|
Posted by Justin Koivisto on 08/10/05 19:16
Ray Muforosky wrote:
> I have this:
> ------------
>
> print "<FORM name=\"form3\" ACTION=\"cmdlog_rep.php\">\n";
> print "<TD><INPUT TYPE=\"submit\" VALUE=\"Submit\"></TD>\n";
> .
> print "<INPUT type=\"HIDDEN\" name=\"year1\" >\n";
> print "<INPUT type=\"TEXT\" name=\"when\" >\n";
> print "</FORM>\n";
>
> if click on submit I get this:
> ------------------------------
> http://cpstmws2/p/cmdlog_rep.php?when=0&year1=
>
>
> and I can't get the values here:
> --------------------------------
>
> <?php
>
> // set server access variables
> $when = $_REQUEST['when'];
> $year1 = $_REQUEST['year1'];
> .
> .
> echo $when;
> echo "<BR>";
> echo $year1;
> echo "<BR> The test ends here\n";
> ?>
> ---------------------------------
> What am I doing wrong?
Try this:
<?php
echo '<pre>';
print_r($_GET);
echo'</pre>';
?>
You should get something like:
array(
[when] = 0
[year1] =
)
Then you can use:
echo $_GET['when'],'<br>',
$_GET['year1'],'<br>',
'The test ends here';
You might want to put in a method attribute for the form as well:
print "<FORM name=\"form3\" method=\"get\" ACTION=\"cmdlog_rep.php\">\n";
If you use "post" as the method, then change the $_GET to $_POST
HTH
--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com
Navigation:
[Reply to this message]
|