czukoman20 Posted February 2, 2009 Share Posted February 2, 2009 I'm currently using a scrip that needs the Exactly URL of the document to work. How would i make a variable that reads what is in the address bar. I got a clue kind of withe the $_SERVER... but i'm lost after that Help is greatly appreciated thanks Link to comment https://forums.phpfreaks.com/topic/143421-solved-how-to-make-a-variable-equal-the-address-bar/ Share on other sites More sharing options...
corbin Posted February 2, 2009 Share Posted February 2, 2009 print_r($_SERVER) and see what variables you need to use. Link to comment https://forums.phpfreaks.com/topic/143421-solved-how-to-make-a-variable-equal-the-address-bar/#findComment-752300 Share on other sites More sharing options...
czukoman20 Posted February 2, 2009 Author Share Posted February 2, 2009 See. thats what i got confused about before.. here the code comes out wierd. if you just go to the link at the bottom. Then you will see what is in the code box better Array ( [HTTP_HOST] => zukodesign.com [HTTP_USER_AGENT] => Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 [HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5 [HTTP_ACCEPT_ENCODING] => gzip,deflate [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7 [HTTP_KEEP_ALIVE] => 300 [HTTP_CONNECTION] => keep-alive [HTTP_REFERER] => http://zukodesign.com/fl-studio.php [HTTP_COOKIE] => PHPSESSID=133aec482283bdb54f482a6015b3e724; __utma=47647532.2123832240.1233461987.1233461987.1233461987.1; __utmz=47647532.1233461988.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); CP=null*; rsi_ct=2009_1_31:1; rsi_segs=; __utmc=47647532 [HTTP_CACHE_CONTROL] => max-age=0 [PATH] => /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin [sERVER_SIGNATURE] => Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8b mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.6 Server at zukodesign.com Port 80 [sERVER_SOFTWARE] => Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8b mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.6 [sERVER_NAME] => zukodesign.com [sERVER_ADDR] => 97.65.128.24 [sERVER_PORT] => 80 [REMOTE_ADDR] => 63.250.232.43 [DOCUMENT_ROOT] => /home/zuko/public_html [sERVER_ADMIN] => [email protected] [sCRIPT_FILENAME] => /home/zuko/public_html/FL_vidtutplayer.php [REMOTE_PORT] => 51904 [GATEWAY_INTERFACE] => CGI/1.1 [sERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => GET [QUERY_STRING] => vid=BEk4MMS0ZBQ&wid=425&ht=344&desc=How+to+use+the+vocoder+in+FL-Studio&link=WarBeats.com [REQUEST_URI] => /FL_vidtutplayer.php?vid=BEk4MMS0ZBQ&wid=425&ht=344&desc=How+to+use+the+vocoder+in+FL-Studio&link=WarBeats.com [sCRIPT_NAME] => /FL_vidtutplayer.php [php_SELF] => /FL_vidtutplayer.php [REQUEST_TIME] => 1233541856 [argv] => Array ( [0] => vid=BEk4MMS0ZBQ&wid=425&ht=344&desc=How [1] => to [2] => use [3] => the [4] => vocoder [5] => in [6] => FL-Studio&link=WarBeats.com ) [argc] => 7 ) WarBeats.com How to use the vocoder in FL-Studio. Thats what i got.. when my url is. http://zukodesign.com/FL_vidtutplayer.php?vid=BEk4MMS0ZBQ&wid=425&ht=344&desc=How+to+use+the+vocoder+in+FL-Studio&link=WarBeats.com Link to comment https://forums.phpfreaks.com/topic/143421-solved-how-to-make-a-variable-equal-the-address-bar/#findComment-752302 Share on other sites More sharing options...
winmastergames Posted February 2, 2009 Share Posted February 2, 2009 try this: $path = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; then use $path in your script Link to comment https://forums.phpfreaks.com/topic/143421-solved-how-to-make-a-variable-equal-the-address-bar/#findComment-752306 Share on other sites More sharing options...
czukoman20 Posted February 2, 2009 Author Share Posted February 2, 2009 Thanks for the help... how do i make this solved lol Link to comment https://forums.phpfreaks.com/topic/143421-solved-how-to-make-a-variable-equal-the-address-bar/#findComment-752317 Share on other sites More sharing options...
Philip Posted February 2, 2009 Share Posted February 2, 2009 There will be a button on the bottom left (under all the posts) that says "Topic Solved" I thought they moved it to the top right, but I guess not. Link to comment https://forums.phpfreaks.com/topic/143421-solved-how-to-make-a-variable-equal-the-address-bar/#findComment-752340 Share on other sites More sharing options...
killah Posted February 2, 2009 Share Posted February 2, 2009 try this: $path = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; then use $path in your script This will not work.. Because php_self stops after .php leaving the ? and rest out. $path = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].$_SERVER['REQUEST_URI']; Link to comment https://forums.phpfreaks.com/topic/143421-solved-how-to-make-a-variable-equal-the-address-bar/#findComment-752341 Share on other sites More sharing options...
winmastergames Posted February 2, 2009 Share Posted February 2, 2009 i guess it depends what he wants. Link to comment https://forums.phpfreaks.com/topic/143421-solved-how-to-make-a-variable-equal-the-address-bar/#findComment-752389 Share on other sites More sharing options...
czukoman20 Posted February 2, 2009 Author Share Posted February 2, 2009 This will not work.. Because php_self stops after .php leaving the ? and rest out. $path = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].$_SERVER['REQUEST_URI']; Yep, that is what i wanted, but i caught that and added the REQUEST_URL into it, and it worked fine.. all i needed to know is how to use those different areas and send it to a variable.. Thanks a ton guys Link to comment https://forums.phpfreaks.com/topic/143421-solved-how-to-make-a-variable-equal-the-address-bar/#findComment-752788 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.