Hold value

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have a web form to collect player data from team leaders.

Problem 1

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

Problem 2
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

Garry Jones

Re: Hold value

Garry Jones wrote:

Quoted text here. Click to load it

Hi Garry,

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  
corresponding formfield:
<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:

In short:
- put a variable in a session:
$_SESSION["teamname"] = $teamname;

from another script:
$_SESSION["teamname"] now contains the value you put into it.

Quoted text here. Click to load 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.

Erwin Moller

Quoted text here. Click to load it

Re: Hold value

Quoted text here. Click to load it

This is reasonably straightforward code. I would suggest that you could
same time by installing phpMyAdmin and have that produce the csv.

Site Timeline