By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,569 Members | 1,386 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,569 IT Pros & Developers. It's quick & easy.

Form Script Question

P: n/a


Hi
Can anyone tell me why my form script fails at this line
<form action="$_SERVER['PHP_SELF']" method="POST">

when running on my ISP which is using PHP version 4.3.2,
Configure Command './configure' '--prefix=/usr/local'
'--with-apache=/home/shells/chriss/Apachetoolbox-1.5.66/apache_1.3.27'
'--enable-exif' '--enable-track-vars' '--with-calendar=shared'
'--enable-magic-quotes' '--enable-trans-sid' '--enable-wddx' '--enable-ftp'
'--enable-inline-optimization' '--enable-memory-limit'
'--with-openssl=/usr/local/ssl'


but works on my Linux box running running PHP version 4.3.1.
Configure Command './configure' '--with-config-file-path=/etc/httpd'
'--with-mysql=/usr' '--with-exec-dir=/usr/bin' '--with-apxs=/usr/sbin/apxs'
'--with-java=/usr/java/jdk1.3.1' '--disable-cli' '--includedir=/usr'
'--with-gdbm' '--with-db' '--enable-track-vars' '--with-zlib-dir=/usr/'
'--with-gd=/usr'

I'll supply more inf if needed.

Thanks in advance
Bill Zapp

Jul 16 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Zapp,
Can anyone tell me why my form script fails at this line
<form action="$_SERVER['PHP_SELF']" method="POST">


If You're in HTML, the line should read
<form action="<?=$_SERVER['PHP_SELF']?>" method="POST">

If this in an echo statement or a variable ect, it should be:
<form action=\" . "$_SERVER["PHP_SELF"] . "\" method=\"POST\">
or shorter:
<form action=\"$PHP_SELF\" method=\"POST\">

Thats all I can do without the rest of the code, but it looks like it's
easy to fix ...

rudi

Jul 16 '05 #2

P: n/a
> echo <<<END
<form action="$_SERVER['PHP_SELF']" method="POST">


Here You go.
It's the quotes around the $_SERVER array index.
Neither '' nor "" will work.

If you want to use the heredoc syntax, use
<form action="$_SERVER[PHP_SELF]" method="POST">
or just
<form action="$PHP_SELF" method="POST">

rudi

Jul 16 '05 #3

P: n/a
(Sorry, first message was a reply to myself ...)
echo <<<END
<form action="$_SERVER['PHP_SELF']" method="POST">


Here You go.
It's the quotes around the $_SERVER array index.
Neither '' nor "" will work.

If you want to use the heredoc syntax, use
<form action="$_SERVER[PHP_SELF]" method="POST">
or just
<form action="$PHP_SELF" method="POST">

rudi

Jul 16 '05 #4

P: n/a
(Sorry, first message was a reply to myself ...)
(darn, again! whats mozilla up to? :-( )
echo <<<END
<form action="$_SERVER['PHP_SELF']" method="POST">


Here You go.
It's the quotes around the $_SERVER array index.
Neither '' nor "" will work.

If you want to use the heredoc syntax, use
<form action="$_SERVER[PHP_SELF]" method="POST">
or just
<form action="$PHP_SELF" method="POST">

rudi

Jul 16 '05 #5

P: n/a
Rudi

No problem with the reposts, just glad to see you're not using MS ;)
Anyway, your fix worked thank you very much for taking the time to respond!
Zapp
"Rudolf Horbas" <rh*****@hypotext.de> wrote in message
news:bh**********@svr8.m-online.net...
Sorry zapp, Mozilla keeps posting to my own reply, 'though I'd marked
Your post. Guess You'll find this anyway, but it's embarassing for me ...

anyone know 'bout this moz behaviour? or am i making some stupid mistake?

rudi

Jul 16 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.