Jump to content

pixeltrace

Members
  • Posts

    577
  • Joined

  • Last visited

    Never

Everything posted by pixeltrace

  1. guys, i need help, i have a form that lets the user reset there password and send a copy of the new pasword to there email the form is already working except that the password that is being sent is also in a md5 format. how do i fix this? this is the current code of my page. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>:: JobHiRings :: Administration Page</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 10px; margin-right: 0px; margin-bottom: 0px; } --> </style> <link href="css.css" rel="stylesheet" type="text/css"> </head> <body> <table width="778" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="2" background="images/headerbg.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="226" align="left"><img src="images/header.gif" width="226" height="148"></td> <td> </td> </tr> </table></td> <td background="images/headerbg.gif"><img src="images/headeright.gif" width="16" height="148"></td> </tr> <tr> <td width="16" rowspan="2" align="left" valign="top" background="images/left.gif"><img src="images/left.gif" width="16" height="14"></td> <td width="745" align="center" valign="top"><table width="739" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="739"> </td> </tr> <tr> <td align="center"><h1 class="text4">Forgot Password</h1> <span class="text8">A new password will be generated for you and send to the email address<br> associated with your account, all you have to do is enter your email address below.</span><br> <br> <?php session_start(); include 'db_connect.php'; $query="SELECT email, password FROM admin_user where email='$email'"; $result=mysql_query($query); while($rec=mysql_fetch_assoc($result)){ $mail=$_SESSION['email']=$rec['email']; } if(mysql_num_rows($result)==1){ $password=md5($password); if($_GET['cmd']=="update"){ $query2="UPDATE admin_user set `password`='$password' where `email` = '$email' "; $result=mysql_query($query2)or die(mysql_error()); $Message = 'please keep this new password in a safe place \n'; $Message = 'Your new password is: '.$password.'\n\n'; $Header = "webadministrator@jobhirings.com"; $To = "$email"; $Subject = "Your New Password"; mail($To,$Subject,$Message,"From: $Header"); echo " <div align='center'><b class='text3'>Thank you password changed!<br> We have sent a copy to your email address!<div></b><br><br><a href='index.php' class='link2'>Please Login Now</a><br> </td> </tr><tr><td> </td></tr></table></td> <td width='16' rowspan='2' align='right' valign='top' background='images/right.gif'><img src='images/spacer.gif' width='1' height='1'><img src='images/right.gif' width='16' height='14'></td> </tr><tr><td valign='top'><img src='images/spacer.gif' width='746' height='10'></td> </tr><tr><td background='images/footerbg.gif'><img src='images/footerleft.gif' width='16' height='43'></td> <td background='images/footerbg.gif'><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'> <tr><td height='10' colspan='2' align='left'><img src='images/spacer.gif' width='12' height='10'></td> </tr><tr><td width='746' align='center' valign='top' class='footer'>Copyright © 2007 www.jobhirings.com. All Rights Reserved</td> </tr></table></td><td background='images/footerbg.gif'><img src='images/footeright.gif' width='16' height='43'></td> </tr></table></body></html>"; exit; } if($_GET['cmd']=="pro"){ echo"<div><form action='forgotpass.php?cmd=update ' method='POST'> <b class='text3'>Please provide a new password</b><br><br> <input type='password' name='password' maxlength='30'> <br> <br> <input type='submit' value='New Password'> </form></td> </tr><tr><td> </td></tr></table></td> <td width='16' rowspan='2' align='right' valign='top' background='images/right.gif'><img src='images/spacer.gif' width='1' height='1'><img src='images/right.gif' width='16' height='14'></td> </tr><tr><td valign='top'><img src='images/spacer.gif' width='746' height='10'></td> </tr><tr><td background='images/footerbg.gif'><img src='images/footerleft.gif' width='16' height='43'></td> <td background='images/footerbg.gif'><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'> <tr><td height='10' colspan='2' align='left'><img src='images/spacer.gif' width='12' height='10'></td> </tr><tr><td width='746' align='center' valign='top' class='footer'>Copyright © 2007 www.jobhirings.com. All Rights Reserved</td> </tr></table></td><td background='images/footerbg.gif'><img src='images/footeright.gif' width='16' height='43'></td> </tr></table></body></html>"; exit; } } ?> <form action="forgotpass.php?cmd=pro" method="POST"> <b class="text3">Email Address:</b> <input type="text" name="email" maxlength="30"> <input type="submit" value="Get New Password"> </form></td> </tr> <tr> <td> </td> </tr> </table></td> <td width="16" rowspan="2" align="right" valign="top" background="images/right.gif"><img src="images/spacer.gif" width="1" height="1"><img src="images/right.gif" width="16" height="14"></td> </tr> <tr> <td valign="top"><img src="images/spacer.gif" width="746" height="10"></td> </tr> <tr> <td background="images/footerbg.gif"><img src="images/footerleft.gif" width="16" height="43"></td> <td background="images/footerbg.gif"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="10" colspan="2" align="left"><img src="images/spacer.gif" width="12" height="10"></td> </tr> <tr> <td width="746" align="center" valign="top" class="footer">Copyright © 2007 www.jobhirings.com. All Rights Reserved</td> </tr> </table></td> <td background="images/footerbg.gif"><img src="images/footeright.gif" width="16" height="43"></td> </tr> </table> </body> </html> also, considering my current code, is there a way that the form could just create a random password instead of letting the user input there own new password? i mean for security reasons. then the new password will just be sent to the user's email. hope you could help me with this. thanks!
  2. hi, no nothing happened actually, when i try to search it just goes back to the same page and all the data from my database as in every item in the table of my database is displayed on top. is there other thing that i need to setup here? need help. thanks!
  3. hi, i am planning to use the example_word.htm from tinymce 2. but i dont know how to remove the toolbars on top i mean the entire tool bar, since i am just planning to use the textarea to let users just copy and paste there resume. i tried removing some of the plugins on top of the codes but i can still see some of the toolbars. hope you could help me with this. this is the current code that i have for that page <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Word example</title> <!-- TinyMCE --> <script language="javascript" type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script> <script language="javascript" type="text/javascript"> tinyMCE.init({ mode : "textareas", theme : "advanced", plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,media", <!--theme_advanced_buttons1_add_before : "save,newdocument,separator",--> theme_advanced_buttons1_add : "fontselect,fontsizeselect", theme_advanced_buttons2_add : "forecolor,backcolor", <!--theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",--> <!--theme_advanced_buttons3_add_before : "tablecontrols,separator",--> <!--theme_advanced_buttons3_add : "emotions,iespell,media,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",--> theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", content_css : "example_word.css", plugi2n_insertdate_dateFormat : "%Y-%m-%d", plugi2n_insertdate_timeFormat : "%H:%M:%S", external_link_list_url : "example_link_list.js", external_image_list_url : "example_image_list.js", media_external_list_url : "example_media_list.js", file_browser_callback : "fileBrowserCallBack", paste_use_dialog : false, theme_advanced_resizing : true, theme_advanced_resize_horizontal : false, theme_advanced_link_targets : "_something=My somthing;_something2=My somthing2;_something3=My somthing3;", paste_auto_cleanup_on_paste : true, paste_convert_headers_to_strong : false, paste_strip_class_attributes : "all", paste_remove_spans : false, paste_remove_styles : false }); function fileBrowserCallBack(field_name, url, type, win) { // This is where you insert your custom filebrowser logic alert("Filebrowser callback: field_name: " + field_name + ", url: " + url + ", type: " + type); // Insert new URL, this would normaly be done in a popup win.document.forms[0].elements[field_name].value = "someurl.htm"; } </script> <!-- /TinyMCE --> </head> <body> <form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true"> <h3><br /> <br /> <textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 100%"> </textarea> <br /> <input type="submit" name="save" value="Submit" /> <input type="reset" name="reset" value="Reset" /> </h3> </form> </body> </html> notice that i already placed <!-- --> on all the plugins that i dont want to appear but what i really wanted to happen is to just have the the Bold, Italize, underline, font color, font size, font type align left, right, center to appear on the tool bar. Thanks!
  4. do you have any samples that i can check? because i will be using tinymce for resume application. so i was having a problem if its ok or right to have all the text content being pasted in the textarea to be saved in the database or somewhere else. also, aside from that, users should be able to edit there resume later on so i dont have any ideas yet as to how to use tinymce for this kind of application hope you could help me with this. thanks!
  5. guys, i need help. anyone here tried using tinymce already? if ever, how do i display or open a word document file using tinymce? what i mean here, if i have a document file, you can read the document file already from the textarea of tinymce need help on this. thanks!
  6. hi, how do i set this up? because when i just copied paste this and test i immediately saw all the items in my database on top then the form is below. if i made some selections on the form below its page cannot be displayed. need help please. thanks!
  7. guys, i need help on my advanced search form my advanced form has textfield, selectbox and checkbox currently my search form only got two fields but now i was requested to developed an advanced search form. below is my advanced search form page code <form id="form1" name="form1" method="post" action="view.php"> <table width="473" border="0" cellspacing="4" cellpadding="0"> <tr> <td width="465" valign="top">Keywords : <input type="text" name="textfield"></td> </tr> <tr> <td valign="top">Country : <select name="ccountry"> <option value="Afghanistan">Afghanistan</option> <option value="Albania">Albania</option> <option value="Algeria">Algeria</option> <option value="American Samoa">American Samoa</option> <option value="Andorra">Andorra</option> <option value="Angola">Angola</option> <option value="Anguilla">Anguilla</option> <option value="Antarctica">Antarctica</option> <option value="Antigua and Barbuda">Antigua and Barbuda</option> </select> <br></td> </tr> <tr> <td>Specialization<br> <select name="specialization[]" size="8" class="textfield1" multiple> <? $uSql = "SELECT specialization FROM specialization ORDER by sid ASC"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; } else{ while($uRow = mysql_fetch_row($uResult)){ ?> <option value="<?= $uRow[0]?>"> <?= $uRow[0]?> </option> <? } } ?> </select></td> </tr> <tr> <td>Position Level <select name="level"> <option value="javascript:;" selected>----</option> <? $uSql = "SELECT level FROM level"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; }else{ while($uRow = mysql_fetch_array($uResult)){ ?> <option value="<?= $uRow[level]?>"> <?= $uRow[level]?> </option> <? } } ?> </select></td> </tr> <tr> <td>Job Type <span class="text3"> <input type="checkbox" name="jtype1" value="Permanent" > Permanent <input type="checkbox" name="jtype2" value="Contract" /> Contract <input type="checkbox" name="jtype3" value="Part-Time" /> Part-Time </span></td> </tr> <tr> <td><input type="submit" name="Submit" value="Submit"></td> </tr> </table> </form> and below is the current code of my view page wherein the fields that i only have is keywords and specialization <?php include '../admean/db_connect.php'; $cond = ''; if($_POST['specialization'] != ''){ $cond = " AND specialization = '". $_POST['specialization'] ."'"; } $sql = "SELECT * FROM job_ads WHERE j_position LIKE '%". $_POST['keywords'] ."%'".$cond; $query = mysql_query($sql) OR die(mysql_error()); //$uResult = mysql_query($uSql, $connection); $numRows = mysql_num_rows($query); if($numRows < 1){ echo "<font color=\"FF0000\">Sorry, there are no matches. Please try again.</font><br />\n"; }else{ while($row = mysql_fetch_array($query)){ echo $row['j_position'] .", ". $row['specialization'] .", ". $row['date_posted'] ." etc..etc..."; } } ?> my problem in the advanced search is if the user selects more than 1 item in the select box and more that 1 item in the checkbox also with that, i dont know what codes do i need to add here. need help on this. thanks!
  8. guys, any other simple mailform that has email and textfield validation there? i currently have a mailform that is working on php4-5 only but its not working on lower and higher version specifically with the getmxrr syntax below is my current code and i hope you can help me with this since the current php that i am using is higher <?php include("validate.php"); $yname = $_POST['yname']; $yemail = $_POST['yemail']; $ycontact = $_POST['ycontact']; $inquiry = $_POST['inquiry']; $cname = $_POST['cname']; $cemail = $_POST['cemail']; $ccontact = $_POST['ccontact']; $cskills = $_POST['cskills']; $recipient = $_POST['recipient']; $cc = $_POST['cc']; if ($yname=='' or $yemail=='' or $ycontact=='') { error ('Some required fields are blank.\\n'. 'Please fill them in and try again.'); } if(!yemail_is_valid($yemail)) { error ('Please use a valid Email Address'); } $Message = ""; $Message .= "An Email from: $yname\n"; $Message .= "Contact Number: $ycontact\n"; $Message .= "Email Address: $yemail\n"; $ip = getenv("REMOTE_ADDR"); $Message .="IP address:".$ip."\n"; $Message .= "\n\n"; $Message .= "Type of scheme: $inquiry\n"; $Message .= "Candidate name: $cname\n"; $Message .= "Candidate contact number: $ccontact\n"; $Message .= "Candidate email: $cemail\n"; $Message .= "Candidate skills: $cskills\n"; $Message .= "\n\n"; $Message .= "Additional Questions/Inquiries: $additional\n"; $Message .= "\n\n"; $Header = $yemail; $To = "$recipient, $cc"; $Subject = "JH Referral Scheme"; // mail($To,$Subject,$Message,"From: $Header","-f $EmailAdd"); last parameter might not be supported mail($To,$Subject,$Message,"From: $Header"); echo '<script language=javascript> alert("Your message has been sent!");top.location = "referral.php?id=3";</script>'; function yemail_is_valid ($yemail) { if(eregi("^[0-9a-z_]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$", $yemail, $check)){ if ( getmxrr(substr(strstr($check[0], '@'), 1), $validate_yemail_temp) ) { return TRUE; } // THIS WILL CATCH DNSs THAT ARE NOT MX. if(checkdnsrr(substr(strstr($check[0], '@'), 1),"ANY")){ return TRUE; } } return FALSE; } ?> thanks!
  9. hi, i corrected it already but its still popping up the error message regardless whether the form is complete or not. this is the current code that i have now <?php include("validate.php"); $yname = $_POST['yname']; $email = $_POST['yemail']; $ycontact = $_POST['ycontact']; $inquiry = $_POST['inquiry']; $cname = $_POST['cname']; $cemail = $_POST['cemail']; $ccontact = $_POST['ccontact']; $cskills = $_POST['cskills']; $recipient = $_POST['recipient']; $cc = $_POST['cc']; if ($yname=='' or $yemail=='' or $yemail=='') { error ('Some required fields are blank.\\n'. 'Please fill them in and try again.'); } $Message = ""; $Message .= "An Email from: $yname\n"; $Message .= "Contact Number: $ycontact\n"; $Message .= "Email Address: $yemail\n"; $ip = getenv("REMOTE_ADDR"); $Message .="IP address:".$ip."\n"; $Message .= "\n\n"; $Message .= "Type of scheme: $inquiry\n"; $Message .= "Candidate name: $cname\n"; $Message .= "Candidate contact number: $ccontact\n"; $Message .= "Candidate email: $cemail\n"; $Message .= "Candidate skills: $cskills\n"; $Message .= "\n\n"; $Message .= "Additional Questions/Inquiries: $additional\n"; $Message .= "\n\n"; $Header = $yemail; $To = "$recipient, $cc"; $Subject = "JH Referral Scheme"; // mail($To,$Subject,$Message,"From: $Header","-f $EmailAdd"); last parameter might not be supported mail($To,$Subject,$Message,"From: $Header"); echo '<script language=javascript> alert("Your message has been sent!");top.location = "referral.php?id=3";</script>'; function email_is_valid ($email) { if(eregi("^[0-9a-z_]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$", $yemail, $check)){ if ( getmxrr(substr(strstr($check[0], '@'), 1), $validate_email_temp) ) { return TRUE; } // THIS WILL CATCH DNSs THAT ARE NOT MX. if(checkdnsrr(substr(strstr($check[0], '@'), 1),"ANY")){ return TRUE; } } return FALSE; } ?>
  10. hi i tried this but the error message keeps on popping regardless whether i complete the form or not this is my current code now <?php include 'validate.php'; $yname = $_POST['yname']; $email = $_POST['yemail']; $ycontact = $_POST['ycontact']; $inquiry = $_POST['inquiry']; $cname = $_POST['cname']; $cemail = $_POST['cemail']; $ccontact = $_POST['ccontact']; $cskills = $_POST['cskills']; $recipient = $_POST['recipient']; $cc = $_POST['cc']; if ($yname=='' or $yemail=='' or $yemail=='') { error ('Some required fields are blank.\\n'. 'Please fill them in and try again.'); } $Message = ""; $Message .= "An Email from: $yname\n"; $Message .= "Contact Number: $ycontact\n"; $Message .= "Email Address: $yemail\n"; $ip = getenv("REMOTE_ADDR"); $Message .="IP address:".$ip."\n"; $Message .= "\n\n"; $Message .= "Type of scheme: $inquiry\n"; $Message .= "Candidate name: $cname\n"; $Message .= "Candidate contact number: $ccontact\n"; $Message .= "Candidate email: $cemail\n"; $Message .= "Candidate skills: $cskills\n"; $Message .= "\n\n"; $Message .= "Additional Questions/Inquiries: $additional\n"; $Message .= "\n\n"; $Header = $yemail; $To = "$recipient, $cc"; $Subject = "JH Referral Scheme"; // mail($To,$Subject,$Message,"From: $Header","-f $EmailAdd"); last parameter might not be supported mail($To,$Subject,$Message,"From: $Header"); echo '<script language=javascript> alert("Your message has been sent!");top.location = "referral.php?id=3";</script>'; function email_is_valid ($email) { if(eregi("^[0-9a-z_]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$", $yemail, $check)){ if ( getmxrr(substr(strstr($check[0], '@'), 1), $validate_email_temp) ) { return TRUE; } // THIS WILL CATCH DNSs THAT ARE NOT MX. if(checkdnsrr(substr(strstr($check[0], '@'), 1),"ANY")){ return TRUE; } } return FALSE; } ?> and this is what's inside validate.php <?php function error($msg) { ?> <script language="JavaScript"> <!-- alert("<?php echo ($msg) ?> "); history.back(); --> </script> <?php exit; } ?> did i make it right?
  11. hi, i tried using your codes but regardless whether i complete the form or not it always prompts the error message what's wrong with my code? need help. this is the current code that i have <?php $yname = $_POST['yname']; $email = $_POST['yemail']; $ycontact = $_POST['ycontact']; $inquiry = $_POST['inquiry']; $cname = $_POST['cname']; $cemail = $_POST['cemail']; $ccontact = $_POST['ccontact']; $cskills = $_POST['cskills']; $recipient = $_POST['recipient']; $cc = $_POST['cc']; if ($yname=='' or $yemail=='' or $yemail=='') { error ('Some required fields are blank.\\n'. 'Please fill them in and try again.'); } ?> <?php function error($msg) { ?> <script language="JavaScript"> <!-- alert("<?php echo ($msg) ?> "); history.back(); --> </script> <?php exit; } ?> <? $Message = ""; $Message .= "An Email from: $yname\n"; $Message .= "Contact Number: $ycontact\n"; $Message .= "Email Address: $yemail\n"; $ip = getenv("REMOTE_ADDR"); $Message .="IP address:".$ip."\n"; $Message .= "\n\n"; $Message .= "Type of scheme: $inquiry\n"; $Message .= "Candidate name: $cname\n"; $Message .= "Candidate contact number: $ccontact\n"; $Message .= "Candidate email: $cemail\n"; $Message .= "Candidate skills: $cskills\n"; $Message .= "\n\n"; $Message .= "Additional Questions/Inquiries: $additional\n"; $Message .= "\n\n"; $Header = $yemail; $To = "$recipient, $cc"; $Subject = "JH Referral Scheme"; // mail($To,$Subject,$Message,"From: $Header","-f $EmailAdd"); last parameter might not be supported mail($To,$Subject,$Message,"From: $Header"); echo '<script language=javascript> alert("Your message has been sent!");top.location = "referral.php?id=3";</script>'; function email_is_valid ($email) { if(eregi("^[0-9a-z_]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$", $yemail, $check)){ if ( getmxrr(substr(strstr($check[0], '@'), 1), $validate_email_temp) ) { return TRUE; } // THIS WILL CATCH DNSs THAT ARE NOT MX. if(checkdnsrr(substr(strstr($check[0], '@'), 1),"ANY")){ return TRUE; } } return FALSE; } ?> thanks!
  12. hi its working now but i am getting an error when sending the complete and correct information this is the error message that i am getting from line 54 Fatal error: Call to undefined function: getmxrr() in c:\hosting\webhost4life\member\diorgrace\new\referral\referralsend.php on line 54 what does this mean? this is the current code that i have for this page <?php $yname = $_POST['yname']; $email = $_POST['email']; $ycontact = $_POST['ycontact']; $inquiry = $_POST['inquiry']; $cname = $_POST['cname']; $cemail = $_POST['cemail']; $ccontact = $_POST['ccontact']; $cskills = $_POST['cskills']; $recipient = $_POST['recipient']; $cc = $_POST['cc']; if (($yname == "") || ($email == "") || ($ycontact == "")) { echo '<script language=javascript> alert("Please complete the form!");history.back();</script>'; exit; } if(!email_is_valid($email)) { echo '<script language=javascript> alert("Please use a valid email address!");history.back();</script>'; exit; } $Message = ""; $Message .= "An Email from: $yname\n"; $Message .= "Contact Number: $ycontact\n"; $Message .= "Email Address: $email\n"; $ip = getenv("REMOTE_ADDR"); $Message .="IP address:".$ip."\n"; $Message .= "\n\n"; $Message .= "Type of scheme: $inquiry\n"; $Message .= "Candidate name: $cname\n"; $Message .= "Candidate contact number: $ccontact\n"; $Message .= "Candidate email: $cemail\n"; $Message .= "Candidate skills: $cskills\n"; $Message .= "\n\n"; $Message .= "Additional Questions/Inquiries: $additional\n"; $Message .= "\n\n"; $Header = $email; $To = "$recipient, $cc"; $Subject = "JH Referral Scheme"; // mail($To,$Subject,$Message,"From: $Header","-f $EmailAdd"); last parameter might not be supported mail($To,$Subject,$Message,"From: $Header"); echo '<script language=javascript> alert("Your message has been sent!");top.location = "referral.php?id=3";</script>'; function email_is_valid ($email) { if(eregi("^[0-9a-z_]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$", $email, $check)){ if ( getmxrr(substr(strstr($check[0], '@'), 1), $validate_email_temp) ) { return TRUE; } // THIS WILL CATCH DNSs THAT ARE NOT MX. if(checkdnsrr(substr(strstr($check[0], '@'), 1),"ANY")){ return TRUE; } } return FALSE; } ?> hope you could help me with this. thanks!
  13. guys, i need help on my form, i wanted to place an validation message beside my text area instead of displaying the error message on a separate page. currently my error message is being displayed on a separate page and what happens is when the error message appear, the user has to manually click back to the form and retype the entire form. how do i do this? this is the current code in my form and i wanted to have the validation message beside the name, email and contact of the personal information field form method="post" action="referral.php?id=4"> <table width="494" border="0" cellspacing="2" cellpadding="0"> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2" align="center" bgcolor="#e5e5e5" class="text7">Please make sure that correct information is supplied so we can get back to you. </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2" bgcolor="#F7F7F7" class="text6">Your Personal Information </td> </tr> <tr> <td colspan="2" valign="top" class="text6"><img src="../images/main/spacer.gif" width="8" height="6" /></td> </tr> <tr> <td width="119" align="right" class="text6">name : </td> <td width="369"><span class="text6"> <input name="yname" type="text" class="field3" /> </span></td> </tr> <tr> <td align="right" class="text6">email : </td> <td><input name="yemail" type="text" class="field3" /></td> </tr> <tr> <td align="right" class="text6">contact number : </td> <td><input name="ycontact" type="text" class="field3" /></td> </tr> <tr> <td align="right" class="text6">type of scheme : </td> <td><select name="inquiry" class="field3"> <option value="Refer a Friend" selected="selected">--Refer a Friend--</option> <option value="Associate Program">--Associate Program--</option> </select></td> </tr> <tr> <td align="right" class="text6"> </td> <td> </td> </tr> <tr> <td colspan="2" bgcolor="#F7F7F7" class="text6">Your Candidate Information </td> </tr> <tr> <td colspan="2" valign="top" class="text6"><img src="../images/main/spacer.gif" width="8" height="6" /></td> </tr> <tr> <td width="119" align="right" class="text6">name : </td> <td><span class="text6"> <input name="cname" type="text" class="field3" /> </span></td> </tr> <tr> <td width="119" align="right" class="text6">email : </td> <td><input name="cemail" type="text" class="field3" /></td> </tr> <tr> <td width="119" align="right" class="text6">contact number : </td> <td><input name="ccontact" type="text" class="field3" /></td> </tr> <tr> <td width="119" align="right" valign="top" class="text6">profession/ skills : </td> <td><textarea name="cskills" cols="35" rows="5" class="field3"></textarea></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td colspan="2" bgcolor="#F7F7F7" class="text6">If you have additonal questions/ inquiries, please type it here </td> </tr> <tr> <td colspan="2" valign="top" class="text6"><img src="../images/main/spacer.gif" width="8" height="6" /></td> </tr> <tr> <td> </td> <td><textarea name="additonal" cols="35" rows="5" class="field3"></textarea></td> </tr> <tr> <td> </td> <td><input name="Submit" type="submit" class="button1" value="Submit" /> <input type="hidden" name="recipient" value="pixeltrace@gmail.com" /> <input type="hidden" name="cc" value="pixeltrace@gmail.com" /> </td> </tr> <tr> <td colspan="2"> </td> </tr> </table> </form> and this is the current code of my referralsend.php here i would like to happen here is the validation will just be done on the form page and referralsend.php will just need to send all the information. <?php $yname = $_POST['yname']; $yemail = $_POST['yemail']; $ycontact = $_POST['ycontact']; $inquiry = $_POST['inquiry']; $cname = $_POST['cname']; $cemail = $_POST['cemail']; $ccontact = $_POST['ccontact']; $cskills = $_POST['cskills']; $recipient = $_POST['recipient']; $cc = $_POST['cc']; echo "<CENTER>"; if (($yname == "") || ($yemail == "") || ($ycontact == "")) { echo '<br><br><span class="text7">Please complete the form. Thanks!</span><br>'; exit; } if(!email_is_valid($yemail)) { echo '<br><br><span class="text7"><br>Email Address Invalid.<br>Please use a valid Email Address</span><br>'; exit; } $Message = ""; $Message .= "An Email from: $yname\n"; $Message .= "Contact Number: $ycontact\n"; $Message .= "Email Address: $yemail\n"; $ip = getenv("REMOTE_ADDR"); $Message .="IP address:".$ip."\n"; $Message .= "\n\n"; $Message .= "Type of scheme: $inquiry\n"; $Message .= "Candidate name: $cname\n"; $Message .= "Candidate contact number: $ccontact\n"; $Message .= "Candidate email: $cemail\n"; $Message .= "Candidate skills: $cskills\n"; $Message .= "\n\n"; $Message .= "Additional Questions/Inquiries: $additional\n"; $Message .= "\n\n"; $Header = $email; $To = "$recipient, $cc"; $Subject = "JH Referral Scheme"; // mail($To,$Subject,$Message,"From: $Header","-f $EmailAdd"); last parameter might not be supported mail($To,$Subject,$Message,"From: $Header"); echo '<script language=javascript> alert("Your message has been sent!");top.location = "referral.php?id=3";</script>'; function email_is_valid ($email) { if(eregi("^[0-9a-z_]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$", $email, $check)){ if ( getmxrr(substr(strstr($check[0], '@'), 1), $validate_email_temp) ) { return TRUE; } // THIS WILL CATCH DNSs THAT ARE NOT MX. if(checkdnsrr(substr(strstr($check[0], '@'), 1),"ANY")){ return TRUE; } } return FALSE; } ?> hope you could help me with this. thanks a lot!
  14. this is the current code that i have now for addresume.php <? session_start(); if (session_is_registered("username")){ }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='../index.php'>Login</a></font>"; } include '../db_connect.php'; $email1 = $_POST['email1']; $email2 = $_POST['email2']; $password1 = $_POST['password1']; $password2 = $_POST['password2']; $fname = $_POST['fname']; $lname = $_POST['lname']; $daybirth = $_POST['daybirth']; $monthbirth = $_POST['monthbirth']; $yearbirth = $_POST['yearbirth']; $gender = $_POST['gender']; $country = $_POST['country']; $state = $_POST['state']; $specialization = implode("\n", $_POST['specialization']); $level = $_POST['level']; //$photofile = $_POST['photofile']; //$resume = $_POST['resume']; $learned = $_POST['learned']; $dateregistered = date('Y-m-d'); // 0000-00-00 $datebirth = $yearbirth.'-'.$monthbirth.'-'.$daybirth; //email verification 1 if ($email1 == $email2){ $email = $email1; $username = $email1; }else { echo '<script language=javascript>alert("Email Address does not match!");top.location = "../resumemngr.php?id=1";</script>'; } //email verification 2 $sql_username_check = mysql_query("SELECT username FROM applicant WHERE email='$email'"); $username_check = mysql_num_rows($sql_username_check); if($username_check > 0){ echo '<script language=javascript> alert("Email is already used!");top.location = "../resumemngr.php?id=1";</script>'; unset($username); exit(); } //password verification if ($password1 == $password2){ $password = ($password1); }else { echo '<script language=javascript>alert("Password does not match!");top.location = "../resumemngr.php?id=1";</script>'; } //set this to the directory where resume files will be uploaded //directory path $uploaddir = '../../../uploads/'; //get the dirrectory to send file to and the file name $uploadfile = $uploaddir . basename($_FILES['resume']['name']); // get the current file information. $file=$uploadfile; //get the . and file exstention. $ext = substr($file, -4); //convert varable to the uplaoded directory the new id and extention. $uploadfile=$uploaddir.$fname.$lname.$ext; //rename the file to the new one. @rename($file,$uploadfile); // if all the conditions are correct send the file to the directory. if(move_uploaded_file($_FILES['resume']['tmp_name'], $uploadfile)) { echo "The file ". basename( $_FILES['resume']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } //set this to the directory where photo files will be uploaded $uploaddir = '../../../uploads/'; $uploadfile = $uploaddir . basename($_FILES['photofile']['name']); // get the current file information. $file=$uploadfile; //get the . and file exstention. $ext = substr($file, -4); //convert varable to the uplaoded directory the new id and extention. $uploadfile=$uploaddir.$fname.$lname.$ext; //rename the file to the new one. @rename($file,$uploadfile); // if all the conditions are correct send the file to the directory. if(move_uploaded_file($_FILES['photofile']['tmp_name'], $uploadfile)) { echo "The file ". basename( $_FILES['photofile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } $email = stripslashes($email); $username = stripslashes($username); $password = stripslashes($password); $fname = stripslashes($fname); $lname = stripslashes($lname); $datebirth = stripslashes($datebirth); $gender = stripslashes($gender); $country = stripslashes($country); $state = stripslashes($state); $specialization = stripslashes($specialization); $level = stripslashes($level); //$photofile = stripslashes($photofile); //$resume = stripslashes($resume); $learned = stripslashes($learned); $dateregistered = stripslashes($dateregistered); $db_password = md5($password); $sql = mysql_query("INSERT INTO applicant (email, username, password, fname, lname, datebirth, gender, country, state, specialization, level, learned, dateregistered ) VALUES('$email', '$username', '$db_password', '$fname', '$lname', '$datebirth', '$gender', '$country', '$state', '$specialization', '$level', '$learned', '$dateregistered')") or die (mysql_error()); if(!$sql){ echo '<script language=javascript> alert("Error adding applicant");top.location = "../resumemngr.php?id=1";</script>'; exit(); } else { $appid = mysql_insert_id(); echo '<script language=javascript> alert("New Applicant has been added by!");top.location = "../resumemngr.php?id=1";</script>'; } ?> i was able to have it renamed using firstname and lastname but i dont know how to rename it using appid since the INSERT query is after the renaming and uploading of the file how do i do this? need help please! thanks!
  15. hi, can you help me with the codes? i dont know what the code is thanks!
  16. guys, i need help. i have a form that is used as a resume/ picture/ new application uploader currently the files (resume and picturefile) is being uploaded and renamed via the applicants firstname-lastname now my problem is i dont know how to rename the files using ID since the the process is the files or application must be uploaded first before an ID for that is created thats why in my current code i used firstname and lastname to rename it but my problem is if the applicants got the same names so i was thinking of renaming the files via ID and not firstname-lastname this is the current code of my form <form action="client/addclient.php" method="post" id="add" name="add"> <table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> <td width="214" valign="top"><table width="558" border="0" cellspacing="2" cellpadding="3"> <tr> <td colspan="3" valign="top"><img src="images/spacer.gif" width="10" height="1" /></td> </tr> <tr> <td colspan="3" bgcolor="#999999" class="text2">CLIENT INFORMATION </td> </tr> <tr> <td colspan="3" valign="top"><img src="images/spacer.gif" width="10" height="10" /></td> </tr> <tr> <td width="119" align="right" valign="top" class="text6">Date Joined : </td> <td> </td> <td class="text7"><select name="dayjoined"> <option value='1'>1</option> <option value='2'>2</option> <option value='3'>3</option> <option value='4'>4</option> <option value='5'>5</option> <option value='6'>6</option> <option value='7'>7</option> <option value='8'>8</option> <option value='9'>9</option> <option value='10'>10</option> <option value='11'>11</option> <option value='12'>12</option> <option value='13'>13</option> <option value='14'>14</option> <option value='15'>15</option> <option value='16'>16</option> <option value='17'>17</option> <option value='18'>18</option> <option value='19'>19</option> <option value='20'>20</option> <option value='21'>21</option> <option value='22'>22</option> <option value='23'>23</option> <option value='24'>24</option> <option value='25'>25</option> <option value='26'>26</option> <option value='27'>27</option> <option value='28'>28</option> <option value='29'>29</option> <option value='30'>30</option> <option value='31'>31</option> </select> <select name="monthjoined"> <option value='01'>Jan</option> <option value='02'>Feb</option> <option value='03'>Mar</option> <option value='04'>Apr</option> <option value='05'>May</option> <option value='06'>Jun</option> <option value='07'>Jul</option> <option value='08'>Aug</option> <option value='09'>Sep</option> <option value='10'>Oct</option> <option value='11'>Nov</option> <option value='12'>Dec</option> </select> <select name="yearjoined"> <?php for($i=2001; $i<=date("Y"); $i++){ print '<option value="'.$i.'"'; if($yearText == $i){ print ' selected'; } print '>'.$i.'</option>'; } ?> </select></td> </tr> <tr> <td align="right" valign="top" class="text6">Company Name: </td> <td width="5" rowspan="2"> </td> <td width="396"><span class="text7"> <input name="cname" type="text" size="50" /> </span></td> </tr> <tr> <td align="right" valign="top" class="text6">Address : </td> <td width="396"><textarea name="cadd" cols="50" rows="5"></textarea></td> </tr> <tr> <td align="right" valign="top" class="text6">Telephone No : </td> <td> </td> <td><span class="text7"> <input type="text" name="cphone" /> </span></td> </tr> <tr> <td align="right" valign="top" class="text6">Fax : </td> <td> </td> <td><span class="text7"> <input type="text" name="cfax" /> </span></td> </tr> <tr> <td align="right" valign="top" class="text6">Website : </td> <td> </td> <td><span class="text7"> <input type="text" name="cwebsite" /> </span></td> </tr> <tr> <td align="right"><span class="text6">Country : </span></td> <td> </td> <td><select name="ccountry"> <option value="AF">Afghanistan</option> <option value="AL">Albania</option> <option value="DZ">Algeria</option> <option value="AS">American Samoa</option> <option value="AD">Andorra</option> <option value="AO">Angola</option> <option value="AI">Anguilla</option> <option value="AQ">Antarctica</option> <option value="AG">Antigua and Barbuda</option> <option value="AR">Argentina</option> <option value="AM">Armenia</option> <option value="AW">Aruba</option> <option value="AU">Australia</option> <option value="AT">Austria</option> <option value="AZ">Azerbaijan</option> <option value="BS">Bahamas</option> <option value="BH">Bahrain</option> <option value="BD">Bangladesh</option> <option value="BB">Barbados</option> <option value="BY">Belarus</option> <option value="BE">Belgium</option> <option value="BZ">Belize</option> <option value="BJ">Benin</option> <option value="BM">Bermuda</option> <option value="BT">Bhutan</option> <option value="BO">Bolivia</option> <option value="BA">Bosnia Hercegovina</option> <option value="BW">Botswana</option> <option value="BV">Bouvet Island</option> <option value="BR">Brazil</option> <option value="IO">British Indian Ocean Territory</option> <option value="BN">Brunei Darussalam</option> <option value="BG">Bulgaria</option> <option value="BF">Burkina Faso</option> <option value="BI">Burundi</option> <option value="KH">Cambodia</option> <option value="CM">Cameroon</option> <option value="CA">Canada</option> <option value="CV">Cape Verde</option> <option value="KY">Cayman Islands</option> <option value="CF">Central African Republic</option> <option value="TD">Chad</option> <option value="CL">Chile</option> <option value="CN">China</option> <option value="CX">Christmas Island</option> <option value="CC">Cocos (Keeling) Islands</option> <option value="CO">Colombia</option> <option value="KM">Comoros</option> <option value="CG">Congo</option> <option value="CK">Cook Islands</option> <option value="CR">Costa Rica</option> <option value="CI">Cote D'ivoire</option> <option value="HR">Croatia</option> <option value="CU">Cuba</option> <option value="CY">Cyprus</option> <option value="CZ">Czech Republic</option> <option value="DK">Denmark</option> <option value="DJ">Djibouti</option> <option value="DM">Dominica</option> <option value="DO">Dominican Republic</option> <option value="TP">East Timor</option> <option value="EC">Ecuador</option> <option value="EG">Egypt</option> <option value="SV">EL Salvador</option> <option value="GQ">Equatorial Guinea</option> <option value="ER">Eritrea</option> <option value="EE">Estonia</option> <option value="ET">Ethiopia</option> <option value="FK">Falkland Islands (Malvinas)</option> <option value="FO">Faroe Islands</option> <option value="FJ">Fiji</option> <option value="FI">Finland</option> <option value="FR">France</option> <option value="GF">French Guiana</option> <option value="PF">French Polynesia</option> <option value="TF">French Southern Territories</option> <option value="GA">Gabon</option> <option value="GM">Gambia</option> <option value="GE">Georgia</option> <option value="DE">Germany</option> <option value="GH">Ghana</option> <option value="GI">Gibraltar</option> <option value="GR">Greece</option> <option value="GL">Greenland</option> <option value="GD">Grenada</option> <option value="GP">Guadeloupe</option> <option value="GU">Guam</option> <option value="GT">Guatemala</option> <option value="GN">Guinea</option> <option value="GW">Guinea-Bissau</option> <option value="GY">Guyana</option> <option value="HT">Haiti</option> <option value="HM">Heard and Mc Donald Islands</option> <option value="HN">Honduras</option> <option value="HK">Hong Kong</option> <option value="HU">Hungary</option> <option value="IS">Iceland</option> <option value="IN">India</option> <option value="ID">Indonesia</option> <option value="IR">Iran</option> <option value="IQ">Iraq</option> <option value="IE">Ireland</option> <option value="IL">Israel</option> <option value="IT">Italy</option> <option value="JM">Jamaica</option> <option value="JP">Japan</option> <option value="JO">Jordan</option> <option value="KZ">Kazakhstan</option> <option value="KE">Kenya</option> <option value="KI">Kiribati</option> <option value="KP">Korea (North)</option> <option value="KR">Korea (South)</option> <option value="KW">Kuwait</option> <option value="KG">Kyrgyzstan</option> <option value="LA">Laos</option> <option value="LV">Latvia</option> <option value="LB">Lebanon</option> <option value="LS">Lesotho</option> <option value="LR">Liberia</option> <option value="LY">Libyan Arab Jamahiriya</option> <option value="LI">Liechtenstein</option> <option value="LT">Lithuania</option> <option value="LU">Luxembourg</option> <option value="MO">Macau</option> <option value="MK">Macedonia</option> <option value="MG">Madagascar</option> <option value="MW">Malawi</option> <option value="MY">Malaysia</option> <option value="MV">Maldives</option> <option value="ML">Mali</option> <option value="MT">Malta</option> <option value="MH">Marshall Islands</option> <option value="MQ">Martinique</option> <option value="MR">Mauritania</option> <option value="MU">Mauritius</option> <option value="YT">Mayotte</option> <option value="MX">Mexico</option> <option value="FM">Micronesia</option> <option value="MC">Monaco</option> <option value="MN">Mongolia</option> <option value="MS">Montserrat</option> <option value="MA">Morocco</option> <option value="MZ">Mozambique</option> <option value="MM">Myanmar</option> <option value="NA">Nambia</option> <option value="NR">Nauru</option> <option value="NP">Nepal</option> <option value="NL">Netherlands</option> <option value="AN">Netherlands Antilles</option> <option value="NC">New Caledonia</option> <option value="NZ">New Zealand</option> <option value="NI">Nicaragua</option> <option value="NE">Niger</option> <option value="NG">Nigeria</option> <option value="NU">Niue</option> <option value="NF">Norfolk Island</option> <option value="MP">Northern Mariana Islands</option> <option value="NO">Norway</option> <option value="OM">Oman</option> <option value="OT">Others</option> <option value="PK">Pakistan</option> <option value="PW">Palau</option> <option value="PS">Palestinian Territory, Occupied</option> <option value="PA">Panama</option> <option value="PG">Papua New Guinea</option> <option value="PY">Paraguay</option> <option value="PE">Peru</option> <option value="PH">Philippines</option> <option value="PN">Pitcairn</option> <option value="PL">Poland</option> <option value="PT">Portugal</option> <option value="PR">Puerto Rico</option> <option value="QA">Qatar</option> <option value="MD">Republic Of Moldova</option> <option value="RE">Reunion</option> <option value="RO">Romania</option> <option value="RU">Russia</option> <option value="RW">Rwanda</option> <option value="KN">Saint Kitts And Nevis</option> <option value="LC">Saint Lucia</option> <option value="VC">Saint Vincent and The Grenadines</option> <option value="WS">Samoa</option> <option value="SM">San Marino</option> <option value="ST">Sao Tome and Principe</option> <option value="SA">Saudi Arabia</option> <option value="SN">Senegal</option> <option value="SC">Seychelles</option> <option value="SL">Sierra Leone</option> <option value="SG" selected="selected">Singapore</option> <option value="SK">Slovakia</option> <option value="SI">Slovenia</option> <option value="SB">Solomon Islands</option> <option value="SO">Somalia</option> <option value="ZA">South Africa</option> <option value="GS">South Georgia And South Sandwich Islands</option> <option value="ES">Spain</option> <option value="LK">Sri Lanka</option> <option value="SH">St. Helena</option> <option value="PM">St. Pierre and Miquelon</option> <option value="SD">Sudan</option> <option value="SR">Suriname</option> <option value="SJ">Svalbard and Jan Mayen Islands</option> <option value="SZ">Swaziland</option> <option value="SE">Sweden</option> <option value="CH">Switzerland</option> <option value="SY">Syrian Arab Republic</option> <option value="TW">Taiwan</option> <option value="TJ">Tajikistan</option> <option value="TZ">Tanzania</option> <option value="TH">Thailand</option> <option value="TG">TOGO</option> <option value="TK">Tokelau</option> <option value="TO">Tonga</option> <option value="TT">Trinidad and Tobago</option> <option value="TN">Tunisia</option> <option value="TR">Turkey</option> <option value="TM">Turkmenistan</option> <option value="TC">Turks and Caicos Islands</option> <option value="TV">Tuvalu</option> <option value="UG">Uganda</option> <option value="UA">Ukraine</option> <option value="AE">United Arab Emirates</option> <option value="GB">United Kingdom</option> <option value="US">United States</option> <option value="UM">United States Minor Outlying Islands</option> <option value="UY">Uruguay</option> <option value="UZ">Uzbekistan</option> <option value="VU">Vanuatu</option> <option value="VA">Vatican City State (Holy See)</option> <option value="VE">Venezuela</option> <option value="VN">Vietnam</option> <option value="VG">Virgin Islands (British)</option> <option value="VI">Virgin Islands (U.S.)</option> <option value="WF">Wallis and Futuna Islands</option> <option value="EH">Western Sahara</option> <option value="YE">Yemen</option> <option value="YU">Yugoslavia</option> <option value="CD">Zaire</option> <option value="ZM">Zambia</option> <option value="ZW">Zimbabwe</option> </select> </td> </tr> <tr> <td colspan="3" align="right" valign="top" class="text6"><img src="images/spacer.gif" width="10" height="10" /></td> </tr> <tr> <td colspan="3" bgcolor="#999999" class="text2">TERMS OF AGREEMENT </td> </tr> <tr> <td colspan="3" align="right" valign="top" class="text6"><img src="images/spacer.gif" width="10" height="10" /></td> </tr> <tr> <td align="right" valign="top" class="text6">Rate Agreed : </td> <td> </td> <td><span class="text7"> <input type="text" name="crate" /> </span></td> </tr> <tr> <td align="right" class="text6">Warranty Period : </td> <td> </td> <td><span class="text7"> <input type="text" name="cwarranty" /> </span></td> </tr> <tr> <td align="right" valign="top" class="text6">Credit Term : </td> <td> </td> <td><span class="text7"> <input type="text" name="cterm" /> </span></td> </tr> <tr> <td align="right" class="text6">Date Signed : </td> <td> </td> <td><span class="text7"> <select name="daysigned"> <option value='1'>1</option> <option value='2'>2</option> <option value='3'>3</option> <option value='4'>4</option> <option value='5'>5</option> <option value='6'>6</option> <option value='7'>7</option> <option value='8'>8</option> <option value='9'>9</option> <option value='10'>10</option> <option value='11'>11</option> <option value='12'>12</option> <option value='13'>13</option> <option value='14'>14</option> <option value='15'>15</option> <option value='16'>16</option> <option value='17'>17</option> <option value='18'>18</option> <option value='19'>19</option> <option value='20'>20</option> <option value='21'>21</option> <option value='22'>22</option> <option value='23'>23</option> <option value='24'>24</option> <option value='25'>25</option> <option value='26'>26</option> <option value='27'>27</option> <option value='28'>28</option> &nbs
  17. another scenario is what if i didnt select any items on the drop down but i just type the word on the keyword area what will be the code for this second scenario. need help please. thanks!
  18. hi, what will be the code if let say i never type anything from the keywords field and just select any item from the drop down. with that i can still view all the list of items that fall on that same category? this is my code for my index.php <form id="form1" name="form1" method="post" action="jobs/view1.php"> Keywords : <input name="keywords" type="text" size="35" /> <br> <br> Job Specialization : <select name="specialization"> <? include 'admean/db_connect.php'; $uSql = "SELECT specialization FROM specialization ORDER by sid"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; }else{ while($uRow = mysql_fetch_array($uResult)){ ?> <option value="<?= $uRow[specialization]?>"><?= $uRow[specialization]?></option> <? } } ?> </select> <input type="submit" name="Submit" value="Search" /> </form> and this is my code for my view1.php <?php include '../admean/db_connect.php'; $sql = "SELECT * FROM job_ads WHERE j_position LIKE '%". $_POST['keywords'] ."%' AND specialization = '". $_POST['specialization'] ."'"; $query = mysql_query($sql) OR die(mysql_error()); //$uResult = mysql_query($uSql, $connection); $numRows = mysql_num_rows($query); if($numRows < 1){ echo "<font color=\"FF0000\">Sorry, there are no matches. Please try again.</font><br />\n"; }else{ while($row = mysql_fetch_array($query)){ echo $row['j_position'] .", ". $row['specialization'] .", ". $row['date_posted'] ." etc..etc..."; } } ?> need help on this. thanks!
  19. i have a related question here. how do i limit the files being uploaded let say i only want jpg, jpeg, gif, doc, or pdf to be uploaded, otherwise the file will be rejected what is the code for this? i have a working codes here but i dont know what codes to add to create a rule on the extension files $target_path = '../../uploads/'; $target_path = $target_path . basename($_FILES['resume']['name']); if(move_uploaded_file($_FILES['resume']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['resume']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } need help on this please. thanks!
  20. guys, i need help on my quick search menu assuming that this is my quick search menu item keywords (textfield) job specialization (list) submit button <form id="form1" name="form1" method="post" action="view.php"> Keywords : <input type="text" name="textfield" /> <br><br> Job Specialization : <select name="select"> <option value="president">president</option> <option value="vice-president">vice-president</option> <option value="director">director</option> <option value="mananger">manager</option> <option value="supervisor">supervisor</option> </select> <input type="submit" name="Submit" value="Search" /> </form> what will be the proper code in view.php normally we usually put the query select and placed the values of the keywords, job specialization but i dont have any idea how to construct it considering the possibility that if there is no data found how do i show the word no item found on the page and assuming the data from my database has 2 words but the user only input the first word how will the codes in view.php function that whether they type the first or second word only you can still be able to view the item hope you guys can help me with this thanks a lot!
×
×
  • 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.