Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6856529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:53:52+00:00 2026-05-27T01:53:52+00:00

This block of code shown below using a php header redirect works locally, but

  • 0

This block of code shown below using a php header redirect works locally, but not on my Bluehost server:

if ($_POST['submit']=='No')
{
    $url ='Location: index.php?id='.$id.'&page='.$page;
    header($url);
    exit;
}

When the server gets to this block of code, absolutely nothing happens. No error, no warning, just a blank page. The page that my form submit redirects to isn’t supposed to do anything except reroute the user to the relevant page.

I’m pretty dang positive it has nothing to do with the common problem of including HTML before the redirect (since it works locally). Therefore I suspect it has something to do with differences between my php.ini files. I’ve pulled up PHPinfo() for both servers, and my local server has a module named mod_headers while my Bluehost server has none. I think this potentially could be the problem, although normally my Bluehost has no problems using header redirects, except in this one instance.

So I suspect the problem has something to do with my ini file, but I don’t know exactly what.

What makes this problem even stranger is that there are other blocks of code which work just fine, for instance

if(!empty($_POST['id']))
{
    $id = htmlentities(strip_tags($_POST['id']));
    $sql = "UPDATE entries SET title=?, entry=? WHERE id=? LIMIT 1";
    $stmt = $db->prepare($sql);
    $stmt->execute(array($title,$entry,$id));
    $stmt->closeCursor();
    $url= 'Location: ../index.php?id='.$id.'&page='.$page;
    header($url);
    exit;
}   

works just great.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:53:53+00:00Added an answer on May 27, 2026 at 1:53 am

    I had the same problem that it works fine on XAMPP but not on bluehost or 1&1.

    PHP documentation says there should be no output before calling the header function.
    http://php.net/manual/en/function.header.php

    In my case there was a space before the opening <?PHP which made the header function not work.

    This should help to solve the problem.

    The quesiton remains though: why does it work on XAMPP and not on the servers of bluehost, 1&1, etc?
    (since I use firefox for both tests – it is definitely not a browser issue)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I seem to be using this block of code alot in Python. if Y
So I run this Windows Server 2008 security update and this code block is
I have been using the block of code below to supposedly stop sql injections.
I cannot understand why the block of code below is not passing even though
If I have a block of code like this: def show @post = Post.find(params[:id])
I have this block of code: users = Array.new users << User.find(:all, :conditions =>
consider this code block public void ManageInstalledComponentsUpdate() { IUpdateView view = new UpdaterForm(); BackgroundWorker
In other words, a block of code like this: (setq initial-major-mode (lambda () (text-mode)
Any way I can get this working? I have a block of code: <p><a
Considering this code, can I be absolutely sure that the finally block always executes,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.