0

I am getting this error in my script. The error is in the bolded line of the script. Can anyone help?

<?php

if($_REQUEST['app_id'])
{
  $app_id=$_REQUEST['app_id'];
}
else
{
  $app_id=$_POST['fb_sig_app_id'];
}

$referral_rate=$referral_cut/100;

$con=mysql_connect($sql_location,$sql_username,$sql_password);
mysql_select_db($sql_database, $con);

$ref=$_REQUEST['ref'];
$item_id=$_REQUEST['item_id'];
$referral_id=$_REQUEST['referral'];
$current_time=time();
$ajax_timeout=$ajax_timeout*1000;

if($_REQUEST['action']=="new")
{
  $referral_id=100000120560309;
}

if($user_id)
{
  $public_info=$facebook->api_client->application_getPublicInfo($app_id);
	
  $dev_count=count($public_info['developers']);
  $dev_array=array();

  if($dev_count>0)
  {
    while($dev_count>=0)
    {
      $dev_count--;

      [B]array_push($dev_array,$public_info['developers'][$dev_count]['uid']);[/B]
    }
  }

  $app_info=$facebook->api_client->admin_getAppProperties(array('application_name','callback_url','canvas_name','logo_url'));
	
  $image_url=$app_info['callback_url']."images/";
  $ajax_url=$app_info['callback_url']."ajax.php";
  $publish_url=$app_info['callback_url']."facebook_init.php";
	
  $result=mysql_query("SELECT * FROM ".$user_db." WHERE UserID='$user_id'");
  $num=mysql_num_rows($result);

  if($num==0)
  {
  	if($referral_id && $referral_id!=$user_id)
    {
  	  mysql_query("INSERT INTO ".$user_db." (UserID,Referral,Timestamp) VALUES ('$user_id','$referral_id','$current_time')");
  	}
  	else
  	{
  	  mysql_query("INSERT INTO ".$user_db." (UserID,Timestamp) VALUES ('$user_id','$current_time')");
  	}
		
		if($_REQUEST['gguv'])
		{
		  mysql_query("UPDATE ".$user_db." SET CurrentPoints=CurrentPoints+100 WHERE UserID='$user_id'");
		}
  }
	
	mysql_query("UPDATE ".$user_db." SET Timestamp='$current_time' WHERE UserID='$user_id'");
	
  $result=mysql_query("SELECT * FROM ".$user_db." WHERE UserID='$user_id'");
  $num=mysql_num_rows($result);

  $user_data=mysql_fetch_assoc($result);
	
  $current_points=$user_data['CurrentPoints'];
  $total_points=$user_data['TotalPoints'];
  $account_type=$user_data['Type'];
  $is_fan=$user_data['IsFan'];

  $log_result=mysql_query("SELECT * FROM ".$log_db." WHERE UserID='$user_id' ORDER BY Timestamp DESC");
  $log_num=mysql_num_rows($log_result);

  $purchase_result=mysql_query("SELECT * FROM ".$purchase_db." WHERE UserID='$user_id' ORDER BY Timestamp DESC");
  $purchase_num=mysql_num_rows($purchase_result);
	
  $content="<fb:name uid=\"".$user_id."\" firstnameonly=\"true\" shownetwork=\"false\"/> has invited you to use ".$app_info['application_name']."!\n".$app_text."<fb:req-choice url=\"http://apps.facebook.com/".$app_info['canvas_name']."/?referral=".$user_id."\" label=\"Join!\"/>"; ?>
	
	<fb:js-string var="loading_message2"><br><br><div style="color:white;font-weight:bold;font-size:150%;text-align:center;">Loading...</div><br><br><br></fb:js-string>
	<fb:js-string var="loading_message"><br><br><div style="text-align:center;"><img src="<?=$image_url?>loading_image.gif"></div><br><br></fb:js-string> <?php
}

?>
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by chrishea
0

This is a shot in the dark but maybe your while statement should be:
while($dev_count>=1)

As it is, it appears that it would try to do the array_push even if the count was zero and that might be a problem.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.