Hello,

I am having a problem with my PHP script. This is surely a simple syntax
error and I have gone almost crossed eyed trying several things to get it
to work. The problem is with the following line of PHP:

----------------------------------------------------------

echo '<a
href="http://www.joshuaneil.com/hir/scripts/results/'.$fdf_file,'>click
here to download Non_Disclosure Agreement</a>';


----------------------------------------------------------

The problem is that it is not generating the hyperlink for users to click
on in Internet Explorer. The code is working fine in Mozilla Firefox but I
need to get it to work in Internet Explorer.

Below is the entire script from which the line of code from above is
located. The line of code from above is not too far from the bottom of the
following script. Please check it out and let me know if you have any
suggestions.


----------------------------------------------------------

<?php
    // check that a form was submitted
    if(isset($_POST) && is_array($_POST) && count($_POST)){
        // we will use this array to pass to the createFDF function
        $data=array();

        // This displays all the data that was submitted. You can
        // remove this without effecting how the FDF data is generated.
        echo'<pre>POST '; print_r($_POST);echo '</pre>';

        if(isset($_POST['TEXT1'])){
            // the name field was submitted
            $pat='`[^a-z0-9\s]+$`i';
            if(empty($_POST['TEXT1']) || preg_match($pat,$_POST['TEXT1'])){
                // no value was submitted or something other than a
                // number, letter or space was included
                die('Invalid input for TEXT1 field.');
            }else{
                // if this passed our tests, this is safe
                $data['TEXT1']=$_POST['TEXT1'];
            }

            if(!isset($_POST['TEXT2'])){
                // Why this? What if someone is spoofing form submissions
                // to see how your script works? Only allow the script to
                // continue with expected data, don't be lazy and insecure ;)
                die('You did not submit the correct form.');
            }

            // Check your data for ALL FIELDS that you expect, ignore ones
you
            // don't care about. This is just an example to illustrate, so I
            // won't check anymore, but I will add them blindly (you don't
want
            // to do this in a production environment).
            $data['TEXT3']=$_POST['TEXT3'];
            $data['TEXT4']=$_POST['TEXT4'];
            $data['TEXT5']=$_POST['TEXT5'];

            // I wanted to add the date to the submissions
            $data['TEXT13']=date('Y-m-d H:i:s');

            // if we got here, the data should be valid,
            // time to create our FDF file contents

            // need the function definition
            require_once 'createFDF.php';

            // some variables to use

            // file name will be <the current timestamp>.fdf
            $fdf_file=time().'.fdf';

            // the directory to write the result in
            $fdf_dir=dirname(__FILE__).'/results';

            // need to know what file the data will go into
            $pdf_doc='http://www.joshuaneil.com/hir/pdf/HIR_NDA.pdf';

            // generate the file content
            $fdf_data=createFDF($pdf_doc,$data);

            // this is where you'd do any custom handling of the data
            // if you wanted to put it in a database, email the
            // FDF data, push ti back to the user with a header() call, etc.

            // write the file out
            if($fp=fopen($fdf_dir.'/'.$fdf_file,'w')){
                fwrite($fp,$fdf_data,strlen($fdf_data));
                echo $fdf_file,' written successfully.';
                                echo '<br>';
                                echo '<a
href="http://www.joshuaneil.com/hir/scripts/results/'.$fdf_file,'>click
here to download Non_Disclosure Agreement</a>';
            }else{
                die('Unable to create file: '.$fdf_dir.'/'.$fdf_file);
            }
            fclose($fp);
        }
    }else{
        echo 'You did not submit a form.';
    }
?>



____________________________________________________________

Thanks for all your help. If you have any questions or require any
additional information from me concerning this script please feel free to
send me an email.

Thank you all in advance for your assistance.

Thanks,
Josh
[EMAIL PROTECTED]
http://www.joshuaneil.com


Reply via email to