Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 30th, 2005, 04:22 PM
Authorized User
 
Join Date: Nov 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default array form problem

Hi everyone,

I have a problem for handling array form between JavaScript and PHP.
So far as I know that JavaScript read form.fieldName by using form.fieldName[i], but PHP read form.fieldName[i] by using $_POST['fieldName']. I found some problems if I want to verify the input using JavaScript before submit the form.

Anyone can let me know how to solve it?
Thank you in advance,
Jun

 
Old December 1st, 2005, 08:00 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

To get the list of all your POST variables using PHP, use:

Code:
print_r($_POST);
or

Code:
while( list($key, $value) = each($_POST) )
    echo $key . " => " . $value . "<br>";






`~@#\^%&*/\.<.\/-|+|_!:;..=?>
Support Indian students' finances http://scholarship.mediasworks.com/
 
Old December 1st, 2005, 10:33 AM
Authorized User
 
Join Date: Nov 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well done. Thank you very much,Jun

 
Old December 1st, 2005, 01:53 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

Surprised!

I just tried to say, using like that, you can trace what is coming from a form.

`~@#\^%&*/\.<.\/-|+|_!:;..=?>
Students' finances
 
Old December 1st, 2005, 02:23 PM
Authorized User
 
Join Date: Nov 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Although not test it yet, I am quite confidently sure that's the way to solve my problem.

Thank you again,
Jun






Similar Threads
Thread Thread Starter Forum Replies Last Post
putting an array unto a form Nyah Access VBA 1 January 14th, 2004 04:48 PM
Quote Form using an Array - Help jgisler Beginning PHP 1 July 8th, 2003 04:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.