piano0011 Posted July 12, 2018 Share Posted July 12, 2018 Hey guys! I would like to have a count down timer to for my music website but I don't know much about javascript. I am just wondering if there is a simple php counter? Quote Link to comment Share on other sites More sharing options...
trochia Posted July 12, 2018 Share Posted July 12, 2018 This might help? was 15 seconds... ;-) https://www.codementor.io/jamesezechukwu/how-to-create-a-simple-counter-using-javascript-html-css-bxcjgbbxa Quote Link to comment Share on other sites More sharing options...
piano0011 Posted July 12, 2018 Author Share Posted July 12, 2018 ?Looks good but how do you save the javascript file? Quote Link to comment Share on other sites More sharing options...
ginerjm Posted July 12, 2018 Share Posted July 12, 2018 Looking at this post and all of your other posts it appears you really, REALLY need to do some learning on your own. First - this post. If you knew anything you would realize that your question is way off base. You can't really get the timer that you want using php. PHP can't count down something for you on your screen as you sit there and watch it. If you wanted to just know for instance how long it took for your app to return an answer to something you asked in a page, yes it could do that. Why? Because php runs on the server! So as in my second case php can start counting when you hit a submit button and then give you back the duration before it comes back to you with an answer. But if you are looking for a timer to tick off the seconds while you are looking at the screen (case 1) you need to use JS because that runs ON YOUR CLIENT. Please - perhaps you need to step back from programming/writing code and do some self-teaching. Read. Read. Read. 1 Quote Link to comment Share on other sites More sharing options...
benanamen Posted July 12, 2018 Share Posted July 12, 2018 2 hours ago, ginerjm said: Looking at this post and all of your other posts it appears you really, REALLY need to do some learning on your own. Sums it up pretty well. Being familiar with the OP from another forum I gave him a heads up when he showed up here. OP, I highly recommend you put some effort into learning on your own and not posting every time a question pops in your head. We are more than happy to help when you get stuck, meaning you have already made attempts on your own to find the answers you need. As you saw from the other forum, people will start ignoring you if you wear out your welcome. Quote Link to comment Share on other sites More sharing options...
Barand Posted July 12, 2018 Share Posted July 12, 2018 3 hours ago, piano0011 said: ?Looks good but how do you save the javascript file? There is a javascript timer in this code Quote Link to comment Share on other sites More sharing options...
piano0011 Posted July 12, 2018 Author Share Posted July 12, 2018 I haven't done any Javascript but read that i have to use script tag? Quote Link to comment Share on other sites More sharing options...
piano0011 Posted July 12, 2018 Author Share Posted July 12, 2018 (edited) I will put in more of my learning effort but was asking questions that i had learnt already such as the div class... and why it move to the next line.. i have done some basic already but was just surprised that it got moved to the next line. However, i wanted a timer with php alone because i haven't learnt java yet and just wanted to know if this was possible? Edited July 12, 2018 by piano0011 Quote Link to comment Share on other sites More sharing options...
ginerjm Posted July 12, 2018 Share Posted July 12, 2018 Apparently you need to do some teaching of yourself on the following subjects: html css js php Point - there is no "div class'. There is a class attribute that you can assign to a div tag. Semantics you may say. I say 'one must be careful in how one words something in this business.' I do appreciate how early it is in your career here and that there is an awful lot that you don't yet know. We have all been there. The way we ALL got through it was by doing a bunch of reading. If reading is not your thing then you may find this road daunting. Quote Link to comment Share on other sites More sharing options...
benanamen Posted July 12, 2018 Share Posted July 12, 2018 1 hour ago, piano0011 said: However, i wanted a timer with php alone because i haven't learnt java yet and just wanted to know if this was possible? My last go at this thread. Java is not the same thing as JavaScript which is what you are actually referring to. Using the wrong terminology could make it difficult for you to get correct responses. Quote Link to comment Share on other sites More sharing options...
cyberRobot Posted July 12, 2018 Share Posted July 12, 2018 2 hours ago, piano0011 said: I will put in more of my learning effort but was asking questions that i had learnt already such as the div class... and why it move to the next line.. i have done some basic already but was just surprised that it got moved to the next line. Learning takes time. Keep at it. Sometimes things take a while before they click into place. ? 2 hours ago, piano0011 said: However, i wanted a timer with php alone because i haven't learnt java yet and just wanted to know if this was possible? I assume that you are looking for a timer that actively changes a set of numbers being displayed on the screen. As ginerjm mentioned in an earlier post, that's not possible with PHP. You'll need to use a client-side language (eg. JavaScript) to do that. Quote Link to comment Share on other sites More sharing options...
piano0011 Posted July 12, 2018 Author Share Posted July 12, 2018 Thanks and i will try to put in more effort to learn Javascript.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.