Jump to content

pixeltrace

Members
  • Posts

    577
  • Joined

  • Last visited

    Never

Everything posted by pixeltrace

  1. guys, i need help, i have a checkbox for 'j_type' which is in my update form page. on that form i have a row there that will display the current job type now in my process page i have a if else condition there that if none of the check box was checked the current value on the current job_type will be the value to be updated. below is my codes for the update form page <form action="job/updatejob.php" method="post"> <tr> <td align="right" valign="top" class="text6">Job Type :</td> <td> </td> <td class="text3"> <input type="checkbox" name="jtype[]" value="Permanent"> Permanent <input type="checkbox" name="jtype[]" value="Contract"> Contract <input type="checkbox" name="jtype[]2" value="Part-Time" /> Part-Time</td> </tr> <tr> <td align="right" valign="top" class="text6">Current Job Type :</td> <td> </td> <td class="text3"> <? $ljtype = explode(", ",$j_type); echo implode(",",$ljtype) ; ?> </td> </tr> <tr> <td rowspan="2"> </td> <td rowspan="2"> </td> <td><input type="submit" name="Submit" value="save" /> <input type="hidden" name="username" value="<? echo "$username"; ?>"> <input type="hidden" name="jobid" value="<? echo "$jobid"; ?>"> <input type="hidden" name="ljtypt" value="<? echo "$ljtype"; ?>"> </td> </tr> and this is the condition code that i have in my updatejob.php <? $ljtype = $_GET['ljtype']; $jtype = $_POST['jtype']; if ($jtype == "") { $jtype = "$ljtype" ; } else { $jtype = implode(",\n", $_POST['jtype']); } include '../db_connect.php'; $sql="UPDATE job_ads SET j_position='$jposition', c_name='$cname', cperson='$cperson', specialization='$specialization', level='$level', industry='$industry', c_description='$cdescription', j_requirements='$jrequirements', j_responsibilities='$jresponsibilities', j_type='$jtype', salary='$salary', location = '$location', country='$country', date_posted='$dateposted', date_closed='$dateclosed', j_status='$jstatus', remarks='$remarks', staff_updated='$staff_updated', date_updated='$date_updated' WHERE jobid='$jobid'"; mysql_query($sql) or die("error:".mysql_error()); ?> whats wrong in my codes. hope you could help me with this. thanks!
  2. still not working. you know its kinda weird because in my other drop down its working. my problem is just for this one
  3. guys, i have a problem on my drop down list. i have a drop down list dor a drop menu named 'date_updated' and it is in my updateform page the current value is being taken from the database my problem is, you can see the curren value from the drop down list but if you dont modify or select a new item from the drop down and just submit the current date_updated that is displayed the date_updated will be set to nothing. meaning if i checked my database, the value for the date_updated field is blank which, the current value should still be there since i didnt change anything to it below is my codes for this form <select name="dayposted"> <option value="<? echo "$day_posted";?>" selected><? echo "$day_posted";?></option> <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> and this is the code for my query <? include 'db_connect.php'; $query = mysql_query("SELECT staff_created, j_position, c_name, cperson, specialization, level, industry, c_description, j_requirements, j_responsibilities, j_type, salary, location, DAY(date_posted), MONTH(date_posted), DATE_FORMAT(date_posted,'%b'), YEAR(date_posted), DAY(date_closed), MONTH(date_closed), DATE_FORMAT(date_closed,'%b'), YEAR(date_closed), j_status, remarks FROM job_ads WHERE jobid= '$jobid'") or die(mysql_error()); $row = mysql_fetch_array( $query ); $staff_created = $row["staff_created"]; $j_position = $row["j_position"]; $c_name = $row["c_name"]; $cperson = $row["c_name"]; $specialization = $row["specialization"]; $level = $row["level"]; $industry = $row["industry"]; $c_description = $row["c_description"]; $j_requirements = $row["j_requirements"]; $j_responsibilities = $row["j_responsibilities"]; $j_type = $row["j_type"]; $salary = $row["salary"]; $location = $row["location"]; $day_posted = $row["DAY(date_posted)"]; $month_posted = $row["MONTH(date_posted)"]; $month_posted1 = $row["DATE_FORMAT(date_posted,'%b')"]; $year_posted = $row["YEAR(date_posted)"]; $day_closed = $row["DAY(date_closed)"]; $month_closed = $row["MONTH(date_closed)"]; $month_closed1 = $row["DATE_FORMAT(date_closed,'%b')"]; $year_closed = $row["YEAR(date_closed)"]; $j_status = $row["j_status"]; $remarks = $row["remarks"]; ?> hope you could help me with this. thanks!
  4. its still not working this is the code of my query <? include 'db_connect.php'; $query = mysql_query("SELECT staff_created, j_position, c_name, cperson, specialization, level, industry, c_description, j_requirements, j_responsibilities, j_type, salary, location, DAY(date_posted), MONTH(date_posted), YEAR(date_posted), DAY(date_closed), MONTH(date_closed), YEAR(date_closed), j_status, remarks FROM job_ads WHERE jobid= '$jobid'") or die(mysql_error()); $row = mysql_fetch_array( $query ); $staff_created = $row["staff_created"]; $j_position = $row["j_position"]; $c_name = $row["c_name"]; $cperson = $row["c_name"]; $specialization = $row["specialization"]; $level = $row["level"]; $industry = $row["industry"]; $c_description = $row["c_description"]; $j_requirements = $row["j_requirements"]; $j_responsibilities = $row["j_responsibilities"]; $j_type = $row["j_type"]; $salary = $row["salary"]; $location = $row["location"]; $day_posted = $row["DAY(date_posted)"]; $month_posted = $row["MONTH(date_posted)"]; //$month_posted1 = $row["MONTH(date_posted, %b)"]; $year_posted = $row["YEAR(date_posted)"]; $day_closed = $row["DAY(date_closed)"]; $month_closed = $row["MONTH(date_closed)"]; //$month_closed1 = $row["MONTH(date_closed, %b)"]; $year_closed = $row["YEAR(date_closed)"]; $j_status = $row["j_status"]; $remarks = $row["remarks"]; ?> and this is the code for my checkbox <? if ($j_type == "Permanent") { $j_type1_ck = "checked" ; } else { $j_type1_ck = "" ; } if ($j_type == "Contract") { $j_type2_ck = "checked" ; } else { $j_type2_ck = "" ; } if ($j_type == "Part Time") { $j_type3_ck = "checked" ; } else { $j_type3_ck = "" ; } ?> <input type="checkbox" name="jtype[]" value="Permanent" <? echo $j_type1_ck ; ?>> Permanent <input type="checkbox" name="jtype[]" value="Contract" <? echo $j_type2_ck ; ?>> Contract <input type="checkbox" name="jtype[]" value="Part Time" <? echo $j_type3_ck ; ?>> Part Time what could be wrong here? need help please! thanks!
  5. TRION, i tried this one <? $jtype = $_GET['j_type']; { if ($jtype == "Permanent") { $j_type1_ck = "checked" ; } else { $j_type1_ck = "" ; } if ($jtype == "Contract") { $j_type2_ck = "checked" ; } else { $j_type2_ck = "" ; } if ($jtype == "Part Time") { $j_type3_ck = "checked" ; } else { $j_type3_ck = "" ; } } ?> <input type="checkbox" name="jtype[]" value="Permanent" <? echo $j_type_ck1 ; ?>> Permanent <input type="checkbox" name="jtype[]" value="Contract" <? echo $j_type_ck2 ; ?>> Contract <input type="checkbox" name="jtype[]" value="Part Time" <? echo $j_type_ck3 ; ?>> Part Time but its still not working by the way this is an update page and with that the value of the checkbox should not be taken from the database the only problem that i want to solve is if the value in the database for j_type is permanent contract part time the checkbox "checked" should be added to the checkbox line. hope you could help me with this. thanks in advance!
  6. TRION, ok. I'll try this one. i'll let you know once it worked thanks!
  7. guys, what is the sql query format for date let say i only want to display the month ex $sql = SELECT MONTH(date_posted) what code or syntax should i add so that the value will be in 3-letter text ? thanks!
  8. sorry, i forgot to save my current updateform the name of the checkbox should be jtype[] since i will use implode in my process page for the jtype[] checkbox what can be the solution for this assuming that permanent, contract part time are the current values in my database? hope you could help me on this. thanks in advance!
  9. no, i need checkbox since the user has the option to select the 3 of them also hope you could help me with this
  10. i cannot echo the value since this page is an updateform page. i just need the current value from the database so the user who will update will know what is the current j_type that was checked. this is the code for my query and the current code that i have for my checkboxes <? include 'db_connect.php'; $query = mysql_query("SELECT staff_created, j_position, c_name, cperson, specialization, level, industry, c_description, j_requirements, j_responsibilities, j_type, salary, location, DAY(date_posted), MONTH(date_posted), YEAR(date_posted), DAY(date_closed), MONTH(date_closed), YEAR(date_closed), j_status, remarks FROM job_ads WHERE jobid= '$jobid'") or die(mysql_error()); $row = mysql_fetch_array( $query ); $staff_created = $row["staff_created"]; $j_position = $row["j_position"]; $c_name = $row["c_name"]; $cperson = $row["c_name"]; $specialization = $row["specialization"]; $level = $row["level"]; $industry = $row["industry"]; $c_description = $row["c_description"]; $j_requirements = $row["j_requirements"]; $j_responsibilities = $row["j_responsibilities"]; $j_type = $row["j_type"]; $salary = $row["salary"]; $location = $row["location"]; $day_posted = $row["DAY(date_posted)"]; $month_posted = $row["MONTH(date_posted)"]; $year_posted = $row["YEAR(date_posted)"]; $day_closed = $row["DAY(date_closed)"]; $month_closed = $row["MONTH(date_closed)"]; $year_closed = $row["YEAR(date_closed)"]; $j_status = $row["j_status"]; $remarks = $row["remarks"]; ?> <input type="checkbox" name="jtype" value="<? if($_REQUEST['j_type']== 'Permanent') { print 'checked' ; }?>"> Permanent <input type="checkbox" name="jtype" value="<? if($_REQUEST['j_type']== 'Contract') { print 'checked' ; }?>"> Contract <input type="checkbox" name="jtype" value="<? if($_REQUEST['j_type']== 'Part Time') { print 'checked' ; }?>"> Part Time hope you could help me. its not yet working thanks!
  11. guys, i need help, i have a form and it has a check box permanent contract parttime what i want to happen is if the current value in my database is permanent i want the checkbox of permanent to be checked. i have a script for it but its not working hope you could help me with this. below is my code for this problem <input type="checkbox" name="jtype" value="<? if($_GET['j_type']== 'permanent')print 'checked'; ?>"> Permanent <input type="checkbox" name="jtype" value="<? if ($_GET['j_type'] == 'contract')print 'checked'; ?>"> Contract <input type="checkbox" name="jtype" value="<? if ($_GET['j_type'] == 'part time')print 'checked'; ?>"> Part Time need help on this please thanks!
  12. thanks to the help its working now.
  13. thanks i will try this one
  14. guys, i need help i have a form wherein in i have a textarea name="requirements" example of the text i am typing there is item1 item2 item3 item4 and this text will then be submitted and saved to my database my problem now is when i view it in my view page the format of the text i typed is item1item2item3item4 how do i fix this wherein when i view it in my view page the output will be * item1 * item2 * item3 * item4 need help on this please! thanks in advance!
  15. gruzin, have you tried using this one? how is the process of this? what will be the codes for the next page? let say the text information will be saved to the database. need help please thanks!
  16. guys, anyone have a rich text editor for php? i just need it in my project very badly. thanks!
  17. guys, anyone knows or have a code for a resume uploader what i mean is a form wherein the applicant will just copy paste his/her entire resume document onto the textarea and the system can recognize without changing the format of what has been paste into the textarea. hope you're getting what i mean. the textarea also has a menu option on top similar to ms word where in there's a button to change the font color, font size, alignment, etc hope you guys can help me with this. since i haven't find one yet since last weekend. thanks in advance!
  18. its working fine now i just added $password = md5($password); thanks again!
  19. i tried and it work however, the password is not in md5 how do i make the password set to md5? thanks!
  20. what is the include header.php?
  21. after replacing it with $query1 i already lost the error however i am not getting any emails and the echo message echo " Thank you password has been changed<br> We also sent a copy to ur email address cheers!"; is not appearing what seems to be the problem here? thanks!
  22. hi, this is the error message that i am getting now Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\forgotpass.php on line 9 need help on this please! below is my current codes. thanks! <?php include("db_connect.php"); $query1 = mysql_query("SELECT * FROM admin_user WHERE specil_name= '$specil_name'") or die(mysql_error()); $row = mysql_fetch_array( $query1 ); while($rec=mysql_fetch_assoc($result2)){ if(mysql_num_rows($row)==1){ $password=md5($password); if($_POST['submit']){ $query2="UPDATE admin_user SET password ='$password' where 'specil_name'='".$rec['specil_name']."''"; $result2=mysql_query($query2)or die("mysql_error()"); echo " Thank you password has been changed<br> We also sent a copy to ur email address cheers!"; exit; } $to = $rec['email']; $subject = 'new password '; $message = 'your new password is: $password'; $headers = "From: pixeltrace@gmail.com\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n"; mail($to, $subject, $message, $headers); echo"<form action=' ' method='POST'> <b class='text3'>New password:</b> <input type='text' name='password' maxlength='30'> <input type='submit' name='submit' value='New Password'> </form>"; } } ?>
  23. hi, i am getting this errors now Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\forgotpass.php on line 7 Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\forgotpass.php on line 9 this is my code <?php include("db_connect.php"); $query1 = mysql_query("SELECT * FROM admin_user WHERE specil_name= '$specil_name'") or die(mysql_error()); $row = mysql_fetch_array( $query ); while($rec=mysql_fetch_assoc($result)){ if(mysql_num_rows($row)==1){ $password=md5($password); if($_POST['submit']){ $query2="UPDATE admin_user SET password ='$password' where 'specil_name'='".$rec['specil_name']."''"; $result=mysql_query($query2)or die("mysql_error()"); echo " Thank you password changed<br> We also sent a copy to ur email address cheers!"; exit; } $to = $rec['email']; $subject = 'new password '; $message = 'your new password is: $password'; $headers = "From: pixeltrace@email.com\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n"; mail($to, $subject, $message, $headers); echo"<form action=' ' method='POST'> <b class='text3'>New password:</b> <input type='text' name='password' maxlength='30'> <input type='submit' name='submit' value='New Password'> </form>"; } } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>:: Testpage :: 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" 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 sent to the email address<br> associated with your account, all you have to do is enter your specil name.<br> Specil name is the secret word that your web administrator gave you<br> together with your username and password. </span><br> <br> <form action="" method="POST"> <b class="text3">Specil name:</b> <input type="text" name="specil_name" 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> need help please!
  24. hi, i am getting a mysql_error() this the code that i used for the entire page <?php include("db_connect.php"); $query1 = mysql_query("SELECT * FROM admin_user WHERE specil_name = '$specil_name'") or die(mysql_error()); $row = mysql_fetch_array( $query1 )or die("mysql_error()"); while($rec=mysql_fetch_assoc($resul2)){ if(mysql_num_rows($row)==1){ $password=md5($password); if($_POST['submit']){ $query2="update `admin_users` set `password`='$password' where `specil_name`=''".$rec['specil_name']."''"; $result=mysql_query($query2)or die("mysql_error()"); echo " Thank you password changed<br> We also sent a copy to ur email address cheers!"; exit; } $to = $rec['test@gmail.com']; $subject = 'new password '; $message = 'your new password is: $password'; $headers = "From: test@email.com\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n"; mail($to, $subject, $message, $headers); echo"<form action=' ' method='POST'> <b class='text3'>New password:</b> <input type='text' name='password' maxlength='30'> <input type='submit' name='submit' value='New Password'> </form>"; } } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>:: Testpage :: 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" 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 sent to the email address<br> associated with your account, all you have to do is enter your specil name.<br> Specil name is the secret word that your web administrator gave you<br> together with your username and password. </span><br> <br> <form action=" " method="POST"> <b class="text3">Specil name:</b> <input type="text" name="specil_name" 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> what could be the problem here? thanks!
  25. i understand, but the database is already there, maybe for the existing user, i will just ask them for the pencil word that you told me then i will just update the database hope you wont mind, assuming i have the form and process page hope its ok if i'll ask the codes for that, since i really haven't tried this kind of function thanks in advance!
×
×
  • 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.