עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

עזרה בקוד JS, PHP

Featured Replies

פורסם

<p>בעקרון אני מנסה לעשות COUNTDOWN שיראה כמה זמן נשאר מהזמן הנוכחי של השרת לזמן מסויים שנמצא בבסיס הנתונים.</p><p>אני יודע ליצור זאת כשהזמן הוא הזמן של הקליינט אבל לא כשמדובר על הזמנים של השרת.</p><p>ניסיתי את הדבר הבא</p><p></p><div></div><pre class="ipsCode"><br><br><input type="text" id="sec"><br> <input type="text" id="min"><br> <input type="text" id="hour"><br> <input type="text" id="days"><br> <script type="text/javascript"><br><br><br><br><br><br> function countdown()<br> {<br> <?php<br>$XcurrentCT = date('Y-m-d H:i'); //Current Time<br>$XcurrentCST = date('Y-m-d H:i:s'); //Current Seconds Time<br>$XtimestampCST = strtotime("$XcurrentCST"); // current timestamp + seconds<br>$XtimestampCT = strtotime("$XcurrentCT"); //current timestamp without seconds (to add a minute)<br>$Xtimestamp2 = strtotime("+1 minutes", $XtimestampCT); // added a minute<br>$Xtime = ($Xtimestamp2 - $XtimestampCST);<br><br>?><br> var rsec= <?php echo $Xtime; ?><br><br> var sec = rsec%60<br> var rmin = rsec/60<br> rmin = parseInt(rmin)<br><br> var min = rmin%60<br> var rhour = rmin/60<br> rhour = parseInt(rhour)<br><br> var hour = rhour%24<br> var rday = rhour/24<br> rday = parseInt(rday)<br><br> var day = rday<br> day = parseInt(day)<br><br><br> document.getElementById('min').value=min<br> document.getElementById('sec').value=sec<br> document.getElementById('hour').value=hour<br> document.getElementById('days').value=day<br><br> t=setTimeout("countdown()",1000)<br><br> }<br> countdown()<br><br> </script><br><br><br></pre><p></p><p>בניגוד למה שאמרתי בהתחלה, היעד כאן הוא בעצם תחילת הדקה הבאה</p><p>אבל זה רק במקרה הזה, אני צריך את הקוד גם לעמודים נוספים.</p><p>בקיצור, כשהעמוד עולה, אני רואה את הזמן הנותר אבל השעון לא ממשיך לרדת למטה... אני מתאר לעצמי</p><p>בגלל שאי אפשר להריץ קוד PHP אחרי שהעמוד נטען</p><p>אבל מה אני כן יכול לעשות כדי לגרום לקוד לעבוד?</p><p>אני יכול לבדוק פעם אחת את הזמן הנותר וכל שניה פשוט להחסיר שניה מהמשתנים</p><p>אבל בשביל זה אני צריך אין ספור משפטי תנאי שמן הסתם כבר יכלתי לעשות את זה עד עכשיו וזהו</p><p>אבל אני בטוח יש דרך פשוטה יותר לעשות זאת.</p><p>תודה מראש לעוזרים.</p>

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.