473,383 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Hold value

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
Sweden


Apr 10 '06 #1
2 1889
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


Apr 11 '06 #2
> 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


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

Apr 13 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: jerrygarciuh | last post by:
Hello, I wanted to migrate some custom 404 error pages from shtml to php for the ease of email notification of lost pages. However when PHP processes the page $_ENV and $_SERVER both now hold...
2
by: Douglas | last post by:
I have a Vehicle MOT field in my table which i have as a Date field I dont really want to hold the year, just 'dd mmm' as MOTs are the same date every year. I have the field on my form as a...
0
by: Julia Baresch | last post by:
Everyone, I posted the message below back in February and didn't get any information. I also wasn't able to find any documentation in MS Help, web site, or other groups. I'm posting now with...
5
by: Max Adams | last post by:
How can I set a byte to hold the binary value 10? Doing this doesn't work, I want to store the code for 10 in 1 byte of memory. byte encodedBytes = '10'; Doesn't compile "Too many...
10
by: danibe | last post by:
I never had any problems storing pointers in STL containers such std::vector and std::map. The benefit of storing pointers instead of the objects themselves is mainly saving memory resources and...
20
by: MLH | last post by:
120 MyString = "How many copies of each letter do you need?" 150 MyVariant = InputBox(MyString, "How Many?", "3") If MyVariant = "2" Then MsgBox "MyVariant equals the string '2'" If...
14
by: Rich | last post by:
Yes, I need to store some values in an array type collection object that can hold 3 or more parameters per index. I have looked at the collection object, hashtable object and would prefer not to...
3
by: vtxr1300 | last post by:
I'm trying to create a login box control to use that simply exposes the username, password and remember me properties when the login button is clicked. I have the button click wired up and working...
3
by: JesusWaffle | last post by:
I'm trying to portably define a type which is wide enough to hold an int, a wchar_t, or a void *. Here's what I've got: #include <stdint.h> #include <wchar.h> #include <limits.h> #if INT_MAX...
2
by: Patrick | last post by:
Hi All, I have numerous files that look like the chunk below. From the date and time I calculate a year day value. For the example that value is 148.67721064815 I'm not an expert yet at...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.