PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 14th, 2000, 12:53 PM
jayrb jayrb is offline
try a linux desktop today!
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: Vancouver
Posts: 23 jayrb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #2  
Old June 14th, 2000, 01:02 PM
immortal immortal is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 20 immortal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to immortal
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

Reply With Quote
  #3  
Old June 14th, 2000, 01:10 PM
jayrb jayrb is offline
try a linux desktop today!
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: Vancouver
Posts: 23 jayrb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #4  
Old June 25th, 2000, 03:55 PM
JoshuaFuller JoshuaFuller is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 1 JoshuaFuller User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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")"

Reply With Quote
  #5  
Old June 26th, 2000, 09:08 AM
jayrb jayrb is offline
try a linux desktop today!
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: Vancouver
Posts: 23 jayrb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #6  
Old June 26th, 2000, 12:08 PM
ujludwig ujludwig is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 63 ujludwig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #7  
Old June 26th, 2000, 12:16 PM
jayrb jayrb is offline
try a linux desktop today!
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: Vancouver
Posts: 23 jayrb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #8  
Old June 28th, 2000, 09:46 AM
Mike Schaefer Mike Schaefer is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 1 Mike Schaefer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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).]

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > grabbing urls

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap