Jump to content

can I email a web page through php?


garyed

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).

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.