This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Send data from DB to populate fields in Machform


  1. drumaboy46
    Member

    OK I created a page where user can search forms they have sent in the past seven days by their emal using some mySQL and PHP. I have read some of the topics on post/get and httpClient.

    But here's what I want to do. I want the user from the page where they see all sent data. I will create a form button labeled resend at that point it will send all the necessary elements I specify to be prefilled when my machform is loaded and all the user has to do is hit send.

    For Exp:

    Sent User Date: 04-20-2010
    Name: John Doe {element_1}
    Email: cheese@gmail.com {element_2}
    Subject: Fried Cake {element_3}
    <input type="submit" value="resend" /> When they hit send------> elements 1 thru 3 will be sent to form id=8 and the element values will show in their respected fields.

    I know I may have to edit the view_functions.php but I only want this behavior when info is being sent from the resend page not when the user uses the form from the link provided by machform itself. Hopes that is clear enough.

    Like I said I've searched the forum and know its possible its just that none of the topics are trying to do what I want but based on what I read I need to edit the view functions and use php to post data to the form in the fields they belong. Thank you by the way you give EXCELLENT SUPPORT!! Everyone always says that cause it's true and you are never impatient thank you for that.

    Posted 14 years ago #
  2. drumaboy46
    Member

    ok ignore this one too made it work with the links you gave me from a previous post if anyone needs help I can show them.

    http://www.phpf1.com/tutorial/php-mysql-tutorial.html
    http://www.siteground.com/tutorials/php-mysql/display_table_data.htm
    http://www.freewebmasterhelp.com/tutorials/phpmysql/4

    Posted 14 years ago #
  3. 13floornetwork
    Member

    I need to do the same thing except I need to populate the whole form with all the form elements instead of just two or three elements. If you have a sample of what you did with drumaboy46 I think I could add to it to do the whole form.

    Thanks in advance

    Posted 14 years ago #
  4. drumaboy46
    Member

    13floornetwork this is achievable let me know what you need maybe I can help and send you some examples. :) However I just followed the links above to achieve this. If you can populate some elements you can populate all of them the key is the inlcudes/view-functions.php and the statement:

    if($_GET['id']=='x') {
    
       //Populate this field for form x only
    
    }

    This way the population only happens when you're in form 'x'(which could be any number.
    You'd just have to repeat that step for each field type you have on your form be it email, text-field, paragraph field, etc...

    Again just let me know please back up your view-functions.php first before any edits.

    Posted 14 years ago #
  5. 13floornetwork
    Member

    drumaboy46, any examples you could send me would be great.

    Posted 14 years ago #

RSS feed for this topic

Reply