Jump to content
xisto Community
Sign in to follow this  
coolcat50

Email Form Code

Recommended Posts

I want to create my own e-mail form for my site and I don't quite know if JavaScript or PHP is required. I use my Nintendo Wii to manage my sites so I only can use what my webhost allows. I am using Angelfire for my main site and InvisionPlus for my forums. I'm planning on switching to Xisto for my main site. Well here is my current code. Please tell me what I need to change.

<form action="mailto:EMAIL" method="post"><input type="text" value="From"><br /><input type="text" value="Subject"><br /><textarea cols="5" rows="10" wrap="true">Message</textarea><br /><input type="submit" value="Send">  <input type="reset" value="Reset"></form>

Share this post


Link to post
Share on other sites

If I understand what you are asking this should work. You will need a webhost with php, and its own mailservers, which Xisto has both! (I think)

Try this:

<?phpif(isset($_POST['From'])){if(mail("YOUREMAIL@GOES.HERE",$_POST['Subject'],$_POST['Message'],"From: ".$_POST['From']))echo'<font color="green">Your message was sent!</font>';else echo'<font color="red">There was an error sending the message</font>';}else{?><form method="post"><input type="text" name="From" value="From"><br /><input type="text" name="Subject" value="Subject"><br /><textarea cols="5" rows="10" wrap="true" name="Message">Message</textarea><br /><input type="submit" value="Send"> <input type="reset" value="Reset"></form><?php}?>

Edited by alex7h3pr0gr4m3r (see edit history)

Share this post


Link to post
Share on other sites

if(mail("YOUREMAIL@GOES.HERE",$_POST['Subject'],$_POST['Message'],"From: ".$_POST['From']))
They will see whatever you put in for YOUREMAIL@GOES.HERE. Any string you put in there is what they will see as from. I'd advise making it a real email address otherwise they won't know what email to return it to.

If you want to you could even change the domain name behind the @ symbol, but they can always see the actual domain that mailed it by looking at the headers of the original mailed data, but that data is usually hidden from the user unless you specifically request it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.