Topic: "storing a text box into a var (php)" (page 1 of 1)

1
Author Post
sniperkid
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
this is sort of what i wanted..
<input type="text" name="note">
<input type="submit" value="Add-Notes" name="notes">

then in php it would get what the value of "note" is and write it to a file, the problem is how do i store the value of "note" as a var???

private message Website
Erik
groupmastergroupmastergroupmastergroupmastergroupmaster
Hi,

first of all you should give different names to the elements of the form. So in your example the submit and text-elements shouldn't have the same name. Now usually you simply create a form containing the elements:
<form action="php_script_to_be_called.php" method="POST">
  Text: <input type="text" name="note" value="" /><br />
  <input type="submit" name="button_send" value="Submit!" />
</form>
In the script you have super-global variables $_GET and $_POST. So you find the data in them, corresponding to which method you specified in the form. In the example, you could access the note in the script with $_POST['note'].

Cu, Erik :-)
private message EMail Website

Topic: "storing a text box into a var (php)" (page 1 of 1)

1