What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Custom Thank You Page for Form Edits Possible?

    Asked by ellie123 on July 08, 2014 at 04:21 PM

    Hello -

    Is it possible to define a custom thank you page for form edits? You know when the user updates or makes changes to their form, can I define a custom thank you page url? Here's why...

    I am having my custom thank you php page create an xml file for me with my users replies. 

    This is working great UNTIL a user comes back to EDIT their responses. And then after they press submit a Sql error gets thrown.

    I am pretty sure the prob is because my on my page I am telling the script to create the xml file and then the node from the user replies: $mydata->addChild('myfieldhere,$row['myfieldhere']);

    BUT when the user goes to UPDATE the form, it says - whoa wait a min....this node is already there.

    I understand this is not necessarily supported by you guys...but any ideas as to how or what php code I can put that says if the node IS THERE already, update it instead of creating it?

    I think it would be this:

    // update
    $mydata->myfieldhere=$myfieldhere;

    But, I don't know how or where to put this on the custom thank you page and if any other code needs to accompany it. Having a separate custom thank you page for edit would be the easiest solution.

    I have my own server and I have downloaded the source code BTW - if that makes an difference.

    Thank you for any help you can provide.

    - Ellie

     

     

    Page URL:
    customthankyoupageforformedit

    custom thank you source xml sql
  • Profile Image
    JotForm Support

    Answered by david on July 08, 2014 at 06:12 PM

    Hi,

    You definitely can include a custom thank you URL.  Here is our guide on how to do so:

    http://www.jotform.com/help/89-Create-a-Custom-Thank-you-page-with-Auto-redirect

    If this doesn't help, let us know and we may be able to find a PHP based solution to check the node and update it.  Though that is a maybe.

    Thank you for using Jotform!

  • Profile Image

    Answered by ellie123 on July 08, 2014 at 09:37 PM

    Hi there - not sure I made my question clear. I have already created a custom PHP solution. 

    When a user submits the form initially I am already using the custom thank page/URL (it's going to my custom URL php page where I have a script that is posting the replies to mysql db and also creating an XML file)

    But when a user clicks the EDIT link from their email to change the values in their form or update it, after they press submit an error is shown. I'm guessing this is happening because the php on my custom thank you page is CREATING the XML again when it should be updating it - because the user is editing the form.

    So I was wondering if and how - I can have a different custom thank you page for when a user EDITS the form. 

    So I would have 2 custom thank you urls: 1) for when the user initially submits the form and 2) for whenever they want to edit or update the form. This would let me specify 2 different custom thank you pages. 

    And if not, would you know how I could instead code my php to check and see if the XML node exists and then update if so? (See my orig post for how I think it might be done?)

    Here is a link to my form: http://form.jotform.us/form/41855520219150

    I am going to post my custom page php below - I'm sorry it's so long but don't know how else to show you. I have intentionally XXX'd out my db user/pass.

    This works beautifully when the user initially submits their form - I get the xml file and the values are posted to my db. 

    But when the user edits heir form - after they press submit on the form, they see an error. If you fill out my form and then go back to edit it. You'll see what I mean.

    Thank you for any help....

     

     

    Hope that explains better.....

  • Profile Image

    Answered by ellie123 on July 08, 2014 at 09:50 PM

    <?php

    // This function will run within each post array including multi-dimensional arrays 

    function ExtendedAddslash(&$params)

            foreach ($params as &$var) {

                // check if $var is an array. If yes, it will start another ExtendedAddslash() function to loop to each key inside.

                is_array($var) ? ExtendedAddslash($var) : $var=addslashes($var);

                unset($var);

            }

    }

     

         // Initialize ExtendedAddslash() function for every $_POST variable

        ExtendedAddslash($_POST);      

     

    ?>

    <?php

    $submission_id=$_POST['submission_id'];

    $formID=$_POST['formID'];

    $ip=$_POST['ip'];

    $whichstep=$_POST['whichstep'];

    $nameof=$_POST['nameof'];

    $clientname=$_POST['clientname'];

    $dineday=$_POST['dineday'];

    $dinehours=$_POST['dinehours'];

    $topitems = str_replace(",", "<br/>", $_POST['topitems']);

    $pleaseorder275=$_POST['pleaseorder275'];

    $pleaserequest=$_POST['pleaserequest'];

    $dinerreimbursed=$_POST['dinerreimbursed'];

    $howwill=$_POST['howwill'];

    $reimballow=$_POST['reimballow'];

    $addanother=$_POST['addanother'];

    $sendemail2=$_POST['sendemail2'];

    $sendemail3=$_POST['sendemail3'];

    $step1complete=$_POST['step1complete'];

    $clickto258=$_POST['clickto258'];

    $dineremail=$_POST['dineremail'];

    $dinerpaypal=$_POST['dinerpaypal'];

    $ihave=$_POST['ihave'];

    $stepcomplete288=$_POST['stepcomplete288'];

    $clickto284=$_POST['clickto284'];

    $clientemail210=$_POST['clientemail210'];

    $mysterydiner=$_POST['mysterydiner'];

    $of215=$_POST['of215'];

    $dateof232=$_POST['dateof232'];

    $clickto88=$_POST['clickto88'];

    $wouldyou89=$_POST['wouldyou89'];

    $wasthe90=$_POST['wasthe90'];

    $werewindows=$_POST['werewindows'];

    $wasthe=$_POST['wasthe'];

    $wereexternal200=$_POST['wereexternal200'];

    $wasthe94=$_POST['wasthe94'];

    $werethe=$_POST['werethe'];

    $isthere201=$_POST['isthere201'];

    $weremenu202=$_POST['weremenu202'];

    $isoutdoor=$_POST['isoutdoor'];

    $wereexternal=$_POST['wereexternal'];

    $wereoutside=$_POST['wereoutside'];

    $wasyour206=$_POST['wasyour206'];

    $wasthe207=$_POST['wasthe207'];

    $wouldyou96=$_POST['wouldyou96'];

    $plsenter23=$_POST['plsenter23'];

    $usingthe35=$_POST['usingthe35'];

    $isthere=$_POST['isthere'];

    $didthe98=$_POST['didthe98'];

    $didthe99=$_POST['didthe99'];

    $didyou208=$_POST['didyou208'];

    $wasyour100=$_POST['wasyour100'];

    $wereyou101=$_POST['wereyou101'];

    $wereyou165=$_POST['wereyou165'];

    $whilewaiting=$_POST['whilewaiting'];

    $isthe=$_POST['isthe'];

    $canyou=$_POST['canyou'];

    $isthe168=$_POST['isthe168'];

    $doyou169=$_POST['doyou169'];

    $img=$_POST['img'];

    $wereyou170=$_POST['wereyou170'];

    $onceseated=$_POST['onceseated'];

    $wereyou=$_POST['wereyou'];

    $didyour173=$_POST['didyour173'];

    $didyour174=$_POST['didyour174'];

    $pleaseorder=$_POST['pleaseorder'];

    $didsomeone176=$_POST['didsomeone176'];

    $werethe177=$_POST['werethe177'];

    $wereyou178=$_POST['wereyou178'];

    $didyour=$_POST['didyour'];

    $didyour180=$_POST['didyour180'];

    $pleaseenter67=$_POST['pleaseenter67'];

    $pleaseenter=$_POST['pleaseenter'];

    $doyou293=$_POST['doyou293'];

    $doyou295=$_POST['doyou295'];

    $doyou297=$_POST['doyou297'];

    $wasthe181=$_POST['wasthe181'];

    $plsexplain=$_POST['plsexplain'];

    $werethe183=$_POST['werethe183'];

    $didyour182=$_POST['didyour182'];

    $didyou=$_POST['didyou'];

    $didyour185=$_POST['didyour185'];

    $whenordering123=$_POST['whenordering123'];

    $didyour186=$_POST['didyour186'];

    $didyou125=$_POST['didyou125'];

    $hasyour=$_POST['hasyour'];

    $pleaseEnter83=$_POST['pleaseEnter83']['0'] .":". $_POST['pleaseEnter83']['1'] ." ". $_POST['pleaseEnter83']['2'];

    $whatis=$_POST['whatis'];

    $pleaseEnter84=$_POST['pleaseEnter84']['0'] .":". $_POST['pleaseEnter84']['1'] ." ". $_POST['pleaseEnter84']['2'];

    $howwould151=$_POST['howwould151'];

    $wasyour=$_POST['wasyour'];

    $whatwas217=$_POST['whatwas217'];

    $doyou300=$_POST['doyou300'];

    $doyou303=$_POST['doyou303'];

    $doyou305=$_POST['doyou305'];

    $didthe=$_POST['didthe'];

    $didthe190=$_POST['didthe190'];

    $wasthe191=$_POST['wasthe191'];

    $didyour192=$_POST['didyour192'];

    $uponfinishing307=$_POST['uponfinishing307'];

    $didyour194=$_POST['didyour194'];

    $onceyou195=$_POST['onceyou195'];

    $atthe=$_POST['atthe'];

    $didthe199=$_POST['didthe199'];

    $okayto=$_POST['okayto'];

    $uploadpictures6=$_POST['uploadpictures6'];

    $uploadaddl=$_POST['uploadaddl'];

    $uploada91=$_POST['uploada91'];

    $photoapp1=$_POST['photoapp1'];

    $photoapp2=$_POST['photoapp2'];

    $photoapp3=$_POST['photoapp3'];

    $photomeal1=$_POST['photomeal1'];

    $photomeal2=$_POST['photomeal2'];

    $photomeal3=$_POST['photomeal3'];

    $photomeal4=$_POST['photomeal4'];

    $uploadsignatureclient=$_POST['uploadsignatureclient'];

    $uploadsignaturediner=$_POST['uploadsignaturediner'];

    $ifyou=$_POST['ifyou'];

    $manageron=$_POST['manageron'];

    $hostesson223=$_POST['hostesson223'];

    $barguy=$_POST['barguy'];

    $pleasemark=$_POST['pleasemark'];

    $step2complete=$_POST['step2complete'];

    $didyou255=$_POST['didyou255'];

    $basedon=$_POST['basedon'];

    $diningexperiencepositive=$_POST['diningexperiencepositive'];

    $explainbadexp=$_POST['explainbadexp'];

    $wasenoughservers=$_POST['wasenoughservers'];

    $writeorattachfinal=$_POST['writeorattachfinal'];

    $writefinal=$_POST['writefinal'];

    $anynotes=$_POST['anynotes'];

    $addfinalnotes=$_POST['addfinalnotes'];

    $step3complete=$_POST['step3complete'];

    $uploadfinal=$_POST['uploadfinal'];

    $picofcheck=$_POST['picofcheck'];

    $picofccreceipt=$_POST['picofccreceipt'];

    ?>

     

    <?php

    $db_host = 'localhost';

    $db_username = 'XXXXXXXXXXXXXXX';

    $db_password = 'XXXXXXXXXXXXXXX';

    $db_name = 'XXXXXXXXXXXXX';

    mysql_connect( $db_host, $db_username, $db_password) or die(mysql_error());

    mysql_select_db($db_name); 

    ?>

    <?php

     

    // search submission ID

     

    $query = "SELECT * FROM `jotallinone` WHERE `submission_id` = '$submission_id'";

    $sqlsearch = mysql_query($query);

    $resultcount = mysql_numrows($sqlsearch);

     

    if ($resultcount > 0) {

     

        mysql_query("UPDATE `jotallinone` SET 

    'whichstep'='$whichstep',

    'nameof'='$nameof',

    'clientname'='$clientname',

    'dineday'='$dineday',

    'dinehours'='$dinehours',

    'topitems'='$topitems',

    'pleaseorder275'='$pleaseorder275',

    'pleaserequest'='$pleaserequest',

    'dinerreimbursed'='$dinerreimbursed',

    'howwill'='$howwill',

    'reimballow'='$reimballow',

    'addanother'='$addanother',

    'sendemail2'='$sendemail2',

    'sendemail3'='$sendemail3',

    'step1complete'='$step1complete',

    'clickto258'='$clickto258',

    'dineremail'='$dineremail',

    'dinerpaypal'='$dinerpaypal',

    'ihave'='$ihave',

    'stepcomplete288'='$stepcomplete288',

    'clickto284'='$clickto284',

    'clientemail210'='$clientemail210',

    'mysterydiner'='$mysterydiner',

    'of215'='$of215',

    'dateof232'='$dateof232',

    'clickto88'='$clickto88',

    'wouldyou89'='$wouldyou89',

    'wasthe90'='$wasthe90',

    'werewindows'='$werewindows',

    'wasthe'='$wasthe',

    'wereexternal200'='$wereexternal200',

    'wasthe94'='$wasthe94',

    'werethe'='$werethe',

    'isthere201'='$isthere201',

    'weremenu202'='$weremenu202',

    'isoutdoor'='$isoutdoor',

    'wereexternal'='$wereexternal',

    'wereoutside'='$wereoutside',

    'wasyour206'='$wasyour206',

    'wasthe207'='$wasthe207',

    'wouldyou96'='$wouldyou96',

    'plsenter23'='$plsenter23',

    'usingthe35'='$usingthe35',

    'isthere'='$isthere',

    'didthe98'='$didthe98',

    'didthe99'='$didthe99',

    'didyou208'='$didyou208',

    'wasyour100'='$wasyour100',

    'wereyou101'='$wereyou101',

    'wereyou165'='$wereyou165',

    'whilewaiting'='$whilewaiting',

    'isthe'='$isthe',

    'canyou'='$canyou',

    'isthe168'='$isthe168',

    'doyou169'='$doyou169',

    'img'='$img',

    'wereyou170'='$wereyou170',

    'onceseated'='$onceseated',

    'wereyou'='$wereyou',

    'didyour173'='$didyour173',

    'didyour174'='$didyour174',

    'pleaseorder'='$pleaseorder',

    'didsomeone176'='$didsomeone176',

    'werethe177'='$werethe177',

    'wereyou178'='$wereyou178',

    'didyour'='$didyour',

    'didyour180'='$didyour180',

    'pleaseenter67'='$pleaseenter67',

    'pleaseenter'='$pleaseenter',

    'doyou293'='$doyou293',

    'doyou295'='$doyou295',

    'doyou297'='$doyou297',

    'wasthe181'='$wasthe181',

    'plsexplain'='$plsexplain',

    'werethe183'='$werethe183',

    'didyour182'='$didyour182',

    'didyou'='$didyou',

    'didyour185'='$didyour185',

    'whenordering123'='$whenordering123',

    'didyour186'='$didyour186',

    'didyou125'='$didyou125',

    'hasyour'='$hasyour',

    'pleaseEnter83'='$pleaseEnter83',

    'whatis'='$whatis',

    'pleaseEnter84'='$pleaseEnter84',

    'howwould151'='$howwould151',

    'wasyour'='$wasyour',

    'whatwas217'='$whatwas217',

    'doyou300'='$doyou300',

    'doyou303'='$doyou303',

    'doyou305'='$doyou305',

    'didthe'='$didthe',

    'didthe190'='$didthe190',

    'wasthe191'='$wasthe191',

    'didyour192'='$didyour192',

    'uponfinishing307'='$uponfinishing307',

    'didyour194'='$didyour194',

    'onceyou195'='$onceyou195',

    'atthe'='$atthe',

    'didthe199'='$didthe199',

    'okayto'='$okayto',

    'uploadpictures6'='$uploadpictures6',

    'uploadaddl'='$uploadaddl',

    'uploada91'='$uploada91',

    'photoapp1'='$photoapp1',

    'photoapp2'='$photoapp2',

    'photoapp3'='$photoapp3',

    'photomeal1'='$photomeal1',

    'photomeal2'='$photomeal2',

    'photomeal3'='$photomeal3',

    'photomeal4'='$photomeal4',

    'uploadsignatureclient'='$uploadsignatureclient',

    'uploadsignaturediner'='$uploadsignaturediner',

    'ifyou'='$ifyou',

    'manageron'='$manageron',

    'hostesson223'='$hostesson223',

    'barguy'='$barguy',

    'pleasemark'='$pleasemark',

    'step2complete'='$step2complete',

    'didyou255'='$didyou255',

    'basedon'='$basedon',

    'diningexperiencepositive'='$diningexperiencepositive',

    'explainbadexp'='$explainbadexp',

    'wasenoughservers'='$wasenoughservers',

    'writeorattachfinal'='$writeorattachfinal',

    'writefinal'='$writefinal',

    'anynotes'='$anynotes',

    'addfinalnotes'='$addfinalnotes',

    'step3complete'='$step3complete',

    'uploadfinal'='$uploadfinal',

    'picofcheck'='$picofcheck',

    'picofccreceipt'='$picofccreceipt',

                                 WHERE `submission_id` = '$submission_id'") 

         or die(mysql_error());

        

    } else {

     

        mysql_query("INSERT INTO `jotallinone` (submission_id,formID,ip,whichstep,nameof,clientname,dineday,dinehours,topitems,pleaseorder275,pleaserequest,dinerreimbursed,howwill,reimballow,addanother,sendemail2,sendemail3,step1complete,clickto258,dineremail,dinerpaypal,ihave,stepcomplete288,clickto284,clientemail210,mysterydiner,of215,dateof232,clickto88,wouldyou89,wasthe90,werewindows,wasthe,wereexternal200,wasthe94,werethe,isthere201,weremenu202,isoutdoor,wereexternal,wereoutside,wasyour206,wasthe207,wouldyou96,plsenter23,usingthe35,isthere,didthe98,didthe99,didyou208,wasyour100,wereyou101,wereyou165,whilewaiting,isthe,canyou,isthe168,doyou169,img,wereyou170,onceseated,wereyou,didyour173,didyour174,pleaseorder,didsomeone176,werethe177,wereyou178,didyour,didyour180,pleaseenter67,pleaseenter,doyou293,doyou295,doyou297,wasthe181,plsexplain,werethe183,didyour182,didyou,didyour185,whenordering123,didyour186,didyou125,hasyour,pleaseEnter83,whatis,pleaseEnter84,howwould151,wasyour,whatwas217,doyou300,doyou303,doyou305,didthe,didthe190,wasthe191,didyour192,uponfinishing307,didyour194,onceyou195,atthe,didthe199,okayto,uploadpictures6,uploadaddl,uploada91,photoapp1,photoapp2,photoapp3,photomeal1,photomeal2,photomeal3,photomeal4,uploadsignatureclient,uploadsignaturediner,ifyou,manageron,hostesson223,barguy,pleasemark,step2complete,didyou255,basedon,diningexperiencepositive,explainbadexp,wasenoughservers,writeorattachfinal,writefinal,anynotes,addfinalnotes,step3complete,uploadfinal,picofcheck,picofccreceipt) 

                                   VALUES ('$submission_id','$formID','$ip','$whichstep','$nameof','$clientname','$dineday','$dinehours','$topitems','$pleaseorder275','$pleaserequest','$dinerreimbursed','$howwill','$reimballow','$addanother','$sendemail2','$sendemail3','$step1complete','$clickto258','$dineremail','$dinerpaypal','$ihave','$stepcomplete288','$clickto284','$clientemail210','$mysterydiner','$of215','$dateof232','$clickto88','$wouldyou89','$wasthe90','$werewindows','$wasthe','$wereexternal200','$wasthe94','$werethe','$isthere201','$weremenu202','$isoutdoor','$wereexternal','$wereoutside','$wasyour206','$wasthe207','$wouldyou96','$plsenter23','$usingthe35','$isthere','$didthe98','$didthe99','$didyou208','$wasyour100','$wereyou101','$wereyou165','$whilewaiting','$isthe','$canyou','$isthe168','$doyou169','$img','$wereyou170','$onceseated','$wereyou','$didyour173','$didyour174','$pleaseorder','$didsomeone176','$werethe177','$wereyou178','$didyour','$didyour180','$pleaseenter67','$pleaseenter','$doyou293','$doyou295','$doyou297','$wasthe181','$plsexplain','$werethe183','$didyour182','$didyou','$didyour185','$whenordering123','$didyour186','$didyou125','$hasyour','$pleaseEnter83','$whatis','$pleaseEnter84','$howwould151','$wasyour','$whatwas217','$doyou300','$doyou303','$doyou305','$didthe','$didthe190','$wasthe191','$didyour192','$uponfinishing307','$didyour194','$onceyou195','$atthe','$didthe199','$okayto','$uploadpictures6','$uploadaddl','$uploada91','$photoapp1','$photoapp2','$photoapp3','$photomeal1','$photomeal2','$photomeal3','$photomeal4','$uploadsignatureclient','$uploadsignaturediner','$ifyou','$manageron','$hostesson223','$barguy','$pleasemark','$step2complete','$didyou255','$basedon','$diningexperiencepositive','$explainbadexp','$wasenoughservers','$writeorattachfinal','$writefinal','$anynotes','$addfinalnotes','$step3complete','$uploadfinal','$picofcheck','$picofccreceipt') ")  

        or die(mysql_error());  

     

    }

    ?>

     

    <?php

     

        //Create Database connection

        $db = mysql_connect("localhost","XXXXXXXXXX","XXXXXXXXXX");

        if (!$db) {

            die('Could not connect to db: ' . mysql_error());

        }

     

        //Select the Database

        mysql_select_db("ellie123_wrdp16",$db);

     

        $result = mysql_query("select * from jotallinone", $db); 

     

        //Create SimpleXMLElement object

        $xml = new SimpleXMLElement('<xml/>');

     

        //Add each column value a node of the XML object

        while($row = mysql_fetch_assoc($result)) {

    $mydata = $xml->addChild('mydata');

    $mydata->addChild('submission_id',$row['submission_id']);

    $mydata->addChild('formID',$row['formID']);

    $mydata->addChild('ip',$row['ip']);

    $mydata->addChild('nameof',$row['nameof']);

    $mydata->addChild('clientname',$row['clientname']);

    $mydata->addChild('dineday',$row['dineday']);

    $mydata->addChild('dinehours',$row['dinehours']);

    $mydata->addChild('topitems',$row['topitems']);

    $mydata->addChild('pleaseorder275',$row['pleaseorder275']);

    $mydata->addChild('pleaserequest',$row['pleaserequest']);

    $mydata->addChild('dinerreimbursed',$row['dinerreimbursed']);

    $mydata->addChild('howwill',$row['howwill']);

    $mydata->addChild('reimballow',$row['reimballow']);

    $mydata->addChild('addanother',$row['addanother']);

    $mydata->addChild('sendemail2',$row['sendemail2']);

    $mydata->addChild('sendemail3',$row['sendemail3']);

    $mydata->addChild('step1complete',$row['step1complete']);

    $mydata->addChild('clickto258',$row['clickto258']);

    $mydata->addChild('dineremail',$row['dineremail']);

    $mydata->addChild('dinerpaypal',$row['dinerpaypal']);

    $mydata->addChild('ihave',$row['ihave']);

    $mydata->addChild('stepcomplete288',$row['stepcomplete288']);

    $mydata->addChild('clickto284',$row['clickto284']);

    $mydata->addChild('clientemail210',$row['clientemail210']);

    $mydata->addChild('mysterydiner',$row['mysterydiner']);

    $mydata->addChild('of215',$row['of215']);

    $mydata->addChild('dateof232',$row['dateof232']);

    $mydata->addChild('clickto88',$row['clickto88']);

    $mydata->addChild('wouldyou89',$row['wouldyou89']);

    $mydata->addChild('wasthe90',$row['wasthe90']);

    $mydata->addChild('werewindows',$row['werewindows']);

    $mydata->addChild('wasthe',$row['wasthe']);

    $mydata->addChild('wereexternal200',$row['wereexternal200']);

    $mydata->addChild('wasthe94',$row['wasthe94']);

    $mydata->addChild('werethe',$row['werethe']);

    $mydata->addChild('isthere201',$row['isthere201']);

    $mydata->addChild('weremenu202',$row['weremenu202']);

    $mydata->addChild('isoutdoor',$row['isoutdoor']);

    $mydata->addChild('wereexternal',$row['wereexternal']);

    $mydata->addChild('wereoutside',$row['wereoutside']);

    $mydata->addChild('wasyour206',$row['wasyour206']);

    $mydata->addChild('wasthe207',$row['wasthe207']);

    $mydata->addChild('wouldyou96',$row['wouldyou96']);

    $mydata->addChild('plsenter23',$row['plsenter23']);

    $mydata->addChild('usingthe35',$row['usingthe35']);

    $mydata->addChild('isthere',$row['isthere']);

    $mydata->addChild('didthe98',$row['didthe98']);

    $mydata->addChild('didthe99',$row['didthe99']);

    $mydata->addChild('didyou208',$row['didyou208']);

    $mydata->addChild('wasyour100',$row['wasyour100']);

    $mydata->addChild('wereyou101',$row['wereyou101']);

    $mydata->addChild('wereyou165',$row['wereyou165']);

    $mydata->addChild('whilewaiting',$row['whilewaiting']);

    $mydata->addChild('isthe',$row['isthe']);

    $mydata->addChild('canyou',$row['canyou']);

    $mydata->addChild('isthe168',$row['isthe168']);

    $mydata->addChild('doyou169',$row['doyou169']);

    $mydata->addChild('img',$row['img']);

    $mydata->addChild('wereyou170',$row['wereyou170']);

    $mydata->addChild('onceseated',$row['onceseated']);

    $mydata->addChild('wereyou',$row['wereyou']);

    $mydata->addChild('didyour173',$row['didyour173']);

    $mydata->addChild('didyour174',$row['didyour174']);

    $mydata->addChild('pleaseorder',$row['pleaseorder']);

    $mydata->addChild('didsomeone176',$row['didsomeone176']);

    $mydata->addChild('werethe177',$row['werethe177']);

    $mydata->addChild('wereyou178',$row['wereyou178']);

    $mydata->addChild('didyour',$row['didyour']);

    $mydata->addChild('didyour180',$row['didyour180']);

    $mydata->addChild('pleaseenter67',$row['pleaseenter67']);

    $mydata->addChild('pleaseenter',$row['pleaseenter']);

    $mydata->addChild('doyou293',$row['doyou293']);

    $mydata->addChild('doyou295',$row['doyou295']);

    $mydata->addChild('doyou297',$row['doyou297']);

    $mydata->addChild('wasthe181',$row['wasthe181']);

    $mydata->addChild('plsexplain',$row['plsexplain']);

    $mydata->addChild('werethe183',$row['werethe183']);

    $mydata->addChild('didyour182',$row['didyour182']);

    $mydata->addChild('didyou',$row['didyou']);

    $mydata->addChild('didyour185',$row['didyour185']);

    $mydata->addChild('whenordering123',$row['whenordering123']);

    $mydata->addChild('didyour186',$row['didyour186']);

    $mydata->addChild('didyou125',$row['didyou125']);

    $mydata->addChild('hasyour',$row['hasyour']);

    $mydata->addChild('pleaseEnter83',$row['pleaseEnter83']);

    $mydata->addChild('whatis',$row['whatis']);

    $mydata->addChild('pleaseEnter84',$row['pleaseEnter84']);

    $mydata->addChild('howwould151',$row['howwould151']);

    $mydata->addChild('wasyour',$row['wasyour']);

    $mydata->addChild('whatwas217',$row['whatwas217']);

    $mydata->addChild('doyou300',$row['doyou300']);

    $mydata->addChild('doyou303',$row['doyou303']);

    $mydata->addChild('doyou305',$row['doyou305']);

    $mydata->addChild('didthe',$row['didthe']);

    $mydata->addChild('didthe190',$row['didthe190']);

    $mydata->addChild('wasthe191',$row['wasthe191']);

    $mydata->addChild('didyour192',$row['didyour192']);

    $mydata->addChild('uponfinishing307',$row['uponfinishing307']);

    $mydata->addChild('didyour194',$row['didyour194']);

    $mydata->addChild('onceyou195',$row['onceyou195']);

    $mydata->addChild('atthe',$row['atthe']);

    $mydata->addChild('didthe199',$row['didthe199']);

    $mydata->addChild('okayto',$row['okayto']);

    $mydata->addChild('uploadpictures6',$row['uploadpictures6']);

    $mydata->addChild('uploadaddl',$row['uploadaddl']);

    $mydata->addChild('uploada91',$row['uploada91']);

    $mydata->addChild('photoapp1',$row['photoapp1']);

    $mydata->addChild('photoapp2',$row['photoapp2']);

    $mydata->addChild('photoapp3',$row['photoapp3']);

    $mydata->addChild('photomeal1',$row['photomeal1']);

    $mydata->addChild('photomeal2',$row['photomeal2']);

    $mydata->addChild('photomeal3',$row['photomeal3']);

    $mydata->addChild('photomeal4',$row['photomeal4']);

    $mydata->addChild('uploadsignatureclient',$row['uploadsignatureclient']);

    $mydata->addChild('uploadsignaturediner',$row['uploadsignaturediner']);

    $mydata->addChild('ifyou',$row['ifyou']);

    $mydata->addChild('manageron',$row['manageron']);

    $mydata->addChild('hostesson223',$row['hostesson223']);

    $mydata->addChild('barguy',$row['barguy']);

    $mydata->addChild('pleasemark',$row['pleasemark']);

    $mydata->addChild('step2complete',$row['step2complete']);

    $mydata->addChild('didyou255',$row['didyou255']);

    $mydata->addChild('basedon',$row['basedon']);

    $mydata->addChild('diningexperiencepositive',$row['diningexperiencepositive']);

    $mydata->addChild('explainbadexp',$row['explainbadexp']);

    $mydata->addChild('wasenoughservers',$row['wasenoughservers']);

    $mydata->addChild('writeorattachfinal',$row['writeorattachfinal']);

    $mydata->addChild('writefinal',$row['writefinal']);

    $mydata->addChild('anynotes',$row['anynotes']);

    $mydata->addChild('addfinalnotes',$row['addfinalnotes']);

    $mydata->addChild('step3complete',$row['step3complete']);

    $mydata->addChild('uploadfinal',$row['uploadfinal']);

    $mydata->addChild('picofcheck',$row['picofcheck']);

    $mydata->addChild('picofccreceipt',$row['picofccreceipt']);

     

        }

     

        mysql_close($db);

        //Create the XML file

        $fp = fopen("jotfinal.xml","wb");

     

        //Write the XML nodes

        fwrite($fp,$xml->asXML());

     

        //Close the database connection

        fclose($fp);

     

    ?>

     

  • Profile Image
    JotForm Support

    Answered by jonathan on July 08, 2014 at 11:06 PM

    Hi Ellie,

    May I ask for confirmation that you need the edit because you want to provide access or capability to the form respondents to edit the form submission data?

    There is a way to edit form submissions even after user have submitted already. That is by using the Edit Link 

    -How-to-Let-Users-Update-Their-Form-Submissions-at-a-Later-Date

    In your custom thank you page, perhaps you can just add the edit link to edit/update the submission.

    We will wait for your updated response.

     

    Thanks.

  • Profile Image

    Answered by ellie123 on July 09, 2014 at 12:06 AM

    The edit link is not working and throws an error when the user hits submit after they make their edits. The problem is when the user taps the submit button after updating their info they get an error. As I said, because my custom thank you php file is creating an XML file from the users responses when they go back and edit a mysql error is thrown. 

    This happens because my php file trying to create an XML node that is already there. You see I need to either to do one of 2 things:

    1) have the user go to a DIFFERENT custom thank you URL page after they press the submit button when they UPDATE or EDIT their form. This custom thank you page URL MUST BE DIFFERENT than the one that was used when they filled out the form the first time. It will only be used when they are editing or updating the form. 

    2) use php to check my xml file and see if the node already exists. If so, then it should just UPDATE the value and not try to CREATE it. 

    Number 2 is the most logical answer and should be the way to go. I'm just not sure what code to write and how to integrate it with what I have written above. 

    If you could please fill out my form you will see the trouble. The only req'd fields on the form on the Terms and Conditions checkboxes on pages 1 and 2. To get the edit link via email fill in the "Email to Send when Report Complete" on Page 1 and you'll get a copy of it. Everything else you can just leave defaults. Then go back and try to edit and you'll see the error. 

    Thank you for your help...

  • Profile Image
    JotForm Support

    Answered by EltonCris on July 09, 2014 at 03:51 AM

    Hi,

    Looks like the solution you're looking for is pretty complex and is beyond of our scope, but I have been still trying to find a workaround for you. Unfortunately, I am unable to find an ideal answer for the number 2 solution you're seeking. However, this article explains about Simple XML checking if a specific node exists, you might be able to come up a solution out of the suggested code.

    http://stackoverflow.com/questions/3646153/check-if-xml-node-exists-in-php

    http://stackoverflow.com/questions/6884142/how-to-check-if-element-exists-with-simplexml

    Hope this somehow helps you. Regards!

  • Profile Image

    Answered by ellie123 on July 09, 2014 at 11:54 AM

    Hi Elton! I was so hoping I'd get you...you're awesome with support and finding a solution! 

    Thank you...I appreciate the help. I think that I can get it to work with an easier solution...

    When the user EDITS or UPDATES the form, they go to a special url right? The one in their email...after they are done filling out their edits. Can I set a different custom thank you url?

    A different custom thank you url than the one that was used originally when they submitted the form? This thank you url would only be used when they EDIT or UPDATE their form.

    I am already using a custom thank url for when they initially submit the form, but I need to use a different one for if they want to EDIT their responses.

    Is that possible? Would be much easier....

  • Profile Image
    JotForm Support

    Answered by david on July 09, 2014 at 01:16 PM

    Hi,

    When the user edits or updates their form, the URL it sends them to is the URL of your form and the identifier for the actual submission data.  An example would be http://submit.jotform.co/form.php?formID=132456789&sid=12345678900&mode=edit.  This just takes them to your exact same form but with the submission information filled in.  Because of this, it would not be possible to have a different thank you page, as it is not a new form or a redirect to a new page.  After they fill out the new data, it simply resubmits your form and overwrites the data associated with the submission ID#.

    If you have any other questions please let us know and we will be happy to help.