Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Garry Jones
April 10, 2006, 9:38 pm
rate this thread
Each team leader may enter individual data for any ammount of others. Each
time the form is submitted I am clearing the field which also clears the
team leader's name. What I want is a way of holding the initial field (team
leaders name) whilst in session. I think I can do this with a php variable.
Cant quite grasp the syntax
On submit I intend sending the data to my email address and to a mysql
database. Whats a simple way for me to get the mysql database to email me a
csv file from the database? Can I do this with PHP code from the website
Re: Hold value
From the receiving script (= the script named in the action of the form) you
can retrieve a POST value as follows:
$teamname = $_POST["teamname"];
If you want to 'recyle' that name, just give it as a value to the
<input type="text" name="teamname" value="<?= $teamname ?>">
If you need to pass around a variable from script to next script, you can
use a session.
It is all here:
- put a variable in a session:
$_SESSION["teamname"] = $teamname;
from another script:
$_SESSION["teamname"] now contains the value you put into it.
That are two different thing.
I suggest that your receiving script first does a database insert, and then
mails the results (as csv or whatever suits you) to your mainadress.
Look up at www.php.net the mail function.
- » Variable scoping - issues with global and multiple includes
- — Previous thread in » PHP Scripting Forum