Jump to content

ereptek

Members
  • Posts

    13
  • Joined

  • Last visited

ereptek's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Thanks for everyone's advice. I decided to see if the problem was related to MS Web Expression 4 rather than the code. I downloaded Adobe Dreamweaver and tried. The php redirect worked perfectly. Then I opened the same file in Web Expression and got no redirect. All other php code works fine locally with Web Expression including phpinfo() so my only conclusion is that there is something wrong with Web Expression or my setup with that tool specifically. Let me know if anyone has ideas. In the meantime, I will be looking into migrating to another platform.
  2. Frustrating. My other alternative is to use some Javascript to do the re-direct. I assume that there is no other method to do this with PHP only. FYI, this method is used extensively in the security code that I am using. I.e. if the Password has not been entered - switch back to the login screen using header("location: login.php"); Any advice is appreciated.
  3. Sorry about the format above. For some reason when I past it in, it reformats the header response to a numbered list.
  4. Here are the response headers: [*] [*] Remote Address: 127.0.0.1:61633 [*] Request URL: http://localhost:61633/test-redirect.php [*] Request Method: GET [*] Status Code: 200 OK [*]Request Headersview source [*] Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 [*] Accept-Encoding: gzip, deflate, sdch [*] Accept-Language: en-US,en;q=0.8 [*] Cache-Control: max-age=0 [*] Connection: keep-alive [*] Cookie: PHPSESSID=t70vppv7cisvgqh87ef6l25hu4 [*] Host: localhost:61633 [*] User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36 [*]Response Headersview source [*] Connection: Close [*] Content-type: text/html [*] Date: Mon, 02 Feb 2015 21:41:12 GMT [*] location: http://www.example.com/ [*] Server: Microsoft Expression Development Server/4.0.0.0 [*] Status: 302 Moved Temporarily [*] X-Powered-By: PHP/5.5.11
  5. I was able to eliminate all of the entries other than the test-redirect.php be disabling Norton Internet Security toolbar add-in, and several other browser add ins. The browser window is blank because in the code above, the echo statement is remarked out (// at the beginning of the line). I refereshed the browser with all of the add-ins disabled. Is there anything in the browser security that might be preventing the re-direct? When I click on the test-redirect.php on the list and then on the header tab I get the following: Remote Address: 127.0.0.1:61633 Request URL: http://localhost:61633/test-redirect.php Request Method: GET Status Code: 200 OK Request Headersview source Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Encoding: gzip, deflate, sdch Accept-Language: en-US,en;q=0.8 Cache-Control: max-age=0 Connection: keep-alive Cookie: PHPSESSID=t70vppv7cisvgqh87ef6l25hu4 Host: localhost:61633 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36 Response Headersview source Connection: Close Content-type: text/html Date: Mon, 02 Feb 2015 21:41:12 GMT location: http://www.example.com/ Server: Microsoft Expression Development Server/4.0.0.0 Status: 302 Moved Temporarily X-Powered-By: PHP/5.5.11
  6. Here is the entire file: <?php ini_set('display_errors', 1); error_reporting(E_ALL); // echo 'test' ; header("location: http://www.example.com/"); ?> Try this screen shot - hopefully, I have managed to enlarge it sufficiently: http://www.evernote.com/l/AE_eQN6lgZtPE5xiiXBtemGo5943k71Z93k/
  7. Here is the screenshot: http://www.evernote.com/l/AE_eQN6lgZtPE5xiiXBtemGo5943k71Z93k/
  8. Tried it. Both with and without the echo statement. No errors either way. With the echo statement, "test" is displayed. Without, all I get is an empty browser screen. I assume that if i inserted yes statement above correctly and I had the echo 'test'; statement before the header statement that I should have seen the error you mentioned above..
  9. Well I just tried on one of my other machines switching to WAMP from XAMPP because of the interference with Ports. I had to stop IIS. Apache appears to be running. PHP works because the test echo statement works. Still no redirect to www.example.com.
  10. I am not really sure. I am using Microsoft Web Expression 4 on a Window 7 machine. I have XAMPP installed, however I am getting the following from the control panel: 8:45:46 AM [Apache] Problem detected! 8:45:46 AM [Apache] Port 80 in use by "Unable to open process" with PID 4! 8:45:46 AM [Apache] Apache WILL NOT start without the configured ports free! 8:45:46 AM [Apache] You need to uninstall/disable/reconfigure the blocking application 8:45:46 AM [Apache] or reconfigure Apache and the Control Panel to listen on a different port 8:45:46 AM [Apache] Problem detected! 8:45:46 AM [Apache] Port 443 in use by "C:Program Files (x86)SkypePhoneSkype.exe" with PID 6524! 8:45:46 AM [Apache] Apache WILL NOT start without the configured ports free! 8:45:46 AM [Apache] You need to uninstall/disable/reconfigure the blocking application 8:45:46 AM [Apache] or reconfigure Apache and the Control Panel to listen on a different port However, php still seems to be working. When I put an echo 'test'; statement before the re-direct, the browser correctly shows "test" and then stops. Do I need apache to do a re-direct?
  11. I do not get any error messages. When I try to execute the code by Previewing in a Browser, the code appears to stop at the header statement as the address bar shows the initial page, but does not advance to www.example.com . Is it possible that there is an error message that I am not seeing?
  12. I am having difficulty getting the header statement to successfully re-direct to another page when running the PHP code on my local machine. It works perfectly on the server / ISP that I am using (1&1). Statements like the following work: header("location: security/login.php"); I have tried to simplify the hole problem down to just one small PHP file: <?php header("location: http://www.example.com/"); ?> I know I can do a workaround using Javascript, but I would like to avoid that as I am using this method in numerous locations in my website PHP.
×
×
  • Create New...