Current location: Hot Scripts Forums » Programming Languages » PHP » Query line


Query line

Reply
  #1 (permalink)  
Old 04-09-05, 04:39 AM
dihan dihan is offline
Coding Addict
 
Join Date: Jan 2004
Posts: 267
Thanks: 0
Thanked 0 Times in 0 Posts
Query line

Hi,

If referral address is:

http://www.google.co.uk/search?hl=en...e+Search&meta=

then

if I were to get the url it will only show

echo $url; \\ would be http://www.google.co.uk/search?hl=en

as "&" usually breaks it up.

Any way I can keep the whole thing?
Reply With Quote
  #2 (permalink)  
Old 04-09-05, 05:03 AM
perleo perleo is offline
Coding Addict
 
Join Date: Jul 2003
Location: Ireland
Posts: 269
Thanks: 0
Thanked 0 Times in 0 Posts
i tried is myself and i works fine...

PHP Code:

$url 'http://www.google.co.uk/search?hl=en&q=programing+talk&btnG=Google+Search&meta=';


echo 
$url
Reply With Quote
  #3 (permalink)  
Old 04-09-05, 03:52 PM
dihan dihan is offline
Coding Addict
 
Join Date: Jan 2004
Posts: 267
Thanks: 0
Thanked 0 Times in 0 Posts
didn't explain it too well. I was trying to make it easy on the eye.

Yeah that should work with your menthod but if you are getting it from the url address it self then you hit a problem.

I'm using Javascript to open

Code:
http://www.mysite.com/referrers.php?url=http://www.google.co.uk/searchhl=en&q=programing+talk&btnG=Google+Search&meta=
imagine your on referrers.php and trying to get $url
Reply With Quote
  #4 (permalink)  
Old 04-09-05, 04:52 PM
ben.periton ben.periton is offline
Wannabe Coder
 
Join Date: Oct 2004
Posts: 183
Thanks: 0
Thanked 0 Times in 0 Posts
You could always use
PHP Code:

$url $_SERVER['QUERY_STRING'];

print 
substr($url,4); 
__________________
Ben Periton
http://ben.periton.co.uk
Reply With Quote
  #5 (permalink)  
Old 04-10-05, 08:17 AM
djwayne_2004 djwayne_2004 is offline
Newbie Coder
 
Join Date: Jan 2005
Location: England
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,

You could try changing the & symbol for the html & that may help the browser to understand it properly.

PHP Code:

$url $_SERVER["QUERY_STRING"];

$url str_replace("&""&"$url); 
Hope this helps

Wayne
Reply With Quote
  #6 (permalink)  
Old 04-12-05, 04:24 AM
dihan dihan is offline
Coding Addict
 
Join Date: Jan 2004
Posts: 267
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks guys. I actully used XTech method which seems to work fine
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirection back to a page from form submit DAL Perl 11 03-21-05 02:45 PM
I most definately suggest DevelopingCentral.com For Any Website Design/Development! Salty777 General Advertisements 2 10-01-04 04:27 AM
asp-iis-Server error nsuresh_rasr ASP.NET 3 02-08-04 12:47 AM
Declared Functions skipper23 PHP 4 12-17-03 10:06 AM
index page not showing up skipper23 PHP 3 12-15-03 01:10 PM


All times are GMT -5. The time now is 06:39 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.