Page 1 of 1

What is the PHP equivalent to JavaScript's location.href?

Posted: Sat Oct 30, 2010 11:43 am
by jackw1926
I'm new to PHP but not to programming (50+ years). I want to be able to pass one or two parameters from a web page to a PHP script via the URL. I now how to this in JavaScript but so far I have not been able to figure out how to do it in PHP.

Thanks for any and all help.

Re: What is the PHP equivalent to JavaScript's location.href

Posted: Sat Oct 30, 2010 12:28 pm
by Eran
Why do you need PHP or Javascript? you put the variables in the URL - it's basic HTML

Code: Select all

<a href="script.php?param1=value1&param2=value2">Click me</a>

Re: What is the PHP equivalent to JavaScript's location.href

Posted: Sat Oct 30, 2010 1:52 pm
by josh

Re: What is the PHP equivalent to JavaScript's location.href

Posted: Sat Oct 30, 2010 4:26 pm
by jackw1926
Thanks, your post got me going again and thanks for the link to the PHP Manual, it will be a great help.