[PHP] Mikes vragen topic ;)

Gestart doorMikek23 reacties59 weergaven

24 berichten · pagina 1 van 2

Mikek

Lid · Topicstarter

Berichten
3.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Beste mensjes,

Ik heb weer eens een php probleem en ik hoop dat jullie mij hiermee kunnen helpen,

Ik gebruik:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]include/config.php[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$info[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users LIMIT 1"[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$info[/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]x[/COLOR][COLOR= #007700]])) {[/COLOR]
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]door[/COLOR][COLOR= #007700]])) {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U heeft u naam niet ingevuld[/COLOR][COLOR= #007700];
            }[/COLOR] [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]])) {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U heeft geen email adres ingevuld[/COLOR][COLOR= #007700];
            }[/COLOR] [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]telefoon[/COLOR][COLOR= #007700]])) {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U heeft geen telefoon nummer ingevuld[/COLOR][COLOR= #007700];
            }[/COLOR] [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bedrag[/COLOR][COLOR= #007700]])) {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U heeft geen bedrag ingevuld[/COLOR][COLOR= #007700];
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
                        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO boden (domein_id,door,bedrag,email,telefoonnummer) VALUES ("[/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]door[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]", "[/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]door[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]", "[/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]email[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]", "[/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]bedrag[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]", "[/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]telefoonnummer[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]") or die(mysql_error()); 
                                        echo U domein is succesvol toegevoegd u wordt door verwezen;
                    }    
        } else {
            echo <form method="[/COLOR]post[COLOR= #DD0000]" action="">;
            echo <table border="[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #DD0000]">;
            echo <tr>;
            echo <td>Naam:</td>;
            echo <td><input type="[/COLOR]text[COLOR= #DD0000]" name="[/COLOR]door[COLOR= #DD0000]" /></td>;
            echo </tr>;
            echo <tr>;
            echo <td>Email-Adres:</td>;
            echo <td><input type="[/COLOR]text[COLOR= #DD0000]" name="[/COLOR]email[COLOR= #DD0000]" /></td>;
            echo </tr>;
            echo <tr>;
            echo <td>Telefoon nummer:</td>;
            echo <td><input type="[/COLOR]text[COLOR= #DD0000]" name="[/COLOR]telefoonnummer[COLOR= #DD0000]" /></td>;
            echo </tr>;
            echo <tr>;
            echo <td>Bedrag:</td>;
            echo <td><input type="[/COLOR]text[COLOR= #DD0000]" name="[/COLOR]bedrag[COLOR= #DD0000]" /></td>;
            echo </tr>;
            echo <tr>;
            echo <td>&nbsp;</td>;
            echo <td><input type="[/COLOR]submit[COLOR= #DD0000]" name="[/COLOR]x[COLOR= #DD0000]" value="[/COLOR]Domein aanbieden" /[COLOR= #007700]><[/COLOR]/td[COLOR= #007700]>[/COLOR][COLOR= #DD0000];
            echo [/COLOR][COLOR= #007700]<[/COLOR]/tr[COLOR= #007700]>[/COLOR][COLOR= #DD0000];
            echo [/COLOR][COLOR= #007700]<[/COLOR]/table[COLOR= #007700]>[/COLOR][COLOR= #DD0000];
            echo [/COLOR][COLOR= #007700]<[/COLOR]/form[COLOR= #007700]>[/COLOR][COLOR= #007700];
        }
         }[/COLOR]
?>


Nu krijg ik dit:

Parse error: syntax error, unexpected T_STRING in /home/dnsrank/domains/****.one2xs.com/public_html/bieden.php on line 19


Zouden jullie mij hiermee kunnen helpen?

Alvast bedankt,
0
Berichten
15.446
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]include/config.php[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$info[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users LIMIT 1"[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$info[/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]x[/COLOR][COLOR= #007700]])) {[/COLOR]
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]door[/COLOR][COLOR= #007700]])) {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U heeft u naam niet ingevuld[/COLOR][COLOR= #007700];
            }[/COLOR] [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]])) {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U heeft geen email adres ingevuld[/COLOR][COLOR= #007700];
            }[/COLOR] [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]telefoon[/COLOR][COLOR= #007700]])) {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U heeft geen telefoon nummer ingevuld[/COLOR][COLOR= #007700];
            }[/COLOR] [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bedrag[/COLOR][COLOR= #007700]])) {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U heeft geen bedrag ingevuld[/COLOR][COLOR= #007700];
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
                        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO boden (domein_id,door,bedrag,email,telefoonnummer) VALUES ("[/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]door[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]", "[/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]door[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]", "[/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]email[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]", "[/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]bedrag[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]", "[/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]telefoonnummer[/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]Uw domein is succesvol toegevoegd u wordt door verwezen[/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]<form method="post" action="">[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<table border="0">[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td>Naam:</td>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td><input type="text" name="door" /></td>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</tr>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td>Email-Adres:</td>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td><input type="text" name="email" /></td>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</tr>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td>Telefoon nummer:</td>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td><input type="text" name="telefoonnummer" /></td>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</tr>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td>Bedrag:</td>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td><input type="text" name="bedrag" /></td>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</tr>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td>&nbsp;</td>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<td><input type="submit" name="x" value="Domein aanbieden" /></td>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</tr>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</table>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</form>[/COLOR][COLOR= #007700];
        }
         }[/COLOR]
?>
0
Mikek

Lid · Topicstarter

Berichten
3.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dankje Marjolein werkt biggrin,

Laat dit topic nog maar even open heb waarschijnlijk nog wel wat vragen

Heb nu dit: $haal = $_GET[id]
Maar wil nu dat hij met zoiets als dit: ".mysql_real_escape_string($_POST[door])."
Het id wat er wordt opgehaald post.

Zou iemand mij daar mee kunnen helpen?
0
Berichten
1.625
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nieuwe vraag; werk samen met Mike, wie heeft hier antwoord op?
0
Mikek

Lid · Topicstarter

Berichten
3.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nog steeds niet opgelost
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Er is niet eens een if $_GET, dan doet hij het ook niet he.clown
0
Mikek

Lid · Topicstarter

Berichten
3.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Shahiem schreef:
Er is niet eens een if $_GET, dan doet hij het ook niet he.clown
Gaat om een andere pagina ik haal hem zo op: $haal = $_GET[id]
en nu wil ik hem ongeveer zo: ".mysql_real_escape_string($_POST[door])." posten in me database
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Huh, ik begrijp het niet helemaal confused
0
Mikek

Lid · Topicstarter

Berichten
3.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ik wil een soort reactie systeem maken en. als er dan een reactie wordt geplaatst dat er dan een column komt met het id van het berich waar op is geregistreerd nu weet ik niet hoe ik deze moet posten
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
$id = mysql_insert_id(); coool
0
Mikek

Lid · Topicstarter

Berichten
3.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoe moet dat in een input dan?

Tussen ".mysql_real_escape_string($_POST[door])." bedoel ik
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
O wacht, dus je wil de id van het bericht?
0
Mikek

Lid · Topicstarter

Berichten
3.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Shahiem schreef:
O wacht, dus je wil de id van het bericht?
Jep van het bericht dus niet van de reactie
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nou dan maak je een veld in PHPmyadmin (die noem je id en dan zet je auto_increment aan)
0
Mikek

Lid · Topicstarter

Berichten
3.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Niet zo ;(

Ik wil het zo: stel je gaat naar nieuws.php?id=8 daar reageer je op nu wil ik dat er in mijn aparte tabel voor reacties 8 wordt gepost
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