Xampp problem with PHP and HTML Input forms

Hi,

I have version PHP: 5.3.1 with Xampp which I believe is the latest version as only downloaded the other day.

In anycase, when I do something like the following:

$gaming= "Action Man";

<input type="text" size="30" name="games" value="<?=$gaming?>">

I get the input box that doesn’t actually display the php parsed $gaming variable. It just shows <?=$gaming?> php code in the actual input txt box in my browser instead of Action Man.

So just wondering if there is something in my PHP.ini file I need changing to solve this issue.

Thanks!

Or is there another way of writing the code.

This works for me on XAMPP:


<?php $gaming= "Action Man"; ?>
<input type="text" size="30" name="games" value="<?=$gaming?>"> 

You could write it like:


<?php $gaming= "Action Man";
echo "<input type=\\"text\\" size=\\"30\\" name=\\"games\\" value=\\"$gaming\\">"; ?>

Yep,

Thanks for that, I just found out the problem before seeing your post. It seems my new Xampp server doesn’t accept <?=$gaming?> anymore, but does accept <?php echo “$gaming”; ?>

Thanks!

Short tags may be off

if there is something in my PHP.ini file I need changing to solve this issue.

short_open_tag as said above

Yep, it was off and I’ve just turned it On.

Thanks guys.