Jump to content

Mystery number one


iceblox

Recommended Posts

Hi Everyone,

 

I have a script which uses PHP & Ajax and when i execute the PHP script a mystery number 1 appears below the script. I have had the error before and managed to get rid of it but I cant remember how? Has anyone else had this error or know how to fix it?

 

Phil

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/72343-mystery-number-one/
Share on other sites

There are two parts

 

This bit calls the PHP Script

 

  <center><div id="DealsHint">
<?php
include ("http://www.yoursite.com/deals.php?ModelID=$ModelID");
?>
</div></center>

 

This is the script

 

<?php

$result = mysql_query($query);


if (mysql_num_rows($result) > 0)
{

  
echo '<table width=615>';
echo '<tr>';
echo '<td width=17% align=center bgcolor="#87C542"><b>Tariff</b></td>';
echo '<td width=50% align=center bgcolor="#87C542"><b>The Detail</b></td>';
echo '<td width=20% align=center bgcolor="#87C542"><b>The Price</b></td>';
echo '<td width=13% align=center bgcolor="#87C542"><b>Where To Buy</b></td>';
echo '</tr>';

while($row = mysql_fetch_row($result))
{

if($rowcounter%2==1)
$bgcolor="#F4F4F4";
else
$bgcolor="#FFFFFF";
        $price =$row[3] / $row[17];
                $price2 =$row[2] - $row[3];
                if($row[17] == "12") {
                $net = '<font color="#000099">' . $row[17] . ' Month Contract</font>';
                }
                else {
                $net = '<font color="#FF0000">' . $row[17] . ' Month Contract</font>';
	}
                if($row[7] == "0.00") {
                $deal = ' - <font color="#FF0000">' . $row[8] . ' Months FREE Line Rental</font>';
                }
                elseif($row[5] >= "0.01")  {
                $deal = ' includes £' . $row[5] . ' Cashback</b>';
                }
                elseif($price2 == "0.00") {
                $deal = ' - <font color="#FF0000">' . $row[8] . ' Months FREE Line Rental</font>';
                }
                elseif($row[7] < "$row[18]") {
                $deal = ' - ' . $row[8] . ' Months at £' . $row[7] . '';
                }
                else {
                $deal = '';
	}
                if($row[6] == "1") {
                $auto = '<font color="#FF0000">Automatic Cashback - No Redemtion Required!</font><br><br>';
                }
                else {
                $auto = '';
	}
                if($row[20] == "0") {
                $say2 = '';
                }
                else {
                $say2 = '' . $row[20] . ' ' . $row[21] . ' minutes to any network ';
	}
                if($row[22] == "0") {
                $say3 = '';
                }
                else {
                $say3 = 'plus ' . $row[22] . ' texts per month';
                }
                echo '<tr bgcolor="' . $bgcolor . '">';
                if($row[2] == "0") {
                $phone = '<b><font color="#FF0000">FREE</font> ' . $row[11] . ' ' . $row[12] . '</b>';
                }
                else {
                $phone = '<b>' . $row[11] . ' ' . $row[12] . ' only £' . $row[2] . '</b>';
                }
                if($row[4] == "") {
                $gift = '';
                }
                else {
                $gift = ' with a <font color="#FF0000">FREE</font> ' . $row[4] . '';
                }
                if($row[22] == "0") {
                $say10 = '';
                }
                else {
                $say10 = 'plus ' . $row[22] . ' texts per month';
	}
                if($row[24] == "Vodafone") {
                $say4 = 'Voda ' . str_replace("£","£",$row[19] ) . '';
                }
                elseif($row[24] == "O2") {
                $say4 = 'O2 ' . str_replace("£","£",$row[19] ) . '';
                }
                elseif($row[24] == "Virgin") {
                $say4 = 'Virgin ' . str_replace("£","£",$row[19] ) . '';
                }
                else {
                $say4 = '' . str_replace("£","£",$row[19] ) . '';
	}
                echo '<tr bgcolor="' . $bgcolor . '">';
	echo '<td align=center><img src=' . $row[25] . '><br>' . $say4 . '<br>' . $net . '<br> £' . $row[18] . ' Per Month</td>';
                echo '<td align=center>';
           
                if($row[23] == "") {
                $tmob = '';
                }
                elseif($row[24] == "Three") {
                $tmob = '';
                }
                else {
                $tmob = ' T-Mobile Flext gives you an Allowance of £' . $row[23] . ' to spend how you like on minutes or texts. This could allow you to have ';
                }
                echo'' . $phone . ' ' . $deal . ' ' . $gift . ' <br> ' . $auto . ' ' . $tmob . ' ' . $say2 . ' ' . $say3 . ' standard Line rental is £' . $row[18] . ' per month.</td>';
                echo '<td align=center>Average line rental after cash back will be ';
                if($row[3] == "0.00") {
                echo' <font color="#FF0000">£' . number_format($price, 2, '.', '') . '</font><br><br>Total cost of this contract: <font color="#FF0000"><b>FREE</b></font></td>';
                }
                else {
                echo' £' . number_format($price, 2, '.', '') . '<br><br>Total cost of this contract: £' . number_format($row[3], 2, '.', '') . '</td>';
                }
	echo '<td align=center><a target="_blank" href=http://www.yoursite.com/banners.php?op=dealsclick&ID=' . $row[1] . '><img border=0 alt="' . $row[26] . '" src=' . $row[27] . '><br><br><img border=0 alt="Buy Now - ' . $row[26] . '" src=http://www.freemobilephonereviews.com/cron/buy.gif></a></td>';
	echo '</tr>';
$rowcounter++;
}
echo '</table>';
}
else
{
echo '<br><br><br><h3>Sorry this phone either isnt available on ' . $NetworkName . ' or there are no deals currently available</h3>';
}

mysql_free_result($result);	

mysql_close($connection);
?>

Link to comment
https://forums.phpfreaks.com/topic/72343-mystery-number-one/#findComment-364811
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.