Re: Problem with submit form if type is image

From: Date: Sat, 14 Aug 2004 15:26:55 +0000
Subject: Re: Problem with submit form if type is image
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-193808@lists.php.net to get a copy of this message
<fkeessen@planet.nl> wrote in message news:a5a58a7842.a7842a5a58@planet.nl... > Dear all, > > Can you please help me with the following? > > I have written the following script: If i have a input type image; the script doesn't go to the prospect2.php. If i have a input type=submit everything works super! Can someone help me? > > Frank > ____________________________________________________________________________ _________ > <? > > $_POST["submit"]=isset($_POST["submit"])?$_POST["submit"]:""; > if($_POST['submit']!="") > { > file://$printresse=$_POST['printresse']; > session_start(); > $_SESSION["printresse"] = $_POST['printresse']; > header("Location: prospect2.php"); > exit; > } > ?> > <html> > <body> > <form name="form1" method=post id=form1 enctype=multipart/form-data action=<?=$_SERVER['PHP_SELF']?>> > <select name="printresse"> > <OPTION>Value1</OPTION> > <OPTION>Value2</OPTION> > </SELECT> > ?> > echo"<td align=\"right\"><input type=\"image\" src=\"images/next_button.jpg\" name=\"submit\" value=\"submit\"></td></tr>"; > ?> > </form> Hi, if you use the input type 'image' you have to check for name_x or name_y, so in your case: $_POST['submit'] = isset($_POST['submit']) ? $_POST['submit_x'] : ''; Whenever you have problems like this do a print_r($_POST) at the top of the second page. This will show you all submitted values. Regards, Torsten Roehr

« previous php.general (#193808) next »