RE:Re: [PHP] Problems processing a form; please help!

From: Date: Fri, 20 Oct 2000 10:46:50 +0000
Subject: RE:Re: [PHP] Problems processing a form; please help!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-21359@lists.php.net to get a copy of this message
Hi, Thanks to your suggestion, I'm closer to a solution (no more blank screens). I'm using <form name="polls" action="default.php?" method="get"> where default.php is the page where you came from (can enter a vote). But: 1. I'm losing my "original" url arguments; e.g. default.php?nav_id=1&.... (argument for navigation in this case) Any way of preserving these arguments? 2. When I reload the page I "keep on voting". This because of the url: e.g. default.php?poll_id=1&poll_sub_id=2&... Maybe this is because I use an image as a "submit" button?!?! <input type="image" name="test" src="images/polls_submit.gif" width="57" height="14" border="0" alt=" Submit "> So I can't really use the if ($submit) { } construction you suggested?!?! Not enough knowledge about the subject, I know. I really need to get into this stuff... Thanks again, Simon. Hit Media: > >><form name="polls" action="polls_process.php?" >>method="get"> >> >>When I submit the form (from polls.php) and process the form (with >>polls_process.php) the active page becomes polls_process.php (just >>processing, >>no output, empty browser screen). But I don't want to change the page! I >>want to >>stay on polls.php. Do the processing, but stay on polls.php. Is this possible? > > >Change your action back to just "polls.php". > >Assuming $submit is the name of your SUBMIT FORM button: >At the top of polls.php code, just say: > >if ($submit) { include "polls_process.php"; } > > >Or, if "polls_process.php" might not like what it sees, try this: > >if ($submit) > { > if (include "polls_process.php") > { $successful = 1; } > } > >if (!$successful) > { > print "bad bad bad boy." >/* SHOW YOUR FORM AGAIN HERE */ > } > > > >The point? > >"include" is now gives a boolean result. (TRUE/FALSE) >in your "include" file, if something goes wrong, you can say "RETURN FALSE;" >and the "if" command surrounding it will fail. > > > Met vriendelijke groet / With kind regards, Simon de Kraa ICL Logistic Systems Simon.de.Kraa@icl.nl --- Microsoft Windows 2000 Professional SP 1, Progress 9.1b, Roundtable 9.1a SCO UnixWare 7.1.1, Progress 9.1a11

« previous php.general (#21359) next »