Hello.

I want to sandwich code for this check box

<?php echo '<p><input type="checkbox" name="confidental" id="confidental" value="on" onclick="confidential(this)" /> <label for="confidental" style="float:none">'.__('Make Company Infomation Confidental.', 'appthemes').'</label></p>'; ?>

after this code

<?php
		if ($relisting) :

but before this code

$packs = jr_get_job_packs();
			$user_packs = jr_get_user_job_packs();
			if (sizeof($packs) > 0 || sizeof($user_packs)>0) :

			echo '<h2 style="margin-top: 20px;">'.__('Select a Job Pack:', 'appthemes').'</h2>';

			echo '<ul class="packs">';
		

I'm very new at this and would like to be shown what I am doing wrong. Every time I code it the page I'm working on crashes and I'm at my wits end with it.

Thanks for any help.
Noobee

    Remove the <?php and ?> from the start and end of that first line you have. The problem you're getting is that you are trying to insert PHP start and end tags inside a block of PHP, which is what is causing the problem.

    Also, it doesn't hurt to have the display_errors set to On in your php.ini file, so that it shows the errors to your screen while you're developing (I wouldn't suggest this on a live server though) instead of showing a blank screen.

      Hey Ashley,
      Thanks for the quick response.

      I have a Wordpress website using the Job Roller theme. Registered visitors can post jobs and relist them once they expire. Both the post jobs and relist jobs share the same php file.

      Now, when a person is posting a job for the first time there is a check box at the top of the form. They can click if they would like to make their company info confidential. However, this checkbox does not appear on the relist jobs page and this is what I would like to understand how to do.

      Below is the code to the page in full. Around line 150 you will see the <?php if relisting I took your advice and removed the portions you suggested and voila the box showed up. Now I need to get the check box to work.

      Below is the php code for the page and after it is the function code I am trying to insert to make it work.

      	<?php
      	if ($relisting) :
      	echo '<p><input type="checkbox" name="confidental" id="confidental" value="on" onclick="confidential(this)" /> <label for="confidental" style="float:none">'.__('Make Company Infomation Confidental.', 'appthemes').'</label></p>';
      		$packs = jr_get_job_packs();
      		$user_packs = jr_get_user_job_packs();
      		if (sizeof($packs) > 0 || sizeof($user_packs)>0) :
      
      			echo '<h2 style="margin-top: 20px;">'.__('Select a Job Pack:', 'appthemes').'</h2>';
      
      			echo '<ul class="packs">';
      
      			$checked = 'checked="checked"';
      
      			if (sizeof($user_packs)>0) foreach ($user_packs as $pack) :
      
      				$choose_or_use = __('Choose this pack', 'appthemes');
      
      				if (!$pack->jobs_limit) :
      					$pack->jobs_count = __('Unlimited', 'appthemes').' '.__('Jobs remaining', 'appthemes');
      				else :
      					$pack->jobs_count = $pack->jobs_limit - $pack->jobs_count;
      					if ($pack->jobs_count==1) $pack->jobs_count = $pack->jobs_count.' '.__('Job remaining', 'appthemes');
      					else $pack->jobs_count = $pack->jobs_count.' '.__('Jobs remaining', 'appthemes');
      				endif;
      
      				if ($pack->pack_expires) $pack->pack_expires = __('Usable before ', 'appthemes').mysql2date(get_option('date_format'), $pack->pack_expires);
      
      				if ($pack->job_duration) $pack->job_duration = __(' lasting ', 'appthemes').$pack->job_duration.__(' days' ,'appthemes');
      
      				echo '<li><span class="cost">'.__('Purchased', 'appthemes').'</span><h3>'.$pack->pack_name.'</h3>';
      					//<p>'.$pack->jobs_count.''.$pack->job_duration.'. '.$pack->pack_expires.'.</p>
      				echo '<div><label>'.$choose_or_use.': <input type="radio" name="job_pack" value="user_'.$pack->id.'" '.$checked.' /></label></div>
      				</li>';
      
      				$checked = '';
      			endforeach;
      
      			if (sizeof($packs)>0) foreach ($packs as $pack) :
      
      				$choose_or_use = '';
      
      				if (!$pack->job_count) $pack->job_count = __('Unlimited', 'appthemes');
      
      				if ($pack->pack_duration) $pack->pack_duration = __(' usable within ', 'appthemes').$pack->pack_duration.__(' days', 'appthemes');
      
      				if ($pack->job_duration) $pack->job_duration = __(' lasting ', 'appthemes').$pack->job_duration.__(' days' ,'appthemes');
      
      				if ($pack->pack_cost) :
      					$pack->pack_cost = jr_get_currency($pack->pack_cost).'';
      					$choose_or_use = __('Buy this pack', 'appthemes');
      				else :
      					$pack->pack_cost = __('Free','appthemes');
      					$choose_or_use = __('Choose this pack', 'appthemes');
      				endif; 
      
      				echo '<li><span class="cost">'.$pack->pack_cost.'</span><h3>'.$pack->pack_name.'  <small>'.$pack->pack_description.'</small></h3>';
      					//<p>'.$pack->job_count.' '.__('Jobs', 'appthemes').''.$pack->job_duration.$pack->pack_duration.'.</p>
      					echo '<div><label>'.$choose_or_use.': <input type="radio" name="job_pack" value="'.$pack->id.'" '.$checked.' /></label></div>
      				</li>';
      
      				$checked = '';
      			endforeach;
      
      			echo '</ul>';
      
      		endif;
      
      		echo '<input type="hidden" name="relist" value="true" />';
      	?>
      
      	<?php
      		$featured_cost = get_option('jr_cost_to_feature');
      		if ($featured_cost && is_numeric($featured_cost) && $featured_cost > 0) :
      
      			// Featuring is an option
      			echo '<h2>'.__('Featured Job Posting = ', 'appthemes').jr_get_currency($featured_cost).__('?', 'appthemes').'</h2>';
      			//Edited By Adeel Raza 18-2-2012
      			echo '<p>'.__('Featured job postings are bolded, highlighted and appear at the top of search results.', 'appthemes').'</p>';
      
      			echo '<p><input type="checkbox" name="featureit" id="featureit" /> <label for="featureit" style="float:none">'.__('Yes please, feature my listing.', 'appthemes').'</label></p>';
      
      		endif;
      
      	endif;
      	?>
      
      
      
      
      	<p><input type="submit" class="submit" name="job_submit" value="<?php if ($relisting) _e('Relist &rarr;', 'appthemes'); else _e('Save &rarr;', 'appthemes'); ?>" /></p>
      
      	<div class="clear"></div>		
      </form>
      <?php
      if (get_option('jr_html_allowed') == 'yes')
          jr_tinymce();
      ?>
      <?php

      }

      Here is the function code...

      		function confidential(checkbox)
      		{
      			if (checkbox.checked)
      			{
      				document.getElementById('your_name').value = "Confidential";
      				document.getElementById('your_name').disabled = true;
      			}else
      				document.getElementById('your_name').disabled = false;
      
      	}
        Write a Reply...