Php Parse Error

windows

Guest
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->Parse error: parse error, unexpected ';' in /home/deathea/public_html/khaleel/xmb/shop_item.php on line 252<!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />that line reads<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->   mt_srand((double)microtime() * 10; $k++){<!--c2--></div><!--ec2--><br /><br />in case you need code around that line<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->eval("echo (\"".template('shop_confirm')."\");");<br />  } elseif ( isset($yessubmit) ) {<br />      $thatime = time();<br />      if ( $self['money'] >= $item['price'] && $item['stock'] != 0 ) {<br />    $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';<br />    $codepart = '';<br />    mt_srand((double)microtime() * 10; $k++){<br />        $codepart .= $chars[mt_rand(0, $ket)];<br />    }<br /><br />    $thecode = $thatime.'-FunForum-'.$codepart;<!--c2--></div><!--ec2--><!--content-->
From a quick look , I do as it suggests in the error, remove the ";" (it's not needed if it's within the brackets {} - but I haven't checked the code to see if the brackets are needed <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /><!--content-->
ie it should be <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->eval("echo (\"".template('shop_confirm')."\")");<!--c2--></div><!--ec2--><!--content-->
I did that, the code is now this:<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->eval("echo (\"".template('shop_confirm')."\")");<br />    } elseif ( isset($yessubmit) ) {<br />      $thatime = time();<br />      if ( $self['money'] >= $item['price'] && $item['stock'] != 0 ) {<br />    $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';<br />    $codepart = '';<br />    mt_srand((double)microtime() * 10 $k++){<br />        $codepart .= $chars[mt_rand(0, $ket)];<br />    }<!--c2--></div><!--ec2--><br /><br />and it says now<br /><br /><!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->Parse error: parse error, unexpected T_VARIABLE in /home/deathea/public_html/khaleel/xmb/shop_item.php on line 251<!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />line 251 reads<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->mt_srand((double)microtime() * 10 $k++){<!--c2--></div><!--ec2--><!--content-->
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->鐖塼_srand((double)microtime() * 10; $k++){<br /> ??#036;codepart .= $chars[mt_rand(0, $ket)];<br /> ?}<!--c2--></div><!--ec2--><br /><br />The error is referring to the $k++<br /><br />Why is it inside the function call?<br /><br />In addition, why is there a { after the function call?<br /><br />Is it perhaps supposed to look like this?<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->eval("echo (\"".template('shop_confirm')."\")");<br /> ?} elseif ( isset($yessubmit) ) {<br /> ?     $thatime = time();<br /> ?     if ( $self['money'] >= $item['price'] && $item['stock'] != 0 ) {<br /> ?       $chars= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ012<br />                        3456789abcdefghijklmnopqrstuvwxyz';<br /> ?       $codepart = '';<br /> ?       mt_srand((double)microtime() * 10); <br /> ?       $k++;<br /> ?       $codepart .= $chars[mt_rand(0, $ket)];<br />        }<br /><br />        $thecode = $thatime.'-FunForum-'.$codepart;<!--c2--></div><!--ec2--><!--content-->
now i get<br /><br /><br /><br />Parse error: parse error, unexpected $, expecting ',' or ';' in /home/deathea/public_html/khaleel/xmb/shop_item.php(245) : eval()'d code on line 21<br /><br /><br />where 245 represents the line:<br /><br /><br />eval("echo (\"".template('shop_confirm')."\")");<br /><br /><br />and line 21 reads<br /><br />$query = $db->query("SELECT id FROM $table_shop_items WHERE cid='$cid' ORDER BY dateline DESC LIMIT 0, 1");<!--content-->
Does line 20 end with a ; properly?<!--content-->
yes that line reads<br /><br /><br />$cid = (isset($cid) && is_numeric($cid)) ? (int) $cid : 0;<!--content-->
shall i just send it to you?<!--content-->
If you still haven't fixed it feel free to send it.<!--content-->
 
Back
Top