Should I use Java Script Or Php?

5 replies
  • WEB DESIGN
  • |
Alright Guys

I am a little bit confused/stuck at the moment

I am in the process of looking at countdown timers either in Javascript or Php but not sure which one would be the right/best option to choose on the criteria that I want

The timer format

To display:

00days 00hrs 00mins 00secs

Timer functions:

To countdown contiounsly until reaches zero (the reason that I say that is because I have seen some that when you go back to the same page it starts counting down again)


I will be using the timer for digital products that I am selling

Lets say for example if I offered a ebook at special price for 2hrs at $2.99 when the timer reaches zero it automatically displays the higher price (lets say $17)

Also on some products I will want either the order button to stop working or a webpage to display letting them know that they have missed out on the offer..

Also I am thinking of having a limit of products added as well.. I.e I am only going to sell 20 ebooks for that low price of $2.99 within those hours..

So when the quantity or timer reaches zero it displayed offer missed or higher price
#java #php #script
  • Profile picture of the author luciuskern
    Hello Byron,

    I just did something simpler to what you are looking for here. In my case, i used both php and java but you can use either/or.

    i think using all java would be easier!
    I dont have any scripts off the top of my head but basically

    you need a java countdown timer with a redirect command that would redirect/reload the page to a new price.
    you can modify this DHTML countdown

    something that converts sweet is, countdown in a floating div over your copy that follows the views.

    There are free scripts for that out there (google it) or you can write yourself.

    Let me know if i can help feather..
    Thanks


    PS: I tried posting some links in here put my post count is not high enough . sorry
    {{ DiscussionBoard.errors[667516].message }}
    • Profile picture of the author Byron_Wells
      Originally Posted by luciuskern View Post

      Hello Byron,

      I just did something simpler to what you are looking for here. In my case, i used both php and java but you can use either/or.

      i think using all java would be easier!
      I dont have any scripts off the top of my head but basically

      you need a java countdown timer with a redirect command that would redirect/reload the page to a new price.
      you can modify this DHTML countdown

      something that converts sweet is, countdown in a floating div over your copy that follows the views.

      There are free scripts for that out there (google it) or you can write yourself.

      Let me know if i can help feather..
      Thanks


      PS: I tried posting some links in here put my post count is not high enough . sorry

      Hmm

      what about the quantity part? or would the redirect only work on the actual timer part in javascript?
      {{ DiscussionBoard.errors[667876].message }}
    • Profile picture of the author TheCren
      PHP is run on the server, while JavaScript is run by the client. So if you use PHP you'll need to learn AJAX in order to have the page updated every second (or few hundred milliseconds). It's probably not worth the hassle for what you're trying to do. Just use Javascript: that's my opinion.

      P.S. -
      Originally Posted by luciuskern View Post

      i think using all java would be easier!
      I dont have any scripts off the top of my head but basically

      you need a java countdown timer with a redirect command that would redirect/reload the page to a new price.
      you can modify this DHTML countdown
      Please, please, please stop using the word "Java" when you mean "JavaScript." They are two very different languages used in two very different settings.
      {{ DiscussionBoard.errors[668056].message }}
      • Profile picture of the author Byron_Wells
        Originally Posted by TheCren View Post

        PHP is run on the server, while JavaScript is run by the client. So if you use PHP you'll need to learn AJAX in order to have the page updated every second (or few hundred milliseconds). It's probably not worth the hassle for what you're trying to do. Just use javascript: that's my opinion.

        P.S. -


        Please, please, please stop using the word "Java" when you mean "JavaScript." They are two very different languages used in two very different settings.

        Could you help me with it pleasE??
        {{ DiscussionBoard.errors[669917].message }}
  • Profile picture of the author Byron_Wells
    Originally Posted by DanielFonda View Post

    I would usually recommend Javascript. But it's all a matter of taste. Just search google for benefits of both and than choose the right language for you.

    But how easy is javascript to code compared to php??
    {{ DiscussionBoard.errors[667986].message }}

Trending Topics