Pass database id through href
| From: | Gavin Amm | Date: | Wed, 14 Apr 2004 01:56:20 +0000 |
| Subject: | Pass database id through href | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-33869@lists.php.net to get a copy of this message | ||
Hi.
I want to update mysql database with parent value of page.
I have several fields in my form.
I have a generated map of web site pages as hyperlinks at end of form.
(generated recursively)
I want to be able to click on hyperlink & have it pass the "parent"
value to the next PHP script.
The point of this is to select the "parent" page of the new/modified
page
EXAMPLE:
(I know you can't use "value" with the "a" tag, but bear with me for
illustration purposes in this pseudo-code)
<form name="theForm">
<input type="text" name="title">
<!-- etc with the fields -->
<input type=text name="formInput">
<a href="javascript:document.theForm.submit();" name="parent"
value="23">Auditing Home</a>
<a href="javascript:document.theForm.submit();" name="parent"
value="17">Finance Home</a>
<a href="javascript:document.theForm.submit();" name="parent"
value="122">Planning Home</a>
<a href="javascript:document.theForm.submit();" name="parent"
value="231">Tax Home</a>
</form>
When the admin clicks on one of the "parent" hyperlinks, the form is
submitted with (in this example) (say they click on the "Tax Home" link)
the values:
$title == [whatever the user types into the text field]
$parent == 231
How do I get this $parent value from the html page??
Any help would be appreciated.
Regards,
Gav