View Full Version : PHP Help


weezer_rocks182
06-07-2003, 01:16 AM
i need help with my php form mailer.

go here:

http://www.scottshriner.net/kwp/php/touchmail/form.php?sub=feedback

i cant get that form to work correctly, it keeps sending me to the error page. ive put all the correct paths in and everything. all the links are the same (such as they are all http://www.scott../kwp and its not like some are http://kwp.scott.. and http://www.scott../kwp)

can anyone figure this out?

alkaline39
06-07-2003, 04:06 AM
here is the code i used for my contact form, you might want to try that one if it works for you

FORM:


<form action="formmail.php" method="POST">
<p align="center">
Your Name:<br>
<input type="text" size="27" name="name" class="form"><br />
Your Email Address:<br />
<input type="text" size="27" name="email" class="form"><br />
Subject:<br />
<select name="subject" class="form">
<option value="Question">Question</option>
<option value="Comment">Comment</option>
<option value="Service Request">Service Request</option>
</select><br />

Questions /Comments:<br />
<textarea name="comments" rows="5" cols="39" class="form"></textarea><br>
<br>
<input type="submit" name="submit" value="Submit">
<input type="reset" name="clear" value="Clear"></p>
</form>







formail.php


<?php

#recipient's email address
$to = "alkaline39@hotmail.com";

#subject of the message
$re = $subject;
$extras = "----------------------------\n" . "· Host: \t\t[ " . $REMOTE_ADDR . " ] " . gethostbyaddr($REMOTE_ADDR) . "\n· Client: \t\t[ " . $ip . " ] " . gethostbyaddr($ip) . "\n· User Agent: \t" . $HTTP_USER_AGENT;


#message from the contact form
$msg = "\n\nName: $name\n\nE-Mail Address: $email\n\nComments:\n$comments";

#send the email
mail ($to, $re, $msg, $extras);


?>

<html>
<head>
<title>Cyto Designs - Thank You For Your Email</title>
<link rel="stylesheet" type="text/css" href="style.css">
<meta HTTP-EQUIV="REFRESH" CONTENT="3; URL=index.php">
</head>

<body>
<center>
<table border="0" cellspacing="1" cellpadding="0" bgcolor="B3B209" width="250">
<tr>
<td>
<table border="1" cellspacing="0" cellpadding="2" bgcolor="F2F1E8" width="100%" bordercolor="F3F3D8">
<tr>
<td valign="top" align="center">
Thank you for your email. You will now be redirected to the home page.
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>

</body>
</html>

designhazard
06-07-2003, 11:07 AM
you can also try the form 2 mail script that i made:

form2mail.php:

<?

include("config.php");

$headers = "From: $SITE_NAME's Feedback <$mail>";

$message = "";

while (list($key, $val) = each($HTTP_POST_VARS)) {
$message .= "$key : $val\n";
}

$message .= "\nSent by ".gethostbyaddr($REMOTE_ADDR). " ($REMOTE_ADDR)\n";

mail($TO, $SUBJECT, $message, $headers);

if(! $exit_page)
$exit_page = $DEFAULT_EXIT_PAGE;

Header("Location: ".$exit_page)

?>


config.php:

<?

$TO = "lalalah@hotmail.com"; // Your Email Address

$DEFAULT_EXIT_PAGE = "lalala.html"; // Your default page when they sucessfully enter your form.

$SITE_NAME = "Design Hazard"; // Your site name

$SUBJECT = "Feedback"; // Your Subject

?>


The Form:
<form action="form2mail.php" method="post">
your input type text stuffz
<input type="submit">
</form>

The best of all is you can add more entries :). or you can show me the code you use.

weezer_rocks182
06-15-2003, 06:50 AM
thank you very, very much for your help! i had tried EVERY form mail possible (php, cgi, PL) and nothing worked, but yours did! thank you soooooooooo much!

designhazard
06-15-2003, 04:04 PM
no problem