Jump to content

[SOLVED] Inserting php variables into html form controls


Recommended Posts

For no apparent reason couldn't find the answer via googling around  :o

 

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 :-[

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  8)

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"  ;D

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"  ;D

 

 

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>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.