[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 05-19-2006, 08:50 PM   #1 (permalink)
Resistance is Futile
 
Borghunter's Avatar
 
Join Date: Apr 2006
Location: Calgary, Canada
Posts: 1,092
601.80 NP$ (Donate)

Borghunter is a name known to allBorghunter is a name known to allBorghunter is a name known to allBorghunter is a name known to allBorghunter is a name known to allBorghunter is a name known to all

Wildlife
$_SERVER['PHP_SELF'] problem

I am having trouble getting a URL, I was wondering if there is a better command than $_SERVER['PHP_SELF'], because if I use that with a URL like index.php?option=com_content&itemid=2
I will get with PHP_SELF
index.php

I want to get the whole URL, how do I do this?
__________________
████ Watch FREE Domain Names Videos by Gurus ████
The Best Check Page Rank
Borghunter is offline  
Old 05-19-2006, 11:22 PM   #2 (permalink)
If only you knew...
 
maximum's Avatar
 
Join Date: Oct 2005
Location: Inside your head...
Posts: 919
128.65 NP$ (Donate)

maximum has a brilliant futuremaximum has a brilliant futuremaximum has a brilliant futuremaximum has a brilliant futuremaximum has a brilliant futuremaximum has a brilliant futuremaximum has a brilliant futuremaximum has a brilliant futuremaximum has a brilliant futuremaximum has a brilliant futuremaximum has a brilliant future

Child Abuse Special Olympics Save a Life Baby Health Autism
PHP Code:
$a = $_SERVER['HTTP_HOST'] // server-name - domain
$b = $_SERVER['PHP_SELF'] // you're page, as you know
$c = $_SERVER['QUERY_STRING'] // everything after the "?",
// but not including the "?"

echo "$a$b?$c";  // would print whole URL

$d = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
// notice the "?" in middle of the above, and variables seprated by dots(.)
// $_SERVER['QUERY_STRING'] reads url GET query, but does not contain
// the "?" in it itself, since "?" is not a variable.

echo $d; // would print the whole URL using above.
__________________
The smartest thing I ever did for my future was to start taking life seriously. The smartest thing I ever did for my present was to stop taking life so seriously
maximum is offline  
Old 05-20-2006, 03:06 AM   #3 (permalink)
Domains my Dominion
 
sdsinc's Avatar
 
Join Date: Aug 2005
Location: Web 1.0
Posts: 6,285
1,095.94 NP$ (Donate)

sdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond repute

Third World Education Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Animal Rescue Animal Cruelty AIDS/HIV Animal Rescue Wildlife Breast Cancer
$_server['request_uri'] ?
__________________
Buy now - MassDeveloper.com $500
sdsinc is offline  
Closed Thread


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

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 03:27 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85