adam.bruzon Posted January 3, 2008 Share Posted January 3, 2008 Hello PHP helpers, I am very confused. I have designed a really good login script for the company i am working for. I was testing it in Firefox all the way through. Now i just tested it in IE and it doesnt work!!!! this is an example of the script i am using: if ($_POST['member'])) { include 'login.php'; } elseif ($_POST['login']) { include 'loginvalidation.php'; } elseif ($_POST['nonmember']) { include 'form2.php'; } etc...... then within all the include files the form action is: action="<?php echo $_SERVER[php_SELF]; ?>" I know that the include function is working because the menu of the page is using an include function and it displays the first time i load the page, but when i click the links and they are supposed to include another file then it just refreshes the page with exactly what was on there when i loaded the page for the first time. So what is wrong. Please Help Me. I am so annoyed Yours Thankfully Adam Quote Link to comment https://forums.phpfreaks.com/topic/84312-include-working-on-firefox-but-not-ie/ Share on other sites More sharing options...
PFMaBiSmAd Posted January 3, 2008 Share Posted January 3, 2008 $HTTP_REFERER (when register_globals are on) and $_SERVER['HTTP_REFERER '] (which is what you should be using since register_globals have been eliminated in php6) is an optional header that is sent only by some browsers and only when they are enabled in the browser settings and then only under some conditions. Your code should not be relying on HTTP_REFERER for anything more than logging information. If you want to detect that someone visited any particular page on your site, start a session on that page and set a session variable with a particular value. Then resume/start a session on the next page and check if that particular session variable exists with the value you put in it. Edit: Unfortunately, going back and editing your code in the first post so that it is no longer what caused the stated symptoms, makes solving problems twice as hard as they need to be. Quote Link to comment https://forums.phpfreaks.com/topic/84312-include-working-on-firefox-but-not-ie/#findComment-429358 Share on other sites More sharing options...
adam.bruzon Posted January 3, 2008 Author Share Posted January 3, 2008 $HTTP_REFERER (when register_globals are on) and $_SERVER['HTTP_REFERER '] (which is what you should be using since register_globals have been eliminated in php6) is an optional header that is sent only by some browsers and only when they are enabled in the browser settings and then only under some conditions. Your code should not be relying on HTTP_REFERER for anything more than logging information. If you want to detect that someone visited any particular page on your site, start a session on that page and set a session variable with a particular value. Then resume/start a session on the next page and check if that particular session variable exists with the value you put in it. Thank you very much for your tip - I have changed $HTTP_REFERER to $_SERVER['HTTP_REFERER '] - but this still does not help me with the current problem!!! Quote Link to comment https://forums.phpfreaks.com/topic/84312-include-working-on-firefox-but-not-ie/#findComment-429369 Share on other sites More sharing options...
PFMaBiSmAd Posted January 3, 2008 Share Posted January 3, 2008 Perhaps you should read what I wrote. HTTP_REFERER is optional and cannot be reliably used. I also stated what you needed to do that would work. Quote Link to comment https://forums.phpfreaks.com/topic/84312-include-working-on-firefox-but-not-ie/#findComment-429381 Share on other sites More sharing options...
adam.bruzon Posted January 3, 2008 Author Share Posted January 3, 2008 Perhaps you should read what I wrote. HTTP_REFERER is optional and cannot be reliably used. I also stated what you needed to do that would work. But i removed the $HTTP_REFERER code aswell and tested it but still no luck!!! Lets forget i ever put it in and see if there is a reason why the if statement are not being recognised. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/84312-include-working-on-firefox-but-not-ie/#findComment-429384 Share on other sites More sharing options...
revraz Posted January 3, 2008 Share Posted January 3, 2008 print_r($_POST) and see what is actually being set. Quote Link to comment https://forums.phpfreaks.com/topic/84312-include-working-on-firefox-but-not-ie/#findComment-429415 Share on other sites More sharing options...
roopurt18 Posted January 3, 2008 Share Posted January 3, 2008 but when i click the links and they are supposed to include another file then it just refreshes the page with exactly what was on there when i loaded the page for the first time. Sounds like a possible caching issue. Is the URL changing from page to page? Your use of $_POST to determine which page to display leads me to believe the URL might be static and that IE is just caching the page. Quote Link to comment https://forums.phpfreaks.com/topic/84312-include-working-on-firefox-but-not-ie/#findComment-429445 Share on other sites More sharing options...
PFMaBiSmAd Posted January 3, 2008 Share Posted January 3, 2008 If you are having problems where form data from one browser works and a different one does not, it is likely due to invalid HTML markup in your form. You would need to post your code or provide a link to the site. Quote Link to comment https://forums.phpfreaks.com/topic/84312-include-working-on-firefox-but-not-ie/#findComment-429468 Share on other sites More sharing options...
adam.bruzon Posted January 4, 2008 Author Share Posted January 4, 2008 print_r($_POST) and see what is actually being set. Ok, print_r($_POST) returns result "Array ( [member_x] => 74 [member_y] => 15 )" I guess that is right because the post data is 'member' and the number corresponds to the mouse position when i clicked. (Correct??) ??? Quote Link to comment https://forums.phpfreaks.com/topic/84312-include-working-on-firefox-but-not-ie/#findComment-430190 Share on other sites More sharing options...
adam.bruzon Posted January 4, 2008 Author Share Posted January 4, 2008 Sounds like a possible caching issue. Is the URL changing from page to page? Your use of $_POST to determine which page to display leads me to believe the URL might be static and that IE is just caching the page. I think you might be right, the url always stays the same and the information changes on the page, is there a way to stop IE caching through php or any other code. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/84312-include-working-on-firefox-but-not-ie/#findComment-430193 Share on other sites More sharing options...
roopurt18 Posted January 4, 2008 Share Posted January 4, 2008 You can do so by setting certain headers, though I don't know which ones. A little forum or google searching should find you what you need. Quote Link to comment https://forums.phpfreaks.com/topic/84312-include-working-on-firefox-but-not-ie/#findComment-430235 Share on other sites More sharing options...
adam.bruzon Posted January 4, 2008 Author Share Posted January 4, 2008 print_r($_POST) and see what is actually being set. Ok, print_r($_POST) returns result "Array ( [member_x] => 74 [member_y] => 15 )" in IE7 I guess that is right because the post data is 'member' and the number corresponds to the mouse position when i clicked. (Correct??) EDIT: Firefox returns Array ( [member_x] => 103 [member_y] => 10 => member ) I think this is the key. But how do i make IE return this result????? Quote Link to comment https://forums.phpfreaks.com/topic/84312-include-working-on-firefox-but-not-ie/#findComment-430261 Share on other sites More sharing options...
rajivgonsalves Posted January 4, 2008 Share Posted January 4, 2008 definately a caching problem... use these headers on top of your script <?php // Date in the past header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Cache-Control: no-cache"); header("Pragma: no-cache"); ?> if that does not work check your IE settings Tools->Internet Options Quote Link to comment https://forums.phpfreaks.com/topic/84312-include-working-on-firefox-but-not-ie/#findComment-430270 Share on other sites More sharing options...
adam.bruzon Posted January 4, 2008 Author Share Posted January 4, 2008 definately a caching problem... use these headers on top of your script <?php // Date in the past header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Cache-Control: no-cache"); header("Pragma: no-cache"); ?> if that does not work check your IE settings Tools->Internet Options Thank you very much for your input, however, this did not sovle the problem. Also it is not only me that is going to view this site so i cannot just change my IE setting because that would mean everyone viewing my site would have to do the same. ??? Quote Link to comment https://forums.phpfreaks.com/topic/84312-include-working-on-firefox-but-not-ie/#findComment-430291 Share on other sites More sharing options...
rajivgonsalves Posted January 4, 2008 Share Posted January 4, 2008 Yes that is true... but mostly IE does not cache pages unless it asked explicitly mentioned Quote Link to comment https://forums.phpfreaks.com/topic/84312-include-working-on-firefox-but-not-ie/#findComment-430300 Share on other sites More sharing options...
gerkintrigg Posted January 4, 2008 Share Posted January 4, 2008 the other thing that I noticed, when I switched from absolute layout (like 600 pixels) to percentages, but forgot to change the value of the unit (thus, leaving the table at 600%) was that IE renders it properly and you have no idea where the data's gone. I suppose this is a good example of Microsoft doing something right... Quote Link to comment https://forums.phpfreaks.com/topic/84312-include-working-on-firefox-but-not-ie/#findComment-430302 Share on other sites More sharing options...
adam.bruzon Posted January 4, 2008 Author Share Posted January 4, 2008 Array ( [member_x] => 103 [member_y] => 10 => member ) I really think it has something to do with the fact that IE7 does not post the bit whereas Firefox does.... Any Suggestions?!?!?! Quote Link to comment https://forums.phpfreaks.com/topic/84312-include-working-on-firefox-but-not-ie/#findComment-430304 Share on other sites More sharing options...
redarrow Posted January 4, 2008 Share Posted January 4, 2008 require_once('what_ever.php'); all u need it $row['what_ever']; not $row[what_ever]; Quote Link to comment https://forums.phpfreaks.com/topic/84312-include-working-on-firefox-but-not-ie/#findComment-430305 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.