Jump to content

[SOLVED] PHP (not js)


AV1611

Recommended Posts

Not sure if I can do this with javascript.  I like to work with PHP only...

 

Here's what I need to do:

 

I have an online form.  When you click submit, I want it to do two things:

1.  Open a "printable" page that they can sign and mail in via snail mail (or fax)

2.  Send an email with the form information.

 

I can do each on separately as php scripts, but can they both happen with a single submit button click?

 

(does the email headers count as output preventing the header from going to the new page or whatever?)

 

I think I want it to capture the data, send the email, then build the form as a printable webpage or as a .doc or .txt file with download headers.

 

I just need concept help, not actual code help.  Thanks.

 

Link to comment
https://forums.phpfreaks.com/topic/89961-solved-php-not-js/
Share on other sites

Of course you can. Just have your code for sending the email, then your code to display the printable version right after. The 'headers' for an email are separate from those of the page.

 

Just be careful, cus if they keep hitting refresh, it will keep sending you an email. You may want to set a session variable to track the fact that the email was sent already. Then just clear the session variable if they return to the form (so they can submit it again).

Link to comment
https://forums.phpfreaks.com/topic/89961-solved-php-not-js/#findComment-461200
Share on other sites

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.