Jump to content

[SOLVED] Fill text box with php variable value


elabuwa

Recommended Posts

Hey guys,

 

A noob needin your help.

I searched the forum for similar threads but couldnt get any results.

May be an incorrect use of keywords, if so please accept my apologies.

And also please accept my apologies if i have posted in the wrong section.

 

 

I have this html page designed with some text boxes etc.

What I want it to do is when the page is loaded, the text boxes are supposed to be with some values.

 

Best example is when you go to edit your profile in php freaks the email addy comes up automatically filled.

 

Therefore, I have php runnin at two places in the page. At the top to get all the values from the database and to store them in php variables.

 

And the second one below.

 

<input type="text" name="acnum1" value="<?php echo $acnumber;?>" />

 

The problem is that the page loads with out any errors. But instead the text box having only the value of the $acnumber variable, the text box has the following text.

 

"<?php echo $acnumber;?>"

 

Can you guys please help me out. i think there is some syntax error or something like that but i googled and all the pages that show the example codes contain the same method.

 

I tried runnin it on another comp that has php server runnin but gave me the same problem.

 

THanks a million in advance.

 

 

Link to comment
Share on other sites

hey uys,

 

thank you for the quick replies.

 

The file is saved as in html file.

It has php codin in it startin with <?php and endin with ?>

 

Php is workin fine as other pages with .php extension seems to do their magic and gimme the required result.

 

I'll post the entire pages coding in a while.

 

Thanks again. :D :D

Link to comment
Share on other sites

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.