The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
grabbing urls
Discuss grabbing urls in the PHP Development forum on Dev Shed. grabbing urls PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

June 14th, 2000, 12:53 PM
|
|
try a linux desktop today!
|
|
Join Date: Jun 2000
Location: Vancouver
Posts: 23
Time spent in forums: 1 h 12 m 58 sec
Reputation Power: 0
|
|
|
Hi all,
user lands on page with info from url. ie: /page.php3?123456
How do I retrieve the value and place in a variable? ie: $reffString = '123456';
I saw a reference to this somewhere and can't find it again...
TIA,
Jay
|

June 14th, 2000, 01:02 PM
|
|
Junior Member
|
|
Join Date: May 2000
Posts: 20
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Correct me if I'm wrong, but wouldn't you want the url to read:
/page.php3?var=123456?
$var would then be equal to "123456"
------------------
---------
Lanny
dtm
|

June 14th, 2000, 01:10 PM
|
|
try a linux desktop today!
|
|
Join Date: Jun 2000
Location: Vancouver
Posts: 23
Time spent in forums: 1 h 12 m 58 sec
Reputation Power: 0
|
|
Ahem. I am feeling a little silly here... Yes, immortal, you are certainly correct
What about storing the url? I was intending to grab the whole thing and split it at the '?'. This is an environmental var, no?
Jay
|

June 25th, 2000, 03:55 PM
|
|
Junior Member
|
|
Join Date: Jun 2000
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
I may be wrong but don't you define it by "$variable_here=getenv("HTTP_REFERER")"
|

June 26th, 2000, 09:08 AM
|
|
try a linux desktop today!
|
|
Join Date: Jun 2000
Location: Vancouver
Posts: 23
Time spent in forums: 1 h 12 m 58 sec
Reputation Power: 0
|
|
|
Thanks Joshua, that's the ticket. As a phph newbie, I am again impressed at how straightforward the usage is.
Jay
|

June 26th, 2000, 12:08 PM
|
|
Contributing User
|
|
Join Date: Apr 2000
Posts: 63
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
I think you're making it a little more complicated than it is... consider the url
www.myurl.com/test.php3?test=1234
When that page is requested, php can immediately use the variable $test. Try it. Create a page called test.php3 with the following code:
<? echo $test?>
Then type in the url and hit enter. You'll see the value of the url parameter "test" print out... so you should see 1234
------------------
----------------------
Ulysses J Ludwig
Consultant
Ujludwig@yahoo.com
213.948.8278
|

June 26th, 2000, 12:16 PM
|
|
try a linux desktop today!
|
|
Join Date: Jun 2000
Location: Vancouver
Posts: 23
Time spent in forums: 1 h 12 m 58 sec
Reputation Power: 0
|
|
Thanks very much to all. Ulysses, you are definitely correct - I was over complicating things.
What joy to see how staightforward php is
Thanks to all.
Jay
|

June 28th, 2000, 09:46 AM
|
|
Junior Member
|
|
Join Date: Jun 2000
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
I think the variable you are looking for is $QUERY_STRING. For the url test.php3?showthis the system variable $QUERY_STRING will bring up 'showthis'. By this you don't have to assign an extra variable.
------------------
Mike Schaefer www.twst.com
[This message has been edited by Mike Schaefer (edited June 28, 2000).]
[This message has been edited by Mike Schaefer (edited June 28, 2000).]
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|