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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.