PHP If Statement - RESOLVED!
Hello All.
Trying to do a similar if statement to my cold fusion one in PHP but am not sure on the syntax of PHP, as im just starting to learn it. I gave it a stab in the dark, but oviously didnt work. could someone point me in the right direction. I tryed but failed. Thanks MoFish
Hello All.
Trying to do a similar if statement to my cold fusion one in PHP but am not sure on the syntax of PHP, as im just starting to learn it. I gave it a stab in the dark, but oviously didnt work. could someone point me in the right direction. I tryed but failed. Thanks MoFish
Code:
<cfif isDefined("url.id1")>
<cfif #url.id1# EQ 2>
<cfinclude template="home.php">
<cfelseif #url.id1# EQ 3>
<cfinclude template="forum.php">
<cfelseif #url.id1# EQ 4>
<cfinclude template="downloads.php">
</cfif>
<cfelse>
<cfinclude template="home.php">
</cfif>
Code:
<if isDefined("url.id1")>
if ($url.id1$ == 2){
<?php include("home.php"); ?>;
}elseif ($url.id1$ == 3){
<?php include("forum.php"); ?>
}elseif ($url.id1$ == 4>{
<?php include("downloads.php"); ?>
<elseif>
<?php include("home.php"); ?>
</if>
?>
Last edited: