Jump to content

Php Parse Error


kaz
 Share

Recommended Posts

Parse error: parse error, unexpected ';' in /home/deathea/public_html/khaleel/xmb/shop_item.php on line 252

 

that line reads

 

>   mt_srand((double)microtime() * 10; $k++){

 

in case you need code around that line

 

>eval("echo (\"".template('shop_confirm')."\");");
 } elseif ( isset($yessubmit) ) {
	 $thatime = time();
	 if ( $self['money'] >= $item['price'] && $item['stock'] != 0 ) {
   $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
   $codepart = '';
   mt_srand((double)microtime() * 10; $k++){
  	 $codepart .= $chars[mt_rand(0, $ket)];
   }

   $thecode = $thatime.'-FunForum-'.$codepart;

Link to comment
Share on other sites

I did that, the code is now this:

 

>eval("echo (\"".template('shop_confirm')."\")");
   } elseif ( isset($yessubmit) ) {
	 $thatime = time();
	 if ( $self['money'] >= $item['price'] && $item['stock'] != 0 ) {
   $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
   $codepart = '';
   mt_srand((double)microtime() * 10 $k++){
  	 $codepart .= $chars[mt_rand(0, $ket)];
   }

 

and it says now

 

Parse error: parse error, unexpected T_VARIABLE in /home/deathea/public_html/khaleel/xmb/shop_item.php on line 251

 

line 251 reads

 

>mt_srand((double)microtime() * 10 $k++){

Link to comment
Share on other sites

Guest helpbytes

> mt_srand((double)microtime() * 10; $k++){
   $codepart .= $chars[mt_rand(0, $ket)];
  }

 

The error is referring to the $k++

 

Why is it inside the function call?

 

In addition, why is there a { after the function call?

 

Is it perhaps supposed to look like this?

 

>eval("echo (\"".template('shop_confirm')."\")");
  } elseif ( isset($yessubmit) ) {
       $thatime = time();
       if ( $self['money'] >= $item['price'] && $item['stock'] != 0 ) {
         $chars= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ012
                       3456789abcdefghijklmnopqrstuvwxyz';
         $codepart = '';
         mt_srand((double)microtime() * 10); 
         $k++;
         $codepart .= $chars[mt_rand(0, $ket)];
       }

       $thecode = $thatime.'-FunForum-'.$codepart;

Edited by helpbytes
Link to comment
Share on other sites

now i get

 

 

 

Parse error: parse error, unexpected $, expecting ',' or ';' in /home/deathea/public_html/khaleel/xmb/shop_item.php(245) : eval()'d code on line 21

 

 

where 245 represents the line:

 

 

eval("echo (\"".template('shop_confirm')."\")");

 

 

and line 21 reads

 

$query = $db->query("SELECT id FROM $table_shop_items WHERE cid='$cid' ORDER BY dateline DESC LIMIT 0, 1");

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

 Share

×
×
  • Create New...