Kleine Vragen Topic #1

Gestart doorLennard4.284 reacties15.585 weergaven

4.285 berichten · pagina 254 van 286

Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Fanorg schreef:
Eerdere citaten tonen
Habbooo schreef:
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$rij[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]test[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]ja[/COLOR][COLOR= #007700]) ?[/COLOR] [COLOR= #DD0000]ja[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR] ?>
Top, bedankt! biggrin
Al zou ik in plaats van Ja/Nee een enum gebruiken met 0 en 1 of een boolean met true/false. Strings kosten meer data in een database.
0
Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Rik schreef:
Eerdere citaten tonen
Fanorg schreef:
Eerdere citaten tonen
Habbooo schreef:
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$rij[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]test[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]ja[/COLOR][COLOR= #007700]) ?[/COLOR] [COLOR= #DD0000]ja[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR] ?>
Top, bedankt! biggrin
Al zou ik in plaats van Ja/Nee een enum gebruiken met 0 en 1 of een boolean met true/false. Strings kosten meer data in een database.

En het staat gewoon lelijk yummie
Over de werking:

(voorwaarde || voorwaarde && voorwaarde) ? (voldoet aan) : (voldoet niet aan)


de ? is dus gewoon de scheiding tussen voorwaardes en de rest
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Ik zie het gewoon altijd als een zin, waar je een vraag (vandaar het vraagteken) stelt.

Is X gelijk aan Y ? Ja-Conditie : Nee-Conditie
(x == y) ? 1 : 0
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sanderc schreef:
Ik ben dus echt heel de tijd aan het klooien met dit, en nu weet ik niet waarom er onderaan mijn scherm een scrollbar komt???!
http://sander.vanmarijn.nl/

Weet iemand hoe dat komt en hoe ik het verhelp?

Verklein je browser ook eens, dan zie je hoe het zit met kleinere schermen...
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Waarom als de array errors 0 is komt er nog steeds De volgende fouten zijn opgetreden?

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aantal[/COLOR][COLOR= #007700]] >=[/COLOR] [COLOR= #0000BB]10[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U heeft al meerde keren een email verzonden vanaf dit IP adres.[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]();
}[/COLOR]

[COLOR= #0000BB]$jouwmail[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]jouwadreshier@domein.nl[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/define"]define[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$jouwmail[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR][COLOR= #007700]) {[/COLOR] [COLOR= #FF8000]// als het forumiel gepost is...[/COLOR]
[COLOR= #0000BB]$errors[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]();[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR]filter_var[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]],[/COLOR] FILTER_VALIDATE_EMAIL[COLOR= #007700])) {[/COLOR] [COLOR= #FF8000]// als het email een goede email is[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]yourname[/COLOR][COLOR= #007700]]) ==[/COLOR] [COLOR= #DD0000][/COLOR] [COLOR= #007700]||[/COLOR] [URL="http://www.php.net/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]onderwerp[/COLOR][COLOR= #007700]]) ==[/COLOR] [COLOR= #DD0000][/COLOR] [COLOR= #007700]||[/COLOR] [URL="http://www.php.net/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]how[/COLOR][COLOR= #007700]]) ==[/COLOR] [COLOR= #DD0000][/COLOR] [COLOR= #007700]||[/COLOR] [URL="http://www.php.net/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]comments[/COLOR][COLOR= #007700]]) ==[/COLOR] [COLOR= #DD0000][/COLOR] [COLOR= #007700]||[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]TOS[/COLOR][COLOR= #007700]] ==[/COLOR] false[COLOR= #007700]) {[/COLOR] [COLOR= #FF8000]// als er iets niet ingevuld is.[/COLOR]
        [COLOR= #0000BB]$errors[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]U heeft één of meerdere velden niet ingevuld.[/COLOR][COLOR= #007700];
        }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] [COLOR= #FF8000]// als alles ingevuld is[/COLOR]
            [COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]
            Beste,
            Iemand heeft het contact formulier ingevuld. Hierbij de gegevens:
         
            Naam: [/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]yourname[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] n
            Email Adres: [/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] n
            Onderwerp: [/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]onderwerp[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] n
            Hoe gevonden: [/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]how[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] n
            IP Adres: [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000] n
            Verstuurd op: [/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/time"]time[/URL][COLOR= #007700]().[/COLOR][COLOR= #DD0000] n
            Bericht: [/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]comments[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] n
            [/COLOR][COLOR= #007700];[/COLOR]
        
            [COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]From: [/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]yourname[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] <[/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]>rn[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]"MIME-Version: 1.0rn"[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]"Content-type: text/html; charset=iso-8859-1rn"[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]"Return-Path: Mail-Error <"[/COLOR][COLOR= #007700].[/COLOR]email[COLOR= #007700].[/COLOR][COLOR= #DD0000]">rn"[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]"Reply-To: "[/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]yourname[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]" <"[/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]">rn"[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$headers[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]"Bcc: "[/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]"rn"[/COLOR][COLOR= #007700];[/COLOR]
            
            [COLOR= #0000BB]$subject[/COLOR] [COLOR= #007700]=[/COLOR] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]onderwerp[/COLOR][COLOR= #007700]]);[/COLOR]
            [COLOR= #0000BB]$to[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]];
            
        }
    }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
    [COLOR= #0000BB]$errors[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]Uw email adres voldoet niet aan onze eisen.[/COLOR][COLOR= #007700];    
    }[/COLOR]
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$errors[/COLOR] [COLOR= #007700]>=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])) {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]De volgende fouten zijn opgetreden: <br />[/COLOR][COLOR= #007700];[/COLOR]
                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$errors[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$error[/COLOR][COLOR= #007700]) {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$error[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];[/COLOR]
                [COLOR= #0000BB]$check[/COLOR] [COLOR= #007700]=[/COLOR] false[COLOR= #007700];
                }
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
                
                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$post[/COLOR][COLOR= #007700]) {[/COLOR]
                    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/ctype_print"]ctype_print[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$post[/COLOR][COLOR= #007700])) {[/COLOR]
                    [COLOR= #0000BB]$check[/COLOR] [COLOR= #007700]=[/COLOR] false[COLOR= #007700];
                    }
                }[/COLOR]
                
                    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$check[/COLOR][COLOR= #007700]) {[/COLOR]
                         [COLOR= #0000BB]$mail[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$to[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$subject[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$headers[/COLOR][COLOR= #007700]);[/COLOR] 
        
                        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$mail[/COLOR][COLOR= #007700]) {[/COLOR]
                        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Email is succesvol vestuurd.[/COLOR][COLOR= #007700];[/COLOR]
                        [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aantal[/COLOR][COLOR= #007700]] = +[/COLOR][COLOR= #0000BB]1[/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]Oeps, er is iets mis gegaan met het versturen van de email. Probeer het later nog eens.[/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]Het beveiliging systeem heeft in één of meerde velden een fout gevonden. Probeer het nogmaals maar dan met andere tekens.[/COLOR][COLOR= #007700];[/COLOR]
                    [URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]();
                    }
            }
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]

?>
    <html>
    <body>
    <form action="#" method="post">
    <b>Uw naam:</b><br />
    <input type="text" name="yourname" /><br /><br />
    <b>Uw e-mailadres:</b><br />
    <input type="text" name="email" size="30px"/>
    <br /> <br />
    <b>Het onderwerp van uw bericht:</b><br />
    <input type="radio" name="onderwerp" value="Vraag" checked="checked" /> Vraag
    <input type="radio" name="onderwerp" value="Bestelling" /> Bestelling
    <input type="radio" name="onderwerp" value="klacht"  /> Klacht
    <input type="radio" name="onderwerp" value="Overige" /> Overige<br /> 
    <br />
    <b>Hoe heeft u ons gevonden?</b><br />
    <select name="how">
    <option>Wil ik liever niet melden</option>
    <option>Google</option>
    <option>Mond tot mond reclame</option>
    <option>Link vanaf een andere website</option>
    <option>Overige</option>
    </select>
    <br /> <br />
    <b>Uw bericht:</b><br />
    <i>*Geef zoveel mogelijk details in geval van een klacht.</i><br />
    <textarea name="comments" rows="20" cols="60" class="textarea"></textarea><br>
    <input type="checkbox" name="TOS" value="TOS">Ik accepteer de algemene voorwaarden en ik maak geen misbruik van dit contact formulier.<br>
    <input type="submit" value="verstuur" name="verstuur"> &nbsp; <input type="reset" value="Verwijder velden" />
    </form>
    </body>
    </html>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
?>
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Regel 46 even goed bekijken...

toevoeging op 24 februari 2013, 141311:
Want daar controleer je of hij die melding moet tonen of niet waar het dus fout gaat. Als je dan even goed kijkt zie je waardoor het komt.
0
Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
if(count($errors >= 1))


Kan je het best veranderen in:

if(!empty($errors))


Naar mijn mening
0
Lennard

Lid · Topicstarter

Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Bartv schreef:
if(count($errors >= 1))
Kan je het best veranderen in:

if(!empty($errors))


Naar mijn mening

Vind ik niet, count is er specifiek voor om te checken hoeveel elemten een array heeft.
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Bartv schreef:
if(count($errors >= 1))
Kan je het best veranderen in:

if(!empty($errors))


Naar mijn mening

Dat eerste is sowieso fout? Je zet de if conditie binnen de count() functie.

if(count($errors) >= 1)


is dan beter.
0
Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Rik schreef:
Eerdere citaten tonen
Bartv schreef:
if(count($errors >= 1))
Kan je het best veranderen in:

if(!empty($errors))


Naar mijn mening
Dat eerste is sowieso fout? Je zet de if conditie binnen de count() functie.

if(count($errors) >= 1)


is dan beter.

Jaa dat snap ik, daarom moet hij het veranderen yummieMaar wat is beter dan?

if(!empty($errors))


of

if(count($errors) >= 1)
0
Berichten
3.532
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoe heet dat dingetje ookalweer dat je opties kan selecteren,
dus iets waarmee je enum dingen kan selecteren



Maar hoe heet dat tussen in de select moet

iets met options ofzo
0
Lennard

Lid · Topicstarter

Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jespar schreef:
Hoe heet dat dingetje ookalweer dat je opties kan selecteren,
dus iets waarmee je enum dingen kan selecteren



Maar hoe heet dat tussen in de select moet

iets met options ofzo
Kon je trouwens ook in 10 sec op Google vinden.
0
Berichten
3.425
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoi jongens,

Even een vraagje, zoals sommige weten zit ik best te klooien met mysql en php.
Ik ben er niet goed in, maar heb het even een beetje omgegooid.

Nu is mijn vraag, is dit stukje script goed veilig? Zo nee, hoe beveilig ik dit?

[COLOR= #0000BB]<?php

$uQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM member_accounts WHERE uId = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/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]
[COLOR= #0000BB]$uFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uQuery[/COLOR][COLOR= #007700]);[/COLOR]

?>

Hoi, [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$uFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uName[/COLOR][COLOR= #007700]];[/COLOR] ?>. <br />
Je hebt op dit moment [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$uFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uCoins[/COLOR][COLOR= #007700]];[/COLOR] ?> punten.
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Gebruik geen die(); En ja het is veilig.

Ik zou het op deze manier doen:

[COLOR= #0000BB]<?php


$uFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM member_accounts WHERE uId = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]));[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$uFetch[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
}[/COLOR]
?>

Hoi, [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$uFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uName[/COLOR][COLOR= #007700]];[/COLOR] ?>. <br />
Je hebt op dit moment [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$uFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uCoins[/COLOR][COLOR= #007700]];[/COLOR] ?> punten.
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