Jump to content

Passing variables through links


swampone

Recommended Posts

if the variable is being sent in the URL, you need to use $_GET['variable'] to retrieve it.

i.e.

 

localhost/page.php?page=1

$page = $_GET['page'];
echo $page;

 

you will want to use isset to ensure no notices are returned,

i.e.

localhost/page.php?page=1

if (isset($_GET['page'])
{
$page = $_GET['page'];
echo $page;
}

 

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.