PhilAI
asked on
Output HTML code on an IF statement
An easy one for most, but I've only just started to work with some JavaScript, VBScript and ASP
I have a page where I have session variables
session("Brand")
session("BrandTitle")
I would like to use the HTML code
<center>
....
</center>
if the session("Brand") = "RAC", otherwise it should not center the items on the page
Thank you, Phil
I have a page where I have session variables
session("Brand")
session("BrandTitle")
I would like to use the HTML code
<center>
....
</center>
if the session("Brand") = "RAC", otherwise it should not center the items on the page
Thank you, Phil
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
sorry, I wrote it in php, NOT as you asked.
also there is an extra "d" at the beginning of pkaleda's code
Rockman
also there is an extra "d" at the beginning of pkaleda's code
Rockman
Thanks rockman. I missed it.
<%
session("Brand")
session("BrandTitle")
if session("Brand") = "RAC" then
response.write("<center>")
end if
%>
.... Here you can just put standard html. Since we removed it out of < % and % > you do not have to response.write.
<%
if session("Brand") = "RAC" then
response.write("</center>" )
end if
%>
<%
session("Brand")
session("BrandTitle")
if session("Brand") = "RAC" then
response.write("<center>")
end if
%>
.... Here you can just put standard html. Since we removed it out of < % and % > you do not have to response.write.
<%
if session("Brand") = "RAC" then
response.write("</center>"
end if
%>
ASKER
I spotted the 'd' mistake thanks
Not a chance to test the code, but I am certain it will work as I simply couldn't remember (or find) the command I wanted
Not a chance to test the code, but I am certain it will work as I simply couldn't remember (or find) the command I wanted
<html>
...
...
<?php if ($_SESSION['Brand']=="RAC"
Blah
<?php if ($_SESSION['Brand']=="RAC"
</html>
rockman