PDA

View Full Version : Whats wrong with this?



PinkFM
02-04-2007, 09:50 PM
OKay I was making a DJ Application form but it says that I haven't filled in all fields

THE FORM:

<?php
$ipi = getenv("REMOTE_ADDR");
?>

<form method="post" action="sendmail.php">

<p><font face="Verdana" size="1">Habbo Name<br>
<input type="text" name="name" size="30"></font></p>

<p><font face="Verdana" size="1">Email Address<br>
<input type="text" name="email" size="30"></font></p>

<p><font face="Verdana" size="1">Hotel Used<br>
<select size="1" name="hotel">
<option selected>Choose one...</option>
<option>UK</option>
<option>USA</option>
<option>CA</option>
<option>AU</option>
<option>Other</option>
</select></font></p>

<p><font face="Verdana" size="1">Time Zone<br>
<input type="text" name="timezone" size="10"></font></p>

<p><font face="Verdana"></font><font face="Verdana" size="1">DJ'ing Equipment<br>
<select size="1" name="equipment">
<option selected>Choose one...</option>
<option>Winamp/Shoutcast</option>
<option>Sam Broadcaster</option>
</select></font></p>

<p><font face="Verdana" size="1">Do you have a working microphone<br>
<select size="1" name="microphone">
<option selected>Choose one...</option>
<option>Yes</option>
<option>No</option>
</select></font></p>

<p><font face="Verdana" size="1">Do you have a working microphone<br>
<select size="1" name="songs">
<option selected>Choose one...</option>
<option>Yes</option>
<option>No</option>
</select></font></p>

<p><font face="Verdana" size="1">Past Experience (put NONE if you have had
no experience)<br>
<textarea rows="5" name="experience" cols="29"></textarea></font></p>

<input type="submit" value="Send" />
</form>
SEND:

<?php
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
die ("Invalid Email Address");
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
echo $badinput;
}
if(empty($visitor) || empty($visitormail) || empty($notes )) {
die ("You didn't fill in all the fields");
}

$subject = $hotel;

$message = "Name: $name \n
Email: $email \n
Hotel: $hotel \n
Time Zone: $timezone \n
Equipment: $equipment \n
Microphone: $microphone \n
Songs: $song \n
Experience: $experience \n
Additional Info : IP = $ip \n
";

$from = "From: $email\r\n";


mail("[email protected]", $name, $email, $hotel, $timezone, $equipment, $microphone, $experience);

?>

Edited by L&#181;ke (Forum Moderator): Thread Moved From Website Designing. Please post in the correct section next time, Thanks :).

Minstrels
02-04-2007, 10:04 PM
The problem is it's ****** :P

Minstrels
02-04-2007, 10:51 PM
Matt I beleive you fixed it. Why dont you lock the thread? :rolleyes:

PinkFM
02-04-2007, 10:54 PM
It didn't work ;[

Sygon..
02-04-2007, 11:49 PM
your not defining the forms.

Drompo
03-04-2007, 10:51 AM
<?php
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
die ("Invalid Email Address");
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
echo $badinput;
}
if(empty($visitor) || empty($visitormail) || empty($notes )) {
die ("You didn't fill in all the fields");
}
Is incorrect
Change to

<?php
if(!$email == "" && (!strstr($email,"@") || !strstr($email,".")))
{
die ("Invalid Email Address");
}
if(empty($name) || empty($email) || empty($hotel) || empty(timezone) || empty($equipment) || empty($microphone) || empty($songs) || empty($experience)) {
die ("You didn't fill in all the fields");
}

PinkFM
03-04-2007, 11:09 AM
Thanks for help
Thread closed

Want to hide these adverts? Register an account for free!