rydog Posted April 29, 2007 Share Posted April 29, 2007 I have added a new mod, but when i go to the link i get an error: syntax error, unexpected ';' in, this might be a simple fix, but i cannot figure out what it is please help. Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/ Share on other sites More sharing options...
bobleny Posted April 29, 2007 Share Posted April 29, 2007 It means that you have an unexpected ';'. You need to look at the lines where it gives you the error and look for an extra ';' or some syntax error near that line. If you can't find it your self, post the problem area. e.g. if the error is on line 20, give us lines 15 through 25. Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241184 Share on other sites More sharing options...
rydog Posted April 29, 2007 Author Share Posted April 29, 2007 ok well the line is 12 here is the whole thing <?php session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c)or die(mysql_error()); $ir=mysql_fetch_array($icheck_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); <h3>Search for a Business</h3> <b>Stuck?, Need to find a business? Well look no further.</b> <form action='businessview.php'> <input type='text' name='ID' value=''> <input type='submit' value='Go!'> </form> EOF; $h->endpage(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241188 Share on other sites More sharing options...
bobleny Posted April 29, 2007 Share Posted April 29, 2007 Well, I think your problem is that you just start randomly rambling off HTML in the middle of you php... You need to either close php or echo the html... Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241197 Share on other sites More sharing options...
rydog Posted April 29, 2007 Author Share Posted April 29, 2007 ok well i am compeltely clueless on html lol Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241199 Share on other sites More sharing options...
eRott Posted April 29, 2007 Share Posted April 29, 2007 Try this. <?php session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php"); exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c)or die(mysql_error()); $ir=mysql_fetch_array($icheck_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); echo "<h3>Search for a Business</h3>"; echo "Stuck?, Need to find a business? Well look no further."; echo ' <form action='businessview.php'> <input type='text' name='ID' value=''> <input type='submit' value='Go!'> </form>'; EOF; $h->endpage(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241202 Share on other sites More sharing options...
rydog Posted April 29, 2007 Author Share Posted April 29, 2007 well i tried that but now im getting this: Parse error: syntax error, unexpected ';' in /home/br4cutav/public_html/bsearch.php on line 16 Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241204 Share on other sites More sharing options...
eRott Posted April 29, 2007 Share Posted April 29, 2007 Ahh. I dont think the echo was the only problem, you forgot another ) on the end of the $ir=mysql.... line. Try this: <?php session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include("mysql.php"); global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c)or die(mysql_error()); $ir=mysql_fetch_array($icheck_level()); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); ?> <h3>Search for a Business</h3> Stuck?, Need to find a business? Well look no further. <form action='businessview.php'> <input type='text' name='ID' value=''> <input type='submit' value='Go!'> </form> <?php EOF; $h->endpage(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241206 Share on other sites More sharing options...
rydog Posted April 29, 2007 Author Share Posted April 29, 2007 ok well that didnt work either grrrrrrrr. i have been up all night trying to figure this out. Fatal error: Cannot redeclare money_formatter() (previously declared in /home/br4cutav/public_html/global_func.php:2) in /home/br4cutav/public_html/global_func.php on line 2 Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241211 Share on other sites More sharing options...
bobleny Posted April 29, 2007 Share Posted April 29, 2007 Try this real quick... Just to check the include... <?php session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit(); } // isn't exit a function? $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); //include("mysql.php"); global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c)or die(mysql_error()); $ir=mysql_fetch_array($icheck_level()); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); ?> <h3>Search for a Business</h3> Stuck?, Need to find a business? Well look no further. <form action='businessview.php'> <input type='text' name='ID' value=''> <input type='submit' value='Go!'> </form> <?php EOF; $h->endpage(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241212 Share on other sites More sharing options...
rydog Posted April 29, 2007 Author Share Posted April 29, 2007 Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/br4cutav/public_html/bsearch.php on line 11 Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241213 Share on other sites More sharing options...
eRott Posted April 29, 2007 Share Posted April 29, 2007 ok well that didnt work either grrrrrrrr. i have been up all night trying to figure this out. Fatal error: Cannot redeclare money_formatter() (previously declared in /home/br4cutav/public_html/global_func.php:2) in /home/br4cutav/public_html/global_func.php on line 2 It would seem for every error corrected, there's a new one waiting. In my opinion, I would just go through each file again and make sure everything is correct. Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241215 Share on other sites More sharing options...
AndyB Posted April 29, 2007 Share Posted April 29, 2007 $ir=mysql_fetch_array($icheck_level()); The resource id returned by the query is defined in the line before as $is What the heck is $icheck_level() ? Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241232 Share on other sites More sharing options...
rydog Posted April 29, 2007 Author Share Posted April 29, 2007 great now i am getting this code error: Parse error: syntax error, unexpected '<' in /home/br4cutav/public_html/bsearch.php on line 18 Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241237 Share on other sites More sharing options...
AndyB Posted April 29, 2007 Share Posted April 29, 2007 OK, how about posting half a dozen lines up to and including line 18. Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241240 Share on other sites More sharing options...
rydog Posted April 29, 2007 Author Share Posted April 29, 2007 well i already posted the complete code above, thats the whole thing Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241267 Share on other sites More sharing options...
AndyB Posted April 29, 2007 Share Posted April 29, 2007 So you haven't made any changes since you posted it? OK, save us counting ... which is line 18? Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241273 Share on other sites More sharing options...
rydog Posted April 30, 2007 Author Share Posted April 30, 2007 $h->menuarea(); that is line 18 Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241277 Share on other sites More sharing options...
rydog Posted April 30, 2007 Author Share Posted April 30, 2007 sorry that was 17 here is 18 <h3>Search for a Business</h3> Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241278 Share on other sites More sharing options...
rydog Posted April 30, 2007 Author Share Posted April 30, 2007 if it helps i am using this code for a text based game. Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241280 Share on other sites More sharing options...
AndyB Posted April 30, 2007 Share Posted April 30, 2007 Is there a closing ?> after line 17 and before that? If not, that'll cause a problem since h3 isn't valid php. And remove the EOF; (an orphan in your closing php), since there's nothing wrong with the line reporting the error. Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241322 Share on other sites More sharing options...
rydog Posted April 30, 2007 Author Share Posted April 30, 2007 1.<?php 2.session_start(); 3.require "global_func.php"; 4.if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } 5.$userid=$_SESSION['userid']; 6.require "header.php"; 7.$h = new headers; 8.$h->startheaders(); 9.include "globals.php"; 10.global $c; 11.$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c)or die (mysql_error()); 12.$ir=mysql_fetch_array($icheck_level()); 13.$fm=money_formatter($ir['money']); 14.$cm=money_formatter($ir['crystals'],''); 15.$lv=date('F j, y, g:i a',$ir['laston']); 16.$h->userdata($ir,$lv,$fm,$cm); 17.$h->menuarea(); 18.<h3>Search for a Business</h3> 19.<b>Stuck?, Need to find a business? Well look no further.</b> 20.<form action='businessview.php'> 21.<input type='text' name='ID' value=''> 22.<input type='submit' value='Go!'> 23.</form> 24.EOF; 25.$h->endpage(); 26.?> Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-241571 Share on other sites More sharing options...
rydog Posted May 7, 2007 Author Share Posted May 7, 2007 well my business mod is still not working, im not sure i even have all the files please help!! Quote Link to comment https://forums.phpfreaks.com/topic/49224-error-please-help/#findComment-247405 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.