View previous topic :: View next topic |
Author |
Message |
jbmohler n00b
Joined: 23 Mar 2004 Posts: 29
|
Posted: Sat May 15, 2004 7:25 pm Post subject: PHP form - post does not work |
|
|
I have a newly emerged copy of apache2 and php (with mod_php installed, but using it as cgi-scripts). My post variables are not coming through.
Here is the entire script. Notice that the form action calls the same script. I've looked for configuration errors (but it seems weird to disable the _POST variable). I've also looked for clues in phpinfo(), but it didn't seem real helpful.
This script works in apache 1.3.xx with php on my red-hat box.
Code: |
#!/usr/bin/php
<html>
<head>
<title>Arghhhh</title>
</head>
<body>
<h1>Testing</h1>
<? if( $_POST["jigger"] != "" )
print( "Last time you typed " . $_POST["jigger"] . "<br>" ); ?>
<form action="help.php" method="POST">
Input this: <input type="text" name="jigger">
<input type="submit"><input type="reset">
</form>
</body>
</html>
|
The if statement is always negative. That is, I never get the "Last time you typed" message when I click the submit button.
Any ideas how to make my 'post's work? Oh, by the way, replacing all POST's with GET's had the same results.
thanks
Joel |
|
Back to top |
|
|
tomk Bodhisattva
Joined: 23 Sep 2003 Posts: 7221 Location: Sat in front of my computer
|
Posted: Sat May 15, 2004 8:46 pm Post subject: |
|
|
Hmm, that script works fine on my system.
As you can get phpinfo(), I'm asuming that you've got php working with apache. Does it mention _POST in the variables section, near the end, of phpinfo?
What versions of php, apache and mod_php do you have installed? _________________ Search | Read | Answer | Report | Strip |
|
Back to top |
|
|
jbmohler n00b
Joined: 23 Mar 2004 Posts: 29
|
Posted: Sat May 15, 2004 9:09 pm Post subject: |
|
|
That appears helpful, although not quite the way I expected:
Here is a grep of the output of a phpinfo() inserted into my page:
Code: |
friedrich / # grep -i post testing.html
always_populate_raw_post_data => Off => Off
post_max_size => 8M => 8M
PostgreSQL
REQUEST_METHOD => POST
_SERVER["REQUEST_METHOD"] => POST
_ENV["REQUEST_METHOD"] => POST
<form action="help.php" method="post">
|
I thought the 'always_populate_raw_post_data' being Off was a bad sign. So I did the following grep:
Code: |
friedrich / # grep -r always_populate_raw_post_data /etc/php/*
/etc/php/apache2-php4/php.ini:;always_populate_raw_post_data = On
Binary file /etc/php/apache2-php4/lib/libphp4.so matches
/etc/php/cli-php4/php.ini:;always_populate_raw_post_data = On
|
I assume that one of these files is the applicable configuration file, but they are turning it on.
Versions: PHP Version => 4.3.6RC2
_ENV["SERVER_SOFTWARE"] => Apache/2.0.49 (Gentoo/Linux)
mod_php: mod_php-4.3.6_rc2
More info needed?
What's going on with this config files?
thanks
Joel |
|
Back to top |
|
|
tomk Bodhisattva
Joined: 23 Sep 2003 Posts: 7221 Location: Sat in front of my computer
|
Posted: Sun May 16, 2004 9:35 am Post subject: |
|
|
The always_populate_raw_post_data variable is different, that affects the $HTTP_RAW_POST_DATA variable. It's also off on my box.
Do you get anything in _REQUEST[]?, in mine I've got:
Code: | _REQUEST["jigger"]
_POST["jigger"]
|
In the variables of my phpinfo, if you get _REQUEST you can use it instead of _POST or _GET. _________________ Search | Read | Answer | Report | Strip |
|
Back to top |
|
|
jbmohler n00b
Joined: 23 Mar 2004 Posts: 29
|
Posted: Mon May 17, 2004 9:55 am Post subject: |
|
|
Actually, I have no occurrences of _REQUEST or _POST in my phpinfo() output.
Although, it is long, here is the entire output to be maximally informative:
Code: |
phpinfo()
PHP Version => 4.3.6RC2
System => Linux friedrich 2.6.3 #2 SMP Wed Mar 10 10:01:38 EST 2004 i686
Build Date => May 14 2004 21:29:43
Configure Command => './configure' '--prefix=/usr' '--host=i586-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--with-apxs2=/usr/sbin/apxs2' '--with-ndbm=/usr' '--with-db4=/usr' '--with-mcrypt=/usr' '--with-mhash=/usr' '--without-interbase' '--without-ming' '--without-swf' '--without-sybase' '--with-gdbm=/usr' '--without-fdftk' '--without-java' '--without-mcal' '--without-unixODBC' '--without-pgsql' '--without-snmp' '--with-pdflib=/usr' '--without-gd' '--with-png=/usr' '--with-png-dir=/usr' '--with-jpeg=/usr' '--with-jpeg-dir=/usr' '--enable-exif' '--with-tiff=/usr' '--with-tiff-dir=/usr' '--with-mysql=/usr' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-freetype-dir=/usr' '--with-ttf=/usr' '--with-t1lib=/usr' '--with-gettext' '--without-qtdom' '--with-pspell=/usr' '--with-openssl=/usr' '--without-imap' '--without-ldap' '--with-dom=/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--without-kerberos' '--with-pam' '--disable-memory-limit' '--disable-ipv6' '--without-yaz' '--without-curl' '--enable-dbx' '--with-zlib=/usr' '--with-zlib-dir=/usr' '--with-sablot=/usr' '--enable-xslt' '--with-xslt-sablot' '--with-xmlrpc' '--enable-wddx' '--with-xml' '--enable-mbstring=all' '--enable-mbregex' '--with-bz2=/usr' '--with-crack=/usr' '--with-cdb' '--enable-pcntl' '--enable-bcmath' '--enable-calendar' '--enable-dbase' '--enable-filepro' '--enable-ftp' '--with-mime-magic=/usr/share/misc/file/magic.mime' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvipc' '--with-iconv' '--enable-shmop' '--enable-dio' '--enable-yp' '--without-ncurses' '--without-readline' '--enable-inline-optimization' '--enable-track-vars' '--enable-trans-sid' '--enable-versioning' '--with-config-file-path=/etc/php/apache2-php4'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php/apache2-php4/php.ini
PHP API => 20020918
PHP Extension => 20020429
Zend Extension => 20021010
Debug Build => no
Thread Safety => disabled
Registered PHP Streams => php, http, ftp, https, ftps, compress.bzip2, compress.zlib
This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
_______________________________________________________________________
Configuration
PHP Core
Directive => Local Value => Master Value
allow_call_time_pass_reference => On => On
allow_url_fopen => Off => Off
always_populate_raw_post_data => Off => Off
arg_separator.input => & => &
arg_separator.output => & => &
asp_tags => Off => Off
auto_append_file => no value => no value
auto_prepend_file => no value => no value
browscap => no value => no value
default_charset => no value => no value
default_mimetype => text/html => text/html
define_syslog_variables => Off => Off
disable_classes => no value => no value
disable_functions => no value => no value
display_errors => On => On
display_startup_errors => Off => Off
doc_root => no value => no value
docref_ext => no value => no value
docref_root => no value => no value
enable_dl => On => On
error_append_string => no value => no value
error_log => no value => no value
error_prepend_string => no value => no value
error_reporting => 2039 => 2039
expose_php => On => On
extension_dir => /usr/lib/php/extensions/no-debug-non-zts-20020429 => /usr/lib/php/extensions/no-debug-non-zts-20020429
file_uploads => On => On
gpc_order => GPC => GPC
highlight.bg => #FFFFFF => #FFFFFF
highlight.comment => #FF8000 => #FF8000
highlight.default => #0000BB => #0000BB
highlight.html => #000000 => #000000
highlight.keyword => #007700 => #007700
highlight.string => #DD0000 => #DD0000
html_errors => Off => On
ignore_repeated_errors => Off => Off
ignore_repeated_source => Off => Off
ignore_user_abort => Off => Off
implicit_flush => On => Off
include_path => .:/usr/lib/php => .:/usr/lib/php
log_errors => Off => Off
log_errors_max_len => 1024 => 1024
magic_quotes_gpc => On => On
magic_quotes_runtime => Off => Off
magic_quotes_sybase => Off => Off
max_execution_time => 0 => 30
max_input_time => 60 => 60
open_basedir => no value => no value
output_buffering => 0 => no value
output_handler => no value => no value
post_max_size => 8M => 8M
precision => 12 => 12
register_argc_argv => On => On
register_globals => On => On
report_memleaks => On => On
safe_mode => Off => Off
safe_mode_exec_dir => no value => no value
safe_mode_gid => Off => Off
safe_mode_include_dir => no value => no value
sendmail_from => no value => no value
sendmail_path => /usr/sbin/sendmail -t -i => /usr/sbin/sendmail -t -i
serialize_precision => 100 => 100
short_open_tag => On => On
SMTP => localhost => localhost
smtp_port => 25 => 25
sql.safe_mode => Off => Off
track_errors => Off => Off
unserialize_callback_func => no value => no value
upload_max_filesize => 2M => 2M
upload_tmp_dir => no value => no value
user_dir => no value => no value
variables_order => EGPCS => EGPCS
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
y2k_compliance => On => On
bcmath
BCMath support => enabled
bz2
BZip2 Support => Enabled
BZip2 Version => 1.0.2, 30-Dec-2001
calendar
Calendar support => enabled
crack
crack support => enabled
Directive => Local Value => Master Value
crack.default_dictionary => no value => no value
ctype
ctype functions => enabled
dba
DBA support => enabled
Supported handlers => gdbm ndbm cdb cdb_make db4 inifile flatfile
dbx
dbx support => enabled
dbx version => 1.0.0
supported databases => MySQL
ODBC
PostgreSQL
Microsoft SQL Server
FrontBase
Oracle 8 (oci8)
Sybase-CT
Directive => Local Value => Master Value
dbx.colnames_case => unchanged => unchanged
dio
dio support => enabled
domxml
DOM/XML => enabled
DOM/XML API Version => 20020815
libxml Version => 20606
HTML Support => enabled
XPath Support => enabled
XPointer Support => enabled
DOM/XSLT => enabled
libxslt Version => 1.1.3
libxslt compiled against libxml Version => 2.6.6
DOM/EXSLT => enabled
libexslt Version => 1.1.3
exif
EXIF Support => enabled
EXIF Version => 1.4 $Id: exif.c,v 1.118.2.27 2003/12/17 09:08:37 helly Exp $
Supported EXIF Version => 0220
Supported filetypes => JPEG,TIFF
ftp
FTP support => enabled
gettext
GetText Support => enabled
iconv
iconv support => enabled
iconv implementation => glibc
iconv library version => 2.3.2
Directive => Local Value => Master Value
iconv.input_encoding => ISO-8859-1 => ISO-8859-1
iconv.internal_encoding => ISO-8859-1 => ISO-8859-1
iconv.output_encoding => ISO-8859-1 => ISO-8859-1
mbstring
Multibyte Support => enabled
Japanese support => enabled
Simplified chinese support => enabled
Traditional chinese support => enabled
Korean support => enabled
Russian support => enabled
Multibyte (japanese) regex support => enabled
mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.
Directive => Local Value => Master Value
mbstring.detect_order => no value => no value
mbstring.encoding_translation => Off => Off
mbstring.func_overload => 0 => 0
mbstring.http_input => pass => pass
mbstring.http_output => pass => pass
mbstring.internal_encoding => ISO-8859-1 => no value
mbstring.language => neutral => neutral
mbstring.substitute_character => no value => no value
mcrypt
mcrypt support => enabled
version => >= 2.4.x
Supported ciphers => cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes
Supported modes => cbc cfb ctr ecb ncfb nofb ofb stream
Directive => Local Value => Master Value
mcrypt.algorithms_dir => no value => no value
mcrypt.modes_dir => no value => no value
mhash
MHASH support => Enabled
MHASH API Version => 20020524
mime_magic
mime_magic support => enabled
Directive => Local Value => Master Value
mime_magic.magicfile => /usr/share/misc/file/magic.mime => /usr/share/misc/file/magic.mime
mysql
MySQL Support => enabled
Active Persistent Links => 0
Active Links => 0
Client API version => 4.0.18
MYSQL_MODULE_TYPE => external
MYSQL_SOCKET => /var/run/mysqld/mysqld.sock
MYSQL_INCLUDE => -I/usr/include/mysql
MYSQL_LIBS => -L/usr/lib -lmysqlclient
Directive => Local Value => Master Value
mysql.allow_persistent => On => On
mysql.connect_timeout => 60 => 60
mysql.default_host => no value => no value
mysql.default_password => no value => no value
mysql.default_port => no value => no value
mysql.default_socket => no value => no value
mysql.default_user => no value => no value
mysql.max_links => Unlimited => Unlimited
mysql.max_persistent => Unlimited => Unlimited
mysql.trace_mode => Off => Off
openssl
OpenSSL support => enabled
OpenSSL Version => OpenSSL 0.9.7d 17 Mar 2004
overload
User-Space Object Overloading Support => enabled
pcntl
pcntl support => enabled
pcre
PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 4.5 01-December-2003
pdf
PDF Support => enabled
PDFlib GmbH Version => 5.0.2
Revision => $Revision: 1.112.2.9 $
posix
Revision => $Revision: 1.51.2.2 $
pspell
PSpell Support => enabled
session
Session Support => enabled
Registered save handlers => files user
Directive => Local Value => Master Value
session.auto_start => Off => Off
session.bug_compat_42 => On => On
session.bug_compat_warn => On => On
session.cache_expire => 180 => 180
session.cache_limiter => nocache => nocache
session.cookie_domain => no value => no value
session.cookie_lifetime => 0 => 0
session.cookie_path => / => /
session.cookie_secure => Off => Off
session.entropy_file => no value => no value
session.entropy_length => 0 => 0
session.gc_divisor => 100 => 100
session.gc_maxlifetime => 1440 => 1440
session.gc_probability => 1 => 1
session.name => PHPSESSID => PHPSESSID
session.referer_check => no value => no value
session.save_handler => files => files
session.save_path => /tmp => /tmp
session.serialize_handler => php => php
session.use_cookies => On => On
session.use_only_cookies => Off => Off
session.use_trans_sid => Off => Off
shmop
shmop support => enabled
sockets
Sockets Support => enabled
standard
Regex Library => Bundled library enabled
Dynamic Library Support => enabled
Path to sendmail => /usr/sbin/sendmail -t -i
Directive => Local Value => Master Value
assert.active => 1 => 1
assert.bail => 0 => 0
assert.callback => no value => no value
assert.quiet_eval => 0 => 0
assert.warning => 1 => 1
auto_detect_line_endings => 0 => 0
default_socket_timeout => 60 => 60
safe_mode_allowed_env_vars => PHP_ => PHP_
safe_mode_protected_env_vars => LD_LIBRARY_PATH => LD_LIBRARY_PATH
url_rewriter.tags => a=href,area=href,frame=src,input=src,form=,fieldset= => a=href,area=href,frame=src,input=src,form=,fieldset=
user_agent => no value => no value
tokenizer
Tokenizer Support => enabled
wddx
WDDX Support => enabled
WDDX Session Serializer => enabled
xml
XML Support => active
XML Namespace Support => active
EXPAT Version => 1.95.6
xmlrpc
core library version => xmlrpc-epi v. 0.51
php extension version => 0.51
author => Dan Libby
homepage => http://xmlrpc-epi.sourceforge.net
open sourced by => Epinions.com
xslt
XSLT support => enabled
Backend => Sablotron
Sablotron Version => 0.97
Sablotron Information => Cflags: -O3 -mcpu=i586 -funroll-loops -pipe Libs: -L/usr/lib -lexpat Prefix: /usr
yp
YP Support => enabled
zlib
ZLib Support => enabled
Compiled Version => 1.1.4
Linked Version => 1.1.4
Directive => Local Value => Master Value
zlib.output_compression => Off => Off
zlib.output_compression_level => -1 => -1
zlib.output_handler => no value => no value
Additional Modules
Module Name
dbase
filepro
sysvsem
sysvshm
Environment
Variable => Value
UNIQUE_ID => 2rFaisCoAP4AAEriApIAAAAB
HTTP_HOST => localhost
HTTP_USER_AGENT => Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040402 Firefox/0.8
HTTP_ACCEPT => text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
HTTP_ACCEPT_LANGUAGE => en-us,en;q=0.5
HTTP_ACCEPT_ENCODING => gzip,deflate
HTTP_ACCEPT_CHARSET => ISO-8859-1,utf-8;q=0.7,*;q=0.7
HTTP_KEEP_ALIVE => 300
HTTP_CONNECTION => keep-alive
HTTP_REFERER => http://localhost/help.php
CONTENT_TYPE => application/x-www-form-urlencoded
CONTENT_LENGTH => 15
PATH => /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/opt/bin:/usr/i586-pc-linux-gnu/gcc-bin/3.3
SERVER_SIGNATURE =>
Apache/2.0.49 (Gentoo/Linux) Server at localhost Port 80
SERVER_SOFTWARE => Apache/2.0.49 (Gentoo/Linux)
SERVER_NAME => localhost
SERVER_ADDR => 127.0.0.1
SERVER_PORT => 80
REMOTE_ADDR => 127.0.0.1
DOCUMENT_ROOT => /var/www/localhost/htdocs
SERVER_ADMIN => joel@kiwistrawberry.us
SCRIPT_FILENAME => /var/www/localhost/htdocs/help.php
REMOTE_PORT => 33299
GATEWAY_INTERFACE => CGI/1.1
SERVER_PROTOCOL => HTTP/1.1
REQUEST_METHOD => POST
QUERY_STRING =>
REQUEST_URI => /help.php
SCRIPT_NAME => /help.php
PHP Variables
Variable => Value
PHP_SELF => /var/www/localhost/htdocs/help.php
_SERVER["UNIQUE_ID"] => 2rFaisCoAP4AAEriApIAAAAB
_SERVER["HTTP_HOST"] => localhost
_SERVER["HTTP_USER_AGENT"] => Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040402 Firefox/0.8
_SERVER["HTTP_ACCEPT"] => text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
_SERVER["HTTP_ACCEPT_LANGUAGE"] => en-us,en;q=0.5
_SERVER["HTTP_ACCEPT_ENCODING"] => gzip,deflate
_SERVER["HTTP_ACCEPT_CHARSET"] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
_SERVER["HTTP_KEEP_ALIVE"] => 300
_SERVER["HTTP_CONNECTION"] => keep-alive
_SERVER["HTTP_REFERER"] => http://localhost/help.php
_SERVER["CONTENT_TYPE"] => application/x-www-form-urlencoded
_SERVER["CONTENT_LENGTH"] => 15
_SERVER["PATH"] => /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/opt/bin:/usr/i586-pc-linux-gnu/gcc-bin/3.3
_SERVER["SERVER_SIGNATURE"] =>
Apache/2.0.49 (Gentoo/Linux) Server at localhost Port 80
_SERVER["SERVER_SOFTWARE"] => Apache/2.0.49 (Gentoo/Linux)
_SERVER["SERVER_NAME"] => localhost
_SERVER["SERVER_ADDR"] => 127.0.0.1
_SERVER["SERVER_PORT"] => 80
_SERVER["REMOTE_ADDR"] => 127.0.0.1
_SERVER["DOCUMENT_ROOT"] =>
_SERVER["SERVER_ADMIN"] => joel@kiwistrawberry.us
_SERVER["SCRIPT_FILENAME"] => /var/www/localhost/htdocs/help.php
_SERVER["REMOTE_PORT"] => 33299
_SERVER["GATEWAY_INTERFACE"] => CGI/1.1
_SERVER["SERVER_PROTOCOL"] => HTTP/1.1
_SERVER["REQUEST_METHOD"] => POST
_SERVER["QUERY_STRING"] =>
_SERVER["REQUEST_URI"] => /help.php
_SERVER["SCRIPT_NAME"] => /var/www/localhost/htdocs/help.php
_SERVER["PHP_SELF"] => /var/www/localhost/htdocs/help.php
_SERVER["PATH_TRANSLATED"] => /var/www/localhost/htdocs/help.php
_SERVER["argv"] => Array
(
[0] => /var/www/localhost/htdocs/help.php
)
_SERVER["argc"] => 1
_ENV["UNIQUE_ID"] => 2rFaisCoAP4AAEriApIAAAAB
_ENV["HTTP_HOST"] => localhost
_ENV["HTTP_USER_AGENT"] => Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040402 Firefox/0.8
_ENV["HTTP_ACCEPT"] => text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
_ENV["HTTP_ACCEPT_LANGUAGE"] => en-us,en;q=0.5
_ENV["HTTP_ACCEPT_ENCODING"] => gzip,deflate
_ENV["HTTP_ACCEPT_CHARSET"] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
_ENV["HTTP_KEEP_ALIVE"] => 300
_ENV["HTTP_CONNECTION"] => keep-alive
_ENV["HTTP_REFERER"] => http://localhost/help.php
_ENV["CONTENT_TYPE"] => application/x-www-form-urlencoded
_ENV["CONTENT_LENGTH"] => 15
_ENV["PATH"] => /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/opt/bin:/usr/i586-pc-linux-gnu/gcc-bin/3.3
_ENV["SERVER_SIGNATURE"] =>
Apache/2.0.49 (Gentoo/Linux) Server at localhost Port 80
_ENV["SERVER_SOFTWARE"] => Apache/2.0.49 (Gentoo/Linux)
_ENV["SERVER_NAME"] => localhost
_ENV["SERVER_ADDR"] => 127.0.0.1
_ENV["SERVER_PORT"] => 80
_ENV["REMOTE_ADDR"] => 127.0.0.1
_ENV["DOCUMENT_ROOT"] => /var/www/localhost/htdocs
_ENV["SERVER_ADMIN"] => joel@kiwistrawberry.us
_ENV["SCRIPT_FILENAME"] => /var/www/localhost/htdocs/help.php
_ENV["REMOTE_PORT"] => 33299
_ENV["GATEWAY_INTERFACE"] => CGI/1.1
_ENV["SERVER_PROTOCOL"] => HTTP/1.1
_ENV["REQUEST_METHOD"] => POST
_ENV["QUERY_STRING"] =>
_ENV["REQUEST_URI"] => /help.php
_ENV["SCRIPT_NAME"] => /help.php
PHP License
This program is free software; you can redistribute it and/or modify
it under the terms of the PHP License as published by the PHP Group
and included in the distribution in the file: LICENSE
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If you did not receive a copy of the PHP license, or have any
questions about PHP licensing, please contact license@php.net.
|
Joel |
|
Back to top |
|
|
MagicMonkey n00b
Joined: 17 Dec 2003 Posts: 37 Location: UK
|
Posted: Mon May 17, 2004 11:48 am Post subject: |
|
|
Does it work if you run it using mod_php instead of the cgi version? I only have experience of mod_php, and it looks like it should work, so I'd guess that the problem is something to do with the cgi interface.
Although, looking at your phpinfo output, you're getting the HTTP_ stuff which suggests that it's aware of the web environment. |
|
Back to top |
|
|
moocha Watchman
Joined: 21 Oct 2003 Posts: 5722
|
Posted: Mon May 17, 2004 12:09 pm Post subject: |
|
|
Not related to a fix (the script works on my system...), but you shouldn't do Code: | if( $_POST["jigger"] != "" | Use Code: | ! isempty($_POST["jigger"]) | instead. The reason is that if there is no $_POST["jigger"] variable defined (i.e. $_POST doesn't contain any entry for the "jigger" index), then the if statement may bomb out. ismepty() will do the Right Thing in that case - it'll return false. _________________ Military Commissions Act of 2006: http://tinyurl.com/jrcto
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin |
|
Back to top |
|
|
jbmohler n00b
Joined: 23 Mar 2004 Posts: 29
|
Posted: Tue May 18, 2004 9:58 am Post subject: |
|
|
Hmmm, The script works with mod_php, but not as a cgi-script. I would prefer cgi-script for compatibility with my previous environment, but I suppose that mod_php would work. I'm very curious what isn't working, but perhaps that question is too big for my little mind.
Thanks for the tip, moocha. Actually, I had better luck with isset than with isempty. (Writing too much perl???)
thanks
Joel |
|
Back to top |
|
|
moocha Watchman
Joined: 21 Oct 2003 Posts: 5722
|
Posted: Tue May 18, 2004 12:20 pm Post subject: |
|
|
That's strange. isempty() includes the functionality of isset(), i.e. in this case, if the variable isn't set, both isset() and isempty() would return true. Additionally, isempty() would return true in case of an empty string.
Ah well. _________________ Military Commissions Act of 2006: http://tinyurl.com/jrcto
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|