i have create 2 pages.
report.php
printForm.php
report.php is simple php page and printform is generate pdf page
when i generate pdf page not generate in online server and when i use local server so completely generate pdf file
report.php is filterig data page and that filtered data print on pdf page
so i have used one hidden box and hidden box value are select query and transfer select query on printForm.php now i fetch data on pdf page but my code is correct so this page complete execute on local server and generate pdf but when i generate pdf on online server so that time all selected value is not print so plz
plz help me
From what i understand...
If everything works fine on your local server, and does'nt perform as expected (Especially issues related to file creates, in your case PDF files) - check your permissions.
Most of the time you might not be having permissions to create a PDF file (if you are saving it first to a disk folder).
Related
I am trying to generate a report based on user input from a form in html. As of right now, everything works. Except when I generate the report, the url of the newly opened tab contains the location and the name of my php file. Obviously, this report won't be accessible once the user closes that tab.
Is there any way I can store this file on my server and specify a path for it(for each user)?
Or just generate a pdf file out of it? I tried using some libraries but they don't fully support bootstrap.
I have a .xml file in my computer and i want it to be inserted in a single column and single cell of a sql table corresponding to serial no.s so that i can create a link on web page that would be directly downloadable from web page when clicking on it .I've searched everywhere but what i am getting is insert xml data in a table or how to upload a file on web page .
But i want them to be already uploaded on web page and when clicking on a link it will be directly downloaded on user,s local machine. So for this , I've to put those files in a column corresponding to their serial no.s then using php i can make those files downloadable to user machine .How is this possible have any idea...???
Go to this link "http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/uploading-files-to-mysql-database.aspx"
This is a tutorial where you can insert xml file into database and also can create its downloadable link .This may help you.
In such case I would encode whole content of XML file using base64 before inserting into single database cell. And when using direct link use a php script which selects that cell, decodes data and simply outputs as xml.
If xml files are quite big, it is recommended to use gzip for compressing data before encoding with base64.
Did I understood your question correctly?
I have a form that generates an SQL statement, based on the users choices. It is functioning much like the report wizard in MS Access. On the last step, I have all the data, and the dynamically generated SQL query, but I need a way where they can download it as a file. How should I go about this?
Currently I have three buttons called
'View Results' (which just shows HTML generated results, that is easy - they just open up in a new tab)
'Download CSV' (preferably I would like this when clicked to just act like a normal download of a file, the user gets prompted to save as etc by the browser)
'Download PDF' (same as CSV)
At the moment when the CSV button is pressed a new tab opens up with export_report.php,
which outputs CSV style report data.
How can I achieve the desired results with the CSV and PDF button? I have all the data and information I need to generate either but I am unsure how to proceed forward with this.
For the generation of the PDF you could use fpdf witch allows you to build a pdf from php.
For the generation of the CSV you only have to adjust the headers. Here is a link that explains how this works: csv generation.
How does résumé upload work? I have a site in PHP and right now users can build their résumé line by line, because it is stored in db table. How can a user upload a resume in Word or other common format and have it uploaded into my db? Is it something to do with regex? Are there any scripts out there available that can do that?
Just trying to understand the process.
Thanks.
UPDATE:
BTW I looked around a bit and saw web-forms for resume creation -- I already have that. I need a user to be able to point webform to his/er resume, click SUBMIT and have that document input into db automagically.
Simply use the file uploading feature:
create a HTML page containing a <form> and a file input.
create a PHP script that receives the uploaded file
The process is simple: user selects a file to upload and the browser sends it to a PHP script designated by the action attribute of the <form> tag. After the file is uploaded into the server, you can do whatever you want with it.
PHP file upload tutorial
File uploading guidelines in PHP manual
All,
I have a PHP5 application written with Zend Framework and MVC style. My application allows multiple users to login and see content based on their privileges. I have a dropdown on the home page. Upon selecting the dropdown, an ajax call occurs which populates the page with a table. Also, it generates a PDF file with the table data using mpdf library. There is a link called "Download PDF" in the page to allow the user to download the generated pdf.
My question is, in such environment, how to best serve pdfs to multiple users? Should I serve a single pdf with the a common name or should I create multple pdfs based on the dropdown value (looks like an overkill)? I don't want to let the users see each other's pdfs. Also, where should I store the pdfs as pretty much the entire application directory will have only 750 acccess.
Thanks,
User clicks "downlod PDF"
Parameters like ID are sent with ajax
Is there a cached version of the PDF with that ID saved? Ok, show it to the user; else:
Generate PDF
Cache it
Show PDF to user
I would have a cache key like userid-documentid (user1-document1 for example) and name the document something that would make them recognize it in a "downloads folder": your-app document-name date.pdf (ABC Half year report 2010-07.pdf for example).
I would store the cache in a /tmp directory somewhere, and present the cached data with a custom header; the following is from Example 1 # php.net:
<?php
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="ABC Half year report 2010-07.pdf"');
readfile('/tmp/user1-document1');