Results 1 to 4 of 4

Thread: Include a page with onclick

  1. #1
    Join Date
    Nov 2008
    Posts
    996

    Include a page with onclick

    I want to generate (or include) a php page by clicking on a link but does not change the page with a link type <a href="#" onclick="XxXx">

    I used the Code:
    PHP Code:
    onclick = "open (<?php $pge 'add_com'>)"
    <script language="
    JavaScript"> 
    <!--
    function open (url) {
    <?php 
    include (
    $pge.'.php'); 
    ?>
    }
    // -->
    </script>
    But it does not

  2. #2
    Join Date
    May 2008
    Posts
    271

    Re: Include a page with onclick

    Quote Originally Posted by CodGuru View Post
    But it does not
    Details? What does it display (error message), it does not produce the desired result, other (specify)?

    Other:
    JavaScript => Language executed later "client" (by the browser)
    PHP => run server-side language.

    What you want to look angrily at the AJAX

  3. #3
    Join Date
    May 2008
    Posts
    685

    Re: Include a page with onclick

    The problem is that you do not understand how PHP works. PHP is executed server side, and JavaScript client-side. So the browser can not interact with PHP (it is obliged to sent an additional request).

  4. #4
    Join Date
    May 2008
    Posts
    945

    Re: Include a page with onclick

    The answer is already given
    What you want to look angrily at the AJAX
    With Ajax (Asynchronous JavaScript and XML), web applications can retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing page. Data is retrieved using the XMLHttpRequest object or through the use of Remote Scripting in browsers that do not support it. Despite the name, the use of JavaScript and XML is not actually required, nor do the requests need to be asynchronous.

Similar Threads

  1. How to include Webpage into your main page without using iFrame
    By Sanju Baba in forum Software Development
    Replies: 4
    Last Post: 20-01-2012, 10:56 AM
  2. Replies: 3
    Last Post: 24-07-2011, 08:05 AM
  3. CSS Button onclick event href="#" onclick="
    By Cornnelius in forum Software Development
    Replies: 6
    Last Post: 14-05-2010, 11:20 PM
  4. Onclick event with DIV tag
    By ISAIAH in forum Software Development
    Replies: 5
    Last Post: 03-03-2010, 04:45 PM
  5. Include explicitly a jsp page in another
    By MAHESA in forum Software Development
    Replies: 5
    Last Post: 02-12-2009, 08:37 PM

Tags for this Thread

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
  •  
Page generated in 1,713,565,476.69030 seconds with 16 queries