d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Problem With > In Php Inside Html File
Add Reply New Topic New Poll
Member
Posts: 36,389
Joined: Jul 18 2008
Gold: 3,192.00
Mar 18 2015 12:03pm
So when I have

Code
<html>

<?php

if(4 > 3){
//do stuff
}

?>

</html>


On my webpage I get

Quote
3){
//do stuff
}

?>


It's treating the > sign in the conditional statement, and any other > in the php code, as the closing php tag and treats the rest of my php as html.

Is there any way around this?
Member
Posts: 62,215
Joined: Jun 3 2007
Gold: 9,039.20
Mar 18 2015 12:31pm
Code
[j0ltk0la@heretic] $ php -a
Interactive shell

php > if(4 > 3){ echo "Make sure file saved as .php"; }


This post was edited by j0ltk0la on Mar 18 2015 12:33pm
Member
Posts: 36,389
Joined: Jul 18 2008
Gold: 3,192.00
Mar 18 2015 12:51pm
Quote (j0ltk0la @ Mar 18 2015 01:31pm)
Code
[j0ltk0la@heretic] $ php -a
Interactive shell

php > if(4 > 3){ echo "Make sure file saved as .php"; }


Sweet, thanks.
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll