PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
This script I am using works flawlessly in Firefox, however in IE when I enter the correct password it does nothing and simply clears the password field and resets to where I can enter it again. It never goes to the page it is protecting. In Firefox it works great. I enter the password and it take me to the page.
I cannot see how this page would ever forward you to anywhere in any browser. You're not even checking if the password is correct anywhere.
Make sure you're pointing firefox and IE to the same webpage as it sounds to me like you may be uploading to one place and browsing to another. This script doesn't look like it has been complete, you'd need to add an else-statement after the inner-if statement to tell PHP what to do if the password is correct.
Also, as a general rule, functions should always return something.
It works perfectly in firefox. You enter the wrong password and you get en error message and asked to re enter. If you enter the right one it takes you to a page with thumbnails on it.
All this is is a password script. You try to open the above site (pics of my son which I have removed while i try to fix this) the single line of php script on that php document calls the one I pasted above. If you enter the wrong password you are denied entry. If you enter the right one it renders the pictures in the browser.
Question still stands. Why would the above code work flawlessly in Firefox and not at all in IE?
PHP executes in the web server, before anything is sent to the browser, so PHP doesn't even know (or care) what browser will see the HTML. If the results are different in IE and FF, it is because the HTML is rendered differently. There are numerous issues with your script, including your use of a function for this purpose, and the conflict in your function argument. I am in a hurry and don't have time to even figure out what you were trying to do.
Usually when there are inconsistencies between browsers, it's because the page isn't being rendered the same - just like ~califdon said. I'd run your code through the HTML validator & get it up to snuff first.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
califdon is right. PHP will run the same regardless of browser. If you are getting discrepancies between two browsers (on the same machine - this is important b/c PHP may behave differently on different operating systems), then most likely what is happening is a difference it how the browsers are interpreting the HTML.
Also some browsers are more forgiving than others, meaning that you might have a slight error in your HTML that FF lets you get away with but IE does not. For instance, I noticed that your post didn't have a closing </html> tag. Now I don't think that that would cause the problem you described, but I would look for something similar to be the culprit.
Well it doesn't work for me in any browser. Ensure you're clearing your cache and checking the right page as well as uploading to the right place. As I said, your script (at least the code you pasted) does not do anything if a password is correct.
I suggest triple checking everything and adding </html> at the base of your function (which has been miss-used).