RE: _POST, _GET, _REQUEST not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mike, 

You are a sharp one but alas that is not my real code. The real code for
displaying var1 and var2 is:

echo " <p>variable 1 : $var1 </p> <br> ";
echo " <p>variable 2 : $var2 </p> <br> ";

I have tried so many things to get this working, I am starting to think it
is a CGI problem. 

-----Original Message-----
From: Ford, Mike [mailto:M.Ford@xxxxxxxxxxxxxx]
Sent: December 22, 2004 4:16 AM
To: Keane, Warren A FIN:EX; php-db@xxxxxxxxxxxxx
Subject: RE:  _POST, _GET, _REQUEST not working 


To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm



On 20 December 2004 21:50, Warren wrote:

> Hello,
> 
> I am running PHP 4.39 as a CGI under Tomcat 5.025,  Linux 2.4.20-31.9.
> Configure = './configure' '--with-java=/usr/java/j2sdk1.4.2_04'
> '--with-servlet=/home/www/jakarta-tomcat-5.0.25' '--with-mysql'
> 
> I cannot get the _GET function or _REQUEST functions to pick
> up values from
> a form generating even though I can see the query string
> values in the URL
> as in:
> http://localhost:8080/ip7/httptest.php?var1=212122&var2=343434
> 
> My HTML is very simple:
> 
> <form action="http://localhost:8080/ip7/httptest.php"; method="get">
> <input type="text" name="var1">
> <input type="text" name="var2">
> <input type="submit">
> </form>
> 
> The PHP program httptest.php is also very simple:
> 
> <?PHP
> global $_SERVER, $_GET, $_POST, $_REQUEST, $_SESSION, $_COOKIE;
> 
> if(!empty($_REQUEST['var1'])) { $var1 = $_REQUEST['var1']; }
> else { $var1 ='undefined'; }
> 
> if(!empty($_GET['var2'])) { $var2 = $_GET['var2']; }
> else  $var2 ='undefined';
> 
> // Various HMTL tags removed for simplicity
> echo   $var1
> echo   $var1

Is this a direct paste from your original?  If so, there's an obvious error
here -- one of those should be $var2,'cos as it is you're never even echoing
the value of the $_GET parameter.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: m.ford@xxxxxxxxxxxxxx
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux