Jump to content

Mindjakk

New Members
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Mindjakk

  • Rank
    Newbie
  1. You are a gentleman and scholar among men. That did it!! Thanks. That is perfect.
  2. YOU WERE RIGHT!! After removing the Echos, I was able to get it to launch the downloader for the pdf I guess my next question is can we launch ti in the browser? Thanks.
  3. This is the HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <center> <h1> Get Directions</h1> <form action="form_action.php" method="get" name="directions" target="_new"> <select name="startpoint" size="1"> <option value="north">North Tower Entrance</option> <option value="south">South Tower Entrance</option> <option value="moba">MOB A Entrance</option></select> -----> <select name="endpoint" size="1"> <option value="onco">Oncology</option> <option value="radio">Radiology</option> <option value="pulm">Pulmanary</option></select> <br /><br /> <input type="submit" value="Submit" /> </form> </center> </body> </html> This is the PHP <?php $a = $_GET["startpoint"]; $b = $_GET["endpoint"]; //build the filename $filename = $a . $b . '.pdf'; echo "Your Startpoint is:". $a. "<br />"; echo "Your Endpoint is: ". $b. "<br />"; echo $a,$b,".pdf". "<br />"; echo $filename; //check to see that it actually exists first if (file_exists($filename)) { //send file to browser header('Content-type: application/pdf'); header('Content-Disposition: attachment; filename="' . $filename . '"'); header('Content-Transfer-Encoding: binary'); header('Content-Length: ' . filesize($filename)); header('Accept-Ranges: bytes'); readfile($filename); } ?> I'm new to PHP coding so I might have messed it up, thanks. Also I am only echoing to be sure I am getting the proper results, I can remove those, in the end it should just launch a PDF with corresponding file name. THanks.
  4. Sorry about the additional thread. I have this portion working now. But it still won't let me know load the pdf, It wont' allow the headers to modified in order to load it, thanks. You can see the working script here... http://movidstudios.com/wayfinder/directions.html Thanks again for your help.
  5. Alright I am so close but can not figure this out, thanks in advance for any help. So what I am trying to do is take the input variables from a form and have them load a specific PDF . <html> <body> <?php if( $_GET["startpoint"] || $_GET["endpoint"]) { $a = $_GET["startpoint"]; $b = $_GET["endpoint"]; echo "Your Startpoint is:". $_GET["startpoint"]. "<br />"; echo "Your Endpoint is: ". $_GET["endpoint"]. "<br />"; echo $a,$b,".pdf"; } ?> </body> </html> This is what I have and it works to display what the two points are what the final pdf file should be. The final echo generates the PDF name echo $a,$b,".pdf"; How can I get it to load a file using this as a variable or the name it generates, thanks.
  6. What you did was great, my issue is getting it to actually launch the pdf through the php action script, thanks.
  7. That looks like it might work but what do I put in the form action section of the form? Do I move the javascript into a file or can I put it into the header? Thanks.
  8. I understand that is might be something that is already answered and I apologize if it is, I could not find it. What I need to do is build a simple form that has two options, they will be dropdown options. Dropdown A and Dropdown B then a Submit button. This part I understand in HTML, although it may be easier in php or javascript. Then I need it to take the two options and create a "if/then" statement that loads a specific pdf that matches the two options selected. Example. If someone selects Option 1 from Dropdown A and Option 2 From Dropdown B then it loads 12.pdf If someone selects Option 5 from Dropdown A and Option 3 From Dropdown B then it loads 53.pdf If someone selects Option 2 from Dropdown A and Option 1 From Dropdown B then it loads 21.pdf and so on... It does not have to be the exact thing just some way to take both inputs and have it equal a specific pdf. Here is the form I built but I don't know what to put in the form_action.php file in order to make it work <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <center> <h1> Get Directions</h1> <form action="form_action.php" method="get" name="directions" target="_new"> <select name="startpoint" size="1"> <option value="north">North Tower Entrance</option> <option value="south">South Tower Entrance</option> <option value="moba">MOB A Entrance</option></select> -----> <select name="endpoint" size="1"> <option value="onco">Oncology</option> <option value="radio">Radiology</option> <option value="pulm">Pulmanary</option></select> <br /><br /> <input type="submit" value="Submit" /> </form> </center> </body> </html> Any help is appreciated, thanks.
×
×
  • 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.