Jump to content

danielbala

Members
  • Posts

    33
  • Joined

  • Last visited

Everything posted by danielbala

  1. Hi thanks for your reply,but iam NIL with payment methods,Can i do it?
  2. Hi All, I jusr learnt the magento basics,i want to create a shopping cart using magento for selling old products I want to know what are the functionalities to be included in the website like.. 1.SEO 2.what Payment methods should be used. 3.for security purpose 4.what is SSL certificate should i do anything with that Thanks
  3. Hi. Iam trying to sent this form values to my email Its not working Can anyone help to solve this.. this is the form <form method="POST" action="sendemail.php"> <table width="450px"> <tr> <td valign="top"> <label for="name">Name </label> </td> <td valign="top"> <input type="text" name="name" maxlength="50" size="30"> </td> </tr> <tr> <td valign="top"> <label for="organisation">Organisation </label> </td> <td valign="top"> <input type="text" name="organisation" maxlength="50" size="30"> </td> </tr> <tr> <td valign="top"> <label for="contact">Contact no </label> </td> <td valign="top"> <input type="text" name="contact" maxlength="80" size="30"> </td> </tr> <tr> <td valign="top"> <label for="remarks">Remarks</label> </td> <td valign="top"> <textarea name="remarks" maxlength="50" ></textarea> </td> </tr> <tr> <td valign="top"> <label for="designation">Designation </label> </td> <td valign="top"> <input type="text" name="designation" maxlength="50" size="50"> </td> </tr> <tr> <td valign="top"> <label for="email">E-mail </label> </td> <td valign="top"> <input type="text" name="email" maxlength="50" size="40"> </td> </tr> <tr> <td colspan="2" style="text-align:center"> <input type="submit" value="Submit"> <input type="reset" value="Reset"> </td> </tr> </table> </form> sendemail.php <?php session_start(); if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "-----------------l@gmail.com"; $email_subject = "Contact Details"; function died($error) { // your error code can go here echo "We are very sorry, but there were error(s) found with the form you submitted. "; echo "These errors appear below.<br /><br />"; echo $error."<br /><br />"; echo "Please go back and fix these errors.<br /><br />"; die(); } // validation expected data exists if(!isset($_POST['name']) || !isset($_POST['organisation']) || !isset($_POST['email']) || !isset($_POST['contact']) || !isset($_POST['designation']) || !isset($_POST['remarks'])) { died('We are sorry, but there appears to be a problem with the form you submitted.'); } $name = $_POST['name']; $organisation = $_POST['organisation']; $email = $_POST['email']; $contact = $_POST['contact']; $designation = $_POST['designation']; $remarks = $_POST['remarks']; $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$name)) { $error_message .= 'Name you entered does not appear to be valid.<br />'; } if(strlen($remarks) < 2) { $error_message .= 'The Remarks you entered do not appear to be valid.<br />'; } if(strlen($error_message) > 0) { died($error_message); } $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "Name: ".clean_string($name)."\n"; $email_message .= "Organisation: ".clean_string($organisation)."\n"; $email_message .= "Contact No: ".clean_string($contact)."\n"; $email_message .= "Email: ".clean_string($email)."\n"; $email_message .= "Remarks: ".clean_string($remarks)."\n"; $email_message .= "Designation: ".clean_string($designation)."\n"; $headers = 'From: '.$email."\r\n". 'Reply-To: '.$email."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); }?> <!-- include your own success html here --> Thank you for contacting us. We will be in touch with you very soon.
  4. Hi.. I installed WAMP server... When I go to localhost iam getting this is "NOT FOUND" HTTP Error 404. The requested resource is not found. how to solve this
  5. ..Im not using any mail server..i want to write a program for identifying spam emails using naive bayes algorithm...i want to try it using php i just took this code from google..i dont know whether we should create DB table or any forms with fields?? <?php class SpamChecker { public $dbh = null; function trainFilter($text,$isspam=true) { if(is_null($this->dbh)) { throw new Exception("Database connection is null"); } $query = $this->dbh->prepare ('select totalsid,totalspam,totalham FROM totals;'); $query->execute(); $result = $query->fetchAll(); $totalsid = $result[0]['totalsid']; $totalspam = $result[0]['totalspam']; $totalham = $result[0]['totalham']; if($isspam){ $totalspam++; $query = $this->dbh->prepare ('update `totals` set totalspam=? where totalsid=1 limit 1;'); $insert = $query->execute(array($totalspam)); } else { $totalham++; $query = $this->dbh->prepare ('update `totals` set totalham=? where totalsid=1 limit 1;'); $insert = $query->execute(array($totalham)); } $text = preg_replace('/\W+/',' ',$text); $text = preg_replace('/\s\s+/',' ',$text); $text = strtolower($text); $temparray = explode(' ',$text); $gettokenquery = $this->dbh->prepare ('select `spamid`,`spamcount`,`hamcount` from spam where token=? limit 0,1;'); foreach($temparray as $token) { $gettokenquery->execute(array($token)); $result = $gettokenquery->fetchAll(); if(count($result) == 0) { if($isspam) { $query = $this->dbh->prepare ("insert into `spam` (`token`,`spamcount`,`hamcount`, `spamrating`) values (?,'1','0','1');"); $insert = $query->execute(array($token)); } else { $query = $this->dbh->prepare ("insert into `spam` (`token`,`spamcount`,`hamcount`, `spamrating`) values (?,'0','1','0');"); $insert = $query->execute(array($token)); } } else { // Already exists in the database $spamcount = $result[0]['spamcount']; $hamcount = $result[0]['hamcount']; if($isspam){ $spamcount++; } else { $hamcount++; } $hamprob = 0; $spamprob = 0; if($totalham != 0){ $hamprob = $hamcount/$totalham; } if($totalspam != 0) { $spamprob = $spamcount/$totalspam; } if($hamprob+$spamprob != 0) { $spamrating = $spamprob/($hamprob+$spamprob); } else { $spamrating = 0; } $query = $this->dbh->prepare ("update `spam` set `spamcount`=?, `hamcount`=?, `spamrating`=? where token=? limit 1;"); $query->execute(array($spamcount,$hamcount, $spamrating,$token)); } } } function checkSpam($text) { if(is_null($this->dbh)) { throw new Exception("Database connection is null"); } $text = preg_replace('/\W+/',' ',$text); $text = preg_replace('/\s\s+/',' ',$text); $text = strtolower($text); $temparray = explode(' ',$text); $gettokenquery = $this->dbh->prepare ('select `token`,`spamrating` from spam where token=? limit 0,1;'); $spamratings = array(); foreach($temparray as $token) { $gettokenquery->execute(array($token)); $result = $gettokenquery->fetchAll(); $spamrating = $result[0]['spamrating']; if($spamrating == ''){ $spamrating = 0.4; } $spamratings[] = $spamrating; } $a = null; $b = null; foreach($spamratings as $rating) { $rating = max($rating,0.01); $a = is_null($a) ? (float)$rating : $a * $rating; $b = is_null($b) ? 1-(float)$rating : $b * (1-(float)$rating); } $spam = (float)0; if((float)((float)$a+(float)$b) != 0) { $spam = (float)$a/(float)((float)$a+(float)$b); } return $spam; } function resetFilter() { if(is_null($this->dbh)) { throw new Exception("Database connection is null"); } $trun = $this->dbh->prepare('TRUNCATE TABLE `spam`;'); $trun->execute(); $trun = $this->dbh->prepare ('update totals set totalspam=0, totalham=0 limit 1;'); $trun->execute(); } } ?> Hide details Change log r31 by bboyte01 on May 23, 2010 Diff Update to remove issues with divide by zero errors. Go to: Double click a line to add a comment Older revisions r28 by bboyte01 on Apr 14, 2010 Diff r27 by bboyte01 on Feb 18, 2010 Diff r26 by bboyte01 on Feb 18, 2010 Diff All revisions of this file File info Size: 4111 bytes, 141 lines View raw file File properties svn:mergeinfo
  6. Hi.. I want to implement a program for identifying spam emails using an algorithm naive bayes in php.. How to implement this ..can any one help me.. Thx in advance
  7. Hi Im using datagrid in javascript to display a table in a page. And im using the check box field in the table..when i select the check box the value is posted in the DB table but the current employee name field is not posted to the DB field Assignedto <script type="text/javascript"> var thegrid = new drasticGrid('grid1', {pathimg:"img/", pagelength:10, columns: [ {name: 'JOB_ID',width:40}, {name: 'ASSIGN_DATE',editable:false,width:80}, {name: 'CLIENT_NAME',editable:false,width:140}, {name: 'JOB_NAME',editable:false,width:100}, {name: 'TASKS_INVOLVED',editable:false,width:140}, {name: 'ASSIGNED_TO',editable:true,width:100}, {name: 'REMARKS', editable: true,width:140}, {name: 'EXP_COMPL_DATE',editable:true,width:80}, {name: 'JOB_STATUS',editable:true,width:100}, {name: 'MANAGER_APPR',editable:false,width:80}, {name: 'Apply'} ] }); </script> <form action="" method="post" enctype="multipart/form-data" name="ActivityPhoneCallForm" target="_self"> <br /> <br /> <table border="1"> <tr width="569" colspan="2"> <td> Current User :    <input name="CurrentUser" type="text" disabled id="UserId" size="35" maxlength="35" readonly class="disabled" value="<?php if (isset($T_UserName)){echo $T_UserName;} ?>"/>   Activity :   <input name="LogActivity" type="text" disabled id="ActLog" size="35" Value="List New Jobs" maxlength="35" readonly class="disabled" />  <br /> Current Employee Name : <input name="CurrentEmpName" type="text" disabled id="CurrentEmpId" size="35" maxlength="35" readonly class="disabled" value="<?php if (isset($T_UserFullName)){echo $T_UserFullName;} ?>"/> </td> </tr> </table> <br /> <table width="1150" height = "200" border="1"> <tr> <td> <div id="grid1"></div> <script type="text/javascript" src="js/mootools-1.2-core.js"></script> <script type="text/javascript" src="js/mootools-1.2-more.js"></script> <script type="text/javascript" src="js/drasticGrid.js"></script> <script type="text/javascript"> var thegrid = new drasticGrid('grid1', {pathimg:"img/", pagelength:10, columns: [ {name: 'JOB_ID',width:40}, {name: 'ASSIGN_DATE',editable:false,width:80}, {name: 'CLIENT_NAME',editable:false,width:140}, {name: 'JOB_NAME',editable:false,width:100}, {name: 'TASKS_INVOLVED',editable:false,width:140}, {name: 'ASSIGNED_TO',editable:true,width:100}, {name: 'REMARKS', editable: true,width:140}, {name: 'EXP_COMPL_DATE',editable:true,width:80}, {name: 'JOB_STATUS',editable:true,width:100}, {name: 'MANAGER_APPR',editable:false,width:80}, {name: 'Apply'} ] }); </script> </td> </tr> </table> <br /> <br />    <input type="submit" name="AssignJob" id="AssignJobID" value="  Assign Job  " class="EmpFormButton"/> <input type="reset" name="AddJobCancel" id="AddJobCancelID" value="  Cancel  " class="EmpFormButton"/> </form> </div>
  8. Where to set the variable??
  9. where to set the variabale??
  10. im getting null and above that im getting this error also Undefined index: emp_name
  11. im getting this error Parse error: syntax error, unexpected T_IF in C:\w
  12. i gave as if (isset($_SESSION['emp_name'])){ $CurrentEmpName=$_SESSION['emp_name']; } is not correct???
  13. I already gave isset($_SESSION['emp_name'];
  14. nope this is the only code not gathered..
  15. please i dont know whether my code is correct or not??
  16. How to do..im new newbie to php :(
  17. Hi.... im just trying to display the current login user's fullname in the field Current employee name in a file..i did the current user name to be displayed This is code. <?php session_start(); if (isset($_SESSION['id'])){ $loginid=$_SESSION['id']; } if (isset($_SESSION['T_UserName'])){ $T_UserName=$_SESSION['T_UserName']; } if (isset($_GET['id'])){ $loginid=$_GET['id']; //Get login username if using GET $loginid=mysql_real_escape_string($loginid); $query = "SELECT `username` FROM `details` WHERE id=$loginid"; $result = mysql_query($query); $row = mysql_fetch_row($result); $T_UserName=$row[0]; } ?> <?php if (isset($_SESSION['emp_id'])){ $loginid=$_SESSION['emp_id']; } if (isset($_SESSION['emp_name'])){ $CurrentEmpName=$_SESSION['emp_name']; } if (isset($_GET['emp_id'])){ $loginid=$_GET['emp_id']; //Get login username if using GET $loginid=mysql_real_escape_string($loginid); $query = "SELECT `emp_name` FROM `login` WHERE emp_id=$loginid"; $result = mysql_query($query); $row = mysql_fetch_row($result); $CurrentEmpName=$row[0]; } ?> this is form.. <form action="" method="post" enctype="multipart/form-data" name="employee" target="_self"> <br /> <br /> <table border="1"> <tr width="569" colspan="2"> <td> Current User : <input name="CurrentUser" type="text" disabled id="UserId" size="35" maxlength="35" readonly class="disabled" value="<?php echo $_SESSION['username'];?>"/> Activity : <input name="LogActivity" type="text" disabled id="ActLog" size="35" Value="List New Jobs" maxlength="35" readonly class="disabled" />  <br /> Current Employee Name : <input name="CurrentEmpName" type="text" disabled id="CurrentEmpId" size="35" maxlength="35" readonly class="disabled" value="<?php echo $_SESSION['emp_name'];?>"/> </td> </tr> </table>
  18. i dont know about TCPDP HOW TO DO THAT??
  19. Nope..I want to give these buttons on the report page
  20. Hi.. Im generating daily reports for employees I have to give PRINT AND SAVE AS PDF button ..how to implement this.. Any code for this in php Thanx in Advance
  21. hi.. Im new to mysql..i want to know how to generate daily reports for all employees i created 3 tables with fields employee table:emp_id,name job table:job_id,job_name activity table:act_id,emp_name,job_name,date,activity done(assigned values as email,phonecall,visits) Daily Activity Report : (Employee ID, Emp Name,Jobs Name, Activity Done) Eg: 1.| Date | Rajeev | Income Tax Filing | Phone Call Options to Select : 1. Which Date (Required - Not Null) 2. Employee Name, if Employee Name not selected, then the list of Activities for that day for all Employees. How to write query
  22. First thing when i submit the form,values are not posted to the database table second thing its just displaying the error messages even if i submit the form.. third thing i dont know about the file upload i just got this code from google..
  23. This is my validation.php code <?php //session_start(); require_once("config.php"); error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING); if(isset($_POST['Emp_Save'])){ $errors=array(); // Continue when clicked if(isset($_POST['_EmpRole'], $_POST['_EmpName'],$_POST['_EmpFatherName'],$_POST['datepicker'],$_POST['_EmpMaritalStatus'],$_POST['Gender'],$_POST['EmpActivityRadio'],$_POST['_EmpAddress'],$_POST['_EmpQuali'],$_FILES['_EmpPhoto2']['name'],$_FILES['_EmpBiodata']['name'],$_POST['_DOJoin'],$_FILES['_EmpIDProof']['name'],$_FILES['_EmpMedIns']['name'],$_POST['_EmpSalary'])) { // Fields are all set else error : No errors conintue // Set variables an sanitise $Emp_Save= mysql_real_escape_string($_POST['Emp_Save']); $Emp_Cancel=$_POST['Emp_Cancel']; $_EmpRole=$_POST['_EmpRole']; $_EmpName=$_POST['_EmpName']; $_EmpFatherName=$_POST['_EmpFatherName']; $datepicker=$_POST['datepicker']; $_EmpMaritalStatus=$_POST['_EmpMaritalStatus']; $Gender=$_POST['Gender']; $EmpActivityRadio=$_POST['EmpActivityRadio']; $_EmpAddress=$_POST['_EmpAddress']; $_EmpQuali=$_POST['_EmpQuali']; $_EmpPhoto2=$_FILES['_EmpPhoto2']['name']; $_EmpBiodata=$_FILES['_EmpBiodata']['name']; $_DOJoin=$_POST['_DOJoin']; $_EmpIDProof=$_FILES['_EmpIDProof']['name']; $_EmpMedIns=$_FILES['_EmpMedIns']['name']; $_EmpSalary=$_POST['_EmpSalary']; //-- Continue with error checks ;; if(strlen($_EmpName >30)){ $errors[].='Name Is Too Long!'; } else if(empty($_EmpName)) { $errors[].='Please Fill The Field!<br />'; } if(strlen($_EmpFatherName >30)){ $errors[].='Name Is Too Long!<br />'; } else if(empty($_EmpFatherName)) { $errors[].='Please Fill The Field!<br />'; } if(empty($_EmpAddress)){ $errors[].='Please Enter The Address!<br />'; } if(empty($_EmpQuali)){ $errors[].='Please Enter The Qualification!<br />'; } //Make files directory $target_files="files"; if (!is_dir($target_files)){ mkdir($target_files, 0700); } if(array_key_exists('_EmpPhoto2', $_FILES)) { $filename = stripslashes($_FILES['_EmpPhoto2']['name']); $allowed_filetypes = array('.jpg','.gif','.bmp','.png','.jpeg','.JPEG','.JPG'); $ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); // Validate the uploaded file if($_FILES['_EmpPhoto2']['size'] === 0 || empty($_FILES['_EmpPhoto2']['tmp_name'])) { $errors[].="No file was selected.<br />\r\n"; } if($_FILES['_EmpPhoto2']['size'] > 5242880) { $errors[].="The Photo was too large.<br />\r\n"; } if($_FILES['_EmpPhoto2']['error'] !== UPLOAD_ERR_OK) { // There was a PHP error $errors[].="There was an error uploading.<br />\r\n"; } // Check if the filetype is allowed, if not DIE and inform the user. if(!in_array($ext,$allowed_filetypes)){ $errors[].="The Photo file you attempted to upload is not allowed.<br />\r\n"; //die(); } else{ $target_path_EmpPhoto2="files/_EmpPhoto2"; if (!is_dir($target_path_EmpPhoto2)){ mkdir($target_path_EmpPhoto2, 0700); } if (is_dir($target_path_EmpPhoto2)){ move_uploaded_file($_FILES["_EmpPhoto2"]["tmp_name"], $target_path_EmpPhoto2 ."/". $filename); } $_EmpPhoto2=$filename; } } if(array_key_exists('_EmpBiodata', $_FILES)) { $filename = stripslashes($_FILES['_EmpBiodata']['name']); $allowed_filetypes = array('.pdf','.PDF'); $ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); // Validate the uploaded file if($_FILES['_EmpBiodata']['size'] === 0 || empty($_FILES['_EmpBiodata']['tmp_name'])) { $errors[].="No file was selected.<br />\r\n"; } if($_FILES['_EmpBiodata']['size'] > 5242880) { $errors[].="The Biodata file was too large.<br />\r\n"; } if($_FILES['_EmpBiodata']['error'] !== UPLOAD_ERR_OK) { // There was a PHP error $errors[].="There was an error uploading.<br />\r\n"; } if(!in_array($ext,$allowed_filetypes)){ $errors[].="The Biodata file you attempted to upload is not allowed.<br />\r\n"; //die(); } else{ $target_path_EmpBiodata="files/_EmpBiodata"; if (!is_dir($target_path_EmpBiodata)){ mkdir($target_path_EmpBiodata, 0700); } if (is_dir($target_path_EmpBiodata)){ move_uploaded_file($_FILES["_EmpBiodata"]["tmp_name"], $target_path_EmpBiodata ."/". $filename); } $_EmpBiodata=$filename; } } if(array_key_exists('_EmpMedIns', $_FILES)) { $filename = stripslashes($_FILES['_EmpMedIns']['name']); $allowed_filetypes = array('.pdf','.PDF'); $ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); // Validate the uploaded file if($_FILES['_EmpMedIns']['size'] === 0 || empty($_FILES['_EmpMedIns']['tmp_name'])) { $errors[].="No file was selected.<br />\r\n"; } if($_FILES['_EmpMedIns']['size'] > 5242880) { $errors[].="The Med Ins file was too large.<br />\r\n"; } if($_FILES['_EmpMedIns']['error'] !== UPLOAD_ERR_OK) { // There was a PHP error $errors[].="There was an error uploading.<br />\r\n"; } if(!in_array($ext,$allowed_filetypes)){ $errors[].="The Med Ins file you attempted to upload is not allowed.<br />\r\n"; //die(); } else{ $target_path_EmpMedIns="files/_EmpMedIns"; if (!is_dir($target_path_EmpMedIns)){ mkdir($target_path_EmpMedIns, 0700); } if (is_dir($target_path_EmpMedIns)){ move_uploaded_file($_FILES["_EmpMedIns"]["tmp_name"], $target_path_EmpMedIns ."/". $filename); } $_EmpMedIns=$filename; } } if(array_key_exists('_EmpIDProof', $_FILES)) { $filename = stripslashes($_FILES['_EmpIDProof']['name']); $allowed_filetypes = array('.pdf','.PDF'); $ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); // Validate the uploaded file if($_FILES['_EmpIDProof']['size'] === 0 || empty($_FILES['_EmpIDProof']['tmp_name'])) { $errors[].="No file was selected.<br />\r\n"; } if($_FILES['_EmpIDProof']['size'] > 5242880) { $errors[].="The ID proof file was too large.<br />\r\n"; } if($_FILES['_EmpIDProof']['error'] !== UPLOAD_ERR_OK) { // There was a PHP error $errors[].="There was an error uploading.<br />\r\n"; } if(!in_array($ext,$allowed_filetypes)){ $errors[].="The IDproof file you attempted to upload is not allowed.<br />\r\n"; //die(); } else{ $target_path_EmpIDproof="files/_EmpIDProof"; if (!is_dir($target_path_EmpIDproof)){ mkdir($target_path_EmpIDproof, 0700); } if (is_dir($target_path_EmpIDproof)){ move_uploaded_file($_FILES["_EmpIDProof"]["tmp_name"], $target_path_EmpIDproof ."/". $filename); } $_EmpIDproof=$filename; } } if(empty($_EmpSalary)){ $errors[].='Please Enter The Salary!<br />'; } //----- End error checks do insert or display errors of any are found -- if(empty($errors)){ //After verifying data, this is where you sanitize $_EmpRole = mysql_real_escape_string($_EmpRole); $_EmpName = mysql_real_escape_string($_EmpName); $_EmpFatherName = mysql_real_escape_string($_EmpFatherName); $datepicker = mysql_real_escape_string($datepicker); $_EmpMaritalStatus = mysql_real_escape_string($_EmpMaritalStatus); $Gender = mysql_real_escape_string($Gender); $EmpActivityRadio = mysql_real_escape_string($EmpActivityRadio); $_EmpAddress = mysql_real_escape_string($_EmpAddress); $_EmpQuali = mysql_real_escape_string($_EmpQuali); $_EmpPhoto2 = mysql_real_escape_string($_EmpPhoto2); $_EmpBiodata = mysql_real_escape_string($_EmpBiodata); $_DOJoin = mysql_real_escape_string($_DOJoin); $_EmpIDproof = mysql_real_escape_string($_EmpIDproof); $_EmpMedIns = mysql_real_escape_string($_EmpMedIns); $_EmpSalary = mysql_real_escape_string($_EmpSalary); // do insert $query = mysql_query("INSERT INTO `employeedetails` (emp_role,name,fathername,date_of_birth,marital_status,gender,activity_status,address,qualification,photo,bio_data,date_of_joining,id_proof,medical_insurance_details,salary) VALUES ('$_EmpRole', '$_EmpName','$_EmpFatherName','$datepicker','$_EmpMaritalStatus','$Gender','$EmpActivityRadio','$_EmpAddress','$_EmpQuali','$_EmpPhoto2','$_EmpBiodata','$_DOJoin','$_EmpIDproof','$_EmpMedIns','$_EmpSalary')"); }//if(empty($errors)) //--------------------------------------------------- } else { $errors[].= 'All fields required.'; } } // END -- ?> This is my form.php code <?php session_start(); include("config.php"); include("validation.php"); ?> <form action="" method="POST" enctype="multipart/form-data" name="TabForm1" target="_self"> <p> </p> <table width="911" height="128" border="1"> <tr> <td width="417"> Name : <input name="_EmpName" type="text" id="_EmpName" size="35" maxlength="35" value="<?php if (isset($_POST['_EmpName'])){ echo "{$_POST['_EmpName']}"; }?>" /></td> <td width="478"><label> Surname : </label> <input name="_EmpFatherName" type="text" id="_EmpFatherName" size="35" maxlength="35" value="<?php if (isset($_POST['_EmpFatherName'])){ echo "{$_POST['_EmpFatherName']}"; }?>" /></td> </tr> <tr> <td><label> Date Of Birth : </label> <input type="text" name="datepicker" id="datepicker" /> <script type="text/javascript"> $("#datepicker").AnyTime_picker( { format: " %D %M %z " ,askEra:false,labelTitle: "Select a Date"}); </script></td> <td rowspan="4"><br /> Photo : <input type="file" id="files" name="_EmpPhoto2" multiple accept="image/*" /> <br />        <output id="list"></output> <script> function handleFileSelect(evt) { var files = evt.target.files; // FileList object // Loop through the FileList and render image files as thumbnails. for (var i = 0, f; f = files[i]; i++) { // Only process image files. if (!f.type.match('image.*')) { continue; } var reader = new FileReader(); // Closure to capture the file information. reader.onload = (function(theFile) { return function(e) { // Render thumbnail. var CurrPic = document.createElement('span'); CurrPic.setAttribute("id","DispPic"); // document.getElementById('list').removeChild(CurrPic); CurrPic.innerHTML = ['<img class="thumb" src="', e.target.result, '" title="', theFile.name, '"/>'].join(''); var child=document.getElementById('list').firstChild; if (child != null){ document.getElementById('list').replaceChild(CurrPic, child); }else{ document.getElementById('list').insertBefore(CurrPic, null); } }; })(f); // Read in the image file as a data URL. reader.readAsDataURL(f); } } document.getElementById('files').addEventListener('change', handleFileSelect, false); </script> </p> <p> </p></td> </tr> <tr> <td> Gender : <span id="EmpGenderRadio3"> <label> <input name="Gender" type="radio" id="Gender_2" value="Male" checked="checked" /> Male</label> <label> <input type="radio" name="Gender" value="Female" id="Gender_3" /> Female</label> </span></td> </tr> <tr> <td> Marital Status : <select name="_EmpMaritalStatus" size="1" id="_EmpMaritalStatus"> <option value="0" selected="selected">Single</option> <option value="1">Married</option> <option value="2">Divorced</option> <option value="3">Widowed</option> </select></td> </tr> <tr> <td> Address : <label> <textarea name="_EmpAddress" id="_EmpAddress" cols="42" rows="3"><?php if (isset($_POST['_EmpAddress'])){ echo "{$_POST['_EmpAddress']}"; }?></textarea> </label></td> </tr> <tr> <td width="418"> ID Proof : <input type="file" name="_EmpIDProof" id="_EmpIDProof" accept="application/pdf" /></td> <td width="476" height="37"> Medical Insurance Details : <input type="file" name="_EmpMedIns" id="_EmpMedIns" accept="application/pdf" /></td> </tr> <tr> <td colspan="2"> Activity Status : <span id="spryradio2"> <label> <input name="EmpActivityRadio" type="radio" id="EmpActivityRadio_0" value="0" checked="checked" /> Active</label> <label> <input type="radio" name="EmpActivityRadio" value="1" id="EmpActivityRadio_1" /> Non Active</label> </span></td> </tr> <tr> <td width="419"><label> </label> Qualification : <input name="_EmpQuali" type="text" id="_EmpQuali" size="35" maxlength="35" value="<?php if (isset($_POST['_EmpQuali'])){ echo "{$_POST['_EmpQuali']}"; }?>" /></td> <td width="479"> Biodata : <input type="file" name="_EmpBiodata" id="_EmpBiodata" accept="application/pdf" /></td> </tr> <tr> <td> Role : <select name="_EmpRole" size="1" id="_EmpRole"> <option value="0">Administrator</option> <option value="1">Manager</option> <option value="2">Employee</option> </select></td> <td> </td> </tr> <tr> <td> Date of Joining : <input type="text" name="_DOJoin" id="datepicker_2" /> <script type="text/javascript"> $("#datepicker_2").AnyTime_picker( { format: " %D %M %z " ,askEra:false,labelTitle: "Select a Date"}); </script></td> <td> Salary : <input name="_EmpSalary" type="text" id="_EmpSalary" value="0" /></td> </tr> </table> <p> <label> </label>      </p> <p> <input type="submit" name="Emp_Save" id="Emp_Save" value=" Save " class="EmpFormButton"/> <input type="reset" name="Emp_Cancel" id="Emp_Cancel" value=" Cancel " class="EmpFormButton"/> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </form>
  24. ok..values are not posted to the database table when i submit the form and its just displaying all the error messages at the top of the table,files are not uploaded
  25. Sorry.. When i save the form values..values are not posted to the database table.. And errors Are displayed..
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.