Jump to content

PHP If Then Help


qmanning

Recommended Posts

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.

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.