I've done this a million times. What am I doing wrong?
When I run the following code & hit the submit button, the $_POST array shows all its values using print_r but when I try to extract the data I get nothing.
This is what I get when I run this script and submit it:Code:<?php // filename.php if (isset($_POST['submit'])) { echo '<pre>'; print_r ($_POST); echo '</pre>'; echo 'file = ' . $_POST['img_data']['file']; echo '<br/>path = ' . $_POST['img_data']['path']; die(); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Title</title> <SCRIPT LANGUAGE="JavaScript" SRC="includes/scripts/common.js"></SCRIPT> <style text/css>Define Styles</style> </head> <body> <form action="<?=$_SERVER['PHP SELF']; ?>" method="post"> <input type="hidden" name="img_data['file']" value="spider.jpg" /> <input type="hidden" name="img_data['path']" value="../images/spider.jpg" /> <input type="submit" name="submit" value="Save New Item" /><br/> </form> </body> </html>
I must have something wrong here. What is it???Code:Array ( [img_data] => Array ( ['file'] => spider.jpg ['path'] => ../images/spider.jpg ) [submit] => Save New Item ) file = path =
--Kenoli



Reply With Quote



- you might get a shock.
Bookmarks