Jump to content

Recommended Posts

Hi I am getting fed up with this error, as I cannot figure out the issue :/

 

Parse error: syntax error, unexpected T_VARIABLE in /home/webredev/public_html/...../jump_page.php on line 1

 

however the only thing on line 1 is <?php right?? note it is only this page.

 

 

<?php

$uri->name(array("id"));
$id = stripinput($_URI['id']);

if ($id == "new")
{
switch($_REQUEST['state'])
{
	default:
	{
		$renderer->assign('id',$id);
		$renderer->display('admin/settings/jump_page_new.tpl');

		break;
	} // end default	

	case 'process':
	{

		$JUMP = array(
			'page_title' => $_POST['jump']['page_title'],
            'page_html_title' => $_POST['jump']['page_html_title'],
            'layout_type' => $_POST['jump']['layout_type'],
            'page_slug' => $_POST['jump']['page_slug'],
			'access_level' => $_POST['jump']['access_level'],
			'restricted_permission_api_name' => $_POST['jump']['restricted_permission_api_name'],
			'php_script' => $_POST['jump']['php_script'],
			'include_tinymce' => $_POST['jump']['include_tinymce'],
			'active' => $_POST['jump']['active'],
		);


		// Create an user and set some base attrs.
		$jump_edit = new JumpPage($db);
		$jump_edit->setPageTitle($JUMP['page_title']);
		$jump_edit->setPageHtmlTitle($JUMP['page_html_title']);
    		$jump_edit->setLayoutType($JUMP['layout_type']);
      		$jump_edit->setPageSlug($JUMP['page_slug']);
       		$jump_edit->setAccessLevel($JUMP['access_level']);
       		$jump_edit->setRestrictedPermissionApiName($JUMP['restricted_permission_api_name']);
		$jump_edit->setPhpScript($JUMP['php_script']);
		$jump_edit->setIncludeTinymce($JUMP['include_tinymce']);
		$jump_edit->setActive($JUMP['active']);
		$jump_edit->save();

		redirect('admin-jump');

		break;
	} // end process
} // end switch

}
else
{
if ($id == null)
{
$JUMP_PAGE_LIST = array();
$jump_page2 = new JumpPage($db);
$jump_page2 = $jump_page2->findBy(array());

foreach($jump_page2 as $jump_list)
{
   		$JUMP_PAGE_LIST[] = array(
   	  	  'id' => $jump_list->getJumpPageId(),
   		  'page_title' => $jump_list->getPageTitle(),
   		);
} // end user list

$renderer->assign('jump_list',$JUMP_PAGE_LIST);
$renderer->assign('jump_available',(bool)sizeof($JUMP_PAGE_LIST));
$renderer->display('admin/settings/jump_page_list.tpl');

}
else
{
switch($_REQUEST['state'])
{
	default:
	{
		$jump_page2 = new JumpPage($db);
		$jump_page2 = $jump_page2->findOneByJumpPageId($id);

		$jump_page2 = array(
		    'id' => $jump_page2->getJumpPageId(),
			'page_title' => $jump_page2->getPageTitle(),
			'page_html_title' => $jump_page2->getPageHtmlTitle(),
			'layout_type' => $jump_page2->getLayoutType(),
			'page_slug' => $jump_page2->getPageSlug(),
			'access_level' => $jump_page2->getAccessLevel(),
			'restricted_permission_api_name' => $jump_page2->getRestreictedPermissionApiName(),
			'php_script' => $jump_page2->getPhpScript(),
			'include_tinymce' => $jump_page2->getIncludeTinymce(),
			'active' => $jump_page2->getActive(),
		);

		$renderer->assign('id',$id);
		$renderer->assign('jump_page',$jump_page2);
		$renderer->display('admin/settings/jump_page_display.tpl');

		break;
	} // end default	

	case 'process':
	{

		$JUMP = array(
			'id' => $_POST['jump']['id'],
			'page_title' => $_POST['jump']['page_title'],
            'page_html_title' => $_POST['jump']['page_html_title'],
            'layout_type' => $_POST['jump']['layout_type'],
            'page_slug' => $_POST['jump']['page_slug'],
			'access_level' => $_POST['jump']['access_level'],
			'restricted_permission_api_name' => $_POST['jump']['restricted_permission_api_name'],
			'php_script' => $_POST['jump']['php_script'],
			'include_tinymce' => $_POST['jump']['include_tinymce'],
			'active' => $_POST['jump']['active'],
		);


		// Create an user and set some base attrs.
		$jump_edit = new JumpPage($db);
		$jump_edit = $jump_edit->findOneByJumpPageId($id);
		$jump_edit->setPageTitle($JUMP['page_title']);
		$jump_edit->setPageHtmlTitle($JUMP['page_html_title']);
    		$jump_edit->setLayoutType($JUMP['layout_type']);
      		$jump_edit->setPageSlug($JUMP['page_slug']);
       		$jump_edit->setAccessLevel($JUMP['access_level']);
       		$jump_edit->setRestrictedPermissionApiName($JUMP['restricted_permission_api_name']);
		$jump_edit->setPhpScript($JUMP['php_script']);
		$jump_edit->setIncludeTinymce($JUMP['include_tinymce']);
		$jump_edit->setActive($JUMP['active']);
		$jump_edit->save();

		redirect('admin-jump');

		break;
	} // end process
} // end switch
}
}
?>

Link to comment
https://forums.phpfreaks.com/topic/164550-solved-parse-error/
Share on other sites

Try:

 

<?php

$uri->name(array("id"));
$id = stripinput($_URI['id']);

if ($id == "new")
{
switch($_REQUEST['state'])
{
	default:
	{
		$renderer->assign('id',$id);
		$renderer->display('admin/settings/jump_page_new.tpl');

		break;
	} // end default	

	case 'process':
	{

		$JUMP = array(
			'page_title' => $_POST['jump']['page_title'],
            'page_html_title' => $_POST['jump']['page_html_title'],
            'layout_type' => $_POST['jump']['layout_type'],
            'page_slug' => $_POST['jump']['page_slug'],
			'access_level' => $_POST['jump']['access_level'],
			'restricted_permission_api_name' => $_POST['jump']['restricted_permission_api_name'],
			'php_script' => $_POST['jump']['php_script'],
			'include_tinymce' => $_POST['jump']['include_tinymce'],
			'active' => $_POST['jump']['active'],
		);


		// Create an user and set some base attrs.
		$jump_edit = new JumpPage($db);
		$jump_edit->setPageTitle($JUMP['page_title']);
		$jump_edit->setPageHtmlTitle($JUMP['page_html_title']);
    		$jump_edit->setLayoutType($JUMP['layout_type']);
      		$jump_edit->setPageSlug($JUMP['page_slug']);
       		$jump_edit->setAccessLevel($JUMP['access_level']);
       		$jump_edit->setRestrictedPermissionApiName($JUMP['restricted_permission_api_name']);
		$jump_edit->setPhpScript($JUMP['php_script']);
		$jump_edit->setIncludeTinymce($JUMP['include_tinymce']);
		$jump_edit->setActive($JUMP['active']);
		$jump_edit->save();

		redirect('admin-jump');

		break;
	} // end process
} // end switch

}
else
//{ << Invalid syntax here.
if ($id == null)
{
$JUMP_PAGE_LIST = array();
$jump_page2 = new JumpPage($db);
$jump_page2 = $jump_page2->findBy(array());

foreach($jump_page2 as $jump_list)
{
   		$JUMP_PAGE_LIST[] = array(
   	  	  'id' => $jump_list->getJumpPageId(),
   		  'page_title' => $jump_list->getPageTitle(),
   		);
} // end user list

$renderer->assign('jump_list',$JUMP_PAGE_LIST);
$renderer->assign('jump_available',(bool)sizeof($JUMP_PAGE_LIST));
$renderer->display('admin/settings/jump_page_list.tpl');

}
else
{
switch($_REQUEST['state'])
{
	default:
	{
		$jump_page2 = new JumpPage($db);
		$jump_page2 = $jump_page2->findOneByJumpPageId($id);

		$jump_page2 = array(
		    'id' => $jump_page2->getJumpPageId(),
			'page_title' => $jump_page2->getPageTitle(),
			'page_html_title' => $jump_page2->getPageHtmlTitle(),
			'layout_type' => $jump_page2->getLayoutType(),
			'page_slug' => $jump_page2->getPageSlug(),
			'access_level' => $jump_page2->getAccessLevel(),
			'restricted_permission_api_name' => $jump_page2->getRestreictedPermissionApiName(),
			'php_script' => $jump_page2->getPhpScript(),
			'include_tinymce' => $jump_page2->getIncludeTinymce(),
			'active' => $jump_page2->getActive(),
		);

		$renderer->assign('id',$id);
		$renderer->assign('jump_page',$jump_page2);
		$renderer->display('admin/settings/jump_page_display.tpl');

		break;
	} // end default	

	case 'process':
	{

		$JUMP = array(
			'id' => $_POST['jump']['id'],
			'page_title' => $_POST['jump']['page_title'],
            'page_html_title' => $_POST['jump']['page_html_title'],
            'layout_type' => $_POST['jump']['layout_type'],
            'page_slug' => $_POST['jump']['page_slug'],
			'access_level' => $_POST['jump']['access_level'],
			'restricted_permission_api_name' => $_POST['jump']['restricted_permission_api_name'],
			'php_script' => $_POST['jump']['php_script'],
			'include_tinymce' => $_POST['jump']['include_tinymce'],
			'active' => $_POST['jump']['active'],
		);


		// Create an user and set some base attrs.
		$jump_edit = new JumpPage($db);
		$jump_edit = $jump_edit->findOneByJumpPageId($id);
		$jump_edit->setPageTitle($JUMP['page_title']);
		$jump_edit->setPageHtmlTitle($JUMP['page_html_title']);
    		$jump_edit->setLayoutType($JUMP['layout_type']);
      		$jump_edit->setPageSlug($JUMP['page_slug']);
       		$jump_edit->setAccessLevel($JUMP['access_level']);
       		$jump_edit->setRestrictedPermissionApiName($JUMP['restricted_permission_api_name']);
		$jump_edit->setPhpScript($JUMP['php_script']);
		$jump_edit->setIncludeTinymce($JUMP['include_tinymce']);
		$jump_edit->setActive($JUMP['active']);
		$jump_edit->save();

		redirect('admin-jump');

		break;
	} // end process
} // end switch
}
}
?>

Link to comment
https://forums.phpfreaks.com/topic/164550-solved-parse-error/#findComment-868049
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.