Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 136,144 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 2,066 people online right now. Registration is fast and FREE... Join Now!




Assigning PHP variable to a html text box

 
Reply to this topicStart new topic

Assigning PHP variable to a html text box, PHP and HTML

rpjd
8 Mar, 2007 - 06:43 AM
Post #1

D.I.C Head
**

Joined: 8 Mar, 2007
Posts: 85


My Contributions
I am using php to query a postgresql database and assigning the resultant variable to a html form/text field. I am new to php, but have not found anything that describes how this is achieved. I have tried in vain using a combination of php and javascript, without success. Any help/insight appeciated smile.gif It's probably simple, but to a beginner!

[code] <input type="text" name="something" value="$php-variable-goes-here"/>[code]


RPJD
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Assigning PHP Variable To A Html Text Box
8 Mar, 2007 - 08:03 AM
Post #2

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,226



Thanked: 37 times
Dream Kudos: 25
My Contributions
You'll need to escape the html into php to display the variable. Something like:
CODE

<input type="text" name="something" value="<?=$php-variable-goes-here?>"/>


User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 10:48PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month