php - how to duplicate the code $ _GET on page 1 to page 2 automatically using the button click
600
how to use duplicate$_GET
code?
example:site.com/page1.php?id=123
using the click button to page 2 which id is the same as page1
for example:site.com/page1.php?id=123
use clik button tosite.com/page2.php?id=123
I want id 123 automatically follow on page2
Answer
Solution:
You can use
to generate the page 2 link with the same GET url params in a link.
This function takes an associtive array (like the
$_GET
superglobal) and converts it into a query string (likeid=123&x=....
). So append this to your link like (remember to add a?
):Then on your page2.php file you can access it in your $_GET superglobal:
Answer
Solution:
People are also looking for solutions of the problem: php undefined array key
Source
Share
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.