MrBillybob Posted August 14, 2007 Share Posted August 14, 2007 i get this error when i run this script.... Parse error: parse error, unexpected $ in *******/****/*/*/*/*****/*/transactions.php on line 123 and 123 is the last line the "?>". if you can find the problem please let me know <?php $args['accountKey'] = '1000'; $args['userid'] = $row['userID']; $args['charid'] = $row['charID']; $args['userkey'] = $row['apiKey']; $akey = $args['accountKey']; while($args['accountKey'] <= 1006){ $args['accountKey'] = $akey; $auth = "userid=" .$args['userid']; $auth .= "&apikey=" .$args['userkey']; $auth .= "&characterID=" .$args['charid']; $auth .= "&accountKey=" .$args['accountKey']; if ($errgetting) { $auth .= "&beforeRefID=" .$args['beforerefid']; } $head = "POST /corp/WalletTransactions.csv.aspx HTTP/1.0\r\n"; $head .= "Host: api.eve-online.com\r\n"; $head .= "Content-Type: application/x-www-form-urlencoded\r\n"; $head .= "Content-Length: " . strlen($auth) . "\r\n"; $head .= "Connection: close\r\n\r\n"; $fp = fsockopen ('api.eve-online.com', 80, $errno, $errstr, 30); if (!$fp) { echo 'fsock failed; damn muppets! '.$errstr; exit(); } fputs($fp, $head); fputs($fp, $auth); $header = 1; $errgetting = 0; $count = 0; while ($line = fgets ($fp)) { $hmm = strpos($line, "# error "); if ($line == "\r\n") { $header = 0; } elseif($hmm !== FALSE){ $errgetting = 1; } if ($errgetting) { $outerror[$akey] = $line; $Errnum = substr($line, 8, 3); if ($Errnum == "102") { $P1 = strpos($line, "[") + 1; $P2 = strpos($line, "]"); $P2 = $P2 - $P1; $errorrefid = substr($line, $P1, $P2); $args['beforerefid'] = $errorrefid; $akey = $akey - 1; } break; } else { if ($header) { $http_header .= $line; } else { $count = $count + 1; if ($count == 1) { } else { list($date, $transID, $quantity, $type, $price, $clientName, $characterName, $stationName, $transactionType) = explode(",", fgets ($fp)); $data_in[$count]['date'] = $date; $data_in[$count]['transID'] = $transID; $data_in[$count]['quantity'] = $quantity; $data_in[$count]['type'] = $type; $data_in[$count]['price'] = $price; $data_in[$count]['clientName'] = $clientName; $data_in[$count]['characterName'] = $characterName; $data_in[$count]['stationName'] = $stationName; $data_in[$count]['transactionType'] = $transactionType; } } } fclose ($fp); for ($i = 3; $i <= $count; $i++) { if ($data_in[$i]['transID'] != 0) { $sql = 'INSERT INTO `eve_wallet_t` (`date`, `transID`, `quantity`, `type`, `price`, `clientName`, `characterName`, `stationName`, `transactionType`, `id`, `acountkey`) VALUES (\'' . mysql_real_escape_string($data_in[$i]['date']) . '\', \'' . mysql_real_escape_string($data_in[$i]['transID']) . '\', \'' . mysql_real_escape_string($data_in[$i]['quantity']) . '\', \'' . mysql_real_escape_string($data_in[$i]['type']) . '\', \'' . mysql_real_escape_string($data_in[$i]['price']) . '\', \'' . mysql_real_escape_string($data_in[$i]['clientName']) . '\', \'' . mysql_real_escape_string($data_in[$i]['characterName']) . '\', \'' . mysql_real_escape_string($data_in[$i]['stationName']) . '\', \'' . mysql_real_escape_string($data_in[$i]['transactionType']) . '\', NULL ,\'' . $args['accountKey'] . '\');'; @mysql_query($sql, $server1); $error = mysql_errno(); if ($error > 0 && $error == 1062) { } else if ($error > 0 && $error != 1062) { return mysql_error(); exit; } else { } $sql = ""; } } $akey++; $sql = 'UPDATE `eve_data_ex` SET refID = \'' . $data_in[$i]['transID'] . '\' WHERE `eve_data_ex`.`id` = 2 LIMIT 1;'; @mysql_query($sql, $server1); } print_r($outerror); ?> Quote Link to comment https://forums.phpfreaks.com/topic/64956-solved-php-error-help/ Share on other sites More sharing options...
Caesar Posted August 15, 2007 Share Posted August 15, 2007 Missing a closing bracket. The whole thing supposed to be in the while loop? Or did you forget to close that first one? Quote Link to comment https://forums.phpfreaks.com/topic/64956-solved-php-error-help/#findComment-324135 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.