SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2006
    Location
    Australia
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using JS and PHP together

    I have a HTML page with a form (and it's own JS validation) that calls a PHP script that does validation of the form.
    A few questions
    1. Is it better to have the whole lot encapsulated within a single PHP file? How would such a file be set out i.e. having the JS and HTML present within?
    2. If I keep the current format (e.g. separate files) where would I put the files on the web server. Would I require seperate directories or could they be in the same directory?
    3. I want to test the PHP validation as if the JS had failed or was turned off. I am testing the code on a WAMP2 server on my laptop. What wold be the best way to set up for the testing?
    ========================
    Carn the Tiges!
    www.petalsandpatches.com

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tigers!
    2. If I keep the current format (e.g. separate files) where would I put the files on the web server. Would I require seperate directories or could they be in the same directory?
    They can be anywhere. There's no reason to create separate directories for every file?

    Quote Originally Posted by Tigers!
    3. I want to test the PHP validation as if the JS had failed or was turned off.
    Turn off JavaScript in your browser and submit the form.


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
  •