Reply
using a php value in the VALUE of hidden field
Old 03-27-2006, 11:18 AM using a php value in the VALUE of hidden field
numbenator's Avatar
Ultra Talker

Posts: 411
Location: London
How do i set a text input field value to equal a php session variable

im using

<input type="text" name="compI" value=".$_SESSION['compNumber']."/>

but all it does is put the text ".$_SESSION['compNumber']."" in the field ... I want the value of the session variable

cheers
__________________
www.mastech-solutions.com
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
When You Register, These Ads Go Away!
Old 03-27-2006, 12:18 PM Re: using a php value in the VALUE of hidden field
Skilled Talker

Posts: 82
Use...
PHP Code:
<?
echo "<input type=\"text\" name=\"compI\" value=\"" $_SESSION['compNumber'] . "\">";
?>
!!!

Last edited by mattcooper : 03-27-2006 at 12:33 PM.
mattcooper is offline
Reply With Quote
View Public Profile
 
Old 03-27-2006, 02:18 PM Re: using a php value in the VALUE of hidden field
Super Talker

Posts: 144
or inline...

<input type="text" name="compI" value="<?= $_SESSION["compNumber"]?>" />
__________________
create.vibe
web development portfolio
createvibe.com is offline
Reply With Quote
View Public Profile Visit createvibe.com's homepage!
 
Old 03-27-2006, 10:01 PM Re: using a php value in the VALUE of hidden field
QuickTim's Avatar
Average Talker

Posts: 16
dont forget to start the session
QuickTim is offline
Reply With Quote
View Public Profile Visit QuickTim's homepage!
 
Reply     « Reply to using a php value in the VALUE of hidden field
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13295 seconds with 12 queries