Auto down counter

bigjoe4

New Member
Messages
907
Reaction score
0
Points
0
I does not work
because after I ordered it once the file changed to -1 again
I know what the probelm must be
for some reason; rather than removing one from the number: it is just changing the number in the file "num.inc" to -1
 
Last edited:

marshian

New Member
Messages
526
Reaction score
9
Points
0
can you try to set the contents of num.inc to 100?
and then 'buy' one?
 

marshian

New Member
Messages
526
Reaction score
9
Points
0
Ok, i tested it and it's back to -1, so the reduce-one function isn't called a couple of times...
Edit:
I've found and solved the problem and sended you the new file
 
Last edited:

marshian

New Member
Messages
526
Reaction score
9
Points
0
to -1 i suppose?
anyway, i found more bugs and fixed them all...
sended you the new page
 

lszanto

New Member
Messages
23
Reaction score
0
Points
0
Have you created the file 'num.inc' and made the chmod 755? Cause its acting as if the file does not exist.
 

marshian

New Member
Messages
526
Reaction score
9
Points
0
Don't worry, it's working now. There were some problems in the FormToEmail.php page
 

bigjoe4

New Member
Messages
907
Reaction score
0
Points
0
Yes it works fine now, there were a few errors in the code but marshian fixed them.

It would be cool if the nostock.html redirected to the buy.html page once there were some in stock; otherwize someone might bookmark the nostock.html page to check later but they would never see that there were some in stock.
 
Last edited:

marshian

New Member
Messages
526
Reaction score
9
Points
0
Try this:
nostock.html:
HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>High power lights for your computer</title>
<link href="Favicon.ico" rel="SHORTCUT ICON">
<META NAME="description" CONTENT="Make your PC look cool! High power flashing LED Lights for your desktop PC."><META NAME="keywords" CONTENT=
"Computer, lights, PC, laser, leds, flashing, leds, kit, multicolor, Case, 12, 12V, volt, volts">
<script type="text/javascript">
<!--
function SwapImage()
{
   var doc=document, args=arguments;
   doc.$imgSwaps = new Array();
   for(var i=2; i<args.length; i+=2)
   {
      var elem=FindObject(args[i]);
      if(elem)
      {
         doc.$imgSwaps[doc.$imgSwaps.length]=elem;
         elem.$src=elem.src;
         elem.src=args[i+1];
      }
   }
}

function ajaxRequest() { 
    //Make var. 
    var ajaxRequest; 
 
    //Try Firefox, Opera or Safari style. 
    try { 
        //Set ajaxRequest. 
        ajaxRequest = new XMLHttpRequest(); 
    } catch(e) { 
        //Try new IE. 
        try {  
            //Set ajaxRequest. 
            ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); 
        } catch(e) { 
            //Try Old IE. 
            try { 
                //Set ajaxRequest. 
                ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); 
            } catch(e) { 
                //Not supported. 
                return false; 
            } 
        } 
    } 
     
    //Assume works. 
    return ajaxRequest; 
}

function getNumber() {
    //Prepare data. 
    var xmlHttp = ajaxRequest(); 
    var url = "getnumber.php"; 
    var data = ""; 
 
    //Check if ajax connection is valid. 
    if(!xmlHttp) { 
        //No ajax. 
        alert("I'm sorry your browser does not support ajax, please upgrade your browser."); 
    } 
 
    //Set up readystatechange. 
    xmlHttp.onreadystatechange = function() { 
        if(xmlHttp.readyState == 4) { 
            //Show new value.
            if(xmlHttp.responseText > 0) { 
                window.location = "buy.html"; 
            }
        } 
    } 
 
    //Send data. 
    xmlHttp.open("POST", url, true); 
    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); 
    xmlHttp.send(data); 
}

// -->
</script>
<script type="text/javascript">
<!--
function FindObject(id, doc)
{
   var child, elem;
   if(!doc)
      doc=document;
   if(doc.getElementById)
      elem=doc.getElementById(id);
   else
   if(doc.layers)
      child=doc.layers;
   else
   if(doc.all)
      elem=doc.all[id];
   if(elem)
      return elem;
   if(doc.id==id || doc.name==id)
      return doc;
   if(doc.childNodes)
      child=doc.childNodes;
   if(child)
   {
      for(var i=0; i<child.length; i++)
      {
         elem=FindObject(id,child[i]);
         if(elem)
            return elem;
      }
   }
   var frm=doc.forms;
   if(frm)
   {
      for(var i=0; i<frm.length; i++)
      {
         var elems=frm[i].elements;
         for(var j=0; j<elems.length; j++)
         {
            elem=FindObject(id,elems[i]);
            if(elem) return elem;
         }
      }
   }
   return null;
}
// -->
</script>
</head>
<body background="purple-tile.gif" bgcolor="#330066" text="#FFFFFF" alink="#0000FF" onload="getNumber();">
<img src="Lights4yourPC.gif" id="Image1" alt="" align="top" border="0" width="704" height="150" style="position:absolute;left:0px;top:0px;width:704px;height:150px;z-index:0">
<div id="bv_" style="position:absolute;left:0px;top:150px;width:118px;height:124px;z-index:1" align="center">
<table border="0" cellpadding="0" cellspacing="0" id="NavigationBar1">

<tr>
<td align="left" valign="top" width="118" height="31"><a href="/"><img id="home" src="home.gif" alt="home" align="top" border="0" width="118" height="31" onmouseover="SwapImage(1,0,'home','home-over.gif')" onmouseout="SwapImage(0,0,'home','home.gif')"></a></td>
</tr>
<tr>
<td align="left" valign="top" width="118" height="31"><a href="pictures.html"><img id="pictures" src="pictures.gif" alt="pictures" align="top" border="0" width="118" height="31" onmouseover="SwapImage(1,0,'pictures','pictures-over.gif')" onmouseout="SwapImage(0,0,'pictures','pictures.gif')"></a></td>
</tr>
<tr>
<td align="left" valign="top" width="118" height="31"><a href="buy.html"><img id="buy" src="buy-over.gif" alt="buy" align="top" border="0" width="118" height="31" onmouseover="SwapImage(1,0,'buy','buy-over.gif')" onmouseout="SwapImage(0,0,'buy','buy-over.gif')"></a></td>
</tr>
<tr>
<td align="left" valign="top" width="118" height="31"><a href="links.html"><img id="links" src="links.gif" alt="links" align="top" border="0" width="118" height="31" onmouseover="SwapImage(1,0,'links','links-over.gif')" onmouseout="SwapImage(0,0,'links','links.gif')"></a></td>
</tr>
</table>
</div>
<img src="line.gif" id="Image2" alt="" align="top" border="0" width="1" height="536" style="position:absolute;left:118px;top:150px;width:1px;height:889px;z-index:2">
<img src="fade.gif" id="Image3" alt="" align="top" border="0" width="118" height="348" style="position:absolute;left:0px;top:274px;width:118px;height:765px;z-index:3">
<div id="b_" style="position:absolute;left:124px;top:152px;width:574px;height:32px;z-index:4" align="left">

<font style="font-size:27px" color="#FFFF99" face="Verdana"><b><u>BUY!</u></b></font></div>
<div id="v_" style="position:absolute;left:124px;top:202px;width:560px;height:559px;z-index:5" align="left">

<!-- PayPal Logo -->
<a href="#" onclick="javascript:window.open('https://www.paypal.com/us/cgi-bin/webscr?cmd=xpt/cps/popup/OLCWhatIsPayPal-outside','olcwhatispaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=350');"><img  src="https://www.paypal.com/en_US/i/logo/PayPal_mark_180x113.gif" border="0" alt="Acceptance Mark" style="position:absolute;left:600px;top:0px"></a><!-- PayPal Logo -->

<font style="font-size:16px" color="#FFFFFF" face="Verdana">These amazing LEDs cost only $30USD each! (including delivery to USA or Europe)<br><br>
To request your LEDs, simply fill out the form below and send it. You will be redirected to a page so you can pay me by paypal.<br>
<br>
Make sure you fill out all the fields correctly.<br>
<br>
I will send you your LEDs as soon as I recieve your payment.<br><br>

OUT OF STOCK!
</font>
</div>
<form action="FormToEmail.php" method="post" style="position:absolute;left:124px;top:430px;z-index:6">
<table border="0" bgcolor="#ececec" cellspacing="5">
<tr><td>Name</td><td><input type="text" size="30" name="Name"></td></tr>
<tr><td>Email address</td><td><input type="text" size="30" name="Email address"></td></tr>
<tr><td valign="top">Your Full Address and postcode.</td><td><textarea name="Your Full Address" rows="6" cols="30"></textarea></td></tr>
<tr><td>&nbsp;</td><td><font face="arial" size="1">&nbsp;&nbsp;</font></td></tr>

</table>
<div id="bv2" style="position:absolute;left:0px;top:224px;width:574px;height:32px;z-index:4" align="left">
<font style="font-size:16px" color="#FFFFFF" face="Verdana">If you want to know the price of delivery to places outside of USA or Europe, or would like to ask me any questions you can email me <script language="JavaScript">
document.write('<a hre'+'f="m'+'ai'+'lto:'+'%6a%6f%65%40%6c%69%67%68%74%73%34%79%6f%75%72%70%63%2e%63%6f%6d">here<\/a>');
</script>
<p><font style="font-size:16px" color="#FFFF99" face="Verdana"><b><u>Disclaimer</u></b></font></p>
By buying these LEDs you are accepting this disclaimer. Although I believe these LEDs are perfectly safe if used with care and in accordance with the instructions, I accept no liability WHATSOEVER for these LEDs, including but not limited to: if they cause you or anyone else, directly or indirectly: personal injury, mental injury, loss of life, or damage to equipment. Once you buy them, it is your responsibility to use them safely.<br>
<br><br><br><br>
<!-- x10 Exchange code begin -->
<!-- DO NOT ALTER THIS CODE! -->
<script language="JavaScript"> 
document.write('<s'+'cript language="JavaScript" src="http://www.x10exchange.com/work.php?n=118&size=1&j=1&c=&code='+new Date().getTime()+'"></s'+'cript>'); 
</script> 
<NOSCRIPT>
<IFRAME SRC="http://www.x10exchange.com/work.php?n=118&size=1&c=" width=468 height=60 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling="no"></IFRAME>
</NOSCRIPT>
<!-- x10 Exchange code end -->

</font>
</div>
</form>
</body>
</html>
 
Top