Form won’t submit – PHP

  php

Q(Question):

Dear scripters,

I wrote a PHP script that produces a form. If the form is submitted, the
entered information is checked. If an error in the input is found, a
message appears. Using the browser’s ‘back’ button, the user can change
his/her input. If no errors are found, the input is used to generate some
graphics (using the gdlib.so module).

When running this script on my own Linux/Apache/PHP/gdlib.so server, it
works perfectly. But when I upload it to a public webserver, it does not
work. When valid input is entered, the error messages appear. But when the
invalid input is entered, the following happens:

1. Netscape/Mozilla/Galeon: nothing seems to happen
2. Konqueror: connection was closed
3. MSIE: 404 error

I can’t find out what’s going wrong; do you have any idea what could cause
this problem?

much thank in advance!

Martin

A(Answer):

Hi Martin

Nobody can help you with the information you provided.
You claim the form is not submitted.
Are you sure about that?
Maybe the PHPscript is not working?

Please be more informative (with code eg).

Regards,
Erwin Moller

A(Answer):

On Tue, 09 Mar 2004 12:14:08 +0100, Erwin Moller wrote:

Hi Erwin,

thanks for your reply. The script does work (at least, on my private
Linux/Apache/PHP server). When I upload the script to my provider,
catching invalid input does work, but when valid input is send, nothing
happens (using Netscape) or a ‘connection closed by server’ message
appears (using Konqueror), or a 404 error appears (using MSIE).

I have put the script online for download:

http://tuxserver.dyndns.org/~martin/fred/grafiek1.zip

If you want to see it running on my own server:

http://tuxserver.dyndns.org/~martin/fred/grafiek1.php

I can’t show it on my providers website, because that part is protected by
..htaccess/.htpasswd files.

Note: db.txt is of the form:

Name#!#number#!#number#!#..#!#number\n
….
Name#!#number#!#number#!#..#!#number\n

week.txt is of the form:

2004,10\n
2004,11\n

I hope this is enough information and one can help me out 🙂

best regards,

Martin

Hi Martin

Nobody can help you with the information you provided.
You claim the form is not submitted.
Are you sure about that?
Maybe the PHPscript is not working?

Please be more informative (with code eg).

Regards,
Erwin Moller

A(Answer):

Hi Martin,

Okay, so we can conclude that your FORM is working. 🙂
It does submit, otherwise your validation shouldn’t work.

(I don’t have the time on my hands at the moment to look into your code now,
sorry! Maybe someone else can.)

But I have a general suggestion/guess:
My guess would be that your imagecreating routines are NOT working on your
providers computer.

Try to check this by giving responses just before you start using the lib.
If you are returning only an image, you’ll get into trouble with
contenttype, so use a file to write your comments to on the server.

If you have access to the errorlog on the provider’s comp, look into that
too. I bet you’ll find some problems with the graphicslibs, maybe they are
not installed.

<Sorry dutch>
Volgens mij kan ik ook gewoon nederlands praten met je. 🙂
</Sorry dutch>

Good luck,
Erwin Moller

A(Answer):

On Wed, 10 Mar 2004 09:07:26 +0100, Erwin Moller wrote:

Hi Martin,

Hi Erwin,
Okay, so we can conclude that your FORM is working. 🙂
It does submit, otherwise your validation shouldn’t work.

Yep 🙂
(I don’t have the time on my hands at the moment to look into your code now,
sorry! Maybe someone else can.)

But I have a general suggestion/guess:
My guess would be that your imagecreating routines are NOT working on your
providers computer.

Well, the server supports it:

http://www.adhosting.nl/phpinfo.php

I am also checking it with an ‘if function_exists(gdlib_info) { .. }’.
Try to check this by giving responses just before you start using the lib.
If you are returning only an image, you’ll get into trouble with
contenttype, so use a file to write your comments to on the server.

I will try to debug it that way, thanks for the idea!
If you have access to the errorlog on the provider’s comp, look into that
too. I bet you’ll find some problems with the graphicslibs, maybe they are
not installed.

I do have root access, but Apache’s error and info log did not give any
information 🙁
<Sorry dutch>
Volgens mij kan ik ook gewoon nederlands praten met je. 🙂 </Sorry
dutch>

Dat kan, maar mag hier niet 🙂

best regards,

Martin
Good luck,
Erwin Moller

A(Answer):

Hi Erwin,

I was using imagecreatetruecolor(), which (*shame* didn’t read the docs
100%) requires PHP version > X and GDlib version > Y. My provider did not
upgrade to one of them, so the function was not available (and I was too
lazy to write an "or die (..)" statement ). Changed it into imagecreate()
and it works perfectly now 🙂

thanks!

Martin

A(Answer):

Martin Herrman wrote:

Hi Erwin,

I was using imagecreatetruecolor(), which (*shame* didn’t read the docs
100%) requires PHP version > X and GDlib version > Y. My provider did not
upgrade to one of them, so the function was not available (and I was too
lazy to write an "or die (..)" statement ). Changed it into imagecreate()
and it works perfectly now 🙂

thanks!

Martin

Good!

LEAVE A COMMENT