The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
Placeholders - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Placeholders (/showthread.php?tid=23) Pages:
1
2
|
Placeholders - frostyintrepid - Mar 2nd, 2009 Hi Ben, In previous version, after the user has submitted the form, it brings the user to a thank you page which shows the information he had input earlier. Is it possible to accomplish it with this version? RE: Placeholders - Ben - Mar 2nd, 2009 Sure! For "direct" form types (i.e. the ones where you're just submitting the content directly to process.php), you just need to specify those fields as being passed along to the thankyou page via the query string. You can then pull them out and display them in the page. This actually works just like FT1, except I think I may have moved the "Pass On" field to a different page in the UI... (I forget, actuallly!) To do it, just edit your form and click on the Fields tab. There, check the "Pass On" checkboxes for those fields you'd like passed along to the thankyou page. On that page, you can refer to the values like so: PHP Code: echo $_GET["myfieldname"]; [EDIT: I just found a bug with this pass-on mechanism. It'll work for most form fields, but multi-select fields don't get passed along properly. This will be fixed in the next build]. RE: Placeholders - Kimberly - Apr 2nd, 2009 I just installed the Beta 2. I have a form that has radio buttons. I noticed that when radio buttons are not selected when the form is submitted to form tools will cause an Undefined index: error when they are passed back to my thank you page. So the problems exists with radio buttons as well as select boxes. For now I will simply have a thank you page that does not contain the form results until the next release. Thanks for all your work on this, I really like this form processor better than any I have used before. -Kimberly. RE: Placeholders - Ben - Apr 2nd, 2009 Ooh... rats, I thought I fixed this in a very early version of the Beta. I'll check it out, thanks! - Ben RE: Placeholders - Ben - Apr 4th, 2009 Hi Kimberly, I just checked this out, and I think the problem actually lies in your "thankyou" page. Sorry - I thought it was passing "undefined" through the query string. To prevent it from happening in your page, check that the value is set first: PHP Code: if (isset($_GET["error"])) If this doesn't help, email me back with a few more details. Thanks! - Ben RE: Placeholders - yettyn - Apr 6th, 2009 Maybe a stupid question, but how can I access submitted data when not using process.php? Well I understand it must be with php, but will they be available there in a simple way of access? I ask actually because I use WYSIWYG WEb Builder, and I have to figure out a smart way to "inbed" it with my layout. RE: Placeholders - Ben - Apr 6th, 2009 Hi Yettyn, Not a stupid question at all! If I undestand your problem correctly, you'll really need some custom PHP. What you'd do is pull the appropriate submissions from the database and display the content in whatever format you want - using your WYSIWYG script. I'd suggest looking at the core functions ft_get_submission_info and ft_update_submission, both found in /global/code/submissions.php. They extract the submission information and update it. Good luck! - Ben RE: Placeholders - yettyn - Apr 6th, 2009 (Apr 6th, 2009, 4:59 PM)Ben Wrote: Hi Yettyn,Yes but isn't the post data available directly as redirect arrives to "thankyou.php"? So I can grab then like Code: <?php echo $postvar ?> RE: Placeholders - Kimberly - Apr 6th, 2009 (Apr 4th, 2009, 9:36 PM)Ben Wrote: Hi Kimberly, Thanks Ben. With Form Tools 1 I was using the following code (only one example out of the whole form is show to conserve space): PHP Code: <?php As you can probably see, this is a reservation form and a number of guests are allowed to be registered along with their membership status and the meal they selected. I check to see if a guest has been registered and if so, then get their status and meal, if not, then it doesn't display anything on the thank you page. The code above worked (I an not a php programmer, but understand a bit of how to write the code) fine with Form Tools 1, but not with Form Tools 2. With those radio buttons passed to the thank_you.php form, with the radio buttons in a null state, (no radio button selected) I get the following errors on my thank you page. [error] Notice: Undefined index: Guest_1_Status in process.php on line 225 Notice: Undefined index: Guest_1_Status in process.php on line 231 Notice: Undefined index: Guest_1_Meal in process.php on line 225 Notice: Undefined index: Guest_1_Meal in process.php on line 231 Notice: Undefined index: Guest_2_Status in process.php on line 225 Notice: Undefined index: Guest_2_Status in process.php on line 231 Notice: Undefined index: Guest_2_Meal in process.php on line 225 Notice: Undefined index: Guest_2_Meal in process.php on line 231 Notice: Undefined index: Guest_3_Status in process.php on line 225 Notice: Undefined index: Guest_3_Status in process.php on line 231 Notice: Undefined index: Guest_3_Meal in process.php on line 225 Notice: Undefined index: Guest_3_Meal in process.php on line 231 Notice: Undefined index: Guest_4_Status in process.php on line 225 Notice: Undefined index: Guest_4_Status in process.php on line 231 Notice: Undefined index: Guest_4_Meal in process.php on line 225 Notice: Undefined index: Guest_4_Meal in process.php on line 231 Warning: Cannot modify header information - headers already sent by (output started at process.php:225) in process.php on line 286 [/error] Please note that I removed the actual path to process.php in the error output. RE: Placeholders - Ben - Apr 9th, 2009 Ahh... now I get it. I've turned up error reporting to a very high setting for the FT2 beta - just so that little errors like these get reported. They shouldn't occur, and often they can explain bigger bugs. So once FT2 is finally released as a main build, the error reporting option will be turned down to errors only and you won't see these warnings. But to fix it in the meantime, add a "@" character before outputting each variable. For example: PHP Code: <?php The "@" symbol suppresses warnings for non-defined variables like these. Hope this helps! - Ben |