|
Posted by Rich on 09/26/06 18:34
On Tue, 26 Sep 2006 12:40:29 GMT, Cerebral Believer wrote...
>
>Hi I need help!
>
>Forgive me I am a PHP newbie. I have a small script that enables me to send
>a form from an HTML page. I want to use the HTML formatted form because the
>design of my website is complex, and I don't want to have to mess around
>with formatting a page using HTML within php. So basically the "action" of
>the HTML page sends the form to "ProcReg.php". This is the code:
>
><?php
>/* Script name: ProcReg.php
> * Description: Script displays all the information passed
> * from a form.
> */
> echo "<html>
> <head><title>Registration Information</title></head>
> <body>";
> foreach ($_REQUEST as $field => $value)
> {
> echo "$field = $value<br>";
> }
>?>
></body>
></html>
>
>-------
>
>This is what I get as a "return", at the moment to a blank web page:
>
>First_Name = First Name
>Last_Name = Last Name
>Address1 = Address Line 1
>Address2 = Address Line 2
>Address3 = Address Line 3
>TownCity = Town/City
>CountyStateProvince = County, State or Province
>PostZipCode = Post Code/Zip Code
>Country = 000
>e-mail1i = Your E-Mail Address
>email1v = Confirm Your E-mail Address
>email2i = Your Alternative E-Mail Address
>email2v = Confirm Your E-Mail Address
>intcode = 000
>areacode = 000
>telnum = 000000
>username = Username
>password = xxxxxxx
>mailinglist = Yes
>clubfbd = Yes
>B1 = Submit
>
>---
>
>I just want to know how I can modify the php code in the ProcReg script so
>that the instead of writing the "return" to a web page, it writes it to
>variables or an array, so that I can call the data later in the same script
>to be checked?
>
>I am sure I know how to do the checking, but not how to get the data into
>variables or an array.
>
>Regards,
>C.B.
>
>
When your PHP code is in the "foreach" loop, it is looking through the
"$_REQUEST" array. In your example it's just printing the $field and $value
variables that are generated. you can replace the print with whatever action you
needed to do, such as validating form field entries. I believe the $_REQUEST or
$_GET or $_POST arrays are available throughout the script so that shouldn't be
a problem.
Rich
--
Help a Community by Participating in Ours
We donate your subscription fees to the charity you choose
100% of your first month, 10% thereafter.
http://newsguy.com/charity.asp
[Back to original message]
|