Javascript or PHP?

Discussion in 'PHP' started by jaydeee, Aug 20, 2011.

  1. jaydeee

    jaydeee New Member

    Joined:
    Aug 18, 2011
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    0
    Hi everyone :)

    I am a week old Javascript and PHP self learner and a bit confused.

    I am trying to make a web application "Visitor Appointment System" with following features:
    1. Receptionist/visitor will register visitor details and contact person.
    2. There will be a dashboard what will list all active visitors for the day.
    3. Visitors that had waited for more than 15 minutes will be highlighted. So there will be a minute counter visible in the dashboard for all users that will trigger the highlighting function.
    4. Contact person from the whole company may put notes or accept the visitor.
    5. Report to be generated every end of the week listing all visitors per day.

    So here is my queries.
    1. how/what to use for minute counter feature.
    2. will I use javascript or php for this projects?

    Your inputs are highly appreciated.
    Thanks.
     
  2. jaydeee

    jaydeee New Member

    Joined:
    Aug 18, 2011
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    0
    any comments or suggestion?
    thanks
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Your question is on JavaScript and PHP and you have posted this forum under JSP and expecting a reply. Isnt that a bit too much?

    Moved your thread to PHP forum
     
  4. jaydeee

    jaydeee New Member

    Joined:
    Aug 18, 2011
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    0
    hi shabbir,
    forgive me, did not noticed that.
    thanks for moving this thread.
     
  5. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    For minute counter feature it has to be PHP and you should store the value of the visitor's entry in database and then cron should verify and update the status.
     
  6. Scripting

    Scripting John Hoder

    Joined:
    Jun 29, 2010
    Messages:
    421
    Likes Received:
    57
    Trophy Points:
    0
    Occupation:
    School for life
    Location:
    /root
    Yeah, as Shabbir already said, PHP is needed for this to be done, and some SEQEL language would be also useful.
     
  7. hanleyhansen

    hanleyhansen New Member

    Joined:
    Jan 24, 2008
    Messages:
    336
    Likes Received:
    8
    Trophy Points:
    0
    Occupation:
    Drupal Developer/LAMP Developer
    Location:
    Clifton
    Home Page:
    http://www.hanseninfotech.com
    Javascript or PHP? You need both. Javascript is browser-side scripting why PHP is server-side scripting. You need a combination of the two to elegantly accomplish what you want.
     
  8. Scripting

    Scripting John Hoder

    Joined:
    Jun 29, 2010
    Messages:
    421
    Likes Received:
    57
    Trophy Points:
    0
    Occupation:
    School for life
    Location:
    /root
    Ehm...? You don't need JS, it just mostly used for design ... For proper function you will just need PHP.
     
  9. hanleyhansen

    hanleyhansen New Member

    Joined:
    Jan 24, 2008
    Messages:
    336
    Likes Received:
    8
    Trophy Points:
    0
    Occupation:
    Drupal Developer/LAMP Developer
    Location:
    Clifton
    Home Page:
    http://www.hanseninfotech.com
    Ehmm...? No. Wrong. Javascript is not used mostly for design. Look at his project objectives. Maybe he doesn't want to POST and GET for every single little thing. Maybe he doesn't want to have to refresh the browser for every single little thing. PHP is SERVER SIDE. The most elegant solution would be a good balance between PHP and Javascript. They are used together all the time. It's actually very common if not a norm. Of course, where to use which will be decided as he goes along when he figures out exactly how he wants to do each thing but best practice is to use a good combination of both.
     
  10. Scripting

    Scripting John Hoder

    Joined:
    Jun 29, 2010
    Messages:
    421
    Likes Received:
    57
    Trophy Points:
    0
    Occupation:
    School for life
    Location:
    /root
    Yes, you are right, JS is good for this, (I havent said it isnt), but its not necessary(as you said too). Thats all.... Peace
     
  11. jaydeee

    jaydeee New Member

    Joined:
    Aug 18, 2011
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    0
    Hi!

    Thanks to your replies...

    I agree that I will have to use both scripts but I do not know what is better for what function. I like for the counter functionality, I think it would be better to JS as I do not like this stored on the DB just starting and ending. For database function/transaction sure it would be PHP.

    Thanks again.
     
  12. CarlyFiorina

    CarlyFiorina Banned

    Joined:
    Jun 16, 2011
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    0
    Hey everyone,

    You can also use JavaScript's Alert command to execute a PHP function that has the database routine in it. You can put any PHP code in a PHP function and let JavaScript use it. The only thing you have to remember is to echo something last that the Alert command can use.

    Thanks and regards
    Carly Fiorina
     
  13. Scripting

    Scripting John Hoder

    Joined:
    Jun 29, 2010
    Messages:
    421
    Likes Received:
    57
    Trophy Points:
    0
    Occupation:
    School for life
    Location:
    /root
    Well, this is very clever idea ! Thumbs Up ! :2thumbsup
     
  14. jaydeee

    jaydeee New Member

    Joined:
    Aug 18, 2011
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    0
    sounds a good idea however I'm really new to php and javascript that I hardly figure what you're suggesting, if you could give me the code I want that will be great for me. :)

    thanks.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice