Jump to content

Recommended Posts

I know how to do an email script so I assume I could email a file without a problem but I want to email a web page.

Currently I have a php page where the user enters a bunch of data in a form & the form prints the results to the screen.

I use a javascript window.print() function so the user can print the page. I want to be able to have the user hit a button & email the same output that the javascript function will print. I assume I would have to print the page to a file & then have that file emailed but how can the page be printed to a file?  Am I even thinking on the right track?

 

Link to comment
https://forums.phpfreaks.com/topic/266991-can-i-email-a-web-page-through-php/
Share on other sites

Before you can mail a link to a page you need a page that can be linked to. So you either have to save the screen output as a static HTML file or store the inputted data and email a link to a php script that can recreate the HTML page from that data.

Maybe I didn't make myself very clear.

The page where the form is filled out remains as is & the data entered into the form produces additional output on the page. A link to the page would be useless because all the data & inputs are gone when you leave the page.

 

In that case I'd use a database to store the data, and use an ID to retrieve it again. Then send a link with the given ID, and you're set.

That sounds like a good idea if I can figure out how to do it.

I'll try & work on it.

Thanks for the idea.

 

 

 

 

You're welcome, glad I could help. :)

 

I've also found you a starting point PHP & MySQLi tutorials, which should help explain how to communicate against a database. I also recommend looking at a MySQL tutorial, to learn how to use a database (and not just how to use PHP to communicate with it).

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.