Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Yay
    Yay is offline
    Regular Coder Yay's Avatar
    Join Date
    Oct 2008
    Location
    54° North, 1° West
    Posts
    102
    Thanks
    9
    Thanked 1 Time in 1 Post

    Exclamation Change HTML to an Image file

    Hi there,

    Is there any way I can make the HTML output (I'm using $_GET, so its necessary that its an output of the page) to an image file?

    Basically, when a user clicks a button, it then makes an image out of the current HTML window (or frame), and stores it in a certain directory.

    Any help with this would be great.
    Words and phrases to use when you pretend to know something on CodingForums: Yes. Indeed. Well done. Absolutely Great. Top-notch. Awesome. Cool. Very Good. I see. Oh, yes. I understand. Good.

  • #2
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    If you want this doing from remote computers the answer is no. If you are doing this locally then yes its possible but tricky. Theres a function called imagegrabwindow but you can't do this on any computer but the server
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)

  • #3
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Search. The question has been asked many times before.

  • #4
    Yay
    Yay is offline
    Regular Coder Yay's Avatar
    Join Date
    Oct 2008
    Location
    54° North, 1° West
    Posts
    102
    Thanks
    9
    Thanked 1 Time in 1 Post
    I'll add some new details:

    I'm running MAMP (Mac), and here's the run-down of my PHP process:

    a) User clicks a button, which uses $_GET to get the value of 'name' from a LEFT JOIN, then, <?php $_GET['name'] ?> is a value of a somewhat invisible input box.

    b) When a user clicks another button, it makes a JPG version of the webpage, and stores it in a directory, and the file name is based on the <?php $_GET['id'] ?> ID of the person.

    Any help towards a script which does this would be appreciated.
    Words and phrases to use when you pretend to know something on CodingForums: Yes. Indeed. Well done. Absolutely Great. Top-notch. Awesome. Cool. Very Good. I see. Oh, yes. I understand. Good.

  • #5
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    You haven't said if people will be accessing this from a computer other than the server. If they are then you cannot capture the screen. To clarify, if this is to be web based and not just on a standalone computer it will NOT be possible
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)

  • #6
    Yay
    Yay is offline
    Regular Coder Yay's Avatar
    Join Date
    Oct 2008
    Location
    54° North, 1° West
    Posts
    102
    Thanks
    9
    Thanked 1 Time in 1 Post
    Quote Originally Posted by JAY6390 View Post
    You haven't said if people will be accessing this from a computer other than the server. If they are then you cannot capture the screen. To clarify, if this is to be web based and not just on a standalone computer it will NOT be possible
    This system will not be web-based. Ever.
    Words and phrases to use when you pretend to know something on CodingForums: Yes. Indeed. Well done. Absolutely Great. Top-notch. Awesome. Cool. Very Good. I see. Oh, yes. I understand. Good.

  • #7
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You have to provide a path to the image. HTML documents use URLs for paths. If the image is in the same directory as your html file, then you use the filename.

    The tag is "img":

    <img src="myImage.jpg">
    Last edited by Fou-Lu; 02-12-2010 at 12:24 PM. Reason: Signatures only through control panel


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •