Please Help with a if / then statement

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jwood700
Forum Newbie
Posts: 2
Joined: Mon Aug 06, 2007 9:10 am

Please Help with a if / then statement

Post by jwood700 »

I am somewhat lacking in PHP programming, i need an example of how to write an if / then statement. Basically what i need to do is for a website i am working i have calendar that has events on this calendar. Some of the events require registration for this events i need an URL link to show up on the page. So here it is better defined, events calendar php page has an if then statement that verifies a record in a table if there is a record then show the URL if there is no record do not show it. Any help would be much appreciated.

Regards,

Jeremiah
User avatar
iknownothing
Forum Contributor
Posts: 337
Joined: Sun Dec 17, 2006 11:53 pm
Location: Sunshine Coast, Australia

Post by iknownothing »

A basic If statement...

Code: Select all

<?php

if (!empty($calendardateURL)){ // ! = NOT ($calendardateURL would be the variable pulled from the database)
echo '<a href="' . $calendardateURL . '">' . $calendardateURL . '</a>';
}
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Post by califdon »

I recommend http://w3schools.com/, where you will find basic answers for just about every language you can think of, PHP, HTML, Javascript, etc. etc.
jwood700
Forum Newbie
Posts: 2
Joined: Mon Aug 06, 2007 9:10 am

Thanks for the help

Post by jwood700 »

thanks for the help
Post Reply