Forum Moderators: coopster

Message Too Old, No Replies

Session Variable 2

         

paseo

6:47 am on Jan 29, 2007 (gmt 0)

10+ Year Member



What would be the proper syntax for the following:

<input type="text" id="FirstName" name="FirstName value="<? $_SESSION["FirstName"]?>"/>

....value="<? $_SESSION["FirstName"]?>"

cameraman

6:59 am on Jan 29, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<input type="text" id="FirstName" name="FirstName" value="<?php echo $_SESSION['FirstName'];?>" />

Somewhere in here I saw a shorter syntax:
<input type="text" id="FirstName" name="FirstName" value="<?= $_SESSION['FirstName'];?>" />

but I don't think it would work on my server.

Scally_Ally

9:23 am on Jan 29, 2007 (gmt 0)

10+ Year Member



hasnt the use of open php without the php tags been depricated?

So this is fine
<?php echo

and this isnt
<?=

Ally

eelixduppy

12:37 pm on Jan 29, 2007 (gmt 0)



More on opening and closing PHP tags can be found here: Basic Syntax [us2.php.net]

I do not think it has been depreciated; it makes it slightly quicker to type :)