RE: [PHP-DB] forms and method POST - variables

2008-01-09 Thread Miguel Guirao
Well, it depends if you use an old version of PHP, in the latest version
both arrays $_POST and $_GET are used to get passed variables!!
I can't remember since what version PHP started to use these arrays!!

MG

-Original Message-
From: Lukáš Moravec [mailto:[EMAIL PROTECTED]
Sent: Miércoles, 09 de Enero de 2008 10:26 a.m.
To: php-db@lists.php.net
Subject: [PHP-DB] forms and method POST - variables


Hi,

I have one question about forms and php (which I use for Mysql too).

Do I need for variables from any form in html and method POST (then in php
script) to set these variables with:

$variable=$_POST['variable'];



For example:

html

head

title FORM/title

/head

body

form action=do_something.php method=POST

 Input something

br

input type=text name=variable

input type=submit value=submit

/FORM

/body

/html



And then.in do_something.php



html

head

titleDO SOMETHING/title

/head

body

?php

$variable=$_POST['variable'];

echo brbVariable: /b.$variable;

?

/body

/html



Because I got some old scripts where I don´t have this setting.they worked
on MS Win2000 - PWS and PHP 4.0 but now - with Apache 2.2.6, PHP 5.2 on WIN
XP it doesn´t work.



Thank you for any advice.



Lukas

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] forms and method POST - variables

2008-01-09 Thread Daniel Brown
On Jan 9, 2008 11:25 AM, Lukáš Moravec [EMAIL PROTECTED] wrote:
 Hi,

 I have one question about forms and php (which I use for Mysql too).

 Do I need for variables from any form in html and method POST (then in php
 script) to set these variables with:

 $variable=$_POST['variable'];
[snip!]

That's a question that should be asked on the PHP-General list,
actually.  I'm forwarding the response to that list with this message.

Are you receiving any errors?  Are any messages displayed when you
have the following at the beginning of the script?
?php
error_reporting(E_ALL);
?

$_GET and $_POST are predefined superglobal variables, which have
been available in PHP since dinosaurs roamed the Earth.

-- 
/Dan

Daniel P. Brown
Senior Unix Geek and #1 Rated Year's Coolest Guy By Self Since 1979.