Click to See Complete Forum and Search --> : form


chris9902
09-05-2003, 06:45 PM
i am making a site and there is a staff section on it.

i want it so when you click on that member of staff it goes to a page were you can fill out a short form and email them.

i need 5 boxes.

1\ to: STAFF MEMBERS NAME
2\ subject: SUBJECT
3\ from: YOUR NAME
4\ email: YOUR EMAIL
5\ comments: YOUR COMMENTS

how would i apply this to a page.... i need to know every thing.

thanks for any help :)

PunkSktBrdr01
09-05-2003, 07:36 PM
Do you want the "To" and "Subject" fields to be select lists, or just text boxes? Also, you could have it so that the staff member who is selected will automatically be in the "To" field?

chris9902
09-06-2003, 04:54 AM
yeah.

the TO. field i want already filled out with that person name but i need so it can not be change. can i just use normal text for that?

and the Subject can it be a list.... good idea.

PunkSktBrdr01
09-06-2003, 09:41 AM
Okay, well, the "To" doesn't need to be an input. It can show up as regular text, with a hidden field holding the info. Here's the code:


<?
if(!$_GET['to']) {
$to = "<select name=\"to\">\n";
$to .= "<option value=\"jack\">Jack\n";
$to .= "<option value=\"jim\">Jim\n";
$to .= "<option value=\"john\">John\n";
$to .= "</select>\n";
}
else {
$to = $_GET['to'];
}
?>
<form name=\"comment_form\" action=\"processing_script\" method=\"post\">
To: <?= $to; ?><br>
<br>
Subject: <select name=\"subject\">
<option value=\"question\">Question
<option value=\"comment\">Comment
</select><br>
<br>
From: <input type=\"text\" name=\"from\" value=\"your name\"><br>
<br>
Email: <input type=\"text\" name=\"email\" value=\"your email address\"><br>
<br>
Comments:<br>
<textarea name=\"comments\" rows=\"5\" cols=\"40\"></textarea>
</form>


Make sure you change the form action to whatever your form processor is called. If you want, I can help you with that, too, but my brother needs to use the computer, so I'll have to do that later.

chris9902
09-06-2003, 12:25 PM
cool.

do i just add that to my web page and change the page to .php

so it will be http://www.example.com/index.pho and not http://www.example.com/index.htm

also where do i add the email. sorry, i don't no any PHP i just need this form.

thanks for the help so far:)

PunkSktBrdr01
09-06-2003, 02:47 PM
Yes, the page must be renamed to index.php. On the page with the staff member links, the href should be "index.php?to=staff member name". I'll make the form processor in a little while. Enjoy!

chris9902
09-06-2003, 04:25 PM
ok.

so not

<a href="contact.php">CONTACT</a>
but
<a href="index.php?to=staff member name">CONTACT</a>

and "I'll make the form processor in a little while" does that mean you will send me a .php page with the form already done, all i have to do is change the email address.