<?php
if( $_POST )
{
$con = mysql_connect("localhost","id142307_*****","*****");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("id142307_*****", $con);
$users_Full name= $_POST['Full name'];
$users_Date of birth= $_POST['Date of birth'];
$users_Visa Type= $_POST['Visa Type'];
$users_Visa validation= $_POST['Visa validation'];
$users_Graduation= $_POST['Graduation'];
$users_Graduation year= $_POST['Graduation year'];
$users_Mobile Number= $_POST['Mobile Number'];
$users_Email Address= $_POST['Email Address'];
$users_Address in Kuwait= $_POST['Address in Kuwait'];
$users_Driving License= $_POST['Driving License'];
$users_Employment status= $_POST['Employment status'];
$users_Fields of expertise= $_POST['Fields of expertise'];
$users_Last / Current Title= $_POST['Last / Current Title'];
$users_Expected Salary KD= $_POST['Expected Salary KD'];
$users_Arabic level= $_POST['Arabic level'];
$users_English level= $_POST['English level'];
$users_MS Outlook= $_POST['MS Outlook'];
$users_MS Excel= $_POST['MS Excel'];
$users_MS Access= $_POST['MS Access'];
$users_MS Word= $_POST['MS Word'];
$users_Full name=mysql_real_escape_string($users_Full name);
$users_Date of birth=mysql_real_escape_string($users_Date of birth);
$users_Visa Type=mysql_real_escape_string($users_Visa Type);
$users_Visa validation=mysql_real_escape_string($users_Visa validation);
$users_Graduation=mysql_real_escape_string($users_Graduation);
$users_Graduation year=mysql_real_escape_string($users_Graduation year);
$users_Mobile Number=mysql_real_escape_string($users_Mobile Number);
$users_Email Address=mysql_real_escape_string($users_Email Address);
$users_Address in Kuwait=mysql_real_escape_string($users_Address in Kuwait);
$users_Driving License=mysql_real_escape_string($users_Driving License);
$users_Employment status=mysql_real_escape_string($users_Employment status);
$users_Fields of expertise=mysql_real_escape_string($users_Fields of expertise);
$users_Last / Current Title=mysql_real_escape_string($users_Last / Current Title);
$users_Expected Salary KD=mysql_real_escape_string($users_Expected Salary KD);
$users_Arabic level=mysql_real_escape_string($users_Arabic level);
$users_English level=mysql_real_escape_string($users_English level);
$users_MS Outlook=mysql_real_escape_string($users_MS Outlook);
$users_MS Excel=mysql_real_escape_string($users_MS Excel);
$users_MS Access=mysql_real_escape_string($users_MS Access);
$users_MS Word=mysql_real_escape_string($users_MS Word);
$articleid = $_GET['id'];
if( ! is_numeric($articleid) ) {
die('invalid article id'); }
$query = "
INSERT INTO `NewForm` (`ID`, `Full name`, `Date of birth`, `Visa Type`, `Visa validation`, `Graduation`, `Graduation year`, `Mobile Number`, `Email Address`, `Address in Kuwait`, `Driving License`, `Employment status`, `Fields of expertise`, `Last / Current Title`, `Expected Salary KD`, `Arabic level`, `English level`, `MS Outlook`, `MS Excel`, `MS Access`, `MS Word`, `Time Stamp`, `ArticleID`);
$return = mysql_query($query);
echo "<h2>Thank you</h2>";
mysql_close($con);
}
?>
the code above is the manage_CVs.php, to get the form sent to my SQL database
the code below is the formcode.php, to be filed by the guest in page1.php
<form method='post'>
<strong>Full name</label></strong>
<div class="input-group"><span class="input-group-addon left"><i class="glyphicon glyphicon-user"></i> </span>
<input type="text" class="form-control" id="f1" name="f1" value=""
data-rule-required="true" />
</div>
</div>
<div class="form-group f4 required" data-fid="f4">
<label class="control-label" for="f4"><strong>Date of birth</strong></label>
<div class="input-group date">
<input type="text" class="form-control datepicker" id="f4" name="f4" value=""
data-rule-required="true"
data-datepicker-format="dd/mm/yyyy"
data-datepicker-startDate="-18"
data-datepicker-startView="1"
data-datepicker-minViewMode="2"
data-datepicker-multidate="false"
data-datepicker-multidateSeparator="/" />
<span class="input-group-addon right"><i class="glyphicon glyphicon-th"></i> </span></div>
</div>
<div class="form-group f6 required col-3" data-fid="f6">
<label class="control-label" for="f6"><strong>Visa Type</strong></label>
<div class="Radio">
<input id="f6_1" name="f6[]" type="Radio" value="Art. 22"
data-rule-required="true" >
<label for="f6_1">
Art. 22
</label>
</div>
<div class="Radio">
<input id="f6_2" name="f6[]" type="Radio" value="Art. 18" >
<label for="f6_2">
Art. 18
</label>
</div>
<div class="Radio">
<input id="f6_3" name="f6[]" type="Radio" value="Art. 17" >
<label for="f6_3">
Art. 17
</label>
</div>
</div>
<div class="form-group f7 required col-2" data-fid="f7">
<label class="control-label" for="f7"><strong>Visa validation</strong></label>
<div class="Radio">
<input id="f7_1" name="f7[]" type="Radio" value="Valid"
data-rule-required="true" >
<label for="f7_1">
Valid
</label>
</div>
<div class="Radio">
<input id="f7_2" name="f7[]" type="Radio" value="Expired" >
<label for="f7_2">
Expired
</label>
</div>
</div>
<div class="form-group f8 required" data-fid="f8">
<label class="control-label" for="f8"><strong>Graduation</strong></label>
<strong>
<input class="form-control" id="f8" name="f8" max="2011-12-31" min="2015-01-02" value=""
data-rule-required="true" dir="ltr" /></strong>
</div>
<div class="form-group f9 required" data-fid="f9">
<label class="control-label" for="f9"><strong>Graduation year</strong></label>
<div class="input-group date">
<input type="text" class="form-control datepicker" id="f9" name="f9" value=""
data-rule-required="true"
data-datepicker-format="dd/mm/yyyy"
data-datepicker-startDate="-18"
data-datepicker-startView="1"
data-datepicker-minViewMode="2"
data-datepicker-multidateSeparator="/" />
<span class="input-group-addon right"><i class="glyphicon glyphicon-th"></i> </span></div>
</div>
<div class="form-group f12 required" data-fid="f12">
<label class="control-label" for="f12"><strong>Mobile Number</strong></label>
<input type="text" class="form-control" id="f12" name="f12" value="" maxlength="8"
data-rule-required="true"
data-rule-minlength="8" data-msg-minlength="Please enter at least {8} characters."
data-rule-maxlength="8" data-msg-maxlength="Please enter no more than {8} characters."
data-mask="#" />
</div>
<div class="form-group f13 required" data-fid="f13">
<label class="control-label" for="f13"><strong>Email Address</strong></label>
<input type="email" class="form-control" id="f13" name="f13" value=""
data-rule-email="true"
data-rule-required="true" />
</div>
<div class="form-group f14 required" data-fid="f14">
<label class="control-label" for="f14"><strong>Address in Kuwait</strong></label>
<input type="text" class="form-control" id="f14" name="f14" value=""
data-rule-required="true" />
</div>
<div class="form-group f15 required col-2" data-fid="f15">
<label class="control-label" for="f15"><strong>Driving License</strong></label>
<div class="Radio">
<input id="f15_1" name="f15[]" type="Radio" value="Yes"
data-rule-required="true" >
<label for="f15_1">
Yes
</label>
</div>
<div class="Radio">
<input id="f15_2" name="f15[]" type="Radio" value="No" >
<label for="f15_2">
No
</label>
</div>
</div>
<div class="form-group f34 " data-fid="f34">
<label class="control-label" for="f34">Untitled</label>
</div>
<div class="form-group f16 required col-2" data-fid="f16">
<label class="control-label" for="f16"><strong>Employment status</strong></label>
<div class="Radio">
<input id="f16_1" name="f16[]" type="Radio" value="Employee"
data-rule-required="true" >
<label for="f16_1">
Employee
</label>
</div>
<div class="Radio">
<input id="f16_2" name="f16[]" type="Radio" value="Unemployed" >
<label for="f16_2">
Unemployed
</label>
</div>
</div>
<div class="form-group f29 required" data-fid="f29">
<label class="control-label" for="f29">Fields of expertise</label>
<textarea class="form-control" id="f29" name="f29" rows="3"
data-rule-required="true" ></textarea>
</div>
<div class="form-group f17 required" data-fid="f17">
<label class="control-label" for="f17">Last / Current Title</label>
<textarea class="form-control" id="f17" name="f17" rows="3"
data-rule-required="true" ></textarea>
</div>
<div class="form-group f18 required" data-fid="f18">
<label class="control-label" for="f18">Expected Salary KD</label>
<input type="text" class="form-control" id="f18" name="f18" value=""
data-rule-required="true"
data-mask="S" />
</div>
<div class="form-group f33 " data-fid="f33">
<label class="control-label" for="f33">Untitled</label>
</div>
<div class="form-group f19 required col-3" data-fid="f19">
<label class="control-label" for="f19">Arabic level</label>
<div class="Radio">
<input id="f19_1" name="f19[]" type="Radio" value="Beginner"
data-rule-required="true" >
<label for="f19_1">
Beginner
</label>
</div>
<div class="Radio">
<input id="f19_2" name="f19[]" type="Radio" value="Elementary" >
<label for="f19_2">
Elementary
</label>
</div>
<div class="Radio">
<input id="f19_3" name="f19[]" type="Radio" value="Intermediate" >
<label for="f19_3">
Intermediate
</label>
</div>
</div>
<div class="form-group f20 required col-3" data-fid="f20">
<label class="control-label" for="f20">English level</label>
<div class="Radio">
<input id="f20_1" name="f20[]" type="Radio" value="Beginner"
data-rule-required="true" >
<label for="f20_1">
Beginner
</label>
</div>
<div class="Radio">
<input id="f20_2" name="f20[]" type="Radio" value="Elementary" >
<label for="f20_2">
Elementary
</label>
</div>
<div class="Radio">
<input id="f20_3" name="f20[]" type="Radio" value="Intermediate" >
<label for="f20_3">
Intermediate
</label>
</div>
</div>
<div class="form-group f24 required col-3" data-fid="f24">
<label class="control-label" for="f24">MS Outlook</label>
<div class="Radio">
<input id="f24_1" name="f24[]" type="Radio" value="Basic"
data-rule-required="true" >
<label for="f24_1">
Basic
</label>
</div>
<div class="Radio">
<input id="f24_2" name="f24[]" type="Radio" value="Intermediate" >
<label for="f24_2">
Intermediate
</label>
</div>
<div class="Radio">
<input id="f24_3" name="f24[]" type="Radio" value="Advanced" >
<label for="f24_3">
Advanced
</label>
</div>
</div>
<div class="form-group f22 required col-3" data-fid="f22">
<label class="control-label" for="f22">MS Excel</label>
<div class="Radio">
<input id="f22_1" name="f22[]" type="Radio" value="Basic"
data-rule-required="true" >
<label for="f22_1">
Basic
</label>
</div>
<div class="Radio">
<input id="f22_2" name="f22[]" type="Radio" value="Intermediate" >
<label for="f22_2">
Intermediate
</label>
</div>
<div class="Radio">
<input id="f22_3" name="f22[]" type="radio" value="Advanced" >
<label for="f22_3">
Advanced
</label>
</div>
</div>
<div class="form-group f23 required col-3" data-fid="f23">
<label class="control-label" for="f23">MS Access</label>
<div class="Radio">
<input id="f23_1" name="f23[]" type="Radio" value="Basic"
data-rule-required="true" >
<label for="f23_1">
Basic
</label>
</div>
<div class="Radio">
<input id="f23_2" name="f23[]" type="Radio" value="Intermediate" >
<label for="f23_2">
Intermediate
</label>
</div>
<div class="Radio">
<input id="f23_3" name="f23[]" type="Radio" value="Advanced" >
<label for="f23_3">
Advanced
</label>
</div>
</div>
<div class="form-group f21 required col-3" data-fid="f21">
<label class="control-label" for="f21">MS Word</label>
<div class="Radio">
<input id="f21_1" name="f21[]" type="Radio" value="Basic"
data-rule-required="true" style="height: 20px" >
<label for="f21_1">
Basic
</label>
</div>
<div class="Radio">
<input id="f21_2" name="f21[]" type="Radio" value="Intermediate" >
<label for="f21_2">
Intermediate
</label>
</div>
<div class="Radio">
<input id="f21_3" name="f21[]" type="Radio" value="Advanced" >
<label for="f21_3">
Advanced
</label>
</div>
</div>
<div class="form-group f32 " data-fid="f32">
<label class="control-label" for="f32">Untitled</label>
</div>
<div class="form-group f25 required" data-fid="f25">
<label class="control-label" for="f25">Upload clear photo</label>
<input type="file" class="form-control" id="f25" name="f25" value=""
data-rule-required="true" data-allowedFileExtensions="png,jpg,jpeg,svg,bmp,gif,tif,tiff,raw,nef,cr2,crw,dng,srf,arw" data-showUpload="false" data-showZoom="false"/>
</div>
<div class="form-group f26 " data-fid="f26">
<label class="control-label" for="f26">Upload C.V.</label>
<input type="file" class="form-control" id="f26" name="f26" value=""
data-allowedFileExtensions="docx,pptx,doc,ppt,rtf,pdf" data-showUpload="false" data-showZoom="false"/>
</div>
<div class="form-group submit f0 " data-fid="f0" style="position: relative;">
<label class="control-label sr-only" for="f0" style="display: block;">Submit Button</label>
<div class="progress" style="display: none; z-index: -1; position: absolute;">
<div class="progress-bar progress-bar-striped active" role="progressbar" style="width:100%">
</div>
</div>
<button type="submit" class="btn btn-primary btn-lg" style="z-index: 1;">
Submit
</button>
</div>
<div class="clearfix">
<input type='hidden' name='articleid' id='articleid' value='<? echo $_GET["id"]; ?>' />
<input type='submit' value='Submit' />
</form>
the code below is the first page which should be used by the guest Page1.php
<? include("manage_CVs.php"); ?>
<h1>This is page1.php</h1>
<div style='margin:20px; width:100px; height:100px; background:blue;'></div>
<?php include("formcode.php"); ?>
That's all what the codes which I have, as I mentioned I'm newbie and I followed a tutorial to made the above.
what is not working :
1- date filed in the Formcode.php is not appears like a date filed, it looks like text filed.
<div class="input-group date">
<input type="text" class="form-control datepicker" id="f4" name="f4" value=""
data-rule-required="true"
data-datepicker-format="dd/mm/yyyy"
data-datepicker-startDate="-18"
data-datepicker-startView="1"
data-datepicker-minViewMode="2"
data-datepicker-multidate="false"
data-datepicker-multidateSeparator="/" />
<span class="input-group-addon right"><i class="glyphicon glyphicon-th"></i> </span></div>
2- the Radio code which I have below, not showing the chosen answer in the database
<div class="form-group f6 required col-3" data-fid="f6">
<label class="control-label" for="f6"><strong>Visa Type</strong></label>
<div class="Radio">
<input id="f6_1" name="f6[]" type="Radio" value="Art. 22"
data-rule-required="true" >
<label for="f6_1">
Art. 22
</label> </div>
<div class="Radio">
<input id="f6_2" name="f6[]" type="Radio" value="Art. 18" >
<label for="f6_2">
Art. 18
</label> </div>
<div class="Radio">
<input id="f6_3" name="f6[]" type="Radio" value="Art. 17" >
<label for="f6_3">
Art. 17
</label>
</div>
hope that this makes it more clear because I'm confused
Thank you in advance