[Help] UberCMS Job App

JayC

Well-Known Member
Aug 8, 2013
5,505
1,401
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:
u1ix.png


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>&bull; Able to moderate the hotel for at least 3 hours a day or 10 hours a week!</i><br>
<i>&bull; Advertise and host events frequently!</i><br>
<i>&bull; Have read the rules and understand them entirely!</i><br>
<i>&bull; Will advertise to help gain users!</i><br>
<i>&bull; 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
 

JayC

Well-Known Member
Aug 8, 2013
5,505
1,401
I tried that, that was how the form came and awkward enough it broke the damn thing. I was thinking the same thing "Why would they put the script above the form?", Like I said I just took the code from a release and changed the page to my appeal.
 

Nehalem

Aug 31, 2013
293
47
I would love that, thank you Nehalem :)
I found multiple things in the original code that doesn't even make any sense.
But here you go, replace the whole FORM and PHP SCRIPT with this:
PHP:
<?php
$name = USER_NAME;
if(isset($_POST['apply'])) {
    $job_username = mysql_real_escape_string($_POST['username']);
    $job_email = mysql_real_escape_string($_POST['useremail']);
    $job_date = mysql_real_escape_string($_POST['date']);
    $job_month = mysql_real_escape_string($_POST['month']);
    $job_year = mysql_real_escape_string($_POST['year']);
    $job_why = mysql_real_escape_string($_POST['why']);
    $job_exp = mysql_real_escape_string($_POST['exp']);

    $job_do = mysql_query("INSERT INTO jobapps (username, email, dob, why, exp) VALUES ('".$job_username."', '".$job_email."', '".$job_date/$job_month/$job_year."', '".$job_why."', '".$job_exp."')");
    if($job_do) {
        echo "<strong>Thank you very much for submitting your staff application, you'll be notified through email if you are considered!</strong>";
    } else {
       die(mysql_error());
    }
}
?>

<form method="post" action="">
    <b>Your hotel username</b><br />
    <input type="text" readonly value="<?php echo $name; ?>" name="username"><br />
    <b>An active email address</b><br />
    <input type="text" name="useremail"><br />
    <b>Position your applying for</b><br />
    <input type="text" disabled value="Trial Mod"><br />
    <b>Real deate of birth</b><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 />
    <b>Why would we choose you?</b><br />
    <textarea style="width: 250px; margin-left: 15px;" name="why"></textarea><br />
    <b>What experience have you had?</b><br />
    <textarea style="width: 250px; margin-left: 15px;" name="exp"></textarea><br />
    <input type="submit" name="apply" value="Submit">
</form>

Tell me if it works or not.
 
Last edited:

Crup

weeeeee
Jul 25, 2010
545
310
I found multiple things in the original code that doesn't even make any sense.
But here you go, replace the whole FORM and PHP SCRIPT with this:
PHP:
<?php
$name = USER_NAME;
if(isset($_POST['apply'])) {
    $job_username = mysql_real_escape_string($_POST['username']);
    $job_email = mysql_real_escape_string($_POST['useremail']);
    $job_date = mysql_real_escape_string($_POST['date']);
    $job_month = mysql_real_escape_string($_POST['month']);
    $job_year = mysql_real_escape_string($_POST['year']);
    $job_why = mysql_real_escape_string($_POST['why']);
    $job_exp = mysql_real_escape_string($_POST['exp'])

    $job_do = mysql_query("INSERT INTO jobapps (username, email, dob, why, exp) VALUES ('".$job_username."', '".$job_email."', '".$job_date/$job_month/$job_year."', '".$job_why."', '".$job_exp."')");
    if($job_do) {
        echo "<strong>Thank you very much for submitting your staff application, you'll be notified through email if you are considered!</strong>";
    } else {
        die mysql_error();
    }
}
?>

<form method="post" action="">
    <b>Your hotel username</b><br />
    <input type="text" readonly value="<?php echo $name; ?>" name="username"><br />
    <b>An active email address</b><br />
    <input type="text" name="useremail"><br />
    <b>Position your applying for</b><br />
    <input type="text" disabled value="Trial Mod"><br />
    <b>Real deate of birth</b><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 />
    <b>Why would we choose you?</b><br />
    <textarea style="width: 250px; margin-left: 15px;" name="why"></textarea><br />
    <b>What experience have you had?</b><br />
    <textarea style="width: 250px; margin-left: 15px;" name="exp"></textarea><br />
    <input type="submit" name="apply" value="Submit">
</form>

Tell me if it works or not.
You have it all wrong
 

Nehalem

Aug 31, 2013
293
47
Test this:
PHP:
<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>&bull; Able to moderate the hotel for at least 3 hours a day or 10 hours a week!</i><br>
<i>&bull; Advertise and host events frequently!</i><br>
<i>&bull; Have read the rules and understand them entirely!</i><br>
<i>&bull; Will advertise to help gain users!</i><br>
<i>&bull; Invite your friends and help people understand what %shortname% is!</i><br>

<hr>
<br />
<?php
$name = USER_NAME;
if(isset($_POST['apply'])) {$job_username = mysql_real_escape_string($_POST['username']);$job_email = mysql_real_escape_string($_POST['useremail']);$job_date = mysql_real_escape_string($_POST['date']);$job_month = mysql_real_escape_string($_POST['month']);$job_year = mysql_real_escape_string($_POST['year']);$job_why = mysql_real_escape_string($_POST['why']);$job_exp = mysql_real_escape_string($_POST['exp']);
$job_do = mysql_query("INSERT INTO jobapps (username, email, dob, why, exp) VALUES ('".$job_username."', '".$job_email."', '".$job_date/$job_month/$job_year."', '".$job_why."', '".$job_exp."')");
if($job_do) {
echo "<strong>Thank you very much for submitting your staff application, you'll be notified through email if you are considered!</strong>";
} else {
die(mysql_error());
}
}?>
<form method="post" action="">
<b>Your hotel username</b><br />
<input type="text" readonly value="<?php echo $name; ?>" name="username"><br />
<b>An active email address</b><br />
<input type="text" name="useremail"><br />
<b>Position your applying for</b><br />
<input type="text" disabled value="Trial Mod"><br />
<b>Real deate of birth</b><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 />
<b>Why would we choose you?</b><br />
<textarea style="width: 250px; margin-left: 15px;" name="why"></textarea><br />
<b>What experience have you had?</b><br />
<textarea style="width: 250px; margin-left: 15px;" name="exp"></textarea><br />
<input type="submit" name="apply" value="Submit">
</form>
</center>
</div>
</div>
</div>
</div>

And please print the error.

EDIT: Missed a semi-colon...
 
Last edited:

JayC

Well-Known Member
Aug 8, 2013
5,505
1,401
Test this:
PHP:
<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>&bull; Able to moderate the hotel for at least 3 hours a day or 10 hours a week!</i><br>
<i>&bull; Advertise and host events frequently!</i><br>
<i>&bull; Have read the rules and understand them entirely!</i><br>
<i>&bull; Will advertise to help gain users!</i><br>
<i>&bull; Invite your friends and help people understand what %shortname% is!</i><br>

<hr>
<br />
<?php
$name = USER_NAME;
if(isset($_POST['apply'])) {$job_username = mysql_real_escape_string($_POST['username']);$job_email = mysql_real_escape_string($_POST['useremail']);$job_date = mysql_real_escape_string($_POST['date']);$job_month = mysql_real_escape_string($_POST['month']);$job_year = mysql_real_escape_string($_POST['year']);$job_why = mysql_real_escape_string($_POST['why']);$job_exp = mysql_real_escape_string($_POST['exp']);
$job_do = mysql_query("INSERT INTO jobapps (username, email, dob, why, exp) VALUES ('".$job_username."', '".$job_email."', '".$job_date/$job_month/$job_year."', '".$job_why."', '".$job_exp."')");
if($job_do) {
echo "<strong>Thank you very much for submitting your staff application, you'll be notified through email if you are considered!</strong>";
} else {
die(mysql_error());
}
}?>
<form method="post" action="">
<b>Your hotel username</b><br />
<input type="text" readonly value="<?php echo $name; ?>" name="username"><br />
<b>An active email address</b><br />
<input type="text" name="useremail"><br />
<b>Position your applying for</b><br />
<input type="text" disabled value="Trial Mod"><br />
<b>Real deate of birth</b><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 />
<b>Why would we choose you?</b><br />
<textarea style="width: 250px; margin-left: 15px;" name="why"></textarea><br />
<b>What experience have you had?</b><br />
<textarea style="width: 250px; margin-left: 15px;" name="exp"></textarea><br />
<input type="submit" name="apply" value="Submit">
</form>
</center>
</div>
</div>
</div>
</div>

And please print the error.

EDIT: Missed a semi-colon...
DUDE YOU DID IT :D IT WORKED! Thank you god so much<333 Ahh !! You're amazing bro , I am going to follow you. You don't realize how much this helped!
 

Users who are viewing this thread

Top