pmjm1234 Posted August 28, 2009 Share Posted August 28, 2009 I'm an asp guy (please don't kill me) but my current project requires me to use php. I am trying to write a basic script but having all kinds of syntax problems... Basically, I want to check the URL that the user is going to and show a block of HTML code only if he's going to the root of the site ("/")... So basically like... if (HttpMessage::getRequestUrl =="/") { <IMG SRC="root.jpg"> } I managed to find the getRequestUrl via google but pretty much have no idea what I'm doing otherwise. Help??? Quote Link to comment https://forums.phpfreaks.com/topic/172264-php-noob-needs-quick-help/ Share on other sites More sharing options...
ignace Posted August 28, 2009 Share Posted August 28, 2009 if ('/' === $_SERVER['REQUEST_URI']) { print '<img src="root.jpg">'; } Quote Link to comment https://forums.phpfreaks.com/topic/172264-php-noob-needs-quick-help/#findComment-908275 Share on other sites More sharing options...
trq Posted August 28, 2009 Share Posted August 28, 2009 If your already a programmer, php should be easy to pickup. The manual is probably the only resource you'll need. Quote Link to comment https://forums.phpfreaks.com/topic/172264-php-noob-needs-quick-help/#findComment-908277 Share on other sites More sharing options...
pmjm1234 Posted August 28, 2009 Author Share Posted August 28, 2009 Thanks guys! I've been fighting with this for about an hour now and I was on a similar track. I'm going to take the lynda.com php course too so I'm 12 hours away from no longer being a noob. Thank you again for the help, it's greatly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/172264-php-noob-needs-quick-help/#findComment-908281 Share on other sites More sharing options...
trq Posted August 28, 2009 Share Posted August 28, 2009 I wouldn't bother. I spent a few hours browsing the manual after coming from asp and had relatively no trouble. Quote Link to comment https://forums.phpfreaks.com/topic/172264-php-noob-needs-quick-help/#findComment-908283 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.