SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist jazztie's Avatar
    Join Date
    Mar 2001
    Location
    the Netherlands
    Posts
    519
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using POSTED information in JavaScript

    I have a little problem.
    I have a very nice Content Editor, but somehow I can't get it to work when I use PHP... rather, it has to be done in HTML at the time.

    There's a lot of Javascript, including the function where it pastes the content in the editor.
    PHP Code:
     //fill editor with content
        
    idContent.content=idContentTemp.innerHTML 
    Now, what I want to do is read the content of the page on a php-page, and POST it in a form to the HTML page with the Content Editor. (Somehow, I can't figure out how to connect to a database in JavaScript (if even possible))...

    So, what I need is to get the POSTED information and put it in the "idContent.content=idContenTemp.innerHTML". How is this done? How can I read the HTTP_VARS in JavaScript?

    Please, any help is appreciated!

    Jazz

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    I think your understanding of client-side and server-side scripting is blurred.

    1. Javascript cannot connect to a database...well, not entirely true, but it would only work in IE.

    2. Javascript cannot read posted form variables. You will have to use a server-side scripting language like PHP or ASP in order to grab the form variables.

    Hope this helps somewhat.

    --Vinnie

  3. #3
    SitePoint Evangelist jazztie's Avatar
    Join Date
    Mar 2001
    Location
    the Netherlands
    Posts
    519
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I figured that I had a problem. I already knew Javascript can't connect to a database...

    Only, I hoped it would be able to read out posted Http-variables.

    PHP won't work at this time, because the editor doesn't seem to work well with it.

    Jazz

  4. #4
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Editor? If you're talking about your text/HTML editor, get a new one. There's plenty of free ones out there that have support for PHP and many other server-side languages.

    --Vinnie


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
  •