note 50033 added to language.variables.variable

From: Date: Wed, 16 Feb 2005 07:11:39 +0000
Subject: note 50033 added to language.variables.variable
Groups: php.notes 
Request: Send a blank email to php-notes+get-85097@lists.php.net to get a copy of this message
A note regarding the code posted by Øyvind Vestavik, NTNU Norway for dynamic html forms with unknown number of entries.. After banging my head against a brick wall with this code, wondering why it wouldn't work on my local server and would on my host.. for the code to work as written, register_globals must be on.. To make the code work as written, either extract($_POST), or specifically reference the required variables by their propper names - ie $nr_entries = $_POST['nr_entries'] For the dynamic entries, (ie $_POST['name_1'] etc) reference them like so: <?php $temp = "name_$i"; $value = $_POST[$temp]; ?> ...thereby removing the reliance on variable variables anyway. regards, David ---- Manual Page -- http://www.php.net/manual/en/language.variables.variable.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+50033 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50033&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50033&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50033&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50033&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50033&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+50033&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#85097) next »