PHP header function won't load the new page via my localhost

Problems with the Windows version of XAMPP, questions, comments, and anything related.

PHP header function won't load the new page via my localhost

Postby minnied » 31. January 2016 22:55

Hello,

I am trying to run some php script that Dreamweaver CS5 automatically loaded on my .php page after using the insert record wizard. The "Record Insertion Form" Wizard has a prompt "after inserting , go to:" This codes a php header redirect. When I open the form in my browser and enter data into my form, the data inserts properly into mySQL table but then does not redirect via the header function but instead gives me a browser error. I checked that there are not white spaces or BOM, etc.

In IE11 the error is "This page cannot be displayed" in FireFox it says "The connection was reset". The URL does not change. Could there be a setting that needs to be set in my Apache config file?

Thank you for any help.
minnied
 
Posts: 10
Joined: 30. December 2015 19:13
Operating System: Windows 8.2

Re: PHP header function won't load the new page via my local

Postby JJ_Tagy » 31. January 2016 23:15

Most likely not. You should check the error/access logs to get a hint at what was requested and the response. You may also want to look at the code to see if it is requesting the new location right.
JJ_Tagy
 
Posts: 788
Joined: 30. January 2012 13:44
XAMPP version: 5.5.15
Operating System: Windows 10 Pro x64

Re: PHP header function won't load the new page via my local

Postby minnied » 03. February 2016 18:05

Thank you for your response. After over a week of head banging, I found the answer. I am using Dreamweaver with Apache/PHP myAdmin/MySQL (xampp) database and the error is on the first line <?php virtual... even though a header redirect error is generated.

Dreamweaver suggested per this forum thread:
https://forums.adobe.com/thread/521030?q=cannot modify header

To change line 1 to: <?php require_once ('Connections/your folder'); ?> This fixed the problem immediately. The header function made the redirect without error.

Hope this helps others to not have to take days to figure this one out.
minnied
 
Posts: 10
Joined: 30. December 2015 19:13
Operating System: Windows 8.2


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 192 guests