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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
jackw1926
Forum Newbie
Posts: 2
Joined: Sat Oct 30, 2010 9:34 am
Location: Orange Park, Florida

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

Post 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.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

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

Post 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>
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

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

Post by josh »

User avatar
jackw1926
Forum Newbie
Posts: 2
Joined: Sat Oct 30, 2010 9:34 am
Location: Orange Park, Florida

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

Post by jackw1926 »

Thanks, your post got me going again and thanks for the link to the PHP Manual, it will be a great help.
Post Reply