qmanning Posted February 9, 2007 Share Posted February 9, 2007 I'm a complete NOOB with PHP. I'm used to more 'common english' web languages like ColdFusion or ASP. And in those, I'd know how to do the following, but in PHP it's seemingly impossible: For my navigation, I need to check the URL variable ID, and depending on what it is, export out some HTML/JAVASCRIPT for the page to parse. In ColdFusion, this'd be a cinch, and would go like this: <cfif Request.ID IS "47"> <html code> <cfelse> <other html code> </cfif> But in PHP, I'm not sure what to do. I've tried using an echo(''), but that just results in a broken page. Can anyone help? I'm assuming this is simple, cause it's so easy in other languages, but exhaustive web searching has yielded nothing. Quote Link to comment https://forums.phpfreaks.com/topic/37722-php-if-then-help/ Share on other sites More sharing options...
artacus Posted February 9, 2007 Share Posted February 9, 2007 if($_REQUEST['id'] == 47) { } else { } Quote Link to comment https://forums.phpfreaks.com/topic/37722-php-if-then-help/#findComment-180480 Share on other sites More sharing options...
artacus Posted February 9, 2007 Share Posted February 9, 2007 Er, I meant to say, "No, you can't do that in PHP" Quote Link to comment https://forums.phpfreaks.com/topic/37722-php-if-then-help/#findComment-180481 Share on other sites More sharing options...
Jessica Posted February 9, 2007 Share Posted February 9, 2007 I think you need to read some basic tutorials and perhaps pick up a teach-yourself book so you can learn the basics. Quote Link to comment https://forums.phpfreaks.com/topic/37722-php-if-then-help/#findComment-180483 Share on other sites More sharing options...
artacus Posted February 9, 2007 Share Posted February 9, 2007 I think you need to read some basic tutorials and perhaps pick up a teach-yourself book so you can learn the basics. Come on! Can't you see he searched searched himself to the point of exhaustion? What more do you want? LOL but exhaustive web searching has yielded nothing Quote Link to comment https://forums.phpfreaks.com/topic/37722-php-if-then-help/#findComment-180489 Share on other sites More sharing options...
qmanning Posted February 9, 2007 Author Share Posted February 9, 2007 Honestly, I'm not a fan of PHP. I find it cumbersome and messy. I'm needing to use certain aspects of it for a client's CMS, and, after 3 days of trying to figure something out, I came here asking for help. I don't want, nor need, some information on the basics. All I needed was this one specific thing. So, thanks for that. Quote Link to comment https://forums.phpfreaks.com/topic/37722-php-if-then-help/#findComment-180496 Share on other sites More sharing options...
Jessica Posted February 9, 2007 Share Posted February 9, 2007 Knowledge is so scary, I can see why you'd want to avoid basic knowledge on a technology you're using at ALL COSTS. Good choice. Cumbersome and messy: <cfif Request.ID IS "47"> vs if($_REQUEST['id'] == 47){ I can see how they're so confusingly different and PHP's version is incredibly hard and just makes no sense at all. Quote Link to comment https://forums.phpfreaks.com/topic/37722-php-if-then-help/#findComment-180503 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.