473,394 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Help with variables and POST

Hello,

Can anyone help with this?

On my online order form, I need to send a few variables to my
credit-card processor. These variables are for non-secure customer
comments, and will be sent through the usual metod, i.e.,
<form action="https://orderpage.ic3.com/hop/orderform.jsp"
method="post">

However, one variable is a text-area box for a detailed customer
comment, and this variable can get pretty long. But my credit-card
processor has a 256 byte maximum length limit for all POSTed
variables. However, I can add as many of these 256-byte variables as I
like.

So how can I accomplish this in the most simple, efficient, and
elegant manner? How can I break up the text-area vaiable into 256-byte
pieces and then send these variables via POST along with all of the
other form variables which will be POSTed through the usual HTML
means?

Thank you.

Sincerely,

Robert

If you reply directly to this question, please send to
ro********@starcenter.com .
Jul 17 '05 #1
3 2496
red
Robert wrote:
Hello,

Can anyone help with this?

On my online order form, I need to send a few variables to my
credit-card processor. These variables are for non-secure customer
comments, and will be sent through the usual metod, i.e.,
<form action="https://orderpage.ic3.com/hop/orderform.jsp"
method="post">

However, one variable is a text-area box for a detailed customer
comment, and this variable can get pretty long. But my credit-card
processor has a 256 byte maximum length limit for all POSTed
variables. However, I can add as many of these 256-byte variables as I
like.

So how can I accomplish this in the most simple, efficient, and
elegant manner? How can I break up the text-area vaiable into 256-byte
pieces and then send these variables via POST along with all of the
other form variables which will be POSTed through the usual HTML
means?

Thank you.

Sincerely,

Robert

If you reply directly to this question, please send to
ro********@starcenter.com .

in the example below,input(), form() and html() are my own functions (I
hate writing html) but its obvious what they do so I won't show
them.This is enough to give you the idea.

$data = str_split($_POST[text_area_data],256);
$num=0;
foreach($data as $d){
$name="comment_part_$num";
$num++;
$fields.=input('hidden',$name,$d);
}
$fields.=input('submit','submit','submit');
$action= "credit_card_processor.php";
$form=form($fields,$action);
html($form);
Jul 17 '05 #2
red <gr*****@reenie.org> wrote in message news:<wm**********************@news.easynews.com>. ..
Robert wrote:
Hello,

Can anyone help with this?

On my online order form, I need to send a few variables to my
credit-card processor. These variables are for non-secure customer
comments, and will be sent through the usual metod, i.e.,
<form action="https://orderpage.ic3.com/hop/orderform.jsp"
method="post">

However, one variable is a text-area box for a detailed customer
comment, and this variable can get pretty long. But my credit-card
processor has a 256 byte maximum length limit for all POSTed
variables. However, I can add as many of these 256-byte variables as I
like.

So how can I accomplish this in the most simple, efficient, and
elegant manner? How can I break up the text-area vaiable into 256-byte
pieces and then send these variables via POST along with all of the
other form variables which will be POSTed through the usual HTML
means?

Thank you.

Sincerely,

Robert

If you reply directly to this question, please send to
ro********@starcenter.com .

in the example below,input(), form() and html() are my own functions (I
hate writing html) but its obvious what they do so I won't show
them.This is enough to give you the idea.

$data = str_split($_POST[text_area_data],256);
$num=0;
foreach($data as $d){
$name="comment_part_$num";
$num++;
$fields.=input('hidden',$name,$d);
}
$fields.=input('submit','submit','submit');
$action= "credit_card_processor.php";
$form=form($fields,$action);
html($form);


Thank you for the reply. However, could you explain the input(),
form() and html()functions?

Sincerely,

Robert
ro********@starcenter.com
Jul 17 '05 #3
Robert wrote:
red <gr*****@reenie.org> wrote in message news:<wm**********************@news.easynews.com>. ..
Robert wrote:
Hello,

Can anyone help with this?

On my online order form, I need to send a few variables to my
credit-card processor. These variables are for non-secure customer
comments, and will be sent through the usual metod, i.e.,
<form action="https://orderpage.ic3.com/hop/orderform.jsp"
method="post">

However, one variable is a text-area box for a detailed customer
comment, and this variable can get pretty long. But my credit-card
processor has a 256 byte maximum length limit for all POSTed
variables. However, I can add as many of these 256-byte variables as I
like.

So how can I accomplish this in the most simple, efficient, and
elegant manner? How can I break up the text-area vaiable into 256-byte
pieces and then send these variables via POST along with all of the
other form variables which will be POSTed through the usual HTML
means?

Thank you.

Sincerely,

Robert

If you reply directly to this question, please send to
ro********@starcenter.com .
in the example below,input(), form() and html() are my own functions (I
hate writing html) but its obvious what they do so I won't show
them.This is enough to give you the idea.

$data = str_split($_POST[text_area_data],256);
$num=0;
foreach($data as $d){
$name="comment_part_$num";
$num++;
$fields.=input('hidden',$name,$d);
}
$fields.=input('submit','submit','submit');
$action= "credit_card_processor.php";
$form=form($fields,$action);
html($form);

Thank you for the reply. However, could you explain the input(),
form() and html()functions?


They just write html tags. Sorry, I assumed you already knew how to do
that.
A form has input statments to gather data to send to the next page.

A)
$data = str_split($_POST[text_area_data],256);
This gets the data from the previous page, devides the data into 256
byte chinks and puts the chunks into the $data array.

B)
$num=0;
foreach($data as $d){
$name="comment_part_$num";
$num++;
$fields.=input('hidden',$name,$d);
}
This loop iterates through the $data array and makes each piece of data
the value of a hidden field in an input statement. It essentially does
something like this:
$fields.="<input type='hidden' name='comment_part_3' value='$d'>";
where $d is one 256 byte chunk of data. Each hidden field is given a
unique name: comment_part_0,comment_part_1,comment_part_2 etc.

C)
$fields.=input('submit','submit','submit');
this adds a submit button: "<input type='submit' name='submit'
value='submit'>

D)
$action= "credit_card_processor.php";
$form=form($fields,$action);
This puts the hidden fields and the submit button between form tags with
the action set to the file that will process your data.
$form="<form action = 'credit_card_processor.php'> $fields</form>";

E)

html($form);
This adds html tags to the argument . It does other things so that the
page validates, but we don't need to get into that to answer your question.
Sincerely,

Robert
ro********@starcenter.com

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: laurie | last post by:
Hi all, I'm trying to help out a friend who has inherited a client with a PHP shopping cart application. Neither of us know PHP, but I've been muddling my way through, trying to get these old...
31
by: da Vinci | last post by:
OK, this has got to be a simple one and yet I cannot find the answer in my textbook. How can I get a simple pause after an output line, that simply waits for any key to be pressed to move on? ...
5
by: David M Loraine | last post by:
I am a sql novice and would appreciate any help with the following problem. In a table I have property addresses stored in 6 fields. Field6 always hold the Post Code. However, fields 4 and 5...
15
by: Alfonso Morra | last post by:
Hi, I have some code from an example, that I want to retrofit into my project. The code from the example has the following line: SharedAppenderPtr myAppender( new...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
4
by: DOTNET | last post by:
Hi, Anybody help me regarding this error: I am assigning the values to the session variables when the button is clicked and passing these session variables to the next page and when I am...
11
by: Frankie | last post by:
Hello: New user here...first post to group. I'm getting an SQL syntax error when I try to run the following query: $query = sprintf("SELECT itemNumber, entryDate, modifyDate, thumbnailURL,...
4
by: Jacob.Bruxer | last post by:
Hi, I'm pretty new to Visual Basic and was wondering if anyone could give some general advise on how to conserve memory when running a Visual Basic program that I've created. I keep getting a...
6
by: AppleBag | last post by:
I'm having the worst time trying to login to myspace through code. Can someone tell me how to do this? Please try it yourself before replying, only because I have asked this a couple of times in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.