Jump to content

read value from url


Recommended Posts

I have a link on Home Page say for eg

 

<a href="count.php?id=<?php echo $row['ID']; ?>&desc=<?php echo $row['PRO']; ?>" name="abc<?php $i; ?>">**Home**</a></li>

 

Once click on Home Link provided above it goes to next page that is

 

http://abb/MyWeb/pr/arro/count.php?id=4&desc=It%20isavailable

 

Now i want to read value from URL

 

id=4 and

desc=it is available

 

and i want to store it in variable

 

$idenity = id ( store the id from url to varible )

Link to comment
https://forums.phpfreaks.com/topic/239892-read-value-from-url/
Share on other sites

I have a link on Home Page say for eg

 

<a href="count.php?id=<?php echo $row['ID']; ?>&desc=<?php echo $row['PRO']; ?>" name="abc<?php $i; ?>">**Home**</a></li>

 

Once click on Home Link provided above it goes to next page that is

 

http://abb/MyWeb/pr/arro/count.php?id=4&desc=It%20isavailable

 

Now i want to read value from URL

 

id=4 and

desc=it is available

 

and i want to store it in variable

 

$idenity = id ( store the id from url to varible )

 

First, you could write the link simpler, with less starts and stops on php.

 

echo '<a href="count.php?id='.$row['ID'].'&desc='.$row['PRO'].'name="abc'.$i.'">**Home**</a></li>';

 

Second, you use $_GET[''], with the variable in the URL you want to get, inside the brackets and single quotes.

 

ie;

 

$identity=$_GET['id'];
$desc=$_GET['desc'];

Link to comment
https://forums.phpfreaks.com/topic/239892-read-value-from-url/#findComment-1232227
Share on other sites

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.