Conditional Statements in PHP code Between HTML Code

royaccedy

New Member
I'm having a bit of an issue by using Conditional Statements in PHP separated by HTML code. This is the type of code I'm trying to write. This is a profile page and it should only be seen by the user whose profile it is (i'm using session variables for checking that) : \[code\]<?php if(check if user is logged in) ?><display users profile in html><?php else ?><display an error>\[/code\]But this doesn't work. I also tried using the shorthand notation by putting a \[code\]:\[/code\] at the end of the \[code\]if\[/code\] and using the \[code\]endif\[/code\] statement, but it didn't work. ( On an earlier project , the \[code\]:\[/code\] method worked for \[code\]foreach\[/code\] and \[code\]endforeach\[/code\] so I thought I would try it out )Any Ideas ?
 
Back
Top