Return data to form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lewmur
Forum Newbie
Posts: 4
Joined: Mon Mar 19, 2007 12:29 pm

Return data to form

Post by lewmur »

I have an embedded PHP script in an HTML form. I can pass the data from the form to the script, but I figure out how to pass the results of the MySQL query back to the form. Displaying the data doesn't help because it has to be available in the form for a VB6 application to retrieve.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Set the various value attributes for each field.
lewmur
Forum Newbie
Posts: 4
Joined: Mon Mar 19, 2007 12:29 pm

Post by lewmur »

feyd wrote:Set the various value attributes for each field.
I don't understand. I have a $result field in the script. It is set by the query but just for simplicity assume it is hardcoded as $result = "Active". Assume three variable were passed to the script, $_POST['name'], $_POST['pass'] and $_POST['status'].

Upon exiting the script and returning to HTML, I want to place the $result in a named textbox. It can be a previously defined box or a new one. Just so long as it contains the word "Active" or whatever $result was set to. How do I do it? Or can I do before exiting the script?

EDIT: I found the solution. I was leaving out the "=" when trying

value = <?=$result?>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Tip: avoid short tags as if they were a diseased, highly infectious, foaming-at-the-mouth baboon.
Post Reply