![]() |
Using conditional statement to switch out content blurbs? I've spent the last 4 hours trying to maneuver around a 500 code, to no avail. I'm trying to get the homepage to display the_content() and a paywall page to show the PayPal subscribe buttons and a small blurb of copy. Here's the code I'm using right now: PHP Code: |
Re: Using conditional statement to switch out content blurbs? Edit. Figured it out. The { in the first line was throwing me off. |
Re: Using conditional statement to switch out content blurbs? Conditional statements like this... PHP Code: I know that you have gotten this particular issue figured out, but I just want to comment on it because this issue is pretty common. Developers will switch back and forth between the standard and alternative syntax within the same application. They'll have one control statement that uses brackets - the standard control statement syntax... PHP Code: PHP Code: -Noah |
Re: Using conditional statement to switch out content blurbs? That's my problem, I think. I've never actually taken the time to learn the structure of PHP. I've always just hacked code together until I don't get errors lol -- my downfall! Thanks for the in-depth explanation. Do you happen to know a resource tailored to helping beginners get their bearings in PHP? |
Re: Using conditional statement to switch out content blurbs? Quote:
That's how we all start, haha. I wish that someone would have explained a few basic principles to me early on...
Quote:
First off, people put it down pretty often because they really dumb stuff down, but I really think that w3Schools is a great resource for beginners. They have a pretty good PHP turorial - PHP 5 Tutorial Also, here's one of the tutorials that I used when I first learned PHP - PHP Tutorial - Introduction - it's pretty solid! If you want to get info straight form the source, try out the official PHP documentation's 'PHP: A simple tutorial' - PHP: A simple tutorial - Manual - it gets a little 'wordy' though which is why I wouldn't necessarily recommend it to an absolute beginner. However, after you learn PHP, you will find yourself referencing the official documentation about 100 times each day - PHP: PHP Manual - Manual - there is a search field in the top right corner of the official docs page that you can use to search for specific PHP functions. I must have used that search box 100,000 times by now. - Noah |
Re: Using conditional statement to switch out content blurbs? Right on, gracias! I'm not completely new -- grew up on VB, ASP, HTML, SSI and CSS. Tried learning CGI and Perl then PHP came around and I abandoned it. As far as PHP goes, I dunno what does what, or the syntax to use, so I guess I'm a newb to it lol Finally in a spot where I can devote some hours to actually learning code again. I'd love to be able to crank out SaaS that solve my own problems, then sell them to other people. :D |
| All times are GMT -6. The time now is 04:16 AM. |