Zelaron Gaming Forum

Zelaron Gaming Forum (http://zelaron.com/forum/index.php)
-   Tech Help (http://zelaron.com/forum/forumdisplay.php?f=329)
-   -   PHP Mailform Problem ($_get...) (http://zelaron.com/forum/showthread.php?t=6013)

Canadianxtreme 2002-09-01 05:10 PM

PHP Mailform Problem ($_get...)
 
can anyone help me with my PHP problem

here is the script for my mailform

--------------
<?php
if($_COOKIE[sentemail] > 2){
include("sorry.php");
} else{
if($_COOKIE[sentemail]) {
$num = 1;
} else {
$num = $_COOKIE[sentemail] + 1;
}

setcookie("sentemail", "$num", time()+600); //set the cookie

$email = "First Name:\t$firstname\n Last Name:\t$lastname\n Gender:\t$gender\n Age:\t$age\n
Province:\t$province\n City:\t$city\n Postal Code:\t$postal\n Email:\t$email\n Confirm Email:\t
$confirmemail\n Username:\t$username\n Password:\t$password\n Confirm Password:$confirmpassword\n
Password Hint:\t$passwordhint\n Xtreme Sports:\t$xtremesports\n Xtreme Level:\t$xtremelvl\n
Comment for Bio:\t$commentbio\n Feedback: \t $feedback\n\n IP:\t$REMOTE_ADDR\n\n";

$to = "[email protected]";
$subject = "Sign Up - CanadianXtreme";

$mailheaders = "From: $email<> \n";
$mailheaders = "Reply-To: $email\n\n";

mail($to, $subject, $email, $mailheaders);
include("thanksecho.php");
}
?>
--------------

the problem that i am having is that everytime someone submits the form. it comes to a page that lists all the form fields and says:

Undefined Variable ......

and so on..

Canadianxtreme 2002-09-07 10:48 AM

Oh thanks.. no one just jump out and try to help me all at once here! cuz i can only handle so many ppl trying to help at once... like look at this form! its so full of replies! i dont know what to do!

if you dont know im being sarcastic... thanks again for all your NON help

tacoX 2002-09-07 12:53 PM

Well, here at zelaron we are mainly the off-topic gamers... we dont know much about php...

This forum was a pre-made php script that all we did was install and customize... thats bout' it.

For some 'better' php help, go here: http://www.ascenvia.net/forums/index.php?s=

Jamesadin 2002-09-07 07:35 PM

Quote:

Originally posted by Canadianxtreme
Oh thanks.. no one just jump out and try to help me all at once here! cuz i can only handle so many ppl trying to help at once... like look at this form! its so full of replies! i dont know what to do!

if you dont know im being sarcastic... thanks again for all your NON help

Wow, that was kinda harsh.

Sirpullido 2002-09-08 12:31 PM

though chruser & wetwired knew about PHP...

Dasher 2002-11-05 10:13 AM

Quote:

Originally posted by Canadianxtreme
can anyone help me with my PHP problem

the problem that i am having is that everytime someone submits the form. it comes to a page that lists all the form fields and says:

Undefined Variable ......

and so on..

So what are the Undefined Variables? That is a good place to start. Also have you checked your script for syntax errors really close. I don't do web pages, but I may be able to help if you can give me some more information about what is going on in your script. I usually do VB or Lotus Script.

Does this help

<?php

// Add as many Names/ Departments -- e-mail addresses as you want here

$eMail[] = array( 'Information', '[email protected]' );
$eMail[] = array( 'TechSupport', '[email protected]' );
$eMail[] = array( 'Billing Questions', '[email protected]' );

?>
<HTML>
<HEAD>
<TITLE>Mail Me!</TITLE>
</HEAD>
<BODY>
<?php if( ! isset( $HTTP_POST_VARS["EMail"] ) ) { ?>
<form method="POST" name="MailForm">
<div align="center">
<center>
<table border="0" cellpadding="4" cellspacing="0">
<tr>
<td valign="top" align="right">To:</td>
<td><select size="1" name="To">
<?php
foreach( $eMail as $k => $a )
echo "<option value=\"$k\">$a[0]</option>\n";
?>
</select></td>
</tr>
<tr>
<td valign="top" align="right">From:</td>
<td><input type="text" name="From" size="44" maxlength="32"></td>
</tr>
<tr>
<td valign="top" align="right">E-Mail:</td>
<td><input type="text" name="EMail" size="44"></td>
</tr>
<tr>
<td valign="top" align="right">Subject: </td>
<td>
<p align="center"><input type="text" name="Subject" size="44"></td>
</tr>
</table>
</center>
</div>
<p align="center"><textarea rows="10" name="Body" cols="45"></textarea></p>
<p align="center"><input type="submit" value="Send" name="B1"></p>
</form>
<?php
} else {
echo "<B>Attempting to send message</b></BR></BR>\n";
if( mail( '"' . $eMail[$HTTP_POST_VARS["To"]][0] . '" <' . $eMail[$HTTP_POST_VARS["To"]][1] . '>',
$HTTP_POST_VARS["Subject"], $HTTP_POST_VARS["Body"],
'Return-Path: "' . $HTTP_POST_VARS["From"] . '" <' . $HTTP_POST_VARS["EMail"] . ">\n"
. 'From: "' . $HTTP_POST_VARS["From"] . '" <' . $HTTP_POST_VARS["EMail"] . ">\n"
. 'Reply-To: "' . $HTTP_POST_VARS["From"] . '" <' . $HTTP_POST_VARS["EMail"] . ">\n"
. "X-Mailer: PHP/" . phpversion() . "\n"
. "X-From-IP: " . $REMOTE_ADDR ) )
echo "Message Sent Successfully";
else
echo "UNABLE To Send Message.";
}
?>
</BODY>
</HTML>
--------- Script Ends Here --------


All times are GMT -6. The time now is 06:57 PM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.