I Need Help!
Moderator: General Moderators
-
Unique1126
- Forum Newbie
- Posts: 9
- Joined: Sun Sep 04, 2005 8:20 pm
I Need Help!
Hey, im new to the site. I've been working on an online portfolio to show case my graphic design. Ok, so heres where my problem begins. For my 'contact' i want to have a php form i guess u can say. . . a form where a visitor of the site can insert thier NAME, EMAIL, and a MESSAGE, and click sumbit and some how (how ever it works) i recieve the message. But i cant seem to understand how to do it. . . i understand what im asking mite take a bit of time to explain but im thankful of anyone willing to help.
im jus tired of having my email as a link for a visitor to contact me, i want to have a more advanced approach to this whole new site.
Thanks again, Rudy.
im jus tired of having my email as a link for a visitor to contact me, i want to have a more advanced approach to this whole new site.
Thanks again, Rudy.
-
Unique1126
- Forum Newbie
- Posts: 9
- Joined: Sun Sep 04, 2005 8:20 pm
i founds this. . . . http://www.scriptarchive.com/formmail.html
im not sure if thats exactly what i need, though if it is i still dont understand how its set up or coded.
not understanding SUCKS!
im not sure if thats exactly what i need, though if it is i still dont understand how its set up or coded.
Thats really easy question really i made this script a while back and it works and its really easy to know how to make it as well
and hope you like it
email.php
mail.php
email.php
Code: Select all
<html>
<body bgcolor="black">
<font color="00FF00">
<center>
<form action="mail.php" method="post">
Your Name: <input type="text" name="name"><br>
E-mail: <input type="text" name = "email"><br>
Comments<br>
<textarea name="comments"></textarea><br><br>
<input type="submit" value="Submit">
</form>
</center>Code: Select all
<?
$name=$_POST['name'];
$email=$_POST['email'];
$comments=$_POST['comments'];
$to="youremail@yoursite.com";
$message="$name just filled in a comment or something.. They said:\n$comments\n\nTheir e-mail address was: $email";
if(mail($to,"Applacations From Your Site",$message,"From: $email\n")) {
echo "Thank you for your comment....";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
header("Location: http://www.yoursite.com");
?>You first create a form (with HTML), in the form tag set the attribute method equal to "post", put textfields for name, etc...
then have the attribute called action in the form tag set to the url of a php script, have you php script do something like this:
that would send the contents of the 'message' text field to your email, if you want to collect names etc.. do something like
info about mail() can be found at http://www.php.net/mail
as always good luck!
Edit: eh, someone beat me to it.
then have the attribute called action in the form tag set to the url of a php script, have you php script do something like this:
Code: Select all
mail ("your_email@example.com", "subject", $_POST['message']);Code: Select all
$name = $_POST['name'];
$msg = $_POST['msg'];
$message = "
$name says:
$msg
";
// send $message through mail() hereas always good luck!
Edit: eh, someone beat me to it.
-
Unique1126
- Forum Newbie
- Posts: 9
- Joined: Sun Sep 04, 2005 8:20 pm
Code: Select all
<?
$name=$_POST['name'];
$email=$_POST['email'];
$comments=$_POST['comments'];
$to="Yungwun11@aol.com";
$message="$name just filled in a comment or something.. They said:\n$comments\n\nTheir e-mail address was: $email";
^what do i put there? do i put something like "Thank you for your message, i will be responding soon?" or something?
if(mail($to,"Applacations From Your Site",$message,"From: $email\n")) {
^whats an application from my site?
echo "Thank you for your comment....";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
header("Location: http://www.UniqueDesigns.com");
?>please tell me if im fillin anything out wrong and what i need to fill out for the parts i mentioned above. so for so many questions.
Last edited by Unique1126 on Sun Sep 04, 2005 9:59 pm, edited 1 time in total.
-
Unique1126
- Forum Newbie
- Posts: 9
- Joined: Sun Sep 04, 2005 8:20 pm
-
Unique1126
- Forum Newbie
- Posts: 9
- Joined: Sun Sep 04, 2005 8:20 pm
all you gotta change is
$to="Yungwun11@aol.com";
header("Location: http://www.UniqueDesigns.com");
Thats it..
$to="Yungwun11@aol.com";
header("Location: http://www.UniqueDesigns.com");
Thats it..
-
Unique1126
- Forum Newbie
- Posts: 9
- Joined: Sun Sep 04, 2005 8:20 pm
-
Unique1126
- Forum Newbie
- Posts: 9
- Joined: Sun Sep 04, 2005 8:20 pm
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
-
Unique1126
- Forum Newbie
- Posts: 9
- Joined: Sun Sep 04, 2005 8:20 pm
- evilmonkey
- Forum Regular
- Posts: 823
- Joined: Sun Oct 06, 2002 1:24 pm
- Location: Toronto, Canada
Okay, I see what you're doing. Basically, the mail() function has the following parameters: To, Subject, Message, Headers. So let's say I want to mail something to you, I can do this:Unique1126 wrote:Code: Select all
<? $name=$_POST['name']; $email=$_POST['email']; $comments=$_POST['comments']; $to="Yungwun11@aol.com"; $message="$name just filled in a comment or something.. They said:\n$comments\n\nTheir e-mail address was: $email"; ^what do i put there? do i put something like "Thank you for your message, i will be responding soon?" or something? if(mail($to,"Applacations From Your Site",$message,"From: $email\n")) { ^whats an application from my site? echo "Thank you for your comment...."; } else { echo "There was a problem sending the mail. Please check that you filled in the form correctly."; } header("Location: http://www.UniqueDesigns.com"); ?>
please tell me if im fillin anything out wrong and what i need to fill out for the parts i mentioned above. so for so many questions.
Code: Select all
<?php
$to="Yungwun11@aol.com";
$subject = "Hi";
$message = "How are you?";
$myemail = "vitali@vagonweb.com";
mail ($to, $subject, $message, "From: ".$myemail);
?>Good luck, let me know if you need something else.
here is a non-PHP form that work s off of just an HTML page... the action="" depends on your host... and you just have to fill in the spaces that you want.
Code: Select all
<form name="form1" method="post" action="http://formmail.dreamhost.com/cgi-bin/formmail.cgi">
<br>
<input type="hidden" name="recipient" value="email@domain.com">
<input type=hidden name="redirect" value="http://www.domain.com/contact.php">
<table width="97%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td colspan="2" bgcolor="#CCCCCC" class="tourCity"> <span class="hdng3"><strong>//
General Questions and Queries:</strong></span></td>
</tr>
<tr>
<td width="27%" class="txtblack"><strong>Name:</strong></td>
<td width="73%"><input name="name" type="text" class="txtblack" id="name" size="34" maxlength="50"></td>
</tr>
<tr>
<td class="txtblack"><strong>Email:</strong></td>
<td><input name="email" type="text" class="txtblack" id="email" size="34" maxlength="50"></td>
</tr>
<tr valign="top">
<td class="txtblack"><strong>About:</strong></td>
<td>
<select name="select" class="txtblack">
<option selected>General Inquiry</option>
<option>Web Hosting</option>
<option>Mutlimedia Design</option>
<option>Computer Support</option>
<option>---</option>
<option>Booking Information</option>
<option>Promotional Help</option>
<option>--</option>
<option>Partnership</option>
</select></td>
</tr>
<tr>
<td class="txtblack"><strong>Subject:</strong></td>
<td><input name="email" type="text" class="txtblack" id="email" size="34" maxlength="50"></td>
</tr>
<tr>
<td valign="top" class="txtblack"><strong>Message:</strong></td>
<td valign="top"><textarea name="textarea" cols="32" rows="16" class="txtblack"></textarea>
<br> <input name="Submit" type="submit" class="formbutton2" value="Sing it!">
<input name="Submit2" type="reset" class="formbutton" value="Reset">
</td>
</tr>
</table>
</form>