[PHP] SMSapi

Gestart doorAzdin39 reacties106 weergaven

40 berichten · pagina 2 van 3

Berichten
473
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Gebruik session_start ? Als je met de userid session dingen wil doen is het misschien handig om session_start(); te gebruiken ?
0
Azdin

Lid · Topicstarter

Berichten
21.633
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sjoerd schreef:
Aan " t werkt nog steeds niet.confused" heb ik niet zo veel..
Wat werkt er niet? En wat zie je in de urlbalk op het begin?
Url is bijvoorbeeld urlblablabla.nl/hoi.php?userid=
Wat staat er achter de = ?

Achter de = komt je ID te staan. Die haalt ie gewoon netjes op, de connectie is er dus met de database.
Maar na je betaling ben je gewoon geen premium?
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Zegt hij dan wel dat je betaald heeft, en geeft hij verder geen error?
Misschien controleert je systeem dan niet of je premium bent met IF(premium = 1) o.i.d?
0
Azdin

Lid · Topicstarter

Berichten
21.633
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hij zegt gewoon dat je betaalt hebt (ik gebruik de testmodus emo) en hij geeft verder geen error.
Geen idee.. dat is ook niet nodig want niemand is premium? Of is dat wel nodig?
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Maak van regel 58 eens:

echo <form action="example.php" method="post">Code: <input type="text" name="code" /><input type="hidden" id="userid" name="userid" value=".$user_fetch[id]." /><br /><input type="submit" value="Ok" /></form>;
0
Azdin

Lid · Topicstarter

Berichten
21.633
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Gamedealer schreef:
Maak van regel 58 eens:

echo <form action="example.php" method="post">Code: <input type="text" name="code" /><input type="hidden" id="userid" name="userid" value=".$user_fetch[id]." /><br /><input type="submit" value="Ok" /></form>;
Nog steeds geen resultaat, niks veranderd.

Hij zegt gewoon dat je betaalt hebt (ik gebruik de testmodus ) en hij geeft verder geen error, maar je wordt geen premium...
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Azdinnn schreef:
Eerdere citaten tonen
Sjoerd schreef:
Aan " t werkt nog steeds niet.confused" heb ik niet zo veel..
Wat werkt er niet? En wat zie je in de urlbalk op het begin?
Url is bijvoorbeeld urlblablabla.nl/hoi.php?userid=
Wat staat er achter de = ?

Achter de = komt je ID te staan. Die haalt ie gewoon netjes op, de connectie is er dus met de database.
Maar na je betaling ben je gewoon geen premium?
heb je al naar mijn code gekeken in dit topic? Het echoén van de query in $sql is ook handig bij het debuggen.
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Staat in de database premium ook niet op 1?
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
$user_query = mysql_query("SELECT username FROM leden WHERE id = ".$user_id." LIMIT 1") or die(mysql_error());
        
        $user_fetch = mysql_fetch_assoc($user_query);


Je vraagt username op en je probeert id uit te voeren.

Maak dus van regel 51 dit:

$user_query = mysql_query("SELECT id, username FROM leden WHERE id = ".$user_id." LIMIT 1") or die(mysql_error());
0
Azdin

Lid · Topicstarter

Berichten
21.633
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sjoerd schreef:
Staat in de database premium ook niet op 1?
Nop, hij wil hem maar niet updaten..
Gamedealer schreef:
$user_query = mysql_query("SELECT username FROM leden WHERE id = ".$user_id." LIMIT 1") or die(mysql_error());
        
        $user_fetch = mysql_fetch_assoc($user_query);
Je vraagt username op en je probeert id uit te voeren.

Maak dus van regel 51 dit:

$user_query = mysql_query("SELECT id, username FROM leden WHERE id = ".$user_id." LIMIT 1") or die(mysql_error());


Geprobeerd maar nog steeds niks:

Quote:
Hij zegt gewoon dat je betaalt hebt (ik gebruik de testmodus ) en hij geeft verder geen error, maar je wordt geen premium...
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Echo je query-string, dan weet je wat er aan MySQL gevoerd wordt.
0
Azdin

Lid · Topicstarter

Berichten
21.633
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
Echo je query-string, dan weet je wat er aan MySQL gevoerd wordt.
Geen idee hoe dat moet dus vertel..?
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
gewoon zo?:
zie regel 95
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/*******
 * Voorbeeldscript voor de werking met de SMS API voor one2xs
 * Meer informatie: http://www.one2xs.com/smsapiinfo
 * Versie              1.1.0
 * Copyright           one2apps 2009 - 2012
 * Datum              12 oktober 2009
 * Laatste wijziging: 16 februari 2012
 * Alle rechten voorbehouden.
 * Gebruik op eigen risico.
 * Misbruik wordt bestraft.
 ***
 * Dit is een voorbeeldscript; je bent vrij om je eigen draai aan het systeem te geven, op voorwaarde dat je je aan de regels houdt.
 * Succes ermee.
 * LET OP!!! WERKT ENKEL VOOR NEDERLANDSE BEZOEKERS; MENSEN UIT BELGIÀ‹ KUNNEN DUS MET DEZE API NIET SMSEN ZODAT JIJ ER PUNTEN VOOR KRIJGT.
 **/[/COLOR]

[COLOR= #0000BB]$testmodus[/COLOR] [COLOR= #007700]=[/COLOR] false[COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$db_host[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]localhost[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$db_username[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]db[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$db_password[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]password[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$db_tabel[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]database[/COLOR][COLOR= #007700];[/COLOR]
 
[COLOR= #0000BB]$username[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Azdinnn[/COLOR][COLOR= #007700];[/COLOR]    [COLOR= #FF8000]// gebruikersnaam op one2xs voor wie gebeld moet worden[/COLOR]
[COLOR= #0000BB]$bedrag[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]2.20[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// het bedrag; je kunt kiezen uit 2.20 of 4.40[/COLOR]
[URL="http://www.php.net/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR]E_ALL[COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/include_once"]include_once[/URL] [COLOR= #DD0000]api.cls.php[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$db_host[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$db_username[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$db_password[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$db_tabel[/COLOR][COLOR= #007700]);

function[/COLOR] format[COLOR= #007700]([/COLOR][COLOR= #0000BB]$bedrag[/COLOR][COLOR= #007700])[/COLOR] [COLOR= #FF8000]// functie om de bedragen (euros) netjes weer te geven (punten en kommas op de goede plek)[/COLOR]
[COLOR= #007700]{[/COLOR]
    
    [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/number_format"]number_format[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$bedrag[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000],[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000].[/COLOR][COLOR= #007700]);
    
}[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]]))[/COLOR] [COLOR= #FF8000]// betaling voorbereiden als er geen telnr en code is opgegeven[/COLOR]
[COLOR= #007700]{[/COLOR]
    [COLOR= #0000BB]$user_id[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]userid[/COLOR][COLOR= #007700]];[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/ctype_digit"]ctype_digit[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]userid[/COLOR][COLOR= #007700]]))
    {[/COLOR]
        [COLOR= #0000BB]$user_query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT id,username FROM leden WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$user_id[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" LIMIT 1"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$user_query[/COLOR][COLOR= #007700]))
        {[/COLOR]
            [COLOR= #0000BB]$api[/COLOR] [COLOR= #007700]= new[/COLOR] api[COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]init[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$bedrag[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]// api instantie maken voor een betaling van EUR 4,40[/COLOR]
            
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$api[/COLOR][COLOR= #007700]->[/COLOR]doTransaction[COLOR= #007700]() ===[/COLOR] TRUE[COLOR= #007700])
            {[/COLOR]
                
                [COLOR= #0000BB]$content[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$api[/COLOR][COLOR= #007700]->[/COLOR]getMessages[COLOR= #007700]();[/COLOR] [COLOR= #FF8000]// berichten ophalen[/COLOR]
                
                [COLOR= #0000BB]$user_fetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$user_query[/COLOR][COLOR= #007700]);[/COLOR]
                
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Hallo <strong>[/COLOR][COLOR= #007700].[/COLOR]htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$user_fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]</strong>!<br/>[/COLOR][COLOR= #007700];[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]SMS <strong>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$content[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</strong> naar <strong>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$content[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]telnr[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</strong> en vul de code die je krijgt hieronder in.<br />[/COLOR][COLOR= #007700];[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Dit kost je &euro; [/COLOR][COLOR= #007700].[/COLOR]format[COLOR= #007700]([/COLOR][COLOR= #0000BB]$content[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]per_eenheid[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] per [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$content[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]per[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000] (totaal dus &euro; [/COLOR][COLOR= #007700].[/COLOR]format[COLOR= #007700]([/COLOR][COLOR= #0000BB]$content[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bedrag[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000], want [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$content[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]extra[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]).<br />[/COLOR][COLOR= #007700];[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<form action="example.php" method="post">Code: <input type="text" name="code" /><input type="hidden" name="userid" value="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$user_fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" /><br /><input type="submit" value="Ok" /></form>[/COLOR][COLOR= #007700];[/COLOR]
                [COLOR= #FF8000]// Je bent VERPLICHT om het servicenummer, de prijs per eenheid (bijvoorbeel 1,10 euro per SMS) en het totaal aantal SMSjes weer te geven
                // Zie http://www.one2xs.com/smsapiinfo voor meer informatie.[/COLOR]
                
            [COLOR= #007700]}[/COLOR]
            [URL="http://www.php.net/else"]else[/URL]
            [COLOR= #007700]{[/COLOR]
                
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]API fout.[/COLOR][COLOR= #007700];
                
            }
        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Geen bestaand userid.[/COLOR][COLOR= #007700];
        }
    }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Geen geldig userid.[/COLOR][COLOR= #007700];
    }
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
    
    [COLOR= #0000BB]$api[/COLOR] [COLOR= #007700]= new[/COLOR] api[COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]volt[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$bedrag[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]// verwerking van de betaling[/COLOR]
    [COLOR= #0000BB]$api[/COLOR][COLOR= #007700]->[/COLOR]addParam[COLOR= #007700]([/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]]);[/COLOR]    [COLOR= #FF8000]// SMS code meezenden[/COLOR]
    
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$api[/COLOR][COLOR= #007700]->[/COLOR]doTransaction[COLOR= #007700]() ===[/COLOR] TRUE[COLOR= #007700])
    {[/COLOR]
        
        [COLOR= #0000BB]$ret[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$api[/COLOR][COLOR= #007700]->[/COLOR]getMessages[COLOR= #007700]();[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ret[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]betaald[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]1[/COLOR] [COLOR= #007700]||[/COLOR] [COLOR= #0000BB]$testmodus[/COLOR] [COLOR= #007700]==[/COLOR] true[COLOR= #007700])
        {[/COLOR]
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]userid[/COLOR][COLOR= #007700]]) &&[/COLOR] [URL="http://www.php.net/ctype_digit"]ctype_digit[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]userid[/COLOR][COLOR= #007700]]))
            {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"UPDATE leden SET premium = 1 WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]userid[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
                [URL="http://www.php.net/mysql_query"]mysql_query[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE leden SET premium = 1 WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]userid[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt betaald![/COLOR][COLOR= #007700];
            }[/COLOR]
            [URL="http://www.php.net/else"]else[/URL]
            [COLOR= #007700]{[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt betaald, maar geen premium ontvangen. Ga niet aan formuliertjes klooien.[/COLOR][COLOR= #007700];
            }
        
        }[/COLOR]
        [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ret[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]betaald[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
        {[/COLOR]
            
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt niet betaald.[/COLOR][COLOR= #007700];
            
        }[/COLOR]
        [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ret[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]betaald[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700])
        {[/COLOR]
            
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Deze code is al gebruikt in de testmodus.[/COLOR][COLOR= #007700];
            
        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
            
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Onbekende fout. Neem contact op met de beheerders voor meer informatie.[/COLOR][COLOR= #007700];
            
        }
        
    }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]
        
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]API fout.[/COLOR][COLOR= #007700];
        
    }
    
}[/COLOR]
?>
0
Azdin

Lid · Topicstarter

Berichten
21.633
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sjoerd, toppie gozer, het werkt nu biggrinbiggrinbiggrin
toevoeging op 3 mei 2012, 14:51:25:
Bedankt!
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Zullen we even die lijnen aanpassen naar dit?

[COLOR= #0000BB]<?php[/COLOR] [COLOR= #FF8000]// kleurtjes[/COLOR]

[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"UPDATE leden SET premium = 1 WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]userid[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt betaald![/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"FOUT: "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]().[/COLOR][COLOR= #DD0000]"<br />"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700];[/COLOR]
?>


Gelieve niet het hoofd in het zand te steken als ik met advies kom.
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren