Jump to content

How to make a page such as page.php?1 etc


CrazeD

Recommended Posts

Its called a query string. PHP parsers everything after the filename in the format ?key=value into the $_GET superglobal array)...

 

You can test this like:

<?php
echo "<pre>";
print_r($_GET);
echo "</pre>";
?>

 

Basically this allows you to pass small amounts of information from page to page, (information that you don't mind the user from easily editing)...

You can read about it briefly at: http://php.net/manual/en/reserved.variables.php#reserved.variables.get

 

hth!

 

Its called a query string. PHP parsers everything after the filename in the format ?key=value into the $_GET superglobal array)...

 

You can test this like:

<?php
echo "<pre>";
print_r($_GET);
echo "</pre>";
?>

 

Basically this allows you to pass small amounts of information from page to page, (information that you don't mind the user from easily editing)...

You can read about it briefly at: http://php.net/manual/en/reserved.variables.php#reserved.variables.get

 

hth!

 

 

Thanks, but I know what the $_GET does...I just don't know how to make different pages with it.

 

redarrow: This is kind of what I want, but I wanted it in one page and to show something different. I put it in one page, with this:

<?php

echo"<a href='test_result.php?php=nice'>goto my page</a>";

if($_GET['php']=="nice"){

echo"hello i am redarrow hows you mate";

}
?>

 

But, it shows "goto my pagehello i am redarrow hows you mate" when I click the link. Can I make a whole new page, IE: so it just says "hello i am redarrow hows you mate"?

 

 

Thanks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.