Hello,
Can anyone help with this code?
I need to split a long piece of text from a textarea box into small
chunks, then POST these chunks to my credit-card provider, whereupon he
will POST them back to my script, which will reassemble them into the
original text and display it. This is necessary because my credit-card
provider has a limit on all POSTed variables, which must be 255
characters or less each.
I thought that this would be simple to do. I used substr to take bites
out of the string, then included each piece as a hidden variable in my
form. When I received the return POST, I reassembled all the strings
using the (.) concatenator, then printed this out.
The problem is, pieces of the original text are missing, and there are
numerous // escape elements present in the text.
Here is my code:
$questions = $_POST['questions']; // coming from a previous POST
$questions=subs tr($questions, 0, 3556); // I put a limit on the total
string size.
$questions0=sub str($questions, 0, 254);
$questions1=sub str($questions, 254, 254);
$questions2=sub str($questions, 508, 254);
$questions3=sub str($questions, 762, 254); // etc.
<INPUT TYPE="HIDDEN" NAME="questions 0" value="<?=$ques tions0?>" >
<INPUT TYPE="HIDDEN" NAME="questions 1" value="<?=$ques tions1?>" >
<INPUT TYPE="HIDDEN" NAME="questions 2" value="<?=$ques tions2?>" >
<INPUT TYPE="HIDDEN" NAME="questions 3" value="<?=$ques tions3?>" > //
etc.
Then I POST the data, and then it comes back to my redirect page, which
uses the following code:
$questions0=$_P OST['questions0'];
$questions1=$_P OST['questions1'];
$questions2=$_P OST['questions2'];
$questions3=$_P OST['questions3']; // etc.
$questions=$que stions0 . $questions1 . $questions2 . $questions3 .
$questions4 . $questions5 . $questions6 . $questions7 . $questions8 .
$questions9 . $questions10 . $questions11 . $questions12 . $questions13
.. $questions14; // concatenate it
print ($questions); // I display $questions. It is mostly there, with
parts missing, and many //s here and there.
Any ideas?
Thank you.
Can anyone help with this code?
I need to split a long piece of text from a textarea box into small
chunks, then POST these chunks to my credit-card provider, whereupon he
will POST them back to my script, which will reassemble them into the
original text and display it. This is necessary because my credit-card
provider has a limit on all POSTed variables, which must be 255
characters or less each.
I thought that this would be simple to do. I used substr to take bites
out of the string, then included each piece as a hidden variable in my
form. When I received the return POST, I reassembled all the strings
using the (.) concatenator, then printed this out.
The problem is, pieces of the original text are missing, and there are
numerous // escape elements present in the text.
Here is my code:
$questions = $_POST['questions']; // coming from a previous POST
$questions=subs tr($questions, 0, 3556); // I put a limit on the total
string size.
$questions0=sub str($questions, 0, 254);
$questions1=sub str($questions, 254, 254);
$questions2=sub str($questions, 508, 254);
$questions3=sub str($questions, 762, 254); // etc.
<INPUT TYPE="HIDDEN" NAME="questions 0" value="<?=$ques tions0?>" >
<INPUT TYPE="HIDDEN" NAME="questions 1" value="<?=$ques tions1?>" >
<INPUT TYPE="HIDDEN" NAME="questions 2" value="<?=$ques tions2?>" >
<INPUT TYPE="HIDDEN" NAME="questions 3" value="<?=$ques tions3?>" > //
etc.
Then I POST the data, and then it comes back to my redirect page, which
uses the following code:
$questions0=$_P OST['questions0'];
$questions1=$_P OST['questions1'];
$questions2=$_P OST['questions2'];
$questions3=$_P OST['questions3']; // etc.
$questions=$que stions0 . $questions1 . $questions2 . $questions3 .
$questions4 . $questions5 . $questions6 . $questions7 . $questions8 .
$questions9 . $questions10 . $questions11 . $questions12 . $questions13
.. $questions14; // concatenate it
print ($questions); // I display $questions. It is mostly there, with
parts missing, and many //s here and there.
Any ideas?
Thank you.
Comment