Re: Print variables coming from a form not controled by me...
| From: | Dream | Date: | Thu, 15 Mar 2001 08:49:51 +0000 |
| Subject: | Re: Print variables coming from a form not controled by me... | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-6046@lists.php.net to get a copy of this message | ||
Hi Michael,
Also, when I run the page, it give me a parse error in line 22, that is:
while ( list ( $key, $val ) = each ( $HTTP_GET_VARS ) )
Any idea?
Here's the complete page
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?
function DumpHttpGetVars()
{
global $HTTP_GET_VARS;
if( $HTTP_GET_VARS )
{
reset ( $HTTP_GET_VARS );
while ( list ( $key, $val ) = each ( $HTTP_GET_VARS ) )
{
echo "$key => $val<br>\n";
if ( "array" == GetType( $val ) )
{
while ( list ( $key_child, $val_child ) = each
$HTTP_GET_VARS ) )
{
echo "|--> $key => $val<br>\n";
}
}
}
}
}
?>
<p>
<? echo $SERVER_ADDR; ?>
</p>
<p>
<? echo $REMOTE_ADDR; ?>
</p>
<p>
<? echo $HTTP_USER_AGENT; ?>
</p>
</body>
</html>
""Michael Rudel"" <mru@suchtreffer.de> escribió en el mensaje
news:002001c0aba9$4fc50ab0$2c00a8c0@suchtreffer.de...
> // Dumps out all HTTP_GET_VARS:
> function DumpHttpGetVars()
> {
> global $HTTP_GET_VARS;
>
> if( $HTTP_GET_VARS )
> {
> reset ( $HTTP_GET_VARS );
> while ( list ( $key, $val ) = each ( $HTTP_GET_VARS ) )
> {
> echo "$key => $val<br>\n";
> if ( "array" == GetType( $val ) )
> {
> while ( list ( $key_child, $val_child ) = each
> $HTTP_GET_VARS ) )
> {
> echo "|--> $key => $val<br>\n";
> }
> }
> }
> }
> }
>
> So you just call the function 'DumpHttpGetVars()'
> and all of them will be printed out.
>
> Greetinx,
> Mike
>
> Michael Rudel
> - Web-Development, Systemadministration -
> _______________________________________________________________
>
> Suchtreffer AG
> Bleicherstraße 20
> D-78467 Konstanz
> Germany
> fon: +49-(0)7531-89207-17
> fax: +49-(0)7531-89207-13
> e-mail: mailto:mru@suchtreffer.de
> internet: http://www.suchtreffer.de
> _______________________________________________________________
""Michael Rudel"" <mru@suchtreffer.de> escribió en el mensaje
news:002001c0aba9$4fc50ab0$2c00a8c0@suchtreffer.de...
> // Dumps out all HTTP_GET_VARS:
> function DumpHttpGetVars()
> {
> global $HTTP_GET_VARS;
>
> if( $HTTP_GET_VARS )
> {
> reset ( $HTTP_GET_VARS );
> while ( list ( $key, $val ) = each ( $HTTP_GET_VARS ) )
> {
> echo "$key => $val<br>\n";
> if ( "array" == GetType( $val ) )
> {
> while ( list ( $key_child, $val_child ) = each
> $HTTP_GET_VARS ) )
> {
> echo "|--> $key => $val<br>\n";
> }
> }
> }
> }
> }
>
> So you just call the function 'DumpHttpGetVars()'
> and all of them will be printed out.
>
> Greetinx,
> Mike
>
> Michael Rudel
> - Web-Development, Systemadministration -
> _______________________________________________________________
>
> Suchtreffer AG
> Bleicherstraße 20
> D-78467 Konstanz
> Germany
> fon: +49-(0)7531-89207-17
> fax: +49-(0)7531-89207-13
> e-mail: mailto:mru@suchtreffer.de
> internet: http://www.suchtreffer.de
> _______________________________________________________________
>
>
>
> -----Original Message-----
> From: Tom Mathews [mailto:Tom.MATHEWS@st.com]
> Sent: Tuesday, March 13, 2001 10:38 AM
> Cc: PHP Windows lista
> Subject: Re: [PHP-WIN] Print variables coming from a form not controled
> by me...
>
>
> Anything in the querystring can be translated as a php variable.
>
> Say you have the string coming in as
> ...?result=1&age=23...
> then in the called page/script, the querystring are already variables.
> eg $result will have the value 1, $age will have the value 23...
>
> Hope this is what you're after
>
> Tom
> Dream wrote:
>
> > Any idea of how to get information from a form (not a form controlled by
> me,
> > through GET method, i.e. info coming with the URL, like this
> >
> > http://www.xxx.com/xxx.cgi?result=1&age=23&name=john) and
> > print it
> through
> > php v.3?
> >
> > I don't know how to get the info (coming from an outside form) and pass
it
> > throught the php3 variables......
> >
> > Thanks,
> >
> > marc
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-windows-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>