Re: PHP form Creates Blank DB entries

Поиск
Список
Период
Сортировка
Искать
От
Frank Bax
Тема
Re: PHP form Creates Blank DB entries
Дата
Msg-id
5.2.1.1.0.20030630131653.00aa7df0@pop6.sympatico.ca
Ответ на
Список
Дерево обсуждения
PHP form Creates Blank DB entries Michael Hanna <zen@hwcn.org>
Re: PHP form Creates Blank DB entries Frank Bax <fbax@sympatico.ca>
Re: PHP form Creates Blank DB entries Jeff <jam@zoidtechnologies.com>
Re: PHP form Creates Blank DB entries Bruno Wolff III <bruno@wolff.to>
Re: PHP form Creates Blank DB entries Jeff <jam@zoidtechnologies.com>
Re: PHP form Creates Blank DB entries "philip johnson" <philip.johnson@atempo.com>
At 12:16 PM 6/30/03, Michael Hanna wrote:
>// error checks on form submission go here
>// generate and execute a query
>$query = "INSERT INTO addressbook VALUES (nextval('addressbook_id_seq'), 
>'$name', '$address', '$tel', '$email')";
>$result = pg_query($connection, $query)
>         or die("Error in query: $query. " . pg_last_error($connection));
>echo "Data successfully added.";
>// close database connection
>pg_close($connection); } ?>


Probably because "register globals" is off (default changed since 4.2.0).
         http://ca3.php.net/register_globals

Insert the following lines before "$query = ..." line:

$name = $_POST[name];
$address = $_POST[address];
$tel = $_POST[tel];
$email = $_POST[email];


В списке pgsql-php по дате отправления
От: Michael Hanna
Дата:
От: Michael Hanna
Дата:
FAQ