PDA

View Full Version : CGI prompt to open/save file


nickyfraggle
08-15-2007, 01:15 PM
Hello,

I have a send to a friend script in CGI. The CGI script is located in the CGI bin.

When I try to run the script from my form, the email is sent fine, but I am prompted to open/save the CGI script in IE6/7.

This is the test location of the form.

Click here (http://www.doodleit.co.uk/indexheart.htm)

Click on the blue send to a friend link.

The script is working fine - the problem is how to avoid the prompt in IE browsers. It works fine in Mozilla Firefox.

Any help appreciated,

Nicola

mlseim
08-15-2007, 02:27 PM
Did you get this fixed? It seems to work OK for me.

nickyfraggle
08-15-2007, 02:29 PM
It works fine in EVERY browser I can get hold of except IE. Are you using IE?

It prompts me to open or save the script. This is a problem as it then opens it in wordpad!

Thanks,

Nicola

kellyblueyz
08-15-2007, 03:41 PM
Hi,
I am having the same problem only opposite. One of my users has this issue (when she submits the form it tries to download the CGI instead of submitting the data). I can't see the problem so it is hard to fix. In my case tho the user is using a Safari browser on a mac. Has anyone heard of that and know how to fix? I have searched on the web but so far don't find this as a known issue with safari.

Thanks for any help anyone can give!

Tamar

PS - I am a new member and not sure if I am allowed to ask another question in this thread but the question is exactly the title of this thread so it seemed appropriate. If I should be starting a new thread please let me know.

nickyfraggle
08-15-2007, 03:53 PM
I'm just glad it's not only me!

Nicky

kellyblueyz
08-15-2007, 04:10 PM
Misery loves company. lol

Tamar

FishMonger
08-15-2007, 04:15 PM
When I tested it, the link took me to your email form and I submitted it with dummy info and it first went to your "Message Sent" page and then redirected back to the main page. So, it worked for me in IE6.

BTW, most people feel that that type email is spam and when I receive something like that, not only do I add that site to my blocked firewall rules, but the "friend" also gets blocked.

nickyfraggle
08-15-2007, 04:19 PM
I have been asked to do this by a client. I have explained the problems and implications. It's only added to my site as a test.

Everyone who tests it seems to say it's ok, but I STILL can't get it to work here...

Thanks so much for your help guys.

This has been driving me nuts!!

mlseim
08-15-2007, 07:02 PM
Nicky ...

Are you using IE with a Mac?



Tamar ...

That sounds like your script is not in the directory where your Perl
scripts should be (cgi-bin). Or, your webhost does not allow CGI scripting.
Let us know ... you may need to use PHP instead.

kellyblueyz
08-15-2007, 08:10 PM
Thanks for your comment mlseim! The script irself is in the cgi-bin but it does call a library module that is down in a directory I made in the cgi-bin. In my case, it is only one user (out of maybe 30 or so at this point) having this problem. But that one user is on a Mac using a Safari browser. Wondering if the Mac is the problem?

Thanks!

Tamar

nickyfraggle
08-17-2007, 01:36 PM
Hello,

I'm not using a MAC with IE and the script is in the cgi-bin. I've managed to fix it now. I looked at the request/response info that was happening, and it looks like it was one of the die statements that was messing it up...IE wasn't reading it right..so it died...then couldn't find the headers...and then thought it was a file so it tried to download it instead of running it.

All a bit strange as I didn't find another person who had the same problem...and it seemed to run ok in IE7 for some people. Who said programming was logical!!! ANYWAY...all seems to work now.

kellyblueyz I'm happy to help if I can!

Thanks for your help everyone!

Nicky

kellyblueyz
08-18-2007, 02:18 AM
Hey Nicky that's great you figured it out! Sounds like I better take a close look at my "die" statements. Anything in particular I should be looking for?

Wow I have so much to learn.

Thanks so much for posting what your problem turned out to be and I'll tinker around with that. I'll let you know if I manage to get this working for the user.

Tamar

KevinADC
08-18-2007, 06:12 AM
IE can't read any perl code, and if it did, it would not know what to do with it anyway. Something else was causing the IE browser to mess up, but I can't think of what it might be.

nickyfraggle
08-18-2007, 11:09 AM
IE can't read Perl code...but when it couldn't find headers it seemed to to be trying to download it, instead of running it correctly.

Hope you manage to sort it out Tamar. It was a case of trial and error this end...I'm pretty new to CGI too!

Thanks to everyone for their help. Forums like this are great...and I'm always surprised by how helpful people are. It's great to have that support around you!

Nicky

KevinADC
08-18-2007, 08:26 PM
It might have been interesting to see this in action. Maybe the headers were the culprit, maybe not, very hard to say without being able to see or run the code.

FishMonger
08-18-2007, 09:13 PM
It might have been interesting to see this in action. Maybe the headers were the culprit, maybe not, very hard to say without being able to see or run the code.

Did you break your crystal ball again? :)

KevinADC
08-19-2007, 07:20 AM
It's still in the shop from last time I broke it. ;)