#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    2
    Rep Power
    0

    Question


    I have searched and searched online and have not found what I want. I am looking for some kind of manual that discusses how to intergrate PHP with JavaScript. I have found out that the book PHP 4 Bible has a section on it but I do not want to pay $30 just for that one section..Does anyone know where I could learn this online?
  2. #2
  3. No Profile Picture
    Resident Moron
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Location
    Tuscaloosa, AL
    Posts
    26
    Rep Power
    0

    What do you mean by "integrate"? While these two languages can have functions that complement each other, there's not that much to using them together except to just learn both of them and apply them when necessary.

    Because Javascript is almost always Client-Side and PHP is Server-Side, there are some natural combinations to be made, For example, lots of form validation is done by Javascript because it saves the bandwidth and time of having to make multiple trips to the server for one submission.

    I'm sure there are some great tutorials, but it'd be easier to point you to them if I had a better grasp of what you're after.
    Pete Holiday
    "The most overlooked advantage to owning a
    computer is that if they foul up, there's no law
    against whacking them around a little."

    More Quotes
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Posts
    23
    Rep Power
    0

    It's actually pretty easy


    Remember that the Javascript is like HTML... it just flows down to the browser in your page.

    I combine Javascript and PHP routinely. So if you wanted, for instance, for some Javascript to update a different field based upon some PHP variable, you can simply use something like:

    document.form[0].<%=$myFormField;%>.value = 'Blah';

    Where 'myformfield' is your PHP variable (of course, this example assumes you have ASP tags enabled in PHP.INI).


IMN logo majestic logo threadwatch logo seochat tools logo