JayC
Well-Known Member
Hey guys I am trying to create a Job Application page so when people fill it out it will go directly into the database. I heavily edited someones release to look like this:
This is my TPL code:
and This is the error:
I appreciate all the help you guys provide Hopefully someone can help with this! Thanks
This is my TPL code:
Code:
<div class="habblet-container ">
<div class="cbb clearfix pixellightblue ">
<h2 class="title">%shortname% Trial Apps</h2>
<div class="box-content">
<center><b><h2>%shortname% Hotel Moderator</b></h2>
</center>
<div style="text-align: right;">
</div>
<br />
%shortname% Hotel is run by highly trained staff, and we're always hiring staff so that the hotel is always safe and having fun! You may apply for staff below, but you need to fill in the information truthfuly, else your application will be denied! Also, please make sure you're at least <b>13</b> years of age before you apply for staff!<br /><br /><center>You must also meet the following requirements:</center>
<br />
<br />
<i>• Able to moderate the hotel for at least 3 hours a day or 10 hours a week!</i><br>
<i>• Advertise and host events frequently!</i><br>
<i>• Have read the rules and understand them entirely!</i><br>
<i>• Will advertise to help gain users!</i><br>
<i>• Invite your friends and help people understand what %shortname% is!</i><br>
<hr>
<br />
<?php
$name = USER_NAME;
if(isset($_POST['apply'])){ // Post the inputs $username = mysql_real_escape_string($_POST['username']); $useremail = mysql_real_escape_string($_POST['email']); $date = mysql_real_escape_string($_POST['date']); $month = mysql_real_escape_string($_POST['month']); $year = mysql_real_escape_string($_POST['year']); $why = mysql_real_escape_string($_POST['why']); $exp = mysql_real_escape_string($_POST['exp']); // Insert the application to database
mysql_query("INSERT INTO jobapps (username, email, dob, why, exp) VALUES ('$username', '$useremail', '$date/$month/$year', '$why', '$exp')");
// Echo a success message
echo
"<strong>Thank you very much for submitting your staff application, you'll be notified through email if you are considered!</strong>";
} else{ $email = ("SELECT * FROM users WHERE username='$name'"); $run = mysql_query($email)or die(mysql_error()); $array = mysql_fetch_array($run)
;?><center>
<form method="post">
<strong>Your Hotel username</strong>
<br>
<input type="text" readonly value="<?php echo $name ?>" name="username" />
<br />
<strong>A active email address</strong>
<br>
<input type="text" value="<?php echo $array['mail']; ?>" name="email" />
<br />
<strong>Position you're applying for</strong>
<br>
<input type="text" disabled value=" Trial Mod " name="email" />
<br />
<strong>Real date of birth Example: 12/01/1990</strong>
<br>
<input type="text" style="width: 40px;" name="date" placeholder="Date" maxlength="2" />
<input type="text" style="width: 40px;" name="month" placeholder="Month" maxlength="2" />
<input type="text" style="width: 80px;" name="year" placeholder="Year" maxlength="4" />
<br /
><br />
<strong>Why would we choose you to become staff here at our hotel?</strong>
<br /> <textarea style="width: 250px; margin-left: 15px;" name="why">
</textarea>
<br />
<strong>What past experience have you had?</strong> (<i>If any</i>)
<br />
<textarea style="width: 250px; margin-left: 15px;" name="exp"></textarea>
<br />
<input type="submit" name="apply" value="Submit your application now!" />
<?php } ?></center>
</div>
</div>
</div>
</div>
and This is the error:
Code:
Notice: Undefined variable: username in C:\xampp\htdocs\includes\tpl\mod-form.tpl on line 27
Notice: Undefined variable: useremail in C:\xampp\htdocs\includes\tpl\mod-form.tpl on line 27
Notice: Undefined variable: date in C:\xampp\htdocs\includes\tpl\mod-form.tpl on line 27
Notice: Undefined variable: month in C:\xampp\htdocs\includes\tpl\mod-form.tpl on line 27
Notice: Undefined variable: year in C:\xampp\htdocs\includes\tpl\mod-form.tpl on line 27
Notice: Undefined variable: why in C:\xampp\htdocs\includes\tpl\mod-form.tpl on line 27
Notice: Undefined variable: exp in C:\xampp\htdocs\includes\tpl\mod-form.tpl on line 27
Thank you very much for submitting your staff application, you'll be notified through email if you are considered!
I appreciate all the help you guys provide Hopefully someone can help with this! Thanks