Jump to content

Recommended Posts

guys, i need help.

 

i have a page where in it lists all job items on a table and each item has a checkbox

so when i check one or more items

when i click the post button

it should display the job items on this post page.

 

my problem is, my post page is not working.

hope you could help me with this.

 

this is the codes for my first page

<?php
session_start();

if (session_is_registered("username")){

include("pagina/my_pagina_class.php");

$cond = '';
if (isset($_GET['specialization'])) {
  if($_GET['specialization'] != ''){
    $cond = " WHERE specialization = '". $_GET['specialization'] ."'";
  }
}

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 ".$cond." ORDER BY ".$sort1 ." ".$sort2."";
//print_r($test);
// 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="732" border="0" cellspacing="2" cellpadding="0">
            <tr>
              <td colspan="6"><form method="get" action="emailalert.php?id=1"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="281"><span class="text6">
                      <?php
				 echo "   total record found: " .$total_recs; ?>
                    </span></td>
                    <td width="447" align="right" 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="specialization">
<? $spec = isset($_GET['specialization']) ? $_GET['specialization'] :$_POST['specialization']; ?>
<option value="<? echo "$spec"; ?>" selected><? echo "$spec"; ?></option>


  <?
$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>
<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="email/viewpost.php" method="post" target="_blank">
				<input type="hidden" value="<? echo "$username"; ?>" name="username" >
<tr>
              	<td colspan="6"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="60%" align="left" class="text8">
                    <input type="submit" name="Submit" value="post"></td>
                  <td width="39%" align="right"><!-- nav top -->
                      <?
				echo "<span class='link1'>".$nav_links."</span>";
				?>                  </td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td width="20" align="center" bgcolor="#83C2ED" class="text5"> </td>
              <td width="41" align="center" bgcolor="#83C2ED" class="text5">ID</td>
              <td width="324" align="center" valign="top" bgcolor="#83C2ED" class="text5">title</td>
              <td width="194" align="center" bgcolor="#83C2ED" class="text5">specialization</td>
              <td width="84" align="center" bgcolor="#83C2ED" class="text5">date posted </td>
              <td width="62" align="center" bgcolor="#83C2ED" class="text5">status</td>
              </tr>
<?php 
for ($i = 0; $i < $num_rows; $i++) {
$jobid = mysql_result($result, $i, "jobid");
$j_position = mysql_result($result, $i, "j_position");
$specialization = mysql_result($result, $i, "specialization");
$date_posted = mysql_result($result, $i, "date_posted");
$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:;" class="link1" onClick="MM_openBrWindow('../jobsearch/jobpost.php?jobid=<? echo "$jobid"; ?>','','scrollbars=yes,width=720,height=700')">
		<? echo "$j_position";?></a></td>
              <td align="center" bgcolor="#FFFFCC" class="text8"> 
             <? echo "$specialization";?>			 </td>
              <td align="center" bgcolor="#FFFFCC" class="text8"> 
             <? echo "$date_posted";?><br></td>
              <td align="center" bgcolor="#FFFFCC" class="text8"> 
                <? echo "$j_status";?></td>
              </tr>
     <?        
}
?>
            <tr>
              <td colspan="6" bgcolor="#83C2ED"><img src="../images/spacer.gif" width="10" height="2" /></td>
            </tr>
            <tr>
              <td colspan="6"><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="6"> </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>";
}
?>

 

 

and this is the code in my post page

<form method="post" target="_blank" action="http://www.jobhirings.com/jobpost.php?id=2"><table width="516" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="516" align="right"> </td>
                    </tr>
                    <tr>
                      <td class="text4">Dear <? echo " ".$fname." ".$lname." "; ?> </td>
                    </tr>
                    <tr>
                      <td class="text4">
JobHiRings is glad to inform you that we have found  job/s matching your job specialization. If the job/s listed below does/do not fit your job specialization, please  click
<a href="http://www.jobhirings.com/job/jobfinder.php" target="_blank" class="link1">here</a> to login and modify your JobHiRings account job specialization.</td>
                    </tr>
                    <tr>
                      <td> </td>
                    </tr>
                    <tr>
                      <td align="center"><table width="484" border="0" cellspacing="2" cellpadding="0">
                        <tr>
                          <td width="286" bgcolor="950101" class="text9">  Position</td>
                          <td width="110" bgcolor="950101" class="text9">  Company</td>
                          <td width="80" bgcolor="950101"> </td>
                        </tr>
		<?
		include '../db_connect.php';
		$jobid = $_POST['jobid'];
		$username = $_POST['username'];
		$checkb = $_POST['checkbox'];
		print_r($checkb);
$query = mysql_query("SELECT jobid, j_position FROM job_ads WHERE jobid= '$checkb'") or die(mysql_error()); 
$row = mysql_fetch_array( $query );
$jobid = $row["jobid"];
$j_postion = $row["j_position"];
			?>
                        <tr>
                          <td bgcolor="#e5e5e5"><a href="http://www.jobhirings.com/jobpost.php?jobid=<? echo "$jobid"; ?>" class="link1">  <? echo "$j_position"; ?></a></td>
                          <td bgcolor="#e5e5e5"><span class="text4">  JobHiRings</span></td>
                          <td align="center" bgcolor="#e5e5e5"><a href="http://www.jobhirings.com/jobpost.php?id=2&jobid=<? echo "$jobid"; ?>">
                            <input name="Submit" type="submit" class="text4" value="apply now">
                          </a>  </td>
                        </tr>
                        <tr>
                          <td colspan="3" bgcolor="950101"><img src="http://www.jobhirings.com/images/main/spacer.gif" width="10" height="2" /></td>
                          </tr>
                        <tr>
                          <td><a href="http://www.jobhirings.com/jobsearch/view.php" class="link1">  click here</a> <span class="text4">to view full list</span> </td>
                          <td> </td>
                          <td> </td>
                        </tr>
                        <tr>
                          <td>  <span class="text4"><a href="http://www.jobhirings.com/job/jobfinder.php?id=2" class="link1">Register</a> or <a href="http://www.jobhirings.com/job/jobfinder.php?id=1" class="link1">update</a> your resume now  </span></td>
                          <td> </td>
                          <td> </td>
                        </tr>
                      </table></td>
                    </tr>
                    <tr>
                      <td> </td>
                    </tr>
                    <tr>
                      <td><hr></td>
                    </tr>
                    <tr>
                      <td class="text6"> </td>
                    </tr>
                    <tr>
                      <td align="center"><p class="text10">You  received this job alert as part of your registration with JobHiRings. If you do not want to receive any job alert us, please  email us at <a href="mailto:postmaster@jobhirings.com?subject=Unsubscribe+Job+Emal+Alert" target="_blank" class="link2">postmaster@jobhirings.com</a> to unsubscribe. </p></td>
                    </tr>
                </table>
                </form>

 

 

hope you could help me with this.

 

thanks!

Link to comment
https://forums.phpfreaks.com/topic/46094-help-on-display-items-using-checkbox/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.