Most likely.
><?php
> if(isset($_POST['submit'])) {
> $question = $_POST['question'];
> $name = $_POST['name'];
> $email = $_POST['email'];
> $subject1 = $_POST['subject1'];
> $comments = $_POST['comments'];
These 5 variables my still show up as unset, if the POST data is either non-
existent or lacks these keys. Also, since this is in a conditional the will
not be set is the POST data does not contain the "submit" key.
> $output_form = false;
>
> if($question != 4 && $question != 'four') {
> echo 'Try the security question again.<br />';
> $output_form = true;
> }
>
> if($question == 4 || $question == 'four')
> {
> $to = 'in...@caneycemetery.com';
> $subject = $subject1;
> $msg = "From $name \n\n$comments";
> $bcc = 'm...@google.com';
> mail ($to, $subject, $msg, "From:" . $email . "\r\nBCC:" .
$bcc);
>
> echo "Thank you for your comments, $name.<br />";
Warning: Possible XSS attack. Try a name of
"<script>alert("0wned!");</script>" for kicks.
> echo 'We appreciate your interest in the history of Caney.';
>
> ?>
> <h2>Click <a href="../index.html">here </a>to go back to the home
>page</h2>
> </div>
> <?php
> }
> }
> else {$output_form = true;}
> if ($output_form) {
> ?>
>
> <h3>Contact Us</h3>
> <form action="email.php" method="post" action="<?php echo
>$_SERVER['PHP_SELF']; ?>">
> <p>
> <label>Security Question: What is 2+2?</label>
> <input id="question" type="text" name ="question"
maxlength=4
>value="" size="30" />
> <label>Name</label>
> <input id="name" type="text" name="name" value="<?php
echo
>$name; ?>" size="30" />
Based on my read of the above, this is only executed when $output_form is
true-ish. That only happens when $name is unset.
> <label>Email</label>
> <input id="email" type="text" name="email" value="<?php
echo
>$email; ?>" size="30" />
Ditto, but s/name/email/.
> <label>Subject</label>
> <input id="subject1" type="text" name="subject1"
value="<?php
>echo $subject1; ?>" size="30" />
Ditto, but for $subject1.
> <label>Your Comments</label>
> <textarea id="comments" name="comments" rows="5"
cols="5"><?php
>echo $comments; ?></textarea>
Ditto, but for $comments.
> <br />
> <input class="button" type="submit" name="submit"/>
> </p>
> </form>
>
> <?php
> }
Don't forget the last "?>".
Also, please make sure of PHP's lint mode "-l" to check your scripts.
--
Boyd Stephen Smith Jr. ,= ,-_-. =.
b...@iguanasuicide.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/ \_/