Skip to main content

Problems with PHP Header Redirect

Recently I was writing a PHP script which required a bit of code to redirect a user from the current page to another one.  This is achieved using the following code:

<?php
header("Location:http://www.othersite.com/otherpage.html");
?>

Unfortunately, however, I could not get this to work for me.  I tried every suggestion and tip I could find on the web to no avail.  Many sites advised making sure to remove any “white space” in the PHP file.  I removed every single bit except the 3 lines listed above, deleted the fourth blank line by going to the end of the third and hitting delete.  No joy.

I got in contact with my fantastic web hosting company Webhost.ie and they figured it out.  By default PHP on their servers runs at PHP4.  As soon as the version running was changed to PHP5 in the website settings area the script ran perfectly!

So there you go: if you’re having trouble with PHP header redirects check the PHP version number running on your web server.  You might need to update it to version 5.  Also, if you need reliable web-hosting with fantastic support I highly recommend you check out www.webhost.ie.  I’m not in any way related to their business, just a happy customer.

Comments

Popular posts from this blog

Resolve WSUS Server issue that gives "Cannot save configuration because the server is still processing"

This is a pretty infuriating error and can sometimes crop up as a result of running a "wsusutil reset" command. First of all, give the server some time, and then a bit more...  but you've probably already done this. These steps may help to resolve the situation: - Install Microsoft SQL Management Studio (free download) - Run SQL Management Studio and start to connect to the WSUS database - Enter this in the "Server Name" box:  \\.\pipe\MICROSOFT##WID\tsql\query - Expand the "Databases" tree - Right-click on "SUSDB" and choose "New Query" - Paste this query in:     UPDATE tbSingletonData     SET ResetStateMachineNeeded = 0 - You should see a message like "1 row affected", which is good - Quit SQL Management Studio - Open "Services" and restart the "WSUS Service" - Now, open WSUS

Print Management Console Missing

I've encountered a few Windows 11 machines lately, some brand new, that haven't had the Print Management Console installed. Trying to run it from the Run menu using "printmanagement.msc" didn't work either. The fix is to run this from a command prompt:  dism /Online /add-Capability /CapabilityName:Print.Management.Console~~~~0.0.1.0

Re-arm ESXI Evaluation License

Needed to get a little more time out of my ESXI trial so that I could migrate it to Hyper-V. This pair of commands came in very handy and gave another 60 days: rm -f /etc/vmware/vmware.lic /etc/vmware/license.cfg reboot To use them, you need to: Put your ESXI server into Maintenance Mode Enable Secure Shell access (SSH) Enable Console Access Then ssh to the server (in Windows 11 you can just type ssh username@serveripaddress and then enter password) Otherwise, you could use something like PuTTY ( https://www.putty.org/ ) Hope this helps.