I would like to use this script Kahlid let me copy, and write a php file within it, so that when the number goes up with the click of the button, and you leave, when you come back the same amount (unless it went up) will remain on the page. I have no PHP exp. and I would like something to mess with, so if you wouldnt mind hooking me up with a script for this, I would greatly appreciate it.
Thanks
Code One
[code]
<script type=”text/javascript”>
/**************************************************************************************
Author : Khalid Ali
Date : July 30,2003
Version : 1.1
Company : webapplikations inc. [url]http://www.webapplikations.com[/url]
The code provided here is copy righted material and belongs to the
webapplikations.com inc. It is provided as a service for our visitors.
It can be used without permission provided that this notification
does appear at the top.
Description :
***************************************************************************************/
<!–
//get the command for the starting point in menu if any
var cmdStr = window.location.search;
cmdStr = (cmdStr.indexOf(“menu_id”)>-1)?cmdStr.substring(cmdStr.indexOf(“=”)+1,cmdStr.length):””;
var isNS6 = (navigator.userAgent.indexOf(“Mozilla”)>-1 && navigator.userAgent.indexOf(“Gecko”)>-1)?true:false;
var isIE = (navigator.userAgent.indexOf(“MSIE”)>-1 && navigator.userAgent.indexOf(“Opera”)==-1)?true:false;
var isOp = (navigator.userAgent.indexOf(“Opera”)>-1)?true:false;
function init(){
if(isIE){
document.getElementById(“msg_scroller”).style.position=”relative”;
}
}
var limit = 5;
var clickCtr=0;
function CountClicks(val){
var frm = document.getElementById(“form1″);
var len = frm.length;
var num = parseInt(val);
clickCtr = clickCtr + num;;
if(clickCtr>limit){
clickCtr = clickCtr-1;
}else if(clickCtr<0){
clickCtr++;
}
frm.t1.value = clickCtr;
}
//–>
</script>
</head>
<body class=”body”>
<div class=”maindiv”>
<div id=”div_1″ class=”table-with-thin-border” style=”margin:auto;width:140px;background-color:#FFFFFF;”>
<form id=”form1″ action=”” onsubmit=””>
<p>
<span style=”display:block;text-align:left;”>
<label class=”small-text-bold”>
Click Counter :<input type=”text” name=”t1″ value=”0″ style=”width:24px;” maxlength=”2″ readonly=”readonly”/>
</label>
</span>
<span style=”display:block;text-align:right;margin-top:-20px;”>
<span style=”display:block;padding-bottom:4px;”>
<img src=”../images/up.gif” width=”12″ height=”16″ alt=”” onclick=”CountClicks(1);”/>
</span>
</p>
</form>
</div>
</div>
</body>
</html>