开发者

Read Value from URL in PHP

开发者 https://www.devze.com 2023-03-13 23:14 出处:网络
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; ?>\">**H

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 = id1 ( store the id from url to variable )


Is this what you want?

$identity=$_GET['id'];


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

Make sure that you filter the contents of the $_GET array to avoid vulnerabilities. For instance, if id is supposed to be a number, force it:

$identity = (int)$_GET['id'];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号