Jump to content

pass variable through link


Jenling

Recommended Posts

Hi,

 

The easiest way as terms of execution is passing it directly in the url of the page you are calling for example

 

www.yourdomain.com/mypage.php?id=1&day=01&month=02&year=08

 

In mypage.php you can access the vars using the $_GET superglobal for example:

 

if (isset($_GET['id')) 
{
   $id = $_GET['id']
   $date = $_GET['date']
   //etc...
}

 

There is a security draw back in passing vars via the url but if you google $_GET and security there are some good tuts on how to sanitise your passed data!

 

HTH

 

Dave

 

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.