Results 1 to 4 of 4

Thread: JavaScript or PHP?

  1. #1

    JavaScript or PHP?

    I just have a quick question. (My posts always start out like that...)
    My webpage (the one hosted by my ISP, not the webserver at home) is due for a redesign. Actually, it has always been due. I wanted to do certain things when I built it the first time, but didn't have the drive to learn how. I plan to redesign it, then run it on the webserver at home until I find a suitable host (ISP won't even let me run CGIs, much less PHP and such...)

    Anyways, I am setting up a MySQL, PHP thing, and I want to have a webpage with about 4 or 5 drop down lists that users can select options, then, based on their options, I want PHP to query the server and retrieve records to be displayed.

    My question is... am I mistaken by thinking that the drop down menus are JavaScript? Is there a problem in mixing JS and PHP like this? I am sorry if these are retarded questions, but since I am new to both concepts, I can't yet envision them together. Thanks for your guys' time
    Asus A8V Deluxe Mobo
    AMD Athlon64 X2 4400 -939
    2GB Crucial DDR3200 Dual-Channel
    ATi AiW 9800 Pro 128DDR
    Audigy2 ZS
    Sony DRU-810 DVD+RW DL
    3 x Maxtor MaxLine SATA 160Gb 16Mb Cache
    1 x Maxtor MaxLine SATA 300Gb 16Mb Cache
    1 x Maxtor MaxLine SATA 120Gb 16Mb Cache

  2. #2
    Senior Member
    Join Date
    Nov 2001
    Posts
    304

    Re:JavaScript or PHP?

    Ok, I can answer this... sort of

    If by "drop down menu" you mean "when I place my mouse over the text, it shows the menu" then... yes that's javascript. If you mean "there's a menu of fields they can select (such as the list of states) and i want them to be able to choose it without typing it in" then... no, that's html (select tag with option tags.)

    It's not "wrong" to mix javascript with cgi, php, asp, jsp, whatever... because the javascript is just another client side thing. It's just an extension to tell the client how to do more with the page than just display text, images, etc. Use it if you feel the need. Personally, I don't like javascript much, (too many things that require you to do "if the browser is Idiot Empowerer, do this, if it's Nutscrape, do that, if it's Best Brand Browser, do the other" just to do one thing and make it look the same across browsers. (This is especially true when trying to do stuff with image transitions, etc)

    Good luck and if you get stuck let us know

  3. #3

    Re:JavaScript or PHP?

    Well...hmmm... the type of menu I am thinking of is the kind where there would be a field, with a default option of "select one", then the user would click on an arrow (or other symbol) then a drop down list would open. The user would then move the mouse over the choice they want to highlight it, click it, then the menu would go back up, displaying their choice in the field. I wish I knew the terminology for the stuff... Actually a perfect example... when you reply to a post on this BBS, you are taken to the "post reply" screen. You then see a menu to choose what kind of message icon you want. When you make your choice, it appears in the field....
    Beats me... I think this is why I gave up on the project to begin with, it is a little hard starting from nothing and trying to work up to this grand thing... I will not give up this time though!
    Asus A8V Deluxe Mobo
    AMD Athlon64 X2 4400 -939
    2GB Crucial DDR3200 Dual-Channel
    ATi AiW 9800 Pro 128DDR
    Audigy2 ZS
    Sony DRU-810 DVD+RW DL
    3 x Maxtor MaxLine SATA 160Gb 16Mb Cache
    1 x Maxtor MaxLine SATA 300Gb 16Mb Cache
    1 x Maxtor MaxLine SATA 120Gb 16Mb Cache

  4. #4
    Senior Member
    Join Date
    Nov 2001
    Posts
    304

    Re:JavaScript or PHP?

    that would be an html tag then

    You want to use <form> tags to create a form, and the tag that creates the menu you describe is a <select> tag. Each choice in that menu is an <option> tag.

    It's all standard HTML so you won't need javascript to do that

    If you need help with it, let us know

Similar Threads

  1. Addicting javascript games
    By jro in forum General Chat
    Replies: 5
    Last Post: 02-18-2005, 03:48 PM
  2. How to delete cookies in Javascript?
    By Jason Lu in forum Windows - General Topics
    Replies: 5
    Last Post: 02-09-2005, 11:04 AM
  3. Isn't javascript great?
    By kornp in forum General Chat
    Replies: 3
    Last Post: 12-04-2002, 02:38 AM
  4. Need help with perl/JavaScript program
    By Schotty in forum Linux - Software, Applications & Programming
    Replies: 3
    Last Post: 02-19-2002, 07:12 PM
  5. Real Player and JavaScript
    By ndogg in forum Linux - General Topics
    Replies: 2
    Last Post: 01-09-2002, 08:04 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •