You are here: Re: Hold value « PHP Programming Language « IT news, forums, messages
Re: Hold value

Posted by Erwin Moller on 04/11/06 17:16

Garry Jones wrote:

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

Hi Garry,

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

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:
http://nl2.php.net/manual/en/ref.session.php

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

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

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

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.

Regards,
Erwin Moller

>
> Garry Jones
> Sweden

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация