Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

63 users online



PHP Form Mail

PHP Form Mail

Currently viewing this thread: 1 (0 members and 1 guests)


sapphire

sapphire

Neverside Newbie
Status: Offline!

PHP Form Mail

hi i got this code off spoono.com:

PHP:


    <p><? //initilize PHP
if($submit//If submit is hit
{
    
mail("info@email.com""$subject""$email""$comments");
    
}
?>
<? 
else
{
?>
    <form method="post" action="comments.php">
    <font size="2" face="Verdana">
    *E-Mail:<br/><INPUT TYPE="TEXT" NAME="email" size=60><br/><br/>
    *Subject:<br/><INPUT TYPE="TEXT" NAME="subject" size=60><br/><br/>
    *Comments:<br/><TEXTAREA NAME="comments" ROWS=10 COLS=30></TEXTAREA><br/><br/>
    <input type="submit" name="submit" value="Submit"><br/><br/>
    * = Required Fields
    </font>
    </form>
<? }?>

when the submit button is pressed the page is reloaded as the 'page cannot be found' page. how can i edit the code i send it to like a confirmation page sayin stuff like your request has been sent blah blah

v3x0rg

v3x0rg

Pawn Coder
Status: Offline!
PHP:


<?
if($submit//If submit is hit
{
mail("info@email.com""$subject""$email""$comments");

echo 
"Your email has been sent!";
// or
include("thankyou.htm");
}
else
{
?>
    <form method="post" action="<? echo "$PHP_SELF"?>">
    <font size="2" face="Verdana">
    *E-Mail:<br/><INPUT TYPE="TEXT" NAME="email" size=60><br/><br/>
    *Subject:<br/><INPUT TYPE="TEXT" NAME="subject" size=60><br/><br/>
    *Comments:<br/><TEXTAREA NAME="comments" ROWS=10 COLS=30></TEXTAREA><br/><br/>
    <input type="submit" name="submit" value="Submit"><br/><br/>
    * = Required Fields
    </font>
    </form>
<? }?>


Try that.

___________________

- Moderator at the official AMX Mod X forums

Rad

Rad

thinking of something witty to put here
Status: Offline!

Please, don't get code from Spoono.

v3x0rg

v3x0rg

Pawn Coder
Status: Offline!
Quote:

Originally posted by Radley
Please, don't get code from Spoono.

True true...Good advice.

___________________

- Moderator at the official AMX Mod X forums

Nem

Nem

Status: Offline!

Why the hell would somebody go to the trouble of writing a whole bunch of useless code and posting it up on spoono. It's just rediculously stupid. Like hotscripts.com aswell, most of the scripts on there dont even work.

MinDFreeZ

MinDFreeZ

Status: Offline!

I made this script (just getting more WORKING scripts out there)

Code:

<?php

if (isset($submit)) {

if(isset($name) && isset($subject) && isset($email) && isset($message)) {

$msg = "Site: " . $url . "\n\rMessage: " . $message;

$sucfail = mail("myemail@domain.com","$subject","$msg","From: $name <$email>");

if($sucfail == TRUE) { echo "Email sent! Thanks for you comments, suggestions or questions.<br />"; }
else { echo "Email sending failed... Either you broke it, I broke it, or you didn't fill out the form.<br />";
}
} else {
echo "Please fill all fields to send.<br />";
}
} else {
echo "<form action=\"\" method=\"post\"><input type=\"text\" name=\"name\" value=\"Name\"
onfocus=\"if(this.value == 'Name') this.value='';\" onblur=\"if(this.value=='') this.value='Name';\"
onclick=\"this.value=''\" /> <input type=\"text\" name=\"url\" value=\"Website\" onfocus=\"
if(this.value == 'Website') this.value='';\" onblur=\"if(this.value=='')
this.value='Website';\" onclick=\"this.value=''\" /><br />
<input type=\"text\" name=\"email\" value=\"Email\" onfocus=\"if(this.value == 'Email')
this.value='';\" onblur=\"if(this.value=='') this.value='Email';\" onclick=\"this.value=''\" />
<input type=\"text\" name=\"subject\" value=\"Subject\" onfocus=\"if(this.value == 'Subject')>
this.value='';\" onblur=\"if(this.value=='') this.value='Subject';\" onclick=\"this.value=''\" /><br />
<textarea name=\"message\" rows=\"6\" cols=\"60\" onfocus=\"if(this.value=='Message')this.value='';\">Message</textarea><br />
 <input name=\"submit\" type=\"submit\" value=\"Send\" /> <input type=\"reset\"
value=\"Clear the form\" /></form>";
}
?>

___________________

http://www.enhancedps.com/images/random/crap/sig.gif

Last edited by MinDFreeZ, November 2nd, 2004 03:14 PM (Edited 1 times)

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0088 seconds.