Jump to content

pixeltrace

Members
  • Posts

    577
  • Joined

  • Last visited

    Never

Everything posted by pixeltrace

  1. its working now. thanks to all the help!!!!
  2. this is the code in my jobmngr.php <? $id = $_GET['id']; { $job = 'job/view.php'; if ($id=='1') {$job = 'job/add.php';} if ($id=='2') {$job = 'job/view.php';} if ($id=='3') {$job = 'job/edit.php';} if ($id=='4') {$job = 'job/application.php';} } ?> <? include ($job); ?> and this is the code in my view.php <?php session_start(); if (session_is_registered("username")){ include($_SERVER['DOCUMENT_ROOT']."/admean/pagina/my_pagina_class.php"); if(isset($_GET['sort1']) && $_GET['sort1']!='') $sort1 = $_GET['sort1']; else $sort1 = "j_position"; if(isset($_GET['sort2']) && $_GET['sort2']!='') $sort2 = $_GET['sort2']; else $sort2 = "ASC"; $test = new JHpage; $test->sql = "SELECT * FROM job_ads ORDER BY ".$sort1 ." ".$sort2.""; // the (basic) sql statement (use the SQL whatever you like) $result = $test->get_page_result(); // result set $num_rows = $test->get_page_num_rows(); // number of records in result set $nav_links = $test->navigation(" | ", "currentStyle"); // the navigation links (define a CSS class selector for the current link) $nav_info = $test->page_info(); // information about the number of records on page ("to" is the text between the number) $simple_nav_links = $test->back_forward_link(true); // the navigation with only the back and forward links, use true to use images $total_recs = $test->get_total_rows(); // the total number of records ?> <script type="text/JavaScript"> <!-- function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //--> </script> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10"></td> <td><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="1049" border="0" cellspacing="2" cellpadding="0"> <tr> <td colspan="13"><table width="616" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="329" class="text6"> <?php echo " total record found: " .$total_recs; ?></td> <td width="287"> </td> </tr> </table></td> </tr> <tr> <td colspan="13"><form method="get" action="jobmngr.php"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="783"> </td> <td width="262" class="text6">sort by : <select name="sort1"> <option value="j_position">name</option> <option value="jobid">ID</option> <option value="date_posted">date</option> </select> <select name="sort2"> <option value="ASC">ASC</option> <option value="DESC">DESC</option> </select> <input type="submit" name="Submit" value="Go" /> </td> </tr> </table></form></td> </tr> <form action="jobrepost.php" method="post"> <tr> <td colspan="13"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%" align="left" class="text8">| <a href="repost" class="link2">repost</a> | <a href="open" class="link2">open</a> | <a href="close" class="link2">close</a> | </td> <td width="39%" align="right"><!-- nav top --> <? echo "<span class='link1'>".$nav_links."</span>"; ?> </td> <td width="1%" align="right"><img src="images/spacer.gif" width="12" height="10" /></td> </tr> </table></td> </tr> <tr> <td width="29" align="center" bgcolor="#83C2ED" class="text5"> </td> <td width="51" align="center" bgcolor="#83C2ED" class="text5">ID</td> <td width="230" align="center" valign="top" bgcolor="#83C2ED" class="text5">title</td> <td width="140" align="center" bgcolor="#83C2ED" class="text5">level </td> <td width="254" align="center" bgcolor="#83C2ED" class="text5">client</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">N</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">C</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">S</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">I</td> <td width="24" align="center" bgcolor="#83C2ED" class="text5">B</td> <td width="28" align="center" bgcolor="#83C2ED" class="text5">CV</td> <td width="60" align="center" bgcolor="#83C2ED" class="text5">status</td> <td width="105" bgcolor="#83C2ED"> </td> </tr> <?php for ($i = 0; $i < $num_rows; $i++) { $jobid = mysql_result($result, $i, "jobid"); $j_position = mysql_result($result, $i, "j_position"); $level = mysql_result($result, $i, "level"); $c_name = mysql_result($result, $i, "c_name"); $cperson = mysql_result($result, $i, "cperson"); $nconsidered = mysql_result($result, $i, "nconsidered"); $considered = mysql_result($result, $i, "considered"); $scheduled = mysql_result($result, $i, "scheduled"); $interviewed = mysql_result($result, $i, "interviewed"); $blocked = mysql_result($result, $i, "blocked"); $cv = mysql_result($result, $i, "cv"); $j_status = mysql_result($result, $i, "j_status"); ?> <tr> <td bgcolor="#FFFFCC" class="text8"><span class="text5"> <input type="checkbox" name="checkbox[]" value="<? echo"jobid"; ?>" /> </span></td> <td bgcolor="#FFFFCC" class="text8">J<? echo ($jobid <= 9) ? $jobid : $jobid;?> </td> <td bgcolor="#FFFFCC"> <a href="javascript:;" target="_blank" class="link1" onclick="MM_openBrWindow('job/jobpost.php?jobid=<? echo "$jobid"; ?>','','width=720')"> <? echo "$j_position";?></a></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$level";?> </td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$c_name";?><br> <i><? echo "$cperson";?></i></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$nconsidered";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$considered";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$scheduled";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$interviewed";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$blocked";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$cv";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$j_status";?></td> <? echo "<td align='center' bgcolor='#FFFFCC'><a href='jobmngr.php?id=3&jobid=$jobid' class='link1'>edit</a> | <a href='jobmngr.php?id=4&jobid=$jobid' class='link1'>applications</a> </td></tr>"; ?> <? } ?> <tr> <td colspan="13" bgcolor="#83C2ED"><img src="../images/spacer.gif" width="10" height="2" /></td> </tr> <tr> <td colspan="13"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%" align="left" class="text8"> </td> <td width="39%" align="right"><!-- nav top --> <? echo "<span class='link1'>".$nav_links."</span>"; ?> </td> <td width="1%" align="right"><img src="images/spacer.gif" width="12" height="10" /></td> </tr> </table></td> </tr> </form> <tr> <td colspan="13"> </td> </tr> </table> </td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1"></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10"></td> </tr> </table> <? }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='../index.php'>Login</a></font>"; } ?> what i wanted to happen is to have the link be http://www.jobhirings.com/admean/jobmngr.php?id=2&sort1=date_posted&sort2=ASC&Submit=Go instead of http://www.jobhirings.com/admean/jobmngr.php?sort1=date_posted&sort2=ASC&Submit=Go because with the current code that i have, the link that i am getting is http://www.jobhirings.com/admean/jobmngr.php?sort1=date_posted&sort2=ASC&Submit=Go hope you could help me with this. thanks!
  3. from jobmngr.php view.php is included in this page where the id of view.php in jobmngr.php is 2 thats why if you notice in my action on my form its pointing to jobmngr.php?id=2 need help. thanks!
  4. hi, its working now but i got a problem because this is file is view.php and it is just included in jobmngr.php with an id=2 how do i fix the link in such a way that the link will be http://www.jobhirings.com/admean/jobmngr.php?id=2&sort1=date_posted&sort2=ASC&Submit=Go instead of http://www.jobhirings.com/admean/jobmngr.php?sort1=date_posted&sort2=ASC&Submit=Go below is the current code of my view.php <?php session_start(); if (session_is_registered("username")){ include($_SERVER['DOCUMENT_ROOT']."/admean/pagina/my_pagina_class.php"); if(isset($_GET['sort1']) && $_GET['sort1']!='') $sort1 = $_GET['sort1']; else $sort1 = "j_position"; if(isset($_GET['sort2']) && $_GET['sort2']!='') $sort2 = $_GET['sort2']; else $sort2 = "ASC"; $test = new JHpage; $test->sql = "SELECT * FROM job_ads ORDER BY ".$sort1 ." ".$sort2.""; // the (basic) sql statement (use the SQL whatever you like) $result = $test->get_page_result(); // result set $num_rows = $test->get_page_num_rows(); // number of records in result set $nav_links = $test->navigation(" | ", "currentStyle"); // the navigation links (define a CSS class selector for the current link) $nav_info = $test->page_info(); // information about the number of records on page ("to" is the text between the number) $simple_nav_links = $test->back_forward_link(true); // the navigation with only the back and forward links, use true to use images $total_recs = $test->get_total_rows(); // the total number of records ?> <script type="text/JavaScript"> <!-- function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //--> </script> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10"></td> <td><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="1049" border="0" cellspacing="2" cellpadding="0"> <tr> <td colspan="13"><table width="616" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="329" class="text6"> <?php echo " total record found: " .$total_recs; ?></td> <td width="287"> </td> </tr> </table></td> </tr> <tr> <td colspan="13"><form method="get" action="jobmngr.php?id=2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="783"> </td> <td width="262" class="text6">sort by : <select name="sort1"> <option value="j_position">name</option> <option value="jobid">ID</option> <option value="date_posted">date</option> </select> <select name="sort2"> <option value="ASC">ASC</option> <option value="DESC">DESC</option> </select> <input type="submit" name="Submit" value="Go" /> </td> </tr> </table></form></td> </tr> <form action="jobrepost.php" method="post"> <tr> <td colspan="13"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%" align="left" class="text8">| <a href="repost" class="link2">repost</a> | <a href="open" class="link2">open</a> | <a href="close" class="link2">close</a> | </td> <td width="39%" align="right"><!-- nav top --> <? echo "<span class='link1'>".$nav_links."</span>"; ?> </td> <td width="1%" align="right"><img src="images/spacer.gif" width="12" height="10" /></td> </tr> </table></td> </tr> <tr> <td width="29" align="center" bgcolor="#83C2ED" class="text5"> </td> <td width="51" align="center" bgcolor="#83C2ED" class="text5">ID</td> <td width="230" align="center" valign="top" bgcolor="#83C2ED" class="text5">title</td> <td width="140" align="center" bgcolor="#83C2ED" class="text5">level </td> <td width="254" align="center" bgcolor="#83C2ED" class="text5">client</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">N</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">C</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">S</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">I</td> <td width="24" align="center" bgcolor="#83C2ED" class="text5">B</td> <td width="28" align="center" bgcolor="#83C2ED" class="text5">CV</td> <td width="60" align="center" bgcolor="#83C2ED" class="text5">status</td> <td width="105" bgcolor="#83C2ED"> </td> </tr> <?php for ($i = 0; $i < $num_rows; $i++) { $jobid = mysql_result($result, $i, "jobid"); $j_position = mysql_result($result, $i, "j_position"); $level = mysql_result($result, $i, "level"); $c_name = mysql_result($result, $i, "c_name"); $cperson = mysql_result($result, $i, "cperson"); $nconsidered = mysql_result($result, $i, "nconsidered"); $considered = mysql_result($result, $i, "considered"); $scheduled = mysql_result($result, $i, "scheduled"); $interviewed = mysql_result($result, $i, "interviewed"); $blocked = mysql_result($result, $i, "blocked"); $cv = mysql_result($result, $i, "cv"); $j_status = mysql_result($result, $i, "j_status"); ?> <tr> <td bgcolor="#FFFFCC" class="text8"><span class="text5"> <input type="checkbox" name="checkbox[]" value="<? echo"jobid"; ?>" /> </span></td> <td bgcolor="#FFFFCC" class="text8">J<? echo ($jobid <= 9) ? $jobid : $jobid;?> </td> <td bgcolor="#FFFFCC"> <a href="javascript:;" target="_blank" class="link1" onclick="MM_openBrWindow('job/jobpost.php?jobid=<? echo "$jobid"; ?>','','width=720')"> <? echo "$j_position";?></a></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$level";?> </td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$c_name";?><br> <i><? echo "$cperson";?></i></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$nconsidered";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$considered";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$scheduled";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$interviewed";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$blocked";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$cv";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$j_status";?></td> <? echo "<td align='center' bgcolor='#FFFFCC'><a href='jobmngr.php?id=3&jobid=$jobid' class='link1'>edit</a> | <a href='jobmngr.php?id=4&jobid=$jobid' class='link1'>applications</a> </td></tr>"; ?> <? } ?> <tr> <td colspan="13" bgcolor="#83C2ED"><img src="../images/spacer.gif" width="10" height="2" /></td> </tr> <tr> <td colspan="13"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%" align="left" class="text8"> </td> <td width="39%" align="right"><!-- nav top --> <? echo "<span class='link1'>".$nav_links."</span>"; ?> </td> <td width="1%" align="right"><img src="images/spacer.gif" width="12" height="10" /></td> </tr> </table></td> </tr> </form> <tr> <td colspan="13"> </td> </tr> </table> </td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1"></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10"></td> </tr> </table> <? }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='../index.php'>Login</a></font>"; } ?> need help on this please! thanks!
  5. its on the same page with the drop down <?php session_start(); if (session_is_registered("username")){ include($_SERVER['DOCUMENT_ROOT']."/admean/pagina/my_pagina_class.php"); $test = new JHpage; if(isset($_GET['sort1']) && $_GET['sort1']!='') $sort1 = $_GET['sort1']; else $sort1 = "name"; if(isset($_GET['sort2']) && $_GET['sort2']!='') $sort2 = $_GET['sort2']; else $sort2 = "ASC"; $test->sql = "SELECT * FROM job_ads ORDER BY ".$sort1 ." ".$sort2.""; // the (basic) sql statement (use the SQL whatever you like) $result = $test->get_page_result(); // result set $num_rows = $test->get_page_num_rows(); // number of records in result set $nav_links = $test->navigation(" | ", "currentStyle"); // the navigation links (define a CSS class selector for the current link) $nav_info = $test->page_info(); // information about the number of records on page ("to" is the text between the number) $simple_nav_links = $test->back_forward_link(true); // the navigation with only the back and forward links, use true to use images $total_recs = $test->get_total_rows(); // the total number of records ?> <script type="text/JavaScript"> <!-- function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //--> </script> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10"></td> <td><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="1049" border="0" cellspacing="2" cellpadding="0"> <tr> <td colspan="13"><table width="616" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="329" class="text6"> <?php echo " total record found: " .$total_recs; ?></td> <td width="287"> </td> </tr> </table></td> </tr> <tr> <td colspan="13"><form method="get" action="jobmngr.php?id=2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="783"> </td> <td width="262" class="text6">sort by : <select name="sort1"> <option value="name">name</option> <option value="id">ID</option> <option value="date">date</option> </select> <select name="sort2"> <option value="ASC">ASC</option> <option value="DESC">DESC</option> </select> <input type="submit" name="Submit" value="Go" /> </td> </tr> </table></form></td> </tr> <form action="jobrepost.php" method="post"> <tr> <td colspan="13"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%" align="left" class="text8">| <a href="repost" class="link2">repost</a> | <a href="open" class="link2">open</a> | <a href="close" class="link2">close</a> | </td> <td width="39%" align="right"><!-- nav top --> <? echo "<span class='link1'>".$nav_links."</span>"; ?> </td> <td width="1%" align="right"><img src="images/spacer.gif" width="12" height="10" /></td> </tr> </table></td> </tr> <tr> <td width="29" align="center" bgcolor="#83C2ED" class="text5"> </td> <td width="51" align="center" bgcolor="#83C2ED" class="text5">ID</td> <td width="230" align="center" valign="top" bgcolor="#83C2ED" class="text5">title</td> <td width="140" align="center" bgcolor="#83C2ED" class="text5">level </td> <td width="254" align="center" bgcolor="#83C2ED" class="text5">client</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">N</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">C</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">S</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">I</td> <td width="24" align="center" bgcolor="#83C2ED" class="text5">B</td> <td width="28" align="center" bgcolor="#83C2ED" class="text5">CV</td> <td width="60" align="center" bgcolor="#83C2ED" class="text5">status</td> <td width="105" bgcolor="#83C2ED"> </td> </tr> <?php for ($i = 0; $i < $num_rows; $i++) { $jobid = mysql_result($result, $i, "jobid"); $j_position = mysql_result($result, $i, "j_position"); $level = mysql_result($result, $i, "level"); $c_name = mysql_result($result, $i, "c_name"); $cperson = mysql_result($result, $i, "cperson"); $nconsidered = mysql_result($result, $i, "nconsidered"); $considered = mysql_result($result, $i, "considered"); $scheduled = mysql_result($result, $i, "scheduled"); $interviewed = mysql_result($result, $i, "interviewed"); $blocked = mysql_result($result, $i, "blocked"); $cv = mysql_result($result, $i, "cv"); $j_status = mysql_result($result, $i, "j_status"); ?> <tr> <td bgcolor="#FFFFCC" class="text8"><span class="text5"> <input type="checkbox" name="checkbox[]" value="<? echo"jobid"; ?>" /> </span></td> <td bgcolor="#FFFFCC" class="text8">J<? echo ($jobid <= 9) ? $jobid : $jobid;?> </td> <td bgcolor="#FFFFCC"> <a href="javascript:;" target="_blank" class="link1" onclick="MM_openBrWindow('job/jobpost.php?jobid=<? echo "$jobid"; ?>','','width=720')"> <? echo "$j_position";?></a></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$level";?> </td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$c_name";?><br> <i><? echo "$cperson";?></i></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$nconsidered";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$considered";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$scheduled";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$interviewed";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$blocked";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$cv";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$j_status";?></td> <? echo "<td align='center' bgcolor='#FFFFCC'><a href='jobmngr.php?id=3&jobid=$jobid' class='link1'>edit</a> | <a href='jobmngr.php?id=4&jobid=$jobid' class='link1'>applications</a> </td></tr>"; ?> <? } ?> <tr> <td colspan="13" bgcolor="#83C2ED"><img src="../images/spacer.gif" width="10" height="2" /></td> </tr> <tr> <td colspan="13"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%" align="left" class="text8"> </td> <td width="39%" align="right"><!-- nav top --> <? echo "<span class='link1'>".$nav_links."</span>"; ?> </td> <td width="1%" align="right"><img src="images/spacer.gif" width="12" height="10" /></td> </tr> </table></td> </tr> </form> <tr> <td colspan="13"> </td> </tr> </table> </td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1"></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10"></td> </tr> </table> <? }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='../index.php'>Login</a></font>"; } ?> need help. thanks!
  6. i used this and this is the error message that i am getting Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 90 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 63 Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 68 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 63 Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 68 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 63 Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 68 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 63 Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 68 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 63 Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 68 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 63 Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 68 the codes of the page that this one is pertaining is my pagina source codes below is the code <?php /************************************************************************ JHpage ver. 1.03 Use this class to handle MySQL record sets and get page navigation links Copyright (c) 2005 -2006, Olaf Lederer All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the finalwebsites.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. _________________________________________________________________________ available at http://www.finalwebsites.com/ Comments & suggestions: http://www.webdigity.com/index.php/board,77.0.html,ref.olaf Updates & bugfixes ver. 1.01 - There was a small bug inside the page_info() method while showing the last page (set). The error (last record) is fixed. There is also a small update in the method set_page(), the check is now with $_REQUEST values in place of $_GET values. ver. 1.02 - The link text (and the new image function) for the forward and backward links will be created with the new method build_back_or_forward(). Because there is no need anymore the variables str_forward and str_backward are removed. Check the example file for the possibility to use images in place of strings for the back- and forward navigation and the modified navigation() method. ver 1.03 - there is a new variable $max_rows, this variable is used to limit the maximum of results during a query. That will say if there are more rows then the number of $max_rows only the last one will show up. Use the new variable $outstanding_rows if you need to inform the user about that. Leave the value inside the constructor empty to disaple the function. Several variables are removed to give this class a safer and better structure. The method page_info() that builds the string with page number information is changed, only one (input) string (formatted with sprintf) is needed now. *************************************************************************/ require($_SERVER['DOCUMENT_ROOT']."/admean/pagina/db_config.php"); error_reporting(E_ALL); // only for testing class JHpage { var $sql; var $result; var $outstanding_rows = false; var $get_var; var $rows_on_page; var $max_rows; // constructor function JHpage($rows = 0) { $this->connect_db(); $this->max_rows = $rows; $this->get_var = QS_VAR; $this->rows_on_page = NUM_ROWS; } // sets the current page number function set_page() { $page = (isset($_REQUEST[$this->get_var]) && $_REQUEST[$this->get_var] != "") ? $_REQUEST[$this->get_var] : 0; return $page; } // gets the total number of records function get_total_rows() { $tmp_result = mysql_query($this->sql); $all_rows = mysql_num_rows($tmp_result); if (!empty($this->max_rows) && $all_rows > $this->max_rows) { $all_rows = $this->max_rows; $this->outstanding_rows = true; } mysql_free_result($tmp_result); return $all_rows; } // database connection function connect_db() { $conn_str = mysql_connect(DB_SERVER, DB_USER, DB_PASSWORD); mysql_select_db(DB_NAME, $conn_str); } // get the totale number of result pages function get_num_pages() { $number_pages = ceil($this->get_total_rows() / $this->rows_on_page); return $number_pages; } // returns the records for the current page function get_page_result() { $start = $this->set_page() * $this->rows_on_page; $page_sql = sprintf("%s LIMIT %s, %s", $this->sql, $start, $this->rows_on_page); $this->result = mysql_query($page_sql); return $this->result; } // get the number of rows on the current page function get_page_num_rows() { $num_rows = mysql_num_rows($this->result); return $num_rows; } // free the database result function free_page_result() { mysql_free_result($this->result); } // function to handle other querystring than the page variable function rebuild_qs($curr_var) { if (!empty($_SERVER['QUERY_STRING'])) { $parts = explode("&", $_SERVER['QUERY_STRING']); $newParts = array(); foreach ($parts as $val) { if (stristr($val, $curr_var) == false) { array_push($newParts, $val); } } if (count($newParts) != 0) { $qs = "&".implode("&", $newParts); } else { return false; } return $qs; // this is your new created query string } else { return false; } } // this method will return the navigation links for the conplete recordset function navigation($separator = " | ", $css_current = "", $back_forward = false, $use_images = false) { $max_links = NUM_LINKS; $curr_pages = $this->set_page(); $all_pages = $this->get_num_pages() - 1; $var = $this->get_var; $navi_string = ""; if (!$back_forward) { $max_links = ($max_links < 2) ? 2 : $max_links; } if ($curr_pages <= $all_pages && $curr_pages >= 0) { if ($curr_pages > ceil($max_links/2)) { $start = ($curr_pages - ceil($max_links/2) > 0) ? $curr_pages - ceil($max_links/2) : 1; $end = $curr_pages + ceil($max_links/2); if ($end >= $all_pages) { $end = $all_pages + 1; $start = ($all_pages - ($max_links - 1) > 0) ? $all_pages - ($max_links - 1) : 1; } } else { $start = 0; $end = ($all_pages >= $max_links) ? $max_links : $all_pages + 1; } if($all_pages >= 1) { $forward = $curr_pages + 1; $backward = $curr_pages - 1; // the text two labels are new sinds ver 1.02 $lbl_forward = $this->build_back_or_forward("forward", $use_images); $lbl_backward = $this->build_back_or_forward("backward", $use_images); $navi_string = ($curr_pages > 0) ? "<a class='link1' href=\"".$_SERVER['PHP_SELF']."?".$var."=".$backward.$this->rebuild_qs($var)."\">".$lbl_backward."</a> " : $lbl_backward." "; if (!$back_forward) { for($a = $start + 1; $a <= $end; $a++){ $theNext = $a - 1; // because a array start with 0 if ($theNext != $curr_pages) { $navi_string .= "<a class='link1' href=\"".$_SERVER['PHP_SELF']."?".$var."=".$theNext.$this->rebuild_qs($var)."\">"; $navi_string .= $a."</a>"; $navi_string .= ($theNext < ($end - 1)) ? $separator : ""; } else { $navi_string .= ($css_current != "") ? "<span class='text6'\"".$css_current."\">".$a."</span>" : $a; $navi_string .= ($theNext < ($end - 1)) ? $separator : ""; } } } $navi_string .= ($curr_pages < $all_pages) ? " <a class='link1' href=\"".$_SERVER['PHP_SELF']."?".$var."=".$forward.$this->rebuild_qs($var)."\">".$lbl_forward."</a>" : " ".$lbl_forward; } } return $navi_string; } // function to create the back/forward elements; $what = forward or backward // type = text or img function build_back_or_forward($what, $img = false) { $label['text']['forward'] = STR_FWD; $label['text']['backward'] = STR_BWD; $label['img']['forward'] = IMG_FWD; $label['img']['backward'] = IMG_BWD; if ($img) { $img_info = getimagesize($label['img'][$what]); $label = "<img src=\"".$label['img'][$what]."\" ".$img_info[3]." border=\"0\">"; } else { $label = $label['text'][$what]; } return $label; } // this info will tell the visitor which number of records are shown on the current page function page_info($str = "Result: %d - %d of %d") { $first_rec_no = ($this->set_page() * $this->rows_on_page) + 1; $last_rec_no = $first_rec_no + $this->rows_on_page - 1; $last_rec_no = ($last_rec_no > $this->get_total_rows()) ? $this->get_total_rows() : $last_rec_no; $info = sprintf($str, $first_rec_no, $last_rec_no, $this->get_total_rows()); return $info; } // simple method to show only the page back and forward link. function back_forward_link($images = true) { $simple_links = $this->navigation(" ", "", false, $images); return $simple_links; } } ?> need help please thanks!
  7. hi, is the query correct? $test->sql = "SELECT * FROM job_ads ORDER BY ".$sort1." ".$sort2; or is it missing some "" or ' ? need help because i am getting errors from this line thanks!
  8. need help on this please. this is the error message that i am getting now. Parse error: parse error, unexpected T_VARIABLE in c:\hosting\webhost4life\member\diorgrace\admean\job\view1.php on line 12 and this is the entire code of my page <?php session_start(); if (session_is_registered("username")){ include($_SERVER['DOCUMENT_ROOT']."/admean/pagina/my_pagina_class.php"); $test = new JHpage; $sort1 = "name"; $sort2 = "ASC"; $test->sql = "SELECT * FROM job_ads ORDER BY ".$_GET['sort1']." "$_GET['sort2']""; // the (basic) sql statement (use the SQL whatever you like) $result = $test->get_page_result(); // result set $num_rows = $test->get_page_num_rows(); // number of records in result set $nav_links = $test->navigation(" | ", "currentStyle"); // the navigation links (define a CSS class selector for the current link) $nav_info = $test->page_info(); // information about the number of records on page ("to" is the text between the number) $simple_nav_links = $test->back_forward_link(true); // the navigation with only the back and forward links, use true to use images $total_recs = $test->get_total_rows(); // the total number of records ?> <script type="text/JavaScript"> <!-- function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //--> </script> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10"></td> <td><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="1049" border="0" cellspacing="2" cellpadding="0"> <tr> <td colspan="13"><table width="616" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="329" class="text6"> <?php echo " total record found: " .$total_recs; ?></td> <td width="287"> </td> </tr> </table></td> </tr> <tr> <td colspan="13"><form method="get" action="jobmngr.php?id=2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="783"> </td> <td width="262" class="text6">sort by : <select name="sort1"> <option value="name">name</option> <option value="id">ID</option> <option value="date">date</option> </select> <select name="sort2"> <option value="ASC">ASC</option> <option value="DESC">DESC</option> </select> <input type="submit" name="Submit" value="Go" /> </td> </tr> </table></form></td> </tr> <form action="jobrepost.php" method="post"> <tr> <td colspan="13"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%" align="left" class="text8">| <a href="repost" class="link2">repost</a> | <a href="open" class="link2">open</a> | <a href="close" class="link2">close</a> | </td> <td width="39%" align="right"><!-- nav top --> <? echo "<span class='link1'>".$nav_links."</span>"; ?> </td> <td width="1%" align="right"><img src="images/spacer.gif" width="12" height="10" /></td> </tr> </table></td> </tr> <tr> <td width="29" align="center" bgcolor="#83C2ED" class="text5"> </td> <td width="51" align="center" bgcolor="#83C2ED" class="text5">ID</td> <td width="230" align="center" valign="top" bgcolor="#83C2ED" class="text5">title</td> <td width="140" align="center" bgcolor="#83C2ED" class="text5">level </td> <td width="254" align="center" bgcolor="#83C2ED" class="text5">client</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">N</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">C</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">S</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">I</td> <td width="24" align="center" bgcolor="#83C2ED" class="text5">B</td> <td width="28" align="center" bgcolor="#83C2ED" class="text5">CV</td> <td width="60" align="center" bgcolor="#83C2ED" class="text5">status</td> <td width="105" bgcolor="#83C2ED"> </td> </tr> <?php for ($i = 0; $i < $num_rows; $i++) { $jobid = mysql_result($result, $i, "jobid"); $j_position = mysql_result($result, $i, "j_position"); $level = mysql_result($result, $i, "level"); $c_name = mysql_result($result, $i, "c_name"); $cperson = mysql_result($result, $i, "cperson"); $nconsidered = mysql_result($result, $i, "nconsidered"); $considered = mysql_result($result, $i, "considered"); $scheduled = mysql_result($result, $i, "scheduled"); $interviewed = mysql_result($result, $i, "interviewed"); $blocked = mysql_result($result, $i, "blocked"); $cv = mysql_result($result, $i, "cv"); $j_status = mysql_result($result, $i, "j_status"); ?> <tr> <td bgcolor="#FFFFCC" class="text8"><span class="text5"> <input type="checkbox" name="checkbox[]" value="<? echo"jobid"; ?>" /> </span></td> <td bgcolor="#FFFFCC" class="text8">J<? echo ($jobid <= 9) ? $jobid : $jobid;?> </td> <td bgcolor="#FFFFCC"> <a href="javascript:;" target="_blank" class="link1" onclick="MM_openBrWindow('job/jobpost.php?jobid=<? echo "$jobid"; ?>','','width=720')"> <? echo "$j_position";?></a></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$level";?> </td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$c_name";?><br> <i><? echo "$cperson";?></i></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$nconsidered";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$considered";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$scheduled";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$interviewed";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$blocked";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$cv";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$j_status";?></td> <? echo "<td align='center' bgcolor='#FFFFCC'><a href='jobmngr.php?id=3&jobid=$jobid' class='link1'>edit</a> | <a href='jobmngr.php?id=4&jobid=$jobid' class='link1'>applications</a> </td></tr>"; ?> <? } ?> <tr> <td colspan="13" bgcolor="#83C2ED"><img src="../images/spacer.gif" width="10" height="2" /></td> </tr> <tr> <td colspan="13"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%" align="left" class="text8"> </td> <td width="39%" align="right"><!-- nav top --> <? echo "<span class='link1'>".$nav_links."</span>"; ?> </td> <td width="1%" align="right"><img src="images/spacer.gif" width="12" height="10" /></td> </tr> </table></td> </tr> </form> <tr> <td colspan="13"> </td> </tr> </table> </td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1"></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10"></td> </tr> </table> <? }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='../index.php'>Login</a></font>"; } ?> hope you could help me with this. i am not sure if the assigning of my sort1 and sort2 variable is correct and my query too. need help thanks!
  9. hi, i am getting an error. may i ask,, how do i add a default value since my query is on top of the form so when the page first loads, it will read the query first before the form. how do i add a default value on sort1 and sort2 so when the page loads this will be the value that the program will execute. i know that code line should be placed on top of the query but i dont have any idea what the code is and how. hope you could help me with this. thanks!
  10. yes, the result will also fall on the same page. i'll try this one. thanks!
  11. guys, i need help on my drop down i have two drop down wherein i want its value to change the variable in my query but i dont know how to do it. so here i have 1. drop down menu for (name, id, date) 2. drop down menu for (ASC, DESC) 3. a go or submit button my query is something like this $test->sql = "SELECT * FROM job_ads WHERE ".$sort1." '.$sort2'"; and below is my codes for the drop down <form> sort by: <select name="firstoption"> <option value="1">name</option> <option value="2">ID</option> <option value="3">date</option> </select> <select name="secondoption"> <option value="1">ASC</option> <option value="2">DESC</option> </select> <input type="submit" name="Submit" value="Go" /> </form> what i wanted to happen is on the first drop down, its will change the value of sort1 on the second drop down it will change the value of sort2 then when the go or submit button is selected changes will be down. how to this is i dont have any ideas yet. hope you guys could help me with this. thanks in advance!
  12. any update on this? thanks a lot!
  13. guys, i need help, i was able to fix my problem on uploading picture and resume using my applcation form. now hope you could help me, get a code where the uploaded file will be renamed equivalent to the applicants username. ex. resume.doc change to username.doc pic.jpg change to username.jpg also, is there a way, that i can only limit files to be uploaded to gif, jpg, doc & pdf only? i just need this for security below is my current code for the process page <? 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 uploaed $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!"; } //set this to the directory where photo files will be uploaded $target_path = 'uploads/'; $target_path = $target_path . basename($_FILES['photofile']['name']); if(move_uploaded_file($_FILES['photofile']['tmp_name'], $target_path)) { 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>'; } ?> hope you could help me with this. thanks!
  14. hi, i did that, this is now the error message that i am getting Warning: move_uploaded_file(reSumes/resume.doc):failed to open stream: Permission denied in c:\hosting\webhost4life\member\diorgrace\admean\resume\addresume.php on line 57 warning: move_uploaded_file():Unable to move 'C:\PHP\uploadtemp\php28AA.tmp' to 'reSumes/resume.doc' in c:\hosting\webhost4life\member\diorgrace\admean\resume\addresume.php on line 57 There was an error uploading the file, please try again! Warning: move_uploaded_file(uploads/pic.jpg):failed to open stream: Permission denied in c:\hosting\webhost4life\member\diorgrace\admean\resume\addresume.php on line 68 warning: move_uploaded_file():Unable to move 'C:\PHP\uploadtemp\php28A9.tmp' to 'uploads/pic.jpg' in c:\hosting\webhost4life\member\diorgrace\admean\resume\addresume.php on line 68 There was an error uploading the file, please try again! is this a permission problem in the folder or in the addresume.php page? i checked the chmod of my upload folder and it was set to 666 already what could be the problem here. below is my current codes 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']; $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('d-m-Y'); // 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 uploaed $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!"; } //set this to the directory where photo files will be uploaded $target_path = 'uploads/'; $target_path = $target_path . basename($_FILES['photofile']['name']); if(move_uploaded_file($_FILES['photofile']['tmp_name'], $target_path)) { 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>'; } ?> need help please! thanks!
  15. hi, i am still getting some errors in uploading files Warning: move_uploaded_file(reSumes/resume.doc):failed to open stream: No such file or directory in c:\hosting\webhost4life\member\diorgrace\admean\resume\addresume.php on line 57 warning: move_uploaded_file():Unable to move 'C:\PHP\uploadtemp\php28AA.tmp' to 'reSumes/resume.doc' in c:\hosting\webhost4life\member\diorgrace\admean\resume\addresume.php on line 57 There was an error uploading the file, please try again! Warning: move_uploaded_file(uploads/pic.jpg):failed to open stream: No such file or directory in c:\hosting\webhost4life\member\diorgrace\admean\resume\addresume.php on line 68 warning: move_uploaded_file():Unable to move 'C:\PHP\uploadtemp\php28A9.tmp' to 'uploads/pic.jpg' in c:\hosting\webhost4life\member\diorgrace\admean\resume\addresume.php on line 68 There was an error uploading the file, please try again! what could be the problem here? below is my codes for my 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']; $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('d-m-Y'); // 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 uploaed $target_path = 'reSumes/'; $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!"; } //set this to the directory where photo files will be uploaded $target_path = 'uploads/'; $target_path = $target_path . basename($_FILES['photofile']['name']); if(move_uploaded_file($_FILES['photofile']['tmp_name'], $target_path)) { 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>'; } ?> hope you could help me with this. thanks!
  16. this is the error message that i am getting now Warning: move_uploaded_file(/c:/hosting/webhost4life/member/diorgrace/admean/pHotos/php2844.tmp):failed to open stream: Invalid argument in c:\hosting\webhost4life\member\diorgrace\admean\resume\addresume.php on line 57 warning: move_uploaded_file():Unable to move 'C:\PHP\uploadtemp\php2844.tmp' to '/c:/hosting/webhost4life/member/diorgrace/admean/pHotos/php2844.tmp' in c:\hosting\webhost4life\member\diorgrace\admean\resume\addresume.php on line 57 file could not be uploaded Warning: move_uploaded_file(/c:/hosting/webhost4life/member/diorgrace/admean/reSumes/php2843.tmp):failed to open stream: Invalid argument in c:\hosting\webhost4life\member\diorgrace\admean\resume\addresume.php on line 66 warning: move_uploaded_file():Unable to move 'C:\PHP\uploadtemp\php2843.tmp' to '/c:/hosting/webhost4life/member/diorgrace/admean/reSumes/php2843.tmp' in c:\hosting\webhost4life\member\diorgrace\admean\resume\addresume.php on line 66 file could not be uploaded this is my current code now in 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']; $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('d-m-Y'); // 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 uploaed $uploaddir = '/c:/hosting/webhost4life/member/diorgrace/admean/pHotos/'; $uploadfile = $uploaddir . basename($_FILES['resume']['tmp_name']); if (move_uploaded_file($_FILES['resume']['tmp_name'], $uploadfile)) { echo "File is uploaded."; } else { echo "File could not be uploaded"; } //set this to the directory where photo files will be uploaded $uploaddir = '/c:/hosting/webhost4life/member/diorgrace/admean/reSumes/'; $uploadfile = $uploaddir . basename($_FILES['photofile']['tmp_name']); if (move_uploaded_file($_FILES['photofile']['tmp_name'], $uploadfile)) { echo "File is uploaded."; } else { echo "File could not be uploaded"; } $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>'; } ?> hope you could help me with this. thanks!
  17. guys, i need help, i have a form a application form wherein the applicant has to attach his/her photo and resume my problem is, the applcation can be submitted successfully but the file could not be uploaded need help on this please below is the codes for my form <form action="resume/addresume.php" method="post" enctype="multipart/form-data"> <tr> <td align="right" valign="top" class="text6">Upload Photo : </td> <td> </td> <td><input type="file" name="photofile" /></td> </tr> <tr> <td align="right" valign="top" class="text6">Upload Resume : </td> <td> </td> <td><input type="file" name="resume" /></td> </tr> <tr> <td align="right" valign="top" class="text6"> </td> <td> </td> <td><input type="submit" name="Submit" value="Register"></td> </tr> and this is my code for my 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']; $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('d-m-Y'); // 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 uploaed $uploaddir = '/c:/hosting/webhost4life/member/diorgrace/admean/pHotos'; $uploadfile = $uploaddir . basename($_FILES['resume']['username']); if (move_uploaded_file($_FILES['resume']['username'], $uploadfile)) { echo "File is uploaded."; } else { echo "File could not be uploaded"; } //set this to the directory where photo files will be uploaded $uploaddir = '/c:/hosting/webhost4life/member/diorgrace/admean/reSumes'; $uploadfile = $uploaddir . basename($_FILES['photofile']['username']); if (move_uploaded_file($_FILES['photofile']['username'], $uploadfile)) { echo "File is uploaded."; } else { echo "File could not be uploaded"; } $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 dont know if my codes for the file upload is wrong or my directory location. hope you could help me with this. thanks a lot!
  18. it worked. thanks!
  19. this is the setup of my ID field field = id type = bigint length = 25 default = extra = auto_increment - primary key
  20. yes, i did and it still the same what else could be done here? thanks!
  21. this might help http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
  22. guys, i have my database setup where it has an ID and is set as the primary key and auto increment i set the default value to 0000 however, whenver there's a new item being added. the value of the ID is set to 1 digit only how do i set this up so that my ID will looked like 0001 0002 0003 ..... thanks!
  23. its working now. hehehe. thanks for the help anyway i just got a typo on my assigned variable. cheers!
  24. guys, need help, i cant make my values be displayed using explode below is the code for my query <? include '../db_connect.php'; $query = mysql_query("SELECT j_position, c_description, j_requirements, j_responsibilities, industry, specialization, level, j_type1, j_type2, j_type3, salary, location, country, DATE_FORMAT(date_closed,'%d %b %Y'), YEAR(date_closed) FROM job_ads WHERE jobid= '$jobid'") or die(mysql_error()); $row = mysql_fetch_array( $query ); $j_position = $row["j_position"]; $c_description = $row["c_description"]; $j_requirements = $row["j_requirements"]; $j_responsibilities = $row["j_responsibilities"]; $industry = $row["industry"]; $specialization = $row["specialization"]; $level = $row["level"]; $j_type1 = $row["j_type1"]; $j_type2 = $row["j_type2"]; $j_type3 = $row["j_type3"]; $level = $row["level"]; $salary = $row["salary"]; $location = $row["location"]; $country = $row["country"]; $date_closed = $row["DATE_FORMAT(date_closed,'%d %b %Y')"]; ?> and this is the code for my explode <? $lresponsibilities = explode("\n",$jresponsibilities); echo "<ul>\n<li>" . implode("</li>\n<li>",$lresponsibilities) . "</li>\n</ul>\n"; ?> hope you could help me with this. thanks in advance!
  25. any help for this one? thanks!
×
×
  • 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.