Spartan 117 Posted January 25, 2007 Share Posted January 25, 2007 Hello, I have a simple question. How would you echo what is in your address, say for instance, the url is this: www.whatever.com/index.php?http://www.google.com/I would like to echo this: http://www.google.com/How would I do that?Thanks Link to comment https://forums.phpfreaks.com/topic/35735-very-quick-question-about-php/ Share on other sites More sharing options...
ShogunWarrior Posted January 25, 2007 Share Posted January 25, 2007 That should be $_SERVER['QUERY_STRING'] If I remember right. Link to comment https://forums.phpfreaks.com/topic/35735-very-quick-question-about-php/#findComment-169345 Share on other sites More sharing options...
matto Posted January 25, 2007 Share Posted January 25, 2007 [code]<?php$url = "www.whatever.com/index.php?http://www.google.com/";$url_query_string = parse_url($url);echo $url_query_string['query'];?>[/code] ;) Link to comment https://forums.phpfreaks.com/topic/35735-very-quick-question-about-php/#findComment-169346 Share on other sites More sharing options...
Spartan 117 Posted January 25, 2007 Author Share Posted January 25, 2007 Thanks for the help, I got it.I am going to use it on this website: http://www.youareban.info/lol, if anyone here or anywhere wants to use it just redirect here if they are banned:www,youareban.info/echo.php?[color=red]www,yoursite.com[/color]* I replaced dots (.) with comma's (,) to disable link...Where it says "Please Wait For Further Details" is where it will say you were banend from: yoursite.comAnnoying music? I know I made it lol! Link to comment https://forums.phpfreaks.com/topic/35735-very-quick-question-about-php/#findComment-169358 Share on other sites More sharing options...
Spartan 117 Posted January 25, 2007 Author Share Posted January 25, 2007 I have one more quick question.I am having some trouble making it say something else if there is nothing after the question mark, so I did this:[code]<?php if ( $_SERVER['QUERY_STRING'] = NULL ) { echo "Some Website";} else { echo $_SERVER['QUERY_STRING'];}?>[/code]And nothing echos. How do I fix this?ThanksNevermind, I got it by changing some stuff:[code]<?php if ( !empty($_SERVER['QUERY_STRING']) ) { echo $_SERVER['QUERY_STRING'];} else { echo "Some Website";}?>[/code]Thanks Again. Link to comment https://forums.phpfreaks.com/topic/35735-very-quick-question-about-php/#findComment-169369 Share on other sites More sharing options...
kenrbnsn Posted January 25, 2007 Share Posted January 25, 2007 The comparison operator for equality is "==" not "=".Ken Link to comment https://forums.phpfreaks.com/topic/35735-very-quick-question-about-php/#findComment-169377 Share on other sites More sharing options...
Spartan 117 Posted January 25, 2007 Author Share Posted January 25, 2007 [quote author=kenrbnsn link=topic=124062.msg513608#msg513608 date=1169767144]The comparison operator for equality is "==" not "=".Ken[/quote]Oh I see. Thanks a lot ;D Link to comment https://forums.phpfreaks.com/topic/35735-very-quick-question-about-php/#findComment-169378 Share on other sites More sharing options...
mattd8752 Posted January 26, 2007 Share Posted January 26, 2007 Ouch, You should add a warning sign to that link here for people on Dial Up, Im not but it still lagged my connection for almost a minute. Anyway, you would probably just want to use Header: http://youarebanned.com or whatever the url is. You don't need a script like that except for a reffer system. Link to comment https://forums.phpfreaks.com/topic/35735-very-quick-question-about-php/#findComment-169470 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.