The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/showthread.php 26 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/showthread.php 26 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/showthread.php 26 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/showthread.php 137 forum_permissions
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined property: MyLanguage::$ratings_update_error - Line: 5 - File: showthread.php(732) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(732) : eval()'d code 5 errorHandler->error
/showthread.php 732 eval
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions_user.php 844 is_member
/inc/functions_post.php 406 purgespammer_show
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(474) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php(474) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 474 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 660 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 660 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showimages" - Line: 741 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 741 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 746 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 746 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions_user.php 844 is_member
/inc/functions_post.php 406 purgespammer_show
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(474) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php(474) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 474 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 660 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 660 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showimages" - Line: 741 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 741 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 746 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 746 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions_user.php 844 is_member
/inc/functions_post.php 406 purgespammer_show
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(474) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php(474) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 474 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 660 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 660 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showimages" - Line: 741 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 741 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 746 - File: inc/functions_post.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions_post.php 746 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "invisible" - Line: 1506 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/showthread.php 1506 errorHandler->error
Warning [2] Undefined variable $threadnotesbox - Line: 30 - File: showthread.php(1533) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 30 errorHandler->error
/showthread.php 1533 eval
Warning [2] Undefined variable $addremovesubscription - Line: 79 - File: showthread.php(1533) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 79 errorHandler->error
/showthread.php 1533 eval



FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
API Refill Form Fields PROBLEM! \r\n
#1
Exclamation 
Hi

I have a big problem so I'll be as thorough as I can with my explanation.

I have a multi page form (3 pages) First page all text boxes, Second page mainly text areas, Third page shows all information entered in the First and Second pages for the customer to review.

If they need to go back and change anything there is a button linking back to the First or Second page so they can change a field then resubmit. Once happy they can send and finalize from the third page which goes to the thanks page.

So far so good and working, almost. In the Third page (review page) the details entered in all of the textareas which have had carriage returns used shows the horrible \r\n characters instead! this is the code used to display the session data from one of those text areas - Key Services (this is just to display the info for review its not an editable field)

Code:
<div class="spacer"><span>Key Services</strong></span><br>
                    <span class="lightgray"><?=@$fields["key_services"]?></span></div>

When I go back to the Second page to edit the info the same \r\n characters are displayed in the text area input field as well, the code for the field - Key Services

Code:
<textarea class="spacersml span12" rows="8" name="key_services" placeholder="Key Features and Services Details Here…"><?=@$fields["key_services"]?></textarea>

Points worth noting: If I fill in the form through to the third page (review page) and go into the database the un-finalized data shows in the database as it should, line breaks between paragraphs or anywhere where the return key has been used. If I go back and edit the second page where it is now displaying the \r\n characters and resubmit the page without removing the \r\n characters they will now be shown in the database as if they had been typed in, each time this is done extra \ seem to appear as well.

Also worth pointing out, if filling out the page and it is submitted without a required field the server side validation lists whats needed, refilling the completed fields correctly, the problem only occurs once the form is filled in correctly and moves on to the next page.

Being a beginner to PHP (I'm trying to learn) I may be missing something very simple but I have followed all of the tutorials to create a multi page form.

Its as if the data is being sent to the database correctly but when it is needed to be displayed again in the form pages it goes wrong.

Please help as I need to crack this, I've spent hours and hours day and night trying to solve it.

PS. I really love form tools.

Many many thanks
Steven
Reply
#2
This one stumped me for quite a bit. Here's what worked for me.

I had the single page form, and then instead of submitting right away, the user clicks a "continue" button to review their submission on the next page before hitting a "submit" button.

On the form:

Code:
<textarea name="abstract_body" id="abstract_body"><?=stripslashes(str_replace('\r\n', "\n", $fields["abstract_body"]))?></textarea>

On the review page:

Code:
<?=str_ireplace('\r\n','<br>',@$fields['abstract_body'])?>

Really hope this helps! Drove me nuts for a good while.


(Feb 7th, 2013, 3:00 AM)stenew Wrote: Hi

I have a big problem so I'll be as thorough as I can with my explanation.

I have a multi page form (3 pages) First page all text boxes, Second page mainly text areas, Third page shows all information entered in the First and Second pages for the customer to review.

If they need to go back and change anything there is a button linking back to the First or Second page so they can change a field then resubmit. Once happy they can send and finalize from the third page which goes to the thanks page.

So far so good and working, almost. In the Third page (review page) the details entered in all of the textareas which have had carriage returns used shows the horrible \r\n characters instead! this is the code used to display the session data from one of those text areas - Key Services (this is just to display the info for review its not an editable field)

Code:
<div class="spacer"><span>Key Services</strong></span><br>
                    <span class="lightgray"><?=@$fields["key_services"]?></span></div>

When I go back to the Second page to edit the info the same \r\n characters are displayed in the text area input field as well, the code for the field - Key Services

Code:
<textarea class="spacersml span12" rows="8" name="key_services" placeholder="Key Features and Services Details Here…"><?=@$fields["key_services"]?></textarea>

Points worth noting: If I fill in the form through to the third page (review page) and go into the database the un-finalized data shows in the database as it should, line breaks between paragraphs or anywhere where the return key has been used. If I go back and edit the second page where it is now displaying the \r\n characters and resubmit the page without removing the \r\n characters they will now be shown in the database as if they had been typed in, each time this is done extra \ seem to appear as well.

Also worth pointing out, if filling out the page and it is submitted without a required field the server side validation lists whats needed, refilling the completed fields correctly, the problem only occurs once the form is filled in correctly and moves on to the next page.

Being a beginner to PHP (I'm trying to learn) I may be missing something very simple but I have followed all of the tutorials to create a multi page form.

Its as if the data is being sent to the database correctly but when it is needed to be displayed again in the form pages it goes wrong.

Please help as I need to crack this, I've spent hours and hours day and night trying to solve it.

PS. I really love form tools.

Many many thanks
Steven

Reply
#3
Hi Steven,

I am working on a similar issue of re-filling form fields from the database, not the session array variable, $fields. I don't have the exact solution for your needs, but you can try re-loading the data from the database fields, rather than from the session data.

It's important to keep in mind the difference between re-filling data from a session variable, $fields in this case, and data from the database. The DB data is not held in the $fields array after a session has been closed. So, you would need to re-query the DB and store it into the $fields array (or some other variable) for use in your script.

That's just my "two cents" worth of help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)