eaglelegend Posted July 2, 2009 Share Posted July 2, 2009 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 } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/164550-solved-parse-error/ Share on other sites More sharing options...
eaglelegend Posted July 2, 2009 Author Share Posted July 2, 2009 Cheers Gimzola!! Any ideas for this Parse error? Quote Link to comment https://forums.phpfreaks.com/topic/164550-solved-parse-error/#findComment-867971 Share on other sites More sharing options...
Maq Posted July 2, 2009 Share Posted July 2, 2009 Cheers Gimzola!! Any ideas for this Parse error? Are we missing something... Quote Link to comment https://forums.phpfreaks.com/topic/164550-solved-parse-error/#findComment-867993 Share on other sites More sharing options...
eaglelegend Posted July 2, 2009 Author Share Posted July 2, 2009 I accidentally left the path in there which I felt was a security risk waiting to happen, I contacted Gimzola to take that out, and he did exactly that, as I couldnt :/. I am still trying to figure out why this parse error is showing up :/ Quote Link to comment https://forums.phpfreaks.com/topic/164550-solved-parse-error/#findComment-868000 Share on other sites More sharing options...
PFMaBiSmAd Posted July 2, 2009 Share Posted July 2, 2009 So, you have tried the obvious things, like deleting the first line and re-typing it, copy and past the rest of the file into a completely new file? Quote Link to comment https://forums.phpfreaks.com/topic/164550-solved-parse-error/#findComment-868044 Share on other sites More sharing options...
mattal999 Posted July 2, 2009 Share Posted July 2, 2009 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 } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/164550-solved-parse-error/#findComment-868049 Share on other sites More sharing options...
eaglelegend Posted July 3, 2009 Author Share Posted July 3, 2009 Thank you mattal999!, your a star, it now works, the code that is... Quote Link to comment https://forums.phpfreaks.com/topic/164550-solved-parse-error/#findComment-868112 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.