473,385 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Form Script Question



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
5 5819
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
> 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
(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
(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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Steve Wylie | last post by:
Recently on this newsgroup I asked for help with a questionnaire I was doing in HTML & Javascript. I wanted a script that allowed me to use the keys 1-9 to fill in the form rather than using the...
7
by: Steve Wylie | last post by:
Last year a kind soul by the name of Lasse Reichstein Nielsen answered a question for me on this newsgroup, including a script that solved my problem. I now need to script to be slightly amended to...
8
by: CJack | last post by:
hy, I have an mdi application, i create a child form and I want to know when a button is pressed while that child form is loaded. I have this code: private void frmTestBaby_KeyUp(object sender,...
2
by: ed kool | last post by:
Question how to code "multipart/form-data” in a PHP script ? We are trying to make our program trchat.exe work via the following PHP script: <?php $lang = " English to Dutch"; ...
5
by: kuyaboj | last post by:
Hi all, I'm trying to implement this script so that it works for both Firefox and IE. The function works properly in Firefox but in IE, it hangs. What am I doing wrong? <script...
26
by: Jerim79 | last post by:
I need to create a form that takes a number that the user enters, and duplicates a question the number of times the user entered. For instance, if the customer enters 5 on the first page, when...
0
by: jianxin9 | last post by:
Hi everyone, I don't have a lot of experience with ASP and I was hoping someone could help me. I want to use our ASP form along with some javascript code to create a form where our patrons can...
5
by: plumba | last post by:
Hi all I have a form (see below), which for some reason has decided to stop functioning all together. It just does not call up the function. It is called up in the opening <form> tag but...
2
by: Ronald Raygun | last post by:
I have a form, which contains a textfield for a user to enter their username. I want to provide a button that allows the user to check to see whether that username has already been taken up by...
3
by: jeremy.gehring | last post by:
Hey all, OK I'm not much of a PHP programmer; but needs must as they say. I have written AJAX file upload system that uses a PERL CGI script so that a PHP script can get the progress (nifty...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.