TheHeretic Posted September 17, 2007 Share Posted September 17, 2007 For no apparent reason couldn't find the answer via googling around Okay in ASP I would simply do this, maybe a slight syntax error there. <input type="text" name="groupname" size="50" value="<%=my_var%>"> What the heck is equiv in php. Have tried settihg value equal my_var and printing the gosh darn thing as well Quote Link to comment https://forums.phpfreaks.com/topic/69627-solved-inserting-php-variables-into-html-form-controls/ Share on other sites More sharing options...
darkfreaks Posted September 17, 2007 Share Posted September 17, 2007 thi is a php forum not ASP? Quote Link to comment https://forums.phpfreaks.com/topic/69627-solved-inserting-php-variables-into-html-form-controls/#findComment-349866 Share on other sites More sharing options...
pocobueno1388 Posted September 17, 2007 Share Posted September 17, 2007 <input type="text" name="groupname" size="50" value="<?php echo $my_var; ?>"> Quote Link to comment https://forums.phpfreaks.com/topic/69627-solved-inserting-php-variables-into-html-form-controls/#findComment-349867 Share on other sites More sharing options...
emehrkay Posted September 17, 2007 Share Posted September 17, 2007 <% is php syntax as well. it is dated, but it will work if you have php setup to search for them. your approach is fine, i'd just change it to this <?php echo $my_var; ?> php > asp btw Quote Link to comment https://forums.phpfreaks.com/topic/69627-solved-inserting-php-variables-into-html-form-controls/#findComment-349868 Share on other sites More sharing options...
darkfreaks Posted September 17, 2007 Share Posted September 17, 2007 yeah <?php echo $myvar ; ?> is better Quote Link to comment https://forums.phpfreaks.com/topic/69627-solved-inserting-php-variables-into-html-form-controls/#findComment-349870 Share on other sites More sharing options...
TheHeretic Posted September 17, 2007 Author Share Posted September 17, 2007 thi is a php forum not ASP? Quite aware, was using ASP to illustrate what I'm trying to achieve as clearly the wordage I'm using in google isn't php speak or something. As in, this is how I would do it in that language, what is the equivalent in php. Off to try out the answers Quote Link to comment https://forums.phpfreaks.com/topic/69627-solved-inserting-php-variables-into-html-form-controls/#findComment-349879 Share on other sites More sharing options...
TheHeretic Posted September 17, 2007 Author Share Posted September 17, 2007 Okay it all worked except for this one <TEXTAREA NAME="description" COLS="40" ROWS="6" value="<?php echo $desc; ?>"> Not sure what's going down there, $desc does have a value = "Alone in the world was a little catdog" Quote Link to comment https://forums.phpfreaks.com/topic/69627-solved-inserting-php-variables-into-html-form-controls/#findComment-349886 Share on other sites More sharing options...
ViN86 Posted September 17, 2007 Share Posted September 17, 2007 Okay it all worked except for this one <TEXTAREA NAME="description" COLS="40" ROWS="6" value="<?php echo $desc; ?>"> Not sure what's going down there, $desc does have a value = "Alone in the world was a little catdog" i believe TEXTAREA fields arent the same as the other input fields with respect to the value option. instead, try this: <TEXTAREA NAME="description" COLS="40" ROWS="6"><?php echo $desc; ?></TEXTAREA> Quote Link to comment https://forums.phpfreaks.com/topic/69627-solved-inserting-php-variables-into-html-form-controls/#findComment-349935 Share on other sites More sharing options...
TheHeretic Posted September 18, 2007 Author Share Posted September 18, 2007 Thanks ViN our web designer pointed that out as well, apparently TEXTAREA doesn't have a value tag/property/thingie. Quote Link to comment https://forums.phpfreaks.com/topic/69627-solved-inserting-php-variables-into-html-form-controls/#findComment-350301 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.