Reply to Re: POST arrays - each as SQL statement

Your name:

Reply:


Posted by HC on 06/12/06 20:43

Hi Karl!

I think your issue lies in the naming of your HTML form elements. I
would name them like such:

ques_1[survey_id]

Note that there are no quotes around survey_id. Here is a quick example
of what I think you may be after. If I don't quite have it, feel free
to post back and I'll see what I can do.

Have fun!
HC



<!-- Example start //-->

<?PHP
// I prefer using $_POST instead of $HTTP_POST_VARS.
if ($_POST) {
echo "<pre>";
print_r($_POST);
echo "</pre>";
}
?>

<html><body>
<form method="post" action="">
<p>Question 1:<br />
<input type="text" name="ques_1[survey_id]" />
<input type="text" name="ques_1[question_id]" />
<input type="text" name="ques_1[answer]" />
<input type="text" name="ques_1[impact]" />
<input type="text" name="ques_1[comments]" />
</p>
<p>Question 2:<br />
<input type="text" name="ques_2[survey_id]" />
<input type="text" name="ques_2[question_id]" />
<input type="text" name="ques_2[answer]" />
<input type="text" name="ques_2[impact]" />
<input type="text" name="ques_2[comments]" />
</p>
<p><input type='submit' /></p>
</form>
</body></html>

<!-- Example end //-->


Karl Groves wrote: (heavily snipped)
>
> ques_1['question_id']
>
> So, why can't I access $value['question_id']; (or any of the other
> values of the other keys)?
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация