Skip to main content
Inspiring
May 12, 2008 9:11 AM UTC
Question

Webpage Snapshots

Hi,
Is there a way I can snapshot a page when the visitor clicks on submit? or is there a script I can use?
This topic is closed to new replies. Start a new post to keep the conversation going.

19 replies

Inspiring
May 13, 2008 2:35 PM UTC
> Thats great thank you for your help and advice.
> I thought about using hidden fields but didn't know how I could implement
> them.
>
> I have spend the last 2 hours amending and hacking away at my script. And
> I
> have finally got the values passed through.
> Its not how I would like it but it works.
> All the values get sent to my given email address then once that is done
> the
> user goes to the payment page which is connected to osCommerce
> http://www.liquidprint.co.uk/cards/
> if you want to have a look

I got a few run-time errors in IE. Impressive, though.

-Darrel


Translate
Inspiring
May 13, 2008 3:35 PM UTC
You chose magenta :-)
Yea those errors are weird. Is there a way I can hide them from IE status bar?
Translate
Inspiring
May 13, 2008 2:22 PM UTC
Thats great thank you for your help and advice.
I thought about using hidden fields but didn't know how I could implement them.

I have spend the last 2 hours amending and hacking away at my script. And I have finally got the values passed through.
Its not how I would like it but it works.
All the values get sent to my given email address then once that is done the user goes to the payment page which is connected to osCommerce
http://www.liquidprint.co.uk/cards/
if you want to have a look

Thanks again
The_FedEx_Guy
Translate
Inspiring
May 12, 2008 1:25 PM UTC
> Is there a way I can snapshot a page when the visitor clicks on submit? or
> is there a script I can use?

What do you mean by 'snapshot'? You mean screen shot? If so, not, not
natively through a browser. You'd have to use some 3rd part add-on compenent
that gets installed client-side.

-Darrel


Translate
Inspiring
May 12, 2008 2:04 PM UTC
yes a screenshot. Sorry I've been searching the net for different terms for the same thing, but still nothing useable.

I have had no luck with dompdf.

All I need to do is create a file, either a pdf or jpg to show me what the site user is seeing

I have gone back to using dompdf so far I have this:

Page 1 with submit button:
Once user has submitted it goes to page 2:

require_once("dompdf/dompdf_config.inc.php");
$width = 3.370 * 72.0; // Width in points (3.37" x 72 pt/in)
$height = 2.125 * 72.0; // Height in points (2.125" x 72 pt/in)
$size = array(0.0, 0.0, $height,$width);

if ( isset( $_POST["html"] ) ) {

if ( get_magic_quotes_gpc() )
$_POST["html"] = stripslashes($_POST["html"]);

$old_limit = ini_set("memory_limit", "16M");

$dompdf = new DOMPDF();
$dompdf->load_html($_POST["html"]);
$dompdf->set_paper($size, "Landscape");
$dompdf->load_html($_REQUEST[html]);
$dompdf->render();

$dompdf->stream("businesscard.pdf");

exit(0);

}

Some how I need to pass the variable html as part of the form.

The script author emailed me saying:
Try calling load_html() only once with the full html document that you want
created as a business card. For example:

// clean input here
...

// Note you can include CSS and whatever markup you need in $html
$html = "<html><body>".
"<p>Name: " . $_POST["name"] . " </p> " .
"<p>Work Phone: " . $_POST["name"] . "</p>" .
...
"</body></html>";

$dompdf = new DOMPDF();
$width = 3.370 * 72.0; // Width in points (3.37" x 72 pt/in)
$height = 2.125 * 72.0; // Height in points (2.125" x 72 pt/in)
$size = array(0.0, 0.0, $height,$width);
$dompdf->set_paper($size);
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream();
...

But I have tried this for page 1 its doesnt seem to work, what am I doing wrong to get it working on separate pages?
Translate