Stotty Posted May 3, 2009 Share Posted May 3, 2009 Ive just uploaded this script <?php $action = $_GET['action']; if($action == "") { $include = "home.php"; } $include2 = $include . ".php"; if(file_exists($include2) { include($include2); } else { echo 'Page Cannot Be Found.<br>'; echo 'Requested File: ' . strip_tags($include2); } ?> Ive had this error before but carnt rember how i fixedd this is the error i get Parse error: syntax error, unexpected '{' in /home/a5499887/public_html/Setoxis/index.php on line 7 Thanks in Advanced Link to comment https://forums.phpfreaks.com/topic/156650-giving-a-error-easy-fix/ Share on other sites More sharing options...
gevans Posted May 3, 2009 Share Posted May 3, 2009 bracket missing if(file_exists($include2) { should be if(file_exists($include2)) { READ THE ERROR Link to comment https://forums.phpfreaks.com/topic/156650-giving-a-error-easy-fix/#findComment-824831 Share on other sites More sharing options...
Stotty Posted May 3, 2009 Author Share Posted May 3, 2009 Same Error Link to comment https://forums.phpfreaks.com/topic/156650-giving-a-error-easy-fix/#findComment-824833 Share on other sites More sharing options...
gevans Posted May 3, 2009 Share Posted May 3, 2009 Post your script again Link to comment https://forums.phpfreaks.com/topic/156650-giving-a-error-easy-fix/#findComment-824835 Share on other sites More sharing options...
Stotty Posted May 3, 2009 Author Share Posted May 3, 2009 <?php $action = $_GET['action']; if($action == "") { $include = "home.php"; } $include2 = $include . ".php"; if(file_exists($include2)) { include($include2); } else { echo 'Page Cannot Be Found.<br>'; echo 'Requested File: ' . strip_tags($include2); } ?> and the error is Parse error: syntax error, unexpected '{' in /home/a5499887/public_html/Setoxis/index.php on line 7 Link to comment https://forums.phpfreaks.com/topic/156650-giving-a-error-easy-fix/#findComment-824836 Share on other sites More sharing options...
gevans Posted May 3, 2009 Share Posted May 3, 2009 <?php $action = $_GET['action']; if($action == "") { $include = "home"; } $include2 = $include . ".php"; if(file_exists($include2)) { include($include2); } else { echo 'Page Cannot Be Found.<br>'; echo 'Requested File: ' . strip_tags($include2); } ?> That should work Link to comment https://forums.phpfreaks.com/topic/156650-giving-a-error-easy-fix/#findComment-824838 Share on other sites More sharing options...
Stotty Posted May 3, 2009 Author Share Posted May 3, 2009 Still getting same error Link to comment https://forums.phpfreaks.com/topic/156650-giving-a-error-easy-fix/#findComment-824839 Share on other sites More sharing options...
gevans Posted May 3, 2009 Share Posted May 3, 2009 Is there any more code on the page, or is that everything? Link to comment https://forums.phpfreaks.com/topic/156650-giving-a-error-easy-fix/#findComment-824840 Share on other sites More sharing options...
Stotty Posted May 3, 2009 Author Share Posted May 3, 2009 Thats everything could you write me one up all i need it to do is website/index.php?action=status or =client Thanks in Advance Link to comment https://forums.phpfreaks.com/topic/156650-giving-a-error-easy-fix/#findComment-824841 Share on other sites More sharing options...
the182guy Posted May 3, 2009 Share Posted May 3, 2009 Nothing wrong with the new code. Check that you are uploading and overwriting the script, if you are uploading to a website. Check that the script is not being cached. Check you are executing the correct script in the browser. Add an echo in there and see if that shows. Link to comment https://forums.phpfreaks.com/topic/156650-giving-a-error-easy-fix/#findComment-824842 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.