Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-09-2010, 04:01 PM   PM User | #1
Yay
Regular Coder

 
Yay's Avatar
 
Join Date: Oct 2008
Location: 54° North, 1° West
Posts: 102
Thanks: 9
Thanked 1 Time in 1 Post
Yay is an unknown quantity at this point
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.
Yay is offline   Reply With Quote
Old 02-09-2010, 04:15 PM   PM User | #2
JAY6390
Regular Coder

 
Join Date: Dec 2009
Location: UK
Posts: 495
Thanks: 0
Thanked 58 Times in 58 Posts
JAY6390 is on a distinguished road
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 :)
JAY6390 is offline   Reply With Quote
Old 02-09-2010, 04:15 PM   PM User | #3
MattF
Senior Coder

 
Join Date: Jul 2009
Location: South Yorkshire, England
Posts: 2,322
Thanks: 6
Thanked 304 Times in 303 Posts
MattF will become famous soon enoughMattF will become famous soon enough
Search. The question has been asked many times before.
MattF is offline   Reply With Quote
Old 02-09-2010, 04:38 PM   PM User | #4
Yay
Regular Coder

 
Yay's Avatar
 
Join Date: Oct 2008
Location: 54° North, 1° West
Posts: 102
Thanks: 9
Thanked 1 Time in 1 Post
Yay is an unknown quantity at this point
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.
Yay is offline   Reply With Quote
Old 02-09-2010, 04:41 PM   PM User | #5
JAY6390
Regular Coder

 
Join Date: Dec 2009
Location: UK
Posts: 495
Thanks: 0
Thanked 58 Times in 58 Posts
JAY6390 is on a distinguished road
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 :)
JAY6390 is offline   Reply With Quote
Old 02-09-2010, 04:49 PM   PM User | #6
Yay
Regular Coder

 
Yay's Avatar
 
Join Date: Oct 2008
Location: 54° North, 1° West
Posts: 102
Thanks: 9
Thanked 1 Time in 1 Post
Yay is an unknown quantity at this point
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.
Yay is offline   Reply With Quote
Old 02-12-2010, 11:07 AM   PM User | #7
martin.lawrence
New to the CF scene

 
Join Date: Feb 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
martin.lawrence is an unknown quantity at this point
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
martin.lawrence is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:16 AM.


Advertisement
Log in to turn off these ads.