RE: [PHP-DB] Form response
Missed most of the thread, so hope this hits the mark! If one form works and one doesn't are they both called .php ? If one is .php3 and one .php and the webserver is only configured to parse onr then the other will show as plain text. just a thought Peter --- Excellence in internet and open source software --- Sunmaia www.sunmaia.net tel. 0121-242-1473 --- -Original Message- From: John Holmes [mailto:[EMAIL PROTECTED]] Sent: 20 September 2002 21:16 To: 'Warren Massengill' Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Form response You have to run the scripts through a web server like Apache. ---John Holmes... -Original Message- From: Warren Massengill [mailto:[EMAIL PROTECTED]] Sent: Friday, September 20, 2002 1:08 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Form response John, If you're seeing PHP source code when you pull up a page, your server is not configured correctly. What if you try a basic .php page like echo Hello World;, does that work? No. Just prints the source code. What is really strange (to me) is that the simple form and a more complex form (not shown here) works pefectly. The forms open, accept input, and when you press submit ... the next script reverts to source code, just like hello world, phpinfo(), and everything else. ;--( You are running a web server right, not just using File-Open?? --- No again, just using the browser in Linux. John Holmes... From: Cornelia Boenigk [EMAIL PROTECTED] Reply-To: Cornelia Boenigk [EMAIL PROTECTED] To: Warren Massengill [EMAIL PROTECTED] Subject: Re: [PHP-DB] Form response Date: Fri, 20 Sep 2002 13:31:46 +0200 Hi Warren Did you change the php.ini? There must be the line default_mimetype = text/html I checked. The line already exists as default_mimetype = text/html . I did find the mod_mime_magic module in Apache (see below for the gory details) and installed it - to no effect as you might imagine (both Apache and PHP are configured to accept html,php,etc...) It seems that the browser doesn't recognize the correct type and displays the source. Did you try to display the forms in another browser. Netscape gave the same result. Thanks, Warren Regards Conni LoadModule mime_magic_module modules/mod_mime_magic.so --- AddModule mod_mime_magic.c # # TypesConfig describes where the mime.types file (or equivalent) is # to be found. # IfModule mod_mime.c TypesConfig /etc/mime.types /IfModule --- # # The mod_mime_magic module allows the server to use various hints from the # contents of the file itself to determine its type. The MIMEMagicFile IfModule mod_mime_magic.c MIMEMagicFile /usr/share/magic.mime MIMEMagicFile conf/magic /IfModule _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Form response
If you're seeing PHP source code when you pull up a page, your server is not configured correctly. What if you try a basic .php page like echo Hello World;, does that work? You are running a web server right, not just using File-Open?? ---John Holmes... -Original Message- From: Warren Massengill [mailto:[EMAIL PROTECTED]] Sent: Friday, September 20, 2002 3:06 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Form response Try $_POST['field_1'] instead of $field_1 ---John Holmes... I tried this with two different versions of reaction.php. Still displays only the source code. Thanks, Warren html body A Simple Form brbr form action=reaction.php method=post input type=text name=$_POST['field_1'] size=10brbr input type=submit name=submitbutton /form /body /html - ?php if ($$_POST['field_1']) { echo $_POST['field_1']: $$_POST['field_1']; } else { echo nothing has been passed to this script; } ? --- ?php if ($field_1) { echo $_POST['field_1']: $field_1; } else { echo nothing has been passed to this script; } ? - ?php if ($$_POST['field_1']) { echo $_POST['field_1']: $$_POST['field_1']; } else { echo nothing has been passed to this script; } ? - I tried this with two different versions of reaction.php. Still displays only the source code. Thanks, Warren -Original Message- From: Warren Massengill [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 19, 2002 8:19 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Form response Hi, RedHat 7.2 RPM with PostgreSQL 7.1.x and PHP 4.0.6 Page 111 of PHP and PostgreSQL, this form displays in Mozilla. The submit button is expected to run a script called reaction.php but it opens the script and displays the code. The response is the same with or without variable input. I changed the script file to executable: no effect. I can run 'reaction.php' from the shell and it works. What is the problem here? - form - html body A Simple Form brbr form action=reaction.php method=post input type=text name=field_1 size=10brbr input type=submit name=submitbutton /form /body /html - Reaction.php -- action.php ?php if ($field_1) { echo field_1: $field_1; } else { echo nothing has been passed to this script; } ? -- run as stand alone php file - bash-2.05$ php reaction.php X-Powered-By: PHP/4.0.6 Content-type: text/html nothing has been passed to this script In: /etc/httpd/conf/httpd.conf AddType application/x-httpd-php .php (appears as above plus an entry for each of php2,3,4) LoadModule php4_modulemodules/libphp4.so LoadModule php_module modules/mod_php.so These were all uncommented in the RPM installation of RedHat 7.2. Somehow PHP is partially working... Any suggestions? I can create forms in php and tables in PostgreSQL but according to phpinfo(), php is not configured for PostfreSQL. If I survive this problem, that one is on the horizon. Does anyone have a generic list of things to do after an RPM installation of RedHat Linux 7.2 in order to use PHP with PostgreSQL? Thanks, Warren _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Form response
You have to run the scripts through a web server like Apache. ---John Holmes... -Original Message- From: Warren Massengill [mailto:[EMAIL PROTECTED]] Sent: Friday, September 20, 2002 1:08 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Form response John, If you're seeing PHP source code when you pull up a page, your server is not configured correctly. What if you try a basic .php page like echo Hello World;, does that work? No. Just prints the source code. What is really strange (to me) is that the simple form and a more complex form (not shown here) works pefectly. The forms open, accept input, and when you press submit ... the next script reverts to source code, just like hello world, phpinfo(), and everything else. ;--( You are running a web server right, not just using File-Open?? --- No again, just using the browser in Linux. John Holmes... From: Cornelia Boenigk [EMAIL PROTECTED] Reply-To: Cornelia Boenigk [EMAIL PROTECTED] To: Warren Massengill [EMAIL PROTECTED] Subject: Re: [PHP-DB] Form response Date: Fri, 20 Sep 2002 13:31:46 +0200 Hi Warren Did you change the php.ini? There must be the line default_mimetype = text/html I checked. The line already exists as default_mimetype = text/html . I did find the mod_mime_magic module in Apache (see below for the gory details) and installed it - to no effect as you might imagine (both Apache and PHP are configured to accept html,php,etc...) It seems that the browser doesn't recognize the correct type and displays the source. Did you try to display the forms in another browser. Netscape gave the same result. Thanks, Warren Regards Conni LoadModule mime_magic_module modules/mod_mime_magic.so --- AddModule mod_mime_magic.c # # TypesConfig describes where the mime.types file (or equivalent) is # to be found. # IfModule mod_mime.c TypesConfig /etc/mime.types /IfModule --- # # The mod_mime_magic module allows the server to use various hints from the # contents of the file itself to determine its type. The MIMEMagicFile IfModule mod_mime_magic.c MIMEMagicFile /usr/share/magic.mime MIMEMagicFile conf/magic /IfModule _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php