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
Please Help with a if / then statement
Moderator: General Moderators
- iknownothing
- Forum Contributor
- Posts: 337
- Joined: Sun Dec 17, 2006 11:53 pm
- Location: Sunshine Coast, Australia
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>';
}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
thanks for the help