Page 1 of 1

Please Help with a if / then statement

Posted: Mon Aug 06, 2007 9:21 am
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

Posted: Mon Aug 06, 2007 9:41 am
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>';
}

Posted: Mon Aug 06, 2007 12:44 pm
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.

Thanks for the help

Posted: Mon Aug 06, 2007 10:47 pm
by jwood700
thanks for the help