简体   繁体   中英

How I can redirect php page with 2 variables

I am redirecting php page with following

<a href='invoice_details.php?ppid=".$row['sno']."'..

but I want to redirect the same with some another condition can this be done

<a href='invoice_details.php?ppid=".$row['sno']." and 'invoice_details.php?pinv=".$row['invno']."'

You can use:

<a href="yourscript.php?variable1=one&amp;variable2=two&amp;variable3=three">Link</a>

And then in php:

$variable1 = $_GET['variable1']; // one
$variable2 = $_GET['variable2']; // two
$variable3 = $_GET['variable3']; // three

In your example:

<a href='invoice_details.php?ppid=".$row['sno']."&amp;pinv=".$row['invno']."'>link</a>

Here is a little explanation about &amp; notation: Encoding issue, coverting &amp; to & for html using php It is better to write html links with entity &amp; then simple & .


More docs on get: http://php.net/manual/en/reserved.variables.get.php . Remember to run some check on your get values, and not save / post them directly on site as this can make some security issues.

用户amerpsand将参数添加到您的网址:

<a href='invoice_details.php?ppid=".$row['sno']."&pinv=".$row['invno']."'....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM