Page 1 of 1

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

PostPosted: 31. January 2016 22:55
by minnied
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.

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

PostPosted: 31. January 2016 23:15
by JJ_Tagy
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.

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

PostPosted: 03. February 2016 18:05
by minnied
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.