vista 64, 2.0h, php not parsing variables?
Posted by: lebowskijeff (---.hsd1.il.comcast.net)
Date: June 23, 2009 08:09PM

hello,

total noob. i'm trying to learn php and got the latest version of wamp setup on vista 64 in a separate directory from program files (c:/program_files/)

i've got the localhost initial index.php to show up, i can execute phpInfo, but nothing beyond that, it simply returns partial php code when accessed through browser (via localhost of course) ignores variables ... any help would be greatly appreciated!

here's the intial code:

<html>
<head>
<title>Three Plus Five</title>
</head>
<body>
<h1>Three Plus Five</h1>
<h3>Demonstrates use of numeric variables</h3>

<?
$x = 3;
$y = 5;

print "$x + $y = ";
print $x + $y;
print "<br><br>";

print "$x - $y = ";
print $x - $y;
print "<br><br>";

print "$x * $y = ";
print $x * $y;
print "<br><br>";

print "$x / $y = ";
print $x / $y;
print "<br><br>";

?>


</body>
</html>



here's what is previewed in firefox:

Three Plus Five
Demonstrates use of numeric variables

"; print "$x - $y = "; print $x - $y; print "

"; print "$x * $y = "; print $x * $y; print "

"; print "$x / $y = "; print $x / $y; print "

"; ?>

Options: ReplyQuote
Re: vista 64, 2.0h, php not parsing variables?
Posted by: c2dan (---.15-1.cable.virginmedia.com)
Date: June 23, 2009 08:22PM

You are using short tags (<? ?> and <?= ?>winking smiley. By default short tags are disabled.

It is recommend to use full PHP tags in your code. On WAMP short tags can be enabled by left clicking WAMP tray icon and select PHP > PHP Settings > short open tag

Options: ReplyQuote
Re: vista 64, 2.0h, php not parsing variables?
Posted by: lebowskijeff (---.hsd1.il.comcast.net)
Date: June 23, 2009 09:18PM

awesome! worked ... silly me! i had a feeling it had something to do w/ the <?php vs <?

thank you so much!

Options: ReplyQuote


Sorry, only registered users may post in this forum.