NYCPHP Meetup

NYPHP.org

[nycphp-talk] need another pair of eyes!

Tim Lieberman tim_lists at o2group.com
Wed Jul 23 17:36:00 EDT 2008


Not entirely clear on what you're trying to accomplish.  Can you give  
us some context, maybe tell us a user story?

-Tim

On Jul 23, 2008, at 3:28 PM, Kristina Anderson wrote:

> Hi everyone, I really need another pair of eyes to take a look at
> this.  I'm pretty sure this form needs to be submitted twice in order
> to pass the post array to the included file (see code below)...is that
> the only issue here..?  this is a bare bones code sample which i will
> have to integrate into my paypal app.
>
> the code modification was prompted by the fact that the buyers were  
> not
> seeing an html page on my client's website before the download box
> popped up, and this needs to be rectified.
>
> Thanks in advance!
>
> FILE 1 - testdowndisp.php
> <?
>
> $itemno = "333";
>
> ?>
>
> <html>
> <head>
> <script language="javascript">
>
> var flag = true;
>
> function laLoad(){
>
> if (flag) {
>
> document.fred.submit();
> //var flag = false;
>
> }
>
> }
>
> </script>
>
> </head>
>
> <body onload="laLoad()">
> Thanks for your purchase.  The charge will appear on your statement as
> Rough Draft P.<p>Welcome back to Proof Magazine website.
>
> <form name="fred" action="testdowndisp.php" method="POST">
> <input type="hidden" name="transid" value="<? echo $tx ?>">
> <input type="hidden" name="pdfid" value="<? echo $itemno ?>">
> </form>
> <?
>
> ob_clean();
> include('downloadfile2.php');
> //exit(0);
>
> ?>
> </body>
> </html>
>
>
> FILE 2 -- downloadfile2.php
>
> <?
>
> $pdfid = $_POST['pdfid'];
> $filename = $pdfid.".pdf";
> //echo $pdfid."<br>";
> //echo $filename."<br>";
>
>
> //====
> $path = '/usr431/home/p/r/proof/PDFs/';
> $filesize=filesize($path.$filename);
> header("Content-Type: application/pdf");
>     header("Content-Length: ".$filesize);
>     header("Content-Disposition: attachment; filename=$filename");
>     header("Content-Transfer-Encoding: binary");
> readfile($path.$filename);
> //fopen($path.$filename);
> //===
>
> ?>
>
>
> -- Kristina_______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php




More information about the talk mailing list