Page 1 of 1
Single Form, many variables
Posted: Sun Nov 28, 2004 4:14 pm
by deastwood
I have a web page with a number of lists on it. This is simply a list of football teams -
http://www.barfl.co.uk
What I want to do is have a single script for my contact form that uses the variable set by whatever team you select.
So I want the title of the form to be set with the variable of the team selected, and the email the form uses to be set by the same variable.
I am very new to PHP although I understand the basics, having hand scripted my web pages for well over 8 years (in HTML). Now using Dreamweaver, so I'm moving on ...
Any help would be appreciated
Donald
Slightly Confusing
Posted: Mon Nov 29, 2004 2:54 am
by thomas777neo
The wording or explaination for your problem is rather vague.
However, did you want to to something like this:
Code: Select all
<form name="<? echo $team; ?>" method="post" action="">
This is a shot in the wind, please tell me if this is in any form of what you are trying to accomplish.
Posted: Mon Nov 29, 2004 3:09 am
by phpScott
close but what I think he wants is
Code: Select all
<title><?php echo $teamName; ?></title>
agian is that what you want.
Posted: Mon Nov 29, 2004 3:40 am
by thomas777neo
So I want the title of the form to be set with the variable of the team selected
PHP Form variables
Posted: Mon Nov 29, 2004 2:21 pm
by deastwood
Sorry for being vague, and I realise it is!
But on my front page I have list of say 20-odd teams. When the user selects a team, I want to load another page (enquiry.php) which takes parameters from the initial slection, in this case the team name, and use these parameters to use in the header of the form and also to use a specific email address in the PHP form.
So, I have form that loads and I want it to say London Lions Enquiry Form (not as the form TITLE but the actual text for the header of the form. And also, the email address the form uses needs to be selected depending on the team name.
If you look at
http://www.barfl.co.uk and see the link for 'BARFL' on the main index page, when this is selected I use a form for equiries. If another team is selected, I want the text on the form to say "London Lions Enquiry Form" of "<teamname> Enquiry Form", and the email address within the PHP code to represent whatever team has been selected (will need a list of email addresses associated with different teams I assume?).
Does that help?
Donald
Posted: Tue Nov 30, 2004 1:31 am
by thomas777neo
The same concept applies, wherever you want the name
. But I think it would be better for you to store the names in a database, with their respective email addresses. Then, if you select a team, send through the primary id so that you can retrieve the team name and email address.