1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Javascript or PHP?

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

  1. jaydeee

    jaydeee New Member

    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.
  2. jaydeee

    jaydeee New Member

    any comments or suggestion?
  3. shabbir

    shabbir Administrator Staff Member

    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

    hi shabbir,
    forgive me, did not noticed that.
    thanks for moving this thread.
  5. shabbir

    shabbir Administrator Staff Member

    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

    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

    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

    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

    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

    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


    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

    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

    Well, this is very clever idea ! Thumbs Up ! :2thumbsup
  14. jaydeee

    jaydeee New Member

    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. :)


Share This Page