Submitting Pdf form fields to a MySQL database via PhP

Hi there,
I have recently created a Pdf in Adobe LiveCycle which looks great, and I have added a submit button which is set up to send all the form data in HTML to a PhP file on the server side. The PhP file then collects the form data and inserts it into my MySQL database.
When I run this form from Adobe reader or Professional it works great and the new record is inserted in the database. However I am trying to embed the form into a HTML page, which again looks fine, and all other buttons i.e. Save As, Print work fine.
The submit button however is not working properly now. It inserts a new record into my database, but the fields are blank as if the form data has not been sent or received?
Can you possibly advise me where i'm going wrong.
Much appreciated
Cane

Hi Cane,
I'm relatively new to creating Adobe Forms but I'm looking to do exactly what you have set up, submitting the results to php which sends the results to a database. I don't like the responses being sent to a pdf response file then every so often you have to export to csv then import the results into a database....too tedious. Can you perhaps provide the code that goes behind the submit button and maybe the code that you use on the php/server side? Again, relatively new to this and don't know where to begin but if I can look at the code behind this it would make things a lot easier.
Thanks,
Ed

Similar Messages

  • Populate Livecycle PDF from mySQL database using PHP

    I'm trying to set up a database of loan agreements, where users will submit a form through Acrobat and their information will be stored in a mySQL database. Later, they can go back and download the PDF, which will be repopulated with their data in the mySQL db.
    I made the form in Livecycle Designer and submit the information through HTTP POST. I can easily get the information from the form into the database...my only problem is getting that information back out into the PDF.
    What would allow me to write back to the PDF, preferably using PHP? What kind of syntax would that require?
    Thanks!

    I have a vital form that clients fill out, which is passed to many people in the company along the workflow. The form is a Planner and we have in the following PDF, Word Doc..
    Well before, the Planner.pdf was originally created in Word, since most people have access to Word.. but evolved to a PDF form created from the Word Doc via Adobe LiveCycle Designer 8.0 w/ User Rights enabled so that the form could be filled out and saved using Adobe Reader.. which was a step better than Word.. being that it is free. But this needed to be easier and more to the point b/c some clients don't particularly like installing the latest version of Reader, even if you provide them the link. Nor do they like saving the form, filling the form, and attaching the form to send back.
    My goal is to have the client fill an HTML version of the form, submit and be done with it, but everyone in the workflow be able to easily receive the filled Planner as a PDF form.
    So some months ago I ran into this post Chris Trip, "Populate Livecycle PDF from mySQL database using PHP" #8, 22 Sep 2007 4:37 pm
    which uses the command line Win32 pdftk.exe to merge an FDF file into an existing PDF on the remote server, and serve this to whoever.
    My problem was with shared hosting and having the ability to use the Win32 pdftk.exe along with PHP which is predominantly used on Linux boxes. And we used a Linux box.
    so i created the following unorthodox method, which a client fills the HTML version of the Planner, all field values are INSERTED into a table in MySQL DB, I and all filled planners that have been filled by clients to date can be viewed from a repository page where an XML file is served up of the corresponding client, but someone would have to have Acrobat Professional, to import the form data from the XML file into a blank form.. altoughh this is simple for me.. I have the PHP file already created so that when a Planner is filled and client submits. >> the an email is sent to me with a table row from the repository of the client name, #, email, and a link to d-load the XML file,
    But I also have the PHP files created so that the Planner can be sent to by email to various people in the workflow with certain fileds ommitted they they do not need to see, but instead of the XML file beiong served up i need the filled PDF Planner to be served.
    I can do this locally with ease on a testing server, but I am currently trying to use another host that uses cross-platform compatibility so i can use PHP and the pdftk.exe to achieve this, as that is why I am having to serve up an XML file b/c we use a Linux server for our website, and cant execute the exe.
    Now that I am testing the other server (cross-platform host), just to use them to do the PDF handling (and it's only $5 per month) I am having problems with getting READ, WRITE, EXECUTE permissions..
    Si guess a good question to ask is can PHP do the same procedure as the pdftk.exe, and i can eleminate it.
    or how in the heck can i get this data from the DB into a blank PDF form, like i have described??
    here are some link to reference
    Populating a LiveCycle PDF with PHP and MySQL
    http://www.andrewheiss.com/Tutorials?page=LiveCycle_PDFs_and_MySQL
    HTML form that passed data into a PDF
    http://www.mactech.com/articles/mactech/Vol.20/20.11/FillOnlinePDFFormsUsingHTML/index.htm l
    and an example
    http://accesspdf.com/html_pdf_form/

  • How do I lock a PDF form field after it has been completed by a user?

    We have a problem with privacy on our downloadable Pdf Forms for customers, they are required to complete personal details within the Pdf Form Fields and then must be processed by our account team.
    But we would require customer completed forms to be disabled from any third party or employee tampering with the entered details.
    Once the data has been input into the form provided online and saved and sent-on it needs to be read ONLY from then on!
    Help please, Chris.

    It depends how secure they need to be. You could include a script in the form which sets the fields to be read-only when the form is submitted, but that can easily be bypassed (and may not be respected by third party PDF applications). Search this forum topic for examples, it's been asked many times before.
    If you have Acrobat you can flatten a form, turning the fields into regular page content, but that's not possible in Adobe Reader X. While the flattened page can no longer be edited in Reader, it can still be edited in Acrobat via the touchup tools, so for complete security you would need to apply encryption to the flattened PDF (via a certifying signature or DRM).

  • Submit pdf form fields data as customized template

    Hi
    Is it possible to submit pdf form fields as a customized template?
    when the form is submited, I want it to be emailed to me as text form and the form field data would be autopopulated into the text template.
    Im not sure but is this how fdf works?
    if so, how do i get my form to be submitted as fdf?
    please help.
    thanks.

    Here you go .....the 3 fields at the top are where you enter data. The allfields field is the field that creates your special format and teh submitted data field is what you woudl recieve in the email. Note that i changed th ebinding for the first three fields so that they are not included as separate items in the data file. This shoudl simplify what you recieve. I cam change the format of what is written to the allfields if you need a different distinction. In this example I hardcoded everything ....depending how many fields there are on yours i woudl use a different approach (using some complicated code) but the concept woudl be the same. I woudl find all of the fields on your form and loop through all of these objects in a for loop construct this will reduce th eamount of code dramatically and also allow you to modify the form to add or remove fields as you see fit without having to change the code.
    Make sense?
    Paul

  • Submitted PDF form is not delivering to my Domain email account

    Submitted PDF form is not delivering to my Domain email account

    What exactly is not working ? As you have mentioned form submission notification is received in your email account so form process is working I believe but you want the notifications to go to another email account I think.
    Have you added the email address in "Email to" field in form options ? If yes and then also you are not receiving the form , then please provide me the site url and post a screenshot or form with option box open.
    Thanks,
    Sanjit

  • Exporting one specific pdf form field data to a specific webpage field

    Hello there.
    I am currently creating a form in which I need to export one specific pdf form field data to a specific webpage field to avoid typing it again or hitting ctrl+c and then ctrl+v to the webpage, as there are several records that need to be copied and pasted.
    I read that there is no access to the clipboard within pdf therefore, would like to know if there is any way to do that without accessing the clipboard.
    I am a newbie and have been learning by searching the forums and Google, therefore, would appreciate any insight on whether or not this is possible using javascript or the "submit form" funcion.
    Any help is greatly appreciated!

    Hi George, thanks for your response!
    The main issue I have is that this web page is in fact a government page in which I have to manually copy and paste information.
    I have no idea how to automate this process - I have access to the scripts on the page to see what I am able to do, but since I do not have much experience (only very basic javascripting), any other insight would be great!

  • PDF Form Field calculates AVERAGE incorrectly

    I have a PDF Form field that is set to calculate the AVERAGE of 4 other fields. Each of those other fields has its validation set to allow only the values 1 through 3.
    The Average field is dividing the total by 4 even if a person only fills out 2 of the fields. I thought AVERAGE would only count the fields that have a value in them. But it's seeing the ones that are blank as containing a 0, even though that is an invalid value for that field.
    How can I fix this? The customer really wants the option of having up to 4 fields and wants an average of just the ones that are filled in. I thought that was what Average was supposed to do.
    Is there a way to tell Acrobat to ignore the fields if their value is less than 1?

    I responded to this question here: http://answers.acrobatusers.com/PDF-Form-Field-calculates-AVERAGE-incorrectly-q13211.aspx

  • PDF form field validation - 2 criterias?

    Does anyone know how can I get a numerical pdf form field to validate within a range as well as validate that the value is equal to or less than the value of another numerical field?
    Thanks!

    I think the following custom Validate script will do what you want:
    function range_validate1() {
        // Do nothing if field is blank
        if (!event.value) {
            return;
        // Initialize some variables
        var sError = "";
        var nMin = 0;
        var nMax2 = 2e6;
        var nVal = +event.value;  // Value user entered, converted to a number
        // Get the other field value, converted to a number
        var nMax1 = +getField("Text1").value;
        // If the value is less than the minimum
        if (nVal < nMin) {
            sError = "Please enter a value greater than or equal to: " + nMin;
        // If value exceeds the other field value...
        if (nVal > nMax1) {
            sError = "Please enter a value less than or equal to: " + nMax1;
        // If value exceeds the max. possible value   
        if (nVal > nMax2) {
            sError = "Please enter a value less than or equal to: " + nMax2;
        // Alert the user and reject the value
        if (sError) {
            app.alert(sError, 0);
            event.rc = false;
    // Call the function
    range_validate1();
    The function can be placed in a document-level JavaScript, but the last line should be the custom Validate script for the field. Replace "Text1" in the line containing the getField statement to the actual name of the other field.

  • Questions about submitting PDF form to server

    I need to add a submit button to an existing PDF form that will submit it to a PHP script on the server. I can find information on submitting as FDF, but what does the "submit as HTML" option do? What and how does it submit to the server? I added a button (also a minor problem, the button text doesn't show) to the document with Acrobat 9 Pro, choosing the "Submit as HTML" option, but when I submit  it to a PHP script on the server that should echo or printr submitted $_POST data, I get an error message "An error occurred in the submit process. Cannot process content of type text/html."
    Apparently submitting as FDF is not an option, because the server does not have the FDF toolkit. What I need to be able to do is submit the PDF form with the information entered into it to the server, and redisplay it with the form inputs in place and with an added image. What would be the easiest way to do this? If I can get the form onto the server in HTML format, it would be easy to to add the image and redisplay it, or possible there is some way I could redisplay it in PDF format after adding an image to it? Any advice? Some tutorial on the other PDF form submit actions?

    Could someone at least point me to some information that provides all the details of how a PDF form is submitted to the server and discusses the options for the action? This information must surely exist somewhere, but after two days of searching I cannot find it.
    I am experienced with PHP (I used FPDF for one project) so a specific "how to" that is PHP oriented would be nice.

  • CF8 and PDF Form field Info

    Do you know of any way to get the type of field in a PDF form
    as opposed to just its value? What about getting the options from a
    drop down menu in select? Are these things possible with
    CF8?

    I responded to this question here: http://answers.acrobatusers.com/PDF-Form-Field-calculates-AVERAGE-incorrectly-q13211.aspx

  • Word form  to pdf form fields conversion

    Does anyone have any expereince with converting form Word
    form with active
    x controls to pdf form fields - any help would be appreciated
    Ann Steer

    No. What you can do, though, is after you edit your file create a new static PDF from it, open your old PDF and then use the Replace Pages command, selecting the new PDF file as the one to insert. This will replace the underlying PDF content while keeping all the form fields in tact. You then might need to adjust them a bit, but it's much less work then re-doing the entire form.

  • Best web browser for submitting PDF forms

    Is there a preferred web browser for submitting PDF forms, or can recipients submit the form via any of the common browers like Explorer, Firefox, Chrome, etc.?

    We support all of the major browsers: Internet Explorer, Firefox and Chrome.
    Thanks
    Roman

  • How  to connect .... MYSQL database via JSP

    Hello,
    I am not able to connect mysql database via JSP... everytime i try to connect the database i get the following error .....
    "java.lang.NoClassDefFoundError: org/aspectj/lang/Signature" ..
    my jsp code is ....
    <%@ page import = "java.sql.*" %>
    <%
    Connection conn = null;
    Statement smt = null;
    ResultSet rs = null;
    %>
    <%
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mydatabase","username" ,"password");
    smt = conn.createStatement();
    rs = smt.executeQuery("select * from table");
    out.println("output is "+ rs.getString("my field"));
    rs.close();
    %>
    I have installed ............
    jdk1.5.0_02
    MySQL Server 4.1
    there are two jar files .. i tried with both jar files ..
    mysql-connector-java-3.1.8-bin.jar
    mysql-connector-java-3.1.8-bin-g.jar
    tomcat server 5.5.9
    my path .... is
    C:\Program Files\Java\jdk1.5.0_02\bin;C:\jakarta-tomcat-5.5.9\bin;C:\program files\mysql\mysql server 4.1\bin;
    any help on this error ..at the earliest ..
    ... am worried ..bcoz my deadlines is getting closer .....
    .. step by step .. procedure .. could be helpful ..
    anil

    Find out the JAR which contains the class and add it
    to WEB-INF/classes directory for your web application.WEB-INF/classes directory ..means ..C:\jakarta-tomcat-5.5.9\common\classes .. is that the one i need to keep my jar files ....???????????
    well i have downloaded .. mysql database connector from the website "http://www.mysql.com/products/connector/j/ " .. and i have downloaded MySQL Connector/J 3.1..under which i have downloaded "Source and Binaries (zip)" ..
    anil

  • Using PHP to process submitted PDF Form and Upload FDF to Server

    Hi All,
    I have a PDF form online (created in Acrobat 9.0 Pro, NOT LiveCycle Designer!) that, once a user has filled it out and clicks the submit button, I want two things to happen:
    1) I want the data from the form to be submitted to a custom PHP script, which I can do several different things with (store the data in a MySQL database, for example).
    2) I would also like to upload/store/save (not sure of the proper vernacular) the filled out form (FDF file) to the web server.
    Now what I need from you lovely people, either directly, or point me to where I can find the following:
    1) How/What options do I choose for the Submit button in Acrobat 9.0 Pro when I create the PDF?
    2) What/Where can I find a PHP code snippet to get the data from fields in the submitted form?
    3) I know you can set up an Acrobat form to e-mail a copy of the FDF file to a specified e-mail address. Instead of emailing that FDF file, I want to store it directly to a folder on my web server. However, just setting the URL in the submit button to a folder on my web server doesn't seem to do the trick. So, I guess what I need is to somehow reference the FDF file with my custom PHP script... something like $_POST["fdffile"] ???? Please if anyone knows how to do this, please let me know! Because, if I can reference the FDF file, I can then use PHP's built in FTP functions to upload it to a specific folder on my web server.
    Thanks for any input!!!

    HI All,
    can someone please quide me how I can make this code to work for me?
    Where and what folder I have to put this PHP script?
    What my http will be?( I will use localhost)
    What the name of my PDF file(create by LiveCycle Designer)
    What the name of the file I will receive and where(folder) will be send it via the server?
    I see these name below in the PHP script but I can not make out what....
    configuration.php
    administrator/xml
    administrator/pdf
    THANK you

  • Email or store submitted PDF form using PHP

    I'm using LiveCycle Designer 8.0. I've searched a lot but haven't seen any answers or solutions to submitting the filled out pdf form online and the pdf sending to an email without it having to use an email client on the users computer.
    I'd prefer to use php and either save to the server or directly send the pdf as an attachment using the php mail() function. Any language would be fine, I'm just experienced with php.
    If anyone would have a solution to this, I am fully capable of editing scripting to send the correct fields for my particular form. I've just not been able to find a way to store and attach in pdf format. Since the LiveCycle has the built-in function to open your default mail client, attach the pdf, and then send - isn't there some way that function could be edited to use the servers php mail feature instead?
    Any help would be greatly appreciated. The reason this has become so important is that the new systems at some doctor's offices are requiring pdf's sent in advance that save in a program that allows the use of digital pen signing (like when you sign for a fedex package) of the documents once the patient arrives. And unfortunately, still many of the patients are not going to be avid pc users and will not have an email client program like outlook set up.
    Thanks much,
    Heather

    Thank you for your answer. I completely understand how to do all the things you mention, have been able to do them - where I can't seem to understand is posting to the web server. Maybe it's just simple and I'm overthinking it. When I set a url to post to, I've been trying to use a php script, but can't get the call right to save or grab the pdf.
    Could you help me with that part? Are you meaning it that way - to post it to a script or am I over-doing it and there's a simpler way?
    I appreciate your help very much.
    Heather

Maybe you are looking for