Page 2 of 2
Re: Print out parts of a URL, then enter it in a form field
Posted: Sat Sep 04, 2010 2:05 am
by Cre8tor
Now that I got the number printed, how would I pass that number through a form? The form code would go something like this:
<form method="post" action="my-form-script.php">
<input name="number" id="number" "type="text">
</form>
but how would I incorporate the
<?php
echo $_GET['number'];
?>
into it so that it is either displaying inside the text field or again passed through in some entirely different other way?
Re: Print out parts of a URL, then enter it in a form field
Posted: Sat Sep 04, 2010 5:32 am
by tonchily
Cre8tor wrote:Now that I got the number printed, how would I pass that number through a form? The form code would go something like this:
<form method="post" action="my-form-script.php">
<input name="number" id="number" "type="text">
</form>
but how would I incorporate the
<?php
echo $_GET['number'];
?>
into it so that it is either displaying inside the text field or again passed through in some entirely different other way?
This:
Code: Select all
<?php
echo $_GET['number'];
?>
<form method="post" action="my-form-script.php">
<input name="number" id="number" type="text" value="<?php echo $_GET['number']; ?>">
</form>
Re: Print out parts of a URL, then enter it in a form field
Posted: Sat Sep 04, 2010 2:59 pm
by Cre8tor
Wow, judging by the way this thread started I would never have believed I'd actually get this completed. Everything has worked. Thanks alot to everyone who contributed.
Re: Print out parts of a URL, then enter it in a form field
Posted: Sat Sep 04, 2010 7:57 pm
by Jonah Bron
That number is just printed out inline in the page wherever the code is. So if you put the PHP code between the quotes in the input field, it goes there.
Simple
