I'm trying to create an array, populating it with values from the $_POST variable. $_POST has all of the values I expect, but they're not becoming part of the array as I expect.
output:
Can anyone tell what I'm doing wrong?
Thank you.
--
-- Ghodmode
Give a man a fish and he'll come back to buy more... Teach a man to fish and you're out of business.
Code:
$review['prod_id'] = addSlashes( $_POST['prod_id'] );
$review['user_id'] = addSlashes( $_SESSION['current_user'] );
$review['rating'] = $_POST['rating'];
$review['review'] = htmlSpecialChars( addSlashes($_POST['review']) );
if ( empty($review['rating']) || ! is_numeric($review['rating']) ) {
?><pre style="text-align: left;"><?php
echo "POST: \n";
print_r( $_POST );
echo "review: \n";
print_r( $review );
?></pre><?php
}
output:
Code:
POST:
Array
(
[star] => images/16-star-hot.gif
[nostar] => images/16-star-cold.gif
[prod_id] => ASIAJEWELS
[rating] => 1
[review] => terrible
)
review:
terrible
Can anyone tell what I'm doing wrong?
Thank you.
--
-- Ghodmode
Give a man a fish and he'll come back to buy more... Teach a man to fish and you're out of business.