brendan-amex
asked on
Adding HTML Code Inside PHP If Else Statement
I have several if else statments that run some HTML and PHP code inside of them but it's not liking the < > symbols used in HTML. It makes sense that I should close the PHP before including the HTML code but then how can I run my If Else statement? Any help is greatly appreciated. The code is below and here's the error I get:
Parse error: syntax error, unexpected '<' in /home/content/b/m/c/brenda n/html/tes t/mysql/ev erything.p hp on line 14
Parse error: syntax error, unexpected '<' in /home/content/b/m/c/brenda
<?php
$select1 = $_POST['select1'];
$select12 = $_POST['select12'];
session_start();
$_SESSION['sessiontest'] = $select12;
$curdata = $_SESSION['sessiontest'];
if ($curdata=="all")
{
<a href="http://www.google.com">Click Here</a>
}
elseif ($curdata=="podium")
{
<a href="http://www.yahoo.com">Click Here!</a>
}
else
{
echo "WRONG";
}
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER