View Single Post
  #3  
Old 08-11-2006, 02:21 PM
monty monty is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
monty is on a distinguished road
Default

Another way of doing it is

PHP Code:
# initialize
$values = array();

# set and not empty?
if (isset($_POST['name']) && !empty($_POST['name'])
{
# set it!
$values['name'] = $_POST['name'];
}
else
{
# error_handler
}
# you could then loop through $_POST with one of the above,
# and if the $_POST key is in your allowed key range, set it
# to your new array (presumably for creating a sanitized way
# of accessing the data)

A bit more verbose version -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  Webmaster Forums - View Single Post - way to merge Hash (Array) dynamically?
View Single Post
  #3  
Old 08-11-2006, 02:21 PM
monty monty is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
monty is on a distinguished road
Default

Another way of doing it is

PHP Code:
# initialize
$values = array();

# set and not empty?
if (isset($_POST['name']) && !empty($_POST['name'])
{
# set it!
$values['name'] = $_POST['name'];
}
else
{
# error_handler
}
# you could then loop through $_POST with one of the above,
# and if the $_POST key is in your allowed key range, set it
# to your new array (presumably for creating a sanitized way
# of accessing the data)

A bit more verbose version -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote