#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    missouri
    Posts
    165
    Rep Power
    12

    Any one good at converting PHP to JavaScript??


    I have built a form with JavaScript that will alter the colors on the form in a day/night mode using a button and external JS.

    I have found a PHP code where it will express whether it is night or day based off of location and sunrise and sunset. I would like to incorporate it into my existing day/night mode in my form. But being it is entirely done in Java Script, I am finding it too hard to incorporate the PHP in.

    Was wondering if anyone would be able to help me by converting this PHP code into JavaScript?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Windsor ON, Canada
    Posts
    462
    Rep Power
    14
    they are two different languages PHP executes on the server side and JavaScript run on the client side. the PHP would have to determine whether it is night of day and send that information somewhere on the page so that the javascript can use it on the client side.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    missouri
    Posts
    165
    Rep Power
    12

    Smile


    I understand that and gave it a try but it is not working right.

    I would rather have it all work client side, that is why I am wanting to build a script in JS to work similar to the PHP day/night mode.

    I have done an extensive search for this type of day/night code and it only is scripted in PHP. There is no Java Script code anywhere that does the same thing.

    That is why I was looking for help in converting the whole PHP code into JS so it could be easier to work into the existing form I created in JS and it operate all client side.

IMN logo majestic logo threadwatch logo seochat tools logo