Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form download question

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi I have a site based on PHP and MySQL that I have recently been completely redesigning from scratch and to do that I installed Apache, PHP 4.0.2, and MySQL 3.23.10 on my home Windows 98 machine so I could edit the scripts locally. It's been going pretty smooth, I got stuck for a couple days on how I could use a /home equivalent in Windows, but I figured that out, and now I've got a problem I have no idea what's going on. Here's how it looks:

Every page includes a common header and footer. The footer contains a form that allows people to login. The form's method is post and action is another file that also contains the common header and footer as well as setting cookies and displaying a link that allows the person to go back to the page he/she was on before he/she logged on.

However, when I fill out the login form then click "submit", I get a file download dialog box. I have absolutely no idea why and have checked over my code as well as checking the html source from the browser, and can find nothing wrong. Any ideas?

P.S. The footer also contains a poll form who's action is $PHP_SELF and it works fine.
 
Well.. here's a start. The download box could potentially come up in two situations --

1. If PHP is compiled as a CGI (rather than embedded in Apache) and there is an error in the script so it doesn't return proper headers. Same thing happens if you have a bad Perl script.

2. Well, I think this is one. <shrug> If the application handler isn't set appropriately ... e.g. If you have one file with a .php and another with a .php4 extension and only one of them is mapped to the PHP interpreter.

Hope this helps,

brendanc@icehouse.net
 
Well they're both using the *.php extension, and I did check the source many many times. Are you saying it's a CGI problem? (Yes PHP is running as CGI)
 
I guess so. :)

Prior to any script output, try using the header() function with header(&quot;Content-type: text/html&quot;);

See if that helps.

brendanc@icehouse.net
 
Hmm interesting. It probably wouldn't be a CGI thing since your poll thing works. You can try uploading to the web server to see if it works differently when not run as a CGI module. Be absolutely sure there's nothing wrong with your code. Do something else for an hour and then come back to your code. It's amazing how many errors you can pick up this way. Good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top