Re: Re: Problem with submit form if type is image
| From: | Frank Keessen | Date: | Sat, 14 Aug 2004 20:03:17 +0000 |
| Subject: | Re: Re: Problem with submit form if type is image | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-193828@lists.php.net to get a copy of this message | ||
Thanks Torsten Roehr, it works!
Frank
"Torsten Roehr" <roehr@zilleon.com> wrote in message
news:20040814152458.95479.qmail@pb1.pair.com...
> <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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>