Refuring to values iin another page.
Moderator: General Moderators
Refuring to values iin another page.
I have a form with some input boxes in it but was wonderiing what the php code is that allows another page refers to the value that is put into the input box and then writes it out in the the same kind of was as document.writeln does in JavaScript.
Last edited by OCCollins on Mon Jun 19, 2006 9:55 am, edited 1 time in total.
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
If your form is like...
Then in test.php you would put...
If your action is get then change all of the $_POST to $_GET
Code: Select all
<form name="blah" action="test.php" method="post">
<input type="text" name="TheVariableName" value="" />
<input type="submit" value="Click Me" />
</form>Code: Select all
<?php
// I am going to echo what you posted...
if ((isset($_POST['TheVariableName'])) and (trim($_POST['TheVariableName']) != '')) {
echo "You posted " . $_POST['TheVariableName'];
} else {
echo "No data received";
}
?>