Old 27-08-2005, 16:31   #1 (permalink)
spider
Registered User
 
Join Date: Aug 2005
Posts: 3
need help with forms

hello, i'm trying to create a form on a website (for the client to fill out - on the contact page - where they can fill out name, e-mail, etc. then click submit)

the only problem is - the form i use works weird - when the person clicks "submit" a small window opens up with a message notifying the person that their e-mail address will be made known...

how do i just create a simple form, that, when submitted, will simply take the user to a new page that say "thank you, we have received your info etc."...or let them know if any fields are missing.

is this java?

thank you.
  Reply With Quote
Old 27-08-2005, 20:02   #2 (permalink)
y498
Stupid Shit since 1982
 
y498's Avatar
 
Join Date: Feb 2005
Location: Calgary, Alberta, Canada
Posts: 152
Who likes PHP? That is what you need to use.

Cheers.
  Reply With Quote
Old 28-08-2005, 15:16   #3 (permalink)
Cborrow
I like code.
 
Join Date: Dec 2004
Location: Chesapeake, VA
Posts: 237
Send a message via AIM to Cborrow
Here is a simple contact form that takes you to another page. It should give you an idea on how to
make one with PHP. Or you can also go to www.hotscripts.com or something similar to download a free contact form script.

PHP Code:
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
<p>
Name: <input type="text" name="name" size="20" /><br /><br />
Email: <input type="text" name="email" size="20" /><br /><br />
Website: <input type="text" name="website" size="20" /><br /><br />
Message:<br />
<textarea name="message" cols="25" rows="5"></textarea><br /><br />
<input type="submit" name="submit" value="Submit" />
<input type="reset" nam="reset" value="Reset" />
</p>
</form>
<?php
    
if(isset($_POST['submit'])) {
    
$to "Your email address"//Email address you want all messages to be sent to
    
$subject "Your subject"//Subject on all email's
    
$name $_POST['name'];
    
$email $_POST['email'];
    
$website $_POST['website'];
    
$message $_POST['message'];
    
    
$content "You have received a message from your contact from, with the following message.\n\n Name: $name\n Email: $email\n Website: $website\n Message: $message";

    if(!
$name) {
    echo 
"You forgot to enter a name, please go back and enter one"; exit;
    }
    if(!
$email) {
    echo 
"You forgot to enter an email address, please go back and enter one"; exit;
    }
    if(!
$website) {
    echo 
"You forgot to enter a website address, please go back and enter one"; exit;
    }
    if(!
$message) {
    echo 
"You forgot to enter a main message, please go back and enter one"; exit;
    }
    else {    
    
mail($to$subject$content);
    
header("Location: thankyou.html");
    }
    }
?>
  Reply With Quote
Old 30-08-2005, 20:01   #4 (permalink)
spider
Registered User
 
Join Date: Aug 2005
Posts: 3
thanks, Cborrow, that was very helpful.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8