close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

DFP and Universal Email work together or no?

Thread began 9/14/2011 1:23 am by Steve | Last modified 9/14/2011 10:50 am by Jason Byrnes | 1018 views | 4 replies |

Steve

DFP and Universal Email work together or no?

Hello,
I need to download a file then send an email.. Simple enough.

But does one cancel out the other? If the download is in front of the email calls only the download happens. IF the download is after the email the GoToPage variable is called and the page header redirects before the download can happen.

And if you move the email includes before the helper.php the download is put into the browser window creating a crash.


<?php require_once("webassist/file_manipulation/helperphp.php"); ?>
<?php
WA_DFP_SetupDownloadStatusStruct("WA_DownloadResult1");
if(isset($_POST["imageField_x"])){
WA_DFP_DownloadFile("WA_DownloadResult1", "downloads/", "tapecalc_setup.zip", "[FileName]", false, false, false, "", "", "", "");
}
?>

<?php require_once("webassist/email/mail_php.php"); ?>
<?php require_once("webassist/email/mailformatting_php.php"); ?>
<?php
if (!isset($_SESSION))session_start();
if ((isset($_POST["imageField_x"]))) {
//WA Universal Email object="mail"
Sign in to reply to this post

Steve

If the file download and helper files are positioned after the email and the email has no GoToPage so it can continue to the next function these errors are returned which look like conflicts in extension:



Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/tfhs33/public_html/test.php:8) in /home/tfhs33/public_html/test.php on line 23

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/tfhs33/public_html/test.php:8) in /home/tfhs33/public_html/test.php on line 23

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/tfhs33/public_html/test.php:8) in /home/tfhs33/public_html/test.php on line 74

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/tfhs33/public_html/test.php:8) in /home/tfhs33/public_html/test.php on line 74

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/tfhs33/public_html/test.php:8) in /home/tfhs33/public_html/webassist/email/mail_php.php on line 285

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/tfhs33/public_html/test.php:8) in /home/tfhs33/public_html/webassist/email/mail_php.php on line 285

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/tfhs33/public_html/test.php:8) in /home/tfhs33/public_html/test.php on line 104

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/tfhs33/public_html/test.php:8) in /home/tfhs33/public_html/test.php on line 104

Warning: Cannot modify header information - headers already sent by (output started at /home/tfhs33/public_html/test.php:8) in /home/tfhs33/public_html/webassist/file_manipulation/helperphp.php on line 690

Warning: Cannot modify header information - headers already sent by (output started at /home/tfhs33/public_html/test.php:8) in /home/tfhs33/public_html/webassist/file_manipulation/helperphp.php on line 691

Warning: Cannot modify header information - headers already sent by (output started at /home/tfhs33/public_html/test.php:8) in /home/tfhs33/public_html/webassist/file_manipulation/helperphp.php on line 692

Warning: Cannot modify header information - headers already sent by (output started at /home/tfhs33/public_html/test.php:8) in /home/tfhs33/public_html/webassist/file_manipulation/helperphp.php on line 693

Sign in to reply to this post

Jason ByrnesWebAssist

A file download cannot occur on a page with other processing, it will not work.

Downloading a file is done through manipulating the pages header.

The email redirect is also done through manipulating the pages header.

The header manipulation done by the download function will prevent any other header action from occurring.

To work around this, you should perform the file download on the thank page that the email behavior redirects to.


as for the errors, thee are cause by a blank line between php code blocks on line 7 or 8.

Seethe following thread for more details on the headers already sent error:
showthread.php?t=19285

Sign in to reply to this post

Steve

Thanks Jason for the prompt reply and assistance.

One parting question, the header use also cancels a metafresh on the thankyou page (tested currently as the condition found) after the download code is executed?

This makes the only way to do a final GoToPage function after initiating the download, is to set a javascript timer and then reinitiate the header redirect or page window.location by forcing it as an event after a timer completes?


Just to outline my current working flow:
1) Order page which sends out email and redirects to:
2) Thank you page which uses a meta refresh to then call the separate download page:
<meta http-equiv="Refresh" content="1;URL=downloadDemo.php" />

This still leaves us on the Thank you page even thought the meta refresh fires and the download starts.

Expected next step IF wanting to then go home after 5 seconds:
3) use a JS timer to then fire and move to home page unless the meta refresh has also killed any further page processes

Yes?

Sign in to reply to this post

Jason ByrnesWebAssist

I'm not really a fan of forcing the redirect to the home page. I think it would be better to have a link to the ho,me page and let the user choose to go there, But if you wanted to force it, yes, I guess a 5 second timer would do the trick.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...