Post word niet herkent

Gestart doorEleky34 reacties83 weergaven

35 berichten · pagina 1 van 3

Eleky

Lid · Topicstarter

Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo,

Ik heb een raar probleem in mijn script.
Om een of andere rede word mijn post niet herkent.

Script:
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR]
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]reageren[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]1[/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]bericht[/COLOR][COLOR= #007700]])){[/COLOR]
                        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"A"[/COLOR][COLOR= #007700];[/COLOR]
                        [COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] Filter[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/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]$bericht[/COLOR][COLOR= #007700])){[/COLOR]
                            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<div class=warning>U heeft niet alle velden correct ingevuld!</div>"[/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]"a"[/COLOR][COLOR= #007700];
                        }
                    }[/COLOR]
                    
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br /><br /><br /><h2>Reageren</h2>[/COLOR][COLOR= #007700];[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<form action="" method="post">[/COLOR][COLOR= #007700];[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<textarea name="bericht" rows="8" cols="60"></textarea><br /><br />[/COLOR][COLOR= #007700];[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<input type="submit" name="send" value="Versturen" /><br /><br />[/COLOR][COLOR= #007700];[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</form>[/COLOR][COLOR= #007700];
                }[/COLOR]
?>
Als ik nu op submit druk geeft hij geen A oid weer, gewoon helemaal niks.
Iemand een idee hoe dit kan?
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
is $aFetch[reageren] nog wel 1 ?
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]reageren[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]1[/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]send[/COLOR][COLOR= #007700]])){[/COLOR]
                        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"A"[/COLOR][COLOR= #007700];[/COLOR]
                        [COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] Filter[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/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]$bericht[/COLOR][COLOR= #007700])){[/COLOR]
                            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<div class=warning>U heeft niet alle velden correct ingevuld!</div>"[/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]"a"[/COLOR][COLOR= #007700];
                        }
                    }[/COLOR]
                    
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br /><br /><br /><h2>Reageren</h2>[/COLOR][COLOR= #007700];[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<form action="" method="post">[/COLOR][COLOR= #007700];[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<textarea name="bericht" rows="8" cols="60"></textarea><br /><br />[/COLOR][COLOR= #007700];[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<input type="submit" name="send" value="Versturen" /><br /><br />[/COLOR][COLOR= #007700];[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</form>[/COLOR][COLOR= #007700];
                }[/COLOR]
?>


Zoek de verschillen wink
Voor slechte ogen: if(isset($_POST[bericht])) word if(isset($_POST[send]))
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
@ gamesdealer: Dat is eigenlijk nog slechter.
Doe dan gewoon

if($_SERVER[REQUEST_METHOD] == "POST")
{

// Rest van code.

}
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nee hoor, de manier van jou is juist slechter, want als je meerdere knoppen hebt pakt hij elke knop die je gebruikt.
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Gamedealer schreef:
Nee hoor, de manier van jou is juist slechter, want als je meerdere knoppen hebt pakt hij elke knop die je gebruikt.
Hebben we hier meerdere knoppen? Nee. So your argument is invalid.

Bovendien is het gebruik van $_POST[buttonnaamhiero] errorgevoeliger en daarmee dus slechter.
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heb er nog nooit problemen mee gehad, maar oké.
0
Eleky

Lid · Topicstarter

Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Rik schreef:
is $aFetch[reageren] nog wel 1 ?
Jep, ik het reactieveld dat ook in reageren zit wel, maar die submit niet...
Gamedealer schreef:
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR]
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]reageren[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]1[/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]send[/COLOR][COLOR= #007700]])){[/COLOR]
                        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"A"[/COLOR][COLOR= #007700];[/COLOR]
                        [COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] Filter[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/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]$bericht[/COLOR][COLOR= #007700])){[/COLOR]
                            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<div class=warning>U heeft niet alle velden correct ingevuld!</div>"[/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]"a"[/COLOR][COLOR= #007700];
                        }
                    }[/COLOR]
                    
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br /><br /><br /><h2>Reageren</h2>[/COLOR][COLOR= #007700];[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<form action="" method="post">[/COLOR][COLOR= #007700];[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<textarea name="bericht" rows="8" cols="60"></textarea><br /><br />[/COLOR][COLOR= #007700];[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<input type="submit" name="send" value="Versturen" /><br /><br />[/COLOR][COLOR= #007700];[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</form>[/COLOR][COLOR= #007700];
                }[/COLOR]
?>
Zoek de verschillen wink
Voor slechte ogen: if(isset($_POST[bericht])) word if(isset($_POST[send]))

Uiteraard heb ik dit al geprobeerd, en werkt ook niet!
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Eleky schreef:
Eerdere citaten tonen
Rik schreef:
is $aFetch[reageren] nog wel 1 ?
Jep, ik het reactieveld dat ook in reageren zit wel, maar die submit niet...
Net zei je nog dat je niks zag als je op submit drukte? Nu zeg je dat je wel het reageerveld ziet staan?

Quote:
Als ik nu op submit druk geeft hij geen A oid weer, gewoon helemaal niks.

Oftewel: wordt na het submitten die $aFetch een andere waarde misschien gegeven (om een of andere reden?).
0
Eleky

Lid · Topicstarter

Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Met er gebeurt niks bedoel ik dat er niks word weergegeven van binnen de if(post)
Het reactieveld zie ik gewoon, en $aFetch veranderd niet, aangezien die afhankelijk is van de URL, en die veranderd niet
Excuses als ik onduidelijk was
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Zet eens voor de isset() hetvolgende:

var_dump($_POST);
0
Eleky

Lid · Topicstarter

Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Geeft:

array(0) { }
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Dan is je $_POST dus leeg terwijl je toch iets post?
0
Eleky

Lid · Topicstarter

Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja dat snap ik dus ook niet...
Als ik op F5 druk vraagt hij ook gewoon of ik zeker weet dat ik het opnieuw wil posten...
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Heb je ergens in je code iets zitten dat $_POST waardes filtert of aanpast?
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