SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Oct 2013
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Include special page content into another page

    Hi, I have a page graph.php where I have drawn a graph using highcharts.js.

    I want to include that graph in another page. Can I use <img src="graph.php"> ? Please suggest me the right of embedding in any page.

    Thanks all.

  2. #2
    SitePoint Member c0dingL!fe's Avatar
    Join Date
    Sep 2013
    Location
    Essex
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HI there,

    Why don't you just use the include() function to include the script?

    Wherever you want the graph to display, just include it:
    PHP Code:
    include("graph.php"); 
    Depends where the graph.php is located relative to the calling script to determine the path of the file.

    Kind regards,

    cL.

  3. #3
    SitePoint Addict
    Join Date
    Aug 2006
    Location
    Nantwich, Cheshire
    Posts
    363
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I belive you can call the routine as you first posted, as the src element of an img tag, as long as the only thing your php routine returns is an image. I haven't tried this with php, but used it for displaying captcha images.
    http://www.firenza.net - my homage to a car from the 1970s


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
  •