1
evan1993
Parse error: parse error, unexpected '=', expecting ')' in /home/asotinc1/public_html/common.php on
  • 2006/1/3 19:25

  • evan1993

  • Just popping in

  • Posts: 1

  • Since: 2006/1/3 1


Hello,

I'm having a problem with a script I'm trying to create.

I keep getting this message:

Parse error: parse error, unexpected '=', expecting ')' in /home/asotinc1/public_html/common.php on line 8

This is the script:

session_start();
include("config.php");
$dbh=mysql_connect ("localhost", "asotinc1_admin", "") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("asotinc1_asotinc");

$affiliateForm = array(
"username"=>array("User Name","text",""),
"password"=>array("Password","password",""),
"site"=>array("Your Web Site","text","http://"),
"email"=>array("Your Email","text","yourname@yoursite.com"),
"akey"=>array("","hidden",""),
"ptype"=>array("Payment Method","select","check|paypal"),
"pemail"=>array("Paypal Email","text",""),
"address"=>array("Your Address","textarea","")
);
function makeKey($len){
$chars=
'ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuv
wxyz0123456789'; // characters to use in the password
mt_srand((double)microtime()*1000000^getmypid());
while(strlen($password)<$len){
$password.=substr($chars,(mt_rand()%strlen($chars)),1);
}
return $password;
}

function AffiliateAdd(){
$_POST['akey'] = makeKey(10);
unset($_POST['ID']);
unset($_POST['step']);
$query = "INSERT INTO affiliates (".implode(", ",array_keys($_POST)).") VALUES ('".implode("', '",array_map("mysql_real_escape_string",$_POST))."')";
mysql_query($query,DBH) or die( mysql_error() );
return mysql_insert_id();
}

function AffiliateUpdate($aid){
unset($_POST['step']);
$query = "UPDATE affiliates SET ";
foreach($_POST as $field => $value) {
$query .= "$field = \"".mysql_real_escape_string($value)."\", ";
}
$query = substr($query, 0, strlen($query)-2)." WHERE ID = '{$aid}'";
mysql_query($query,DBH) or die( mysql_error() );
}

function AffiliateStats($aid=""){
$sql = "SELECT * FROM affiliates WHERE ID='{$aid}'";
$lo = mysql_query( $sql );
$affi = mysql_fetch_assoc($lo);
list($clicks) = mysql_fetch_row( mysql_query("SELECT COUNT(*) FROM affstats WHERE akey= '{$affi['akey']}'") );
list($orders) = mysql_fetch_row( mysql_query("SELECT COUNT(*) FROM affstats WHERE akey= '{$affi['akey']}' AND type=2") );
list($pending_total) = mysql_fetch_row( mysql_query("SELECT SUM(price) FROM affstats WHERE akey= '{$affi['akey']}' AND type=2 AND paid=0") );
list($paid_total) = mysql_fetch_row( mysql_query("SELECT SUM(price) FROM affstats WHERE akey= '{$affi['akey']}' AND type=2 AND paid=1") );
$total = $clicks+$orders;
$order_total = $pending_total+$paid_total;
$return = array(
"total"=>$total,
"clicks"=>$clicks,
"orders"=>$orders,
"pending_total"=>$pending_total,
"paid_total"=>$paid_total,
"order_total"=>$order_total
);
return $return;
}
?>

A quit notification would be greatly appreciated. Thanks!

Login

Who's Online

471 user(s) are online (58 user(s) are browsing Support Forums)


Members: 0


Guests: 471


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits