[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

unknown problem - please read

Asked by teoexe in SCO Unix, Samba File Server, Delphi Database

Hello

I`m the owner of a real time auctions company ( like swoopo )

how can i call a php script localy ? and not for every user who`ll be on my webpage?

i have 2 php files : bid_calc.php and uppp.php
bid_calc.php calls uppp.php ( and works good ) , but he call everytime a visitator come to pur webpage. ( this is wrong )

bid_calc.php must call uppp.php only once for all visitors.

attached those 2 files ( bid_calc.php ) and uppp.php
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
<table width="215" border="0" align="center" cellpadding="0" cellspacing="0">
                                          <tr>
                                            <td align="left" valign="top" background="image/w_t_c.gif"><img src="image/w_t_l.gif" width="12" height="11" /></td>
                                            <td align="left" valign="top" background="image/w_t_c.gif"><img src="image/w_t_c.gif" width="5" height="11" /></td>
                                            <td align="right" valign="top" background="image/w_t_c.gif"><img src="image/w_t_r.gif" width="12" height="11" /></td>
                                          </tr>
                                          <tr>
                                            <td colspan="3" align="left" valign="top" class="TblBrd4"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                              <tr>
                                                <td align="left" valign="top">
												
											<!--if auction is about to end-->
												<?php /*if($currentTime > $rows['rem_date']){												
												
												include("auc_complete.php");?>
												
											
												
												
												
												<? } else {*/ ?>
												
													<table width="98%" border="0" align="center" cellpadding="0" cellspacing="4">
                                                  <tr>
                                                    <td width="100%" align="center" valign="middle" class="Light2 Blue1">
											
											
													<div id="timeerLive" <?php if($rows['running_status']=='Paused'){?> style="display:none" <? } else {?>style="width:120px; font-size:20px; font-weight:bold; font-family:Arial, Helvetica, sans-serif" <? } ?> >&nbsp;</div>													</td>
                                                  </tr>
                                                  <tr>
                                                    <td align="center" valign="middle" class="Light2 Blue1">&nbsp;</td>
                                                  </tr>
                                                  <tr>
                                                    <td align="center" valign="middle" class="Light2 Blue1">
<?php if($rows['running_status']=='Paused') {
$timeDiff = ($rows['expiry_date']-$rows['paused_date']); 
echo "<p style=font-size:25px; font-weight:bold; font-family:Arial, Helvetica, sans-serif>"."<b>".calc_counter_from_time($timeDiff)."</b>"."</p>";
}?>
 
<div id="txtLive" style="height:50px"></div>
<input name="diffval" id='diffval' type="hidden" value="<?=$diffs?>" />
<?
//$t1=  strtotime(date("Y-m-d h:i:s"));
$t1 = time();
$serverTime = $t1;
 
//$t1 = strtotime("2009-02-20 h:i:s"); // AA -- test purposes only
$t2 = getExpDate($rows['id']);
$expiryTime = $t2;
 
 
$diffs =  $t2 - $t1;
 
$currentBidPrice = getCurrentBid($rows[id]);
$currentBidder =   getCurrentBidder($rows[id]);
/*if (diffs<=20)
{
getUpdateExpDate($rows['id'] , 65);
}*/
?>
 
<input type='hidden' id='expiry_time' value='<?=$expiryTime;?>'>
<input type='hidden' id='server_time' value='<?=$serverTime;?>'>
<input type='hidden' id='step_time' value='0'>
 
<script type="text/javascript">
var current='<?=$diffs?>';
var page_request = false;
function ajaxpage_local(_url) {
		page_request = false;
		if (window.XMLHttpRequest) // if Mozilla, Safari etc
			page_request = new XMLHttpRequest()
		else if (window.ActiveXObject){ // if IE
			try {
				page_request = new ActiveXObject("Msxml2.XMLHTTP")
			} 
			catch (e){
				try{
					page_request = new ActiveXObject("Microsoft.XMLHTTP")
				}
				catch (e){}
			}
		} else {
			return false;
		}
		page_request.onreadystatechange=function(){
			loadpage_local(page_request)
		}
		page_request.open('GET', _url, true)
		page_request.send(null)
	}
	
	
	function functoadd(_url) {
		page_request12 = false;
		if (window.XMLHttpRequest) // if Mozilla, Safari etc
			page_request12 = new XMLHttpRequest()
		else if (window.ActiveXObject){ // if IE
			try {
				page_request12 = new ActiveXObject("Msxml2.XMLHTTP")
			} 
			catch (e){
				try{
					page_request12 = new ActiveXObject("Microsoft.XMLHTTP")
				}
				catch (e){}
			}
		} else {
			return false;
		}
		page_request12.onreadystatechange=function(){
 
		}
		page_request12.open('GET', _url, true)
		page_request12.send(null)
	}
	
	
function calc_counter_from_time() { //diff,temp) {
 //temp=parseInt(temp)+parseInt(1000);
 var tem="temps";
 //var current=document.getElementById('diffval').value;
 
 var expiryTime = parseInt(document.getElementById('expiry_time').value); 
 var cTime = parseInt(document.getElementById('server_time').value); 
 var stepTime = parseInt(document.getElementById('step_time').value);
 
 cTime = cTime + stepTime;
 document.getElementById('step_time').value = stepTime+1;
 
 diff = expiryTime - cTime;
 
 
 var divnamech="timeerLive";
//  dd=diff-currenttime;
 
 
 
if (diff > 0) {
    hours=Math.floor(diff / 3600)
 
    minutes=Math.floor((diff / 3600 - hours) * 60)
 
    seconds=Math.round((((diff / 3600 - hours) * 60) - minutes) * 60)
	
  } else {
  functoadd('uppp.php?id='+<? echo $rows['id']?>);
  document.getElementById('step_time').setAttribute('value' , 0);
  document.getElementById('expiry_time').setAttribute('value' , 65);
  document.getElementById('server_time').setAttribute('value' , 0);
  //alert(seconds);
    hours = 0;
    minutes = 0;
    seconds = 1;
  }
 
  if (seconds == 60) {
    seconds = 0;
  }
 
  if (minutes < 10) {
    if (minutes < 0) {
      minutes = 0;
    }
    minutes = '0' + minutes;
  }
  if (seconds < 10) {
    if (seconds < 0) {
      seconds = 0;
    }
    seconds = '0' + seconds;
  }
  if (hours < 10) {
    if (hours < 0) {
      hours = 0;
    }
    hours = '0' + hours;
  }
  /*if (hours==00&&minutes==00&&(seconds==00||seconds==01))
{
hours=0;
hours='0'+hours;
minutes=1;
minutes='0'+minutes;
seconds=5;
seconds='0'+seconds;
//functoadd('uppp.php?id='+<? echo $rows['id']?>);
}*/
/*
if (hours==00&&minutes==00&&seconds<=05)
{
functoadd('uppp.php?id='+<? echo $rows['id'];?>);
}*/
 
document.getElementById(divnamech).innerHTML=hours+":"+minutes+":"+seconds;
 
    //alert(hours);
//if(hours==00&&minutes==00&&seconds==00){
	//pageRefrersh('product_detail.php?id='+<? echo $rows['id']?>);  
//}
//else
	//{
	 // var next=parseInt(dday*24);
     // next=next+dhour;
	//current=current-1;
	//if(hours==00&&minutes==00&&seconds<=10){
	//if(seconds==<? echo intval(rand(1,10)) ?>) ajaxpage_local('bidcheck.php');
	//document.getElementById(divnamech).innerHTML='<span style="color:#FF0000">'+hours+":"+minutes+":"+seconds+'</span>';
	//}
	//else
	//{
	//document.getElementById(divnamech).innerHTML=hours+":"+minutes+":"+seconds;
	//}
	
	//document.getElementById(divnamech).innerHTML=hours+":"+minutes+":"+seconds;
	<?
	//$y=i+1;
	?>
	/*
	   ajaxpage('bid_history.php?tit='+<? echo $rows['id']?>+'&update=bid',  'bidHistory');
		 ajaxpage('bid_hits_prd_detail.php?tit='+<? echo $rows['id']?>, 'txtLive');
	*/
 
		setTimeout("calc_counter_from_time()", 1000); //"+current+","+temp+")",1000);
	//}
//alert(hours + ":" + minutes + ":" + seconds);
//return hours + ":" + minutes + ":" + seconds;
}
	function loadpage_local(page_request, containerid) {
		if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)) {
			//document.getElementById(containerid).innerHTML=page_request.responseText;
			//alert(eval('(' + page_request.responseText + ')'));
			var res = page_request.responseText;
			var h1 = res.substring(0, res.indexOf('@'));
			document.getElementById('txtLive').innerHTML = h1;
			var h2 = res.substring(res.indexOf('@') + 1, res.indexOf('|'));
			document.getElementById('bidHistory').innerHTML = h2;
			var h3 = res.substring(res.indexOf('|')+1, res.indexOf('~'));
			document.getElementById('savingBox').innerHTML = h3;
			var expiryTime = res.substring(res.indexOf('~')+1, res.indexOf('!'));
			document.getElementById('expiry_time').value = expiryTime;
			var serverTime = res.substring(res.indexOf('!')+1);
			document.getElementById('server_time').value = serverTime;
			document.getElementById('step_time').value = 0;
		}
	}
 
function updateAuctionDetails() {
	/*
	ajaxpage('bid_hits_prd_detail.php?tit='+<? echo $rows['id']?>, 'txtLive');
	ajaxpage('bid_history.php?tit='+<? echo $rows['id']?>, 'bidHistory');
	ajaxpage('saving.php?tit='+<? echo $rows['id']?>, 'savingBox');
	*/
 
	ajaxpage_local('aa_auction_details.php?tit='+<? echo $rows['id']?>);
 
	setTimeout("updateAuctionDetails()", 3000);
}
 
calc_counter_from_time(); /* '<?=$diffs?>'); */
updateAuctionDetails();
 
</script>
<!-- </div> txtlive--></td>
                                                    </tr>
                                                  
                                                  
                                                  
                                                  <tr>
                                                    <td height="28" align="center" valign="top" class="Light05">&nbsp;</td>
                                                  </tr>
												  
												  
												  
												  
                                                  <tr>
                                                    <td height="28" align="center" valign="top" class="Bdr0B"><br/>
 
<?php if($rows['running_status']!='Paused'){?>
<?php if($_SESSION['mid']!=""){
			if($bidAvailable>0){ 
 
/*
<a href="javascript:ajaxpage('bid_hits_prd_detail.php?tit='+<? echo $rows['id']?>+'&update=bid', 'txtLive'); javascript:ajaxpage('bid_history.php?tit='+<? echo $rows['id']?>+'&update=bid',  'bidHistory'); ajaxpage('saving.php?tit='+<? echo $rows['id']?>, 'savingBox');">
*/			
?>
<a href="javascript:ajaxpage_local('aa_auction_details.php?tit='+<? echo $rows['id']?>+'&update=bid');">
<img src="image/bid.jpg" width="106" height="31" border="0" /></a>
			<? } else { ?>
			<div id="content"><a href="javascript:showDialog('Recharge Bid','Please Recharge Your Bid Account.','error',2);"><img src="image/bid.jpg" width="95" height="27" border="0" /></a></div>
<? }?>
<? }
else{
?>
<a href="login_us.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image<?php echo $rows['id'];?>','','image/bid_login.jpg',1)"><img src="image/bid.jpg" name="Image<?php echo $rows['id'];?>" width="143" height="39" border="0" id="Image<?php echo $rows['id'];?>" /></a>
<? }?>
<? } else {?>
				<img src="image/paused.gif" name="Image<?php echo $i;?>" width="98" height="33" border="0" /><? }?>													</td>
                                                  </tr>
                                                </table>
											<? 	//}?>
												
												
												
												
												</td>
                                              </tr>
                                              <tr>
                                                <td height="15" align="left" valign="top"></td>
                                              </tr>
                                              <tr>
                                                <td align="left" valign="top"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="4">
                                                  
                                                  
                                                  <tr>
                                                    <td height="17" align="left" valign="top" class="small_text"><div align="center">
                                                    <div align="center">Pentru a evita anumite neplaceri , va rugam licitati inainte de secunda 03 ( 00:00:03 ) <strong class="small_text"></strong></div></td>
                                                  </tr>
                                                  <tr>
                                                    <td height="17" align="left" valign="top" class="saving">Economii:<strong class="header_text"></strong></td>
                                                    </tr>
                                                  <tr>
                                                    <td align="center" valign="top" class="BgBlue3">
													<div id="savingBox">
													</div>
													</td>
                                                  </tr>
                                                  <tr>
                                                    <td align="center" valign="top" class="small_text">Pret in magazin * -  pretul actual in magazinele din Romania </td>
                                                  </tr>
                                                </table></td>
                                              </tr>
                                              
                                            </table></td>
                                            </tr>
                                          <tr>
                                            <td align="left" valign="top" background="image/w_b_c.gif"><img src="image/w_b_l.gif" width="12" height="11" /></td>
                                            <td align="left" valign="top" background="image/w_b_c.gif"><img src="image/w_b_c.gif" width="5" height="11" /></td>
                                            <td align="right" valign="top" background="image/w_b_c.gif"><img src="image/w_b_r.gif" width="12" height="11" /></td>
                                          </tr>
                                        </table>
[+][-]07/20/09 08:19 AM, ID: 24895935Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/22/09 06:38 AM, ID: 24914656Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93 - Hierarchy / EE_QW_3_20090701_SELECT_ZONES