Need help!

Discussion in 'PHP' started by phillip, Aug 9, 2007.

  1. #1
    I'm really having trouble with this error:

    Script:
    <?PHP
    include_once('../../admin/myconnect.php');
    function my_dir(){
        $arfdn = explode('/', dirname($_SERVER['PHP_SELF']));
        return end($arfdn);
    }
    $client = "user";
    
    	$cfgProgDir = 'secure/';
    	include($cfgProgDir . "secure.php");
    
    if ($login && $re != "no") {
    
    include_once('header.php');
    $id = $_GET["id"];
    function crearid() {
    
    $random_id_length = 30;
    $rnd_id = crypt(uniqid(rand(),1));
    
    $rnd_id = strip_tags(stripslashes($rnd_id));
    $rnd_id = str_replace(".","",$rnd_id);
    $rnd_id = strrev(str_replace("/","",$rnd_id));
    
    $rnd_id = substr($rnd_id,0,$random_id_length);
    
    $sql1="SELECT * FROM `registro`";
    $result1=mysql_query($sql1);
    while($row1 = mysql_fetch_array($result1, MYSQL_ASSOC)) {
      if ($rnd_id == $row1["sid"]) {
        $repetido = "si";
      }
    }
     if ($repetido == "si") {
      crearid();
     }
     else {
      return($rnd_id);
     }
    }
    $sid = crearid();
    $sql9="SELECT * FROM `".$client."_surveys` WHERE `id` = '".$id."' LIMIT 1";
    $result9=mysql_query($sql9);
    while($row9 = mysql_fetch_array($result9, MYSQL_ASSOC)) {
    $pay = $row9["payout"];
    $sql47="SELECT * FROM `".$client."_payouts` ";
    $result47=mysql_query($sql47);
    while($row47 = mysql_fetch_array($result47, MYSQL_ASSOC)) {
      if ($pay == $row47["payout"]) {
      $payout = $row47['commission'];
      }
    }
    $sql48="SELECT * FROM `payouts` ";
    $result48=mysql_query($sql48);
    while($row48 = mysql_fetch_array($result48, MYSQL_ASSOC)) {
      if ($payout == $row48["payout"]) {
      $ourpay = $row48['commission'];
      }
    }
    mysql_query("INSERT INTO `registro` (sid, user, subuser, ourpay, clientpay, userpay, status, survey, partner) VALUES('".$sid."', '".$client."', '".$login."', '".$ourpay."', '".$pay."', '".$payout."', '2', '".$row9['description']."', '".$row9['partner']."'") 
     or die(mysql_error());
     if ($row9["partner"] == "cpalead.com") {
      $url = "http://www.cpalead.com/offer.php?id=".$row9["campid"]."&pub=708&sub=".$sid;
     }
     elseif ($row9["partner"] == "revenueuniverse.com") {
      $url = "http://publishers.revenueuniverse.com/click.php?affiliate=xxx&campaign=".$row9["campid"]."&creative=".$row9["intid"]."&sid=".$sid;
     }
     elseif ($row9["partner"] == "leadgains.com") {
      $url = "http://partners.leadgains.com/click.php?affiliate=xxx&campaign=".$row9["campid"]."&creative=".$row9["intid"]."&sid=".$sid;
     }
     elseif ($row9["partner"] == "adexhibit.com") {
      $url = "http://www.adexhibit.com/ez/bnvqfvslq/".$sid;
      $campid = $row9["campid"];
      $post = "yes";
     }
     if ($post != "yes") {
    ?>
    <META HTTP-EQUIV="refresh" CONTENT="1;URL=<?PHP echo $url; ?>">
    <?PHP
     }
     else {
    ?>
     <SCRIPT language="JavaScript">
    function submitf()
    {
      document.forma.submit();
    }
    </SCRIPT>
    <?PHP
     }
    ?>
    </head>
    
    <body onload="javascript:submitf();">
    
    <center><p align="center"><font face="arial, verdana">Loading ...</p><center>
    <?PHP
     if ($post == "yes") {
    ?>
    <form action="<?PHP echo $url; ?>" method="POST" name="forma"><input type="hidden" name="campaign" value="<?PHP echo $campid; ?>">
    <input type="hidden" name="sid" value="<?PHP echo $sid; ?>">
    </form>
    <?PHP
    }
    ?>
    </body>
    </html>
    <?PHP
    }
    }
    ?>
    PHP:
    1 possibility is a old mysql version other then that, nothing. Also if it is a old version is there any way to work around that? I have a deadline to meet!

    Thanks
     
    phillip, Aug 9, 2007 IP
  2. Chemo

    Chemo Peon

    Messages:
    146
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    mysql_query("INSERT INTO `registro` (sid, user, subuser, ourpay, clientpay, userpay, status, survey, partner) VALUES ('".$sid."', '".$client."', '".$login."', '".$ourpay."', '".$pay."', '".$payout."', '2', '".$row9['description']."', '".$row9['partner']."')") 
     or die(mysql_error());
    
    PHP:
     
    Chemo, Aug 9, 2007 IP
  3. phillip

    phillip Active Member

    Messages:
    727
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Too many queries?
     
    phillip, Aug 9, 2007 IP