php problem

neo36

UAAAARRRR!
after installing php and mysql with the help of macosx.com's HOWTO and the instructions of entropy.ch i'm just trying to learn working with it.

i discovered the following problem:

if i want to submit data from an HTML-Form (same problem with GET and POST), the data given by the user should be imported into a php-variable with the name specified in the form input field.

the form opens a php-page, which then would echo the variable... i don't know why, but that doesnt work...

using the GET-Method i can see that the fields are correctly delivered...

another thing (which possible is connected to this problem?) i discovered is: when i use the phpinfo() function, it tells me that my PHP.INI File would reside in /usr/local/lib... i looked it up, but there's no php.ini... what's that about??

any ideas?

PS: maybe that's a bit OT in the Darwin Forum, but i'm not sure if i just misconfigured something.
 
It's a bit unclear to me what your problem is. If you're having problems in getting hold of the actual values in the form-variables, it might be that your php.ini file has the option register_globals = Off. If this is the case, you have to refer to the form variables as $_GET['varname'] instead of $varname. To find the php.ini file, try the unix command
locate php.ini
and you should see it in /usr/local/lib/php.ini
If that doesen't show anything, run the weekly script as root, to update your locate database

z4ph0d
 
the php.ini config file is not automatically installed when you compile and install php from source. you have to copy php.ini-dist or php.ini-recommended from the root of the source directory to the location that the binary expects to find the file (/usr/local/lib is default, but i prefer it in the same directory as my http.conf file: /usr/local/etc/httpd. this location must be set at compile time). obviously, you must rename the copied file to php.ini. installing this file in the right place will not allow you to see your $_GET and $_POST variables, however. you still need to follow z4ph0d's directions...
 
Back
Top