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

  • SEARCH
  • Home
  • 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 7828235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:15:53+00:00 2026-06-02T10:15:53+00:00

How does php return CGI headers? I’ve been writing CGI ‘scripts’ in C++, and

  • 0

How does php return CGI headers?

I’ve been writing CGI ‘scripts’ in C++, and this is straightforward: I just manually output a Content-type and a Status line. However, I need to use phpmailer, so I also have some php code. The problem is that my simple php code just works, even though I’m not explicitly returning any headers. I’ve got to the point where I now have to return a failure status code to the client, and I can’t see how I’m meant to do this. Any ideas? Is Apache doing this automatically for me and, if so, how do I persuade it to return a 400 status?

Thanks.

  • 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-06-02T10:15:54+00:00Added an answer on June 2, 2026 at 10:15 am

    As per the docs, send a header that starts with “HTTP/”.

    header("HTTP/1.0 400 Bad Request");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why does this code always return 0? var possibleMatches = new Array(); $.getJSON('getInformation.php', function(data)
i just got some more questions while learning PHP, does php implement any built
any time i write this: $this->setTemplate('module/action'); I'm getting this error: The template module/actionSuccess.php does
Why does PHP require you to explicitly write $this ? I would understand if
I wrote this function to get a subset of an array. Does php have
Why does / . date(Y) + 1 in PHP return 1 ? And a
UPDATE 1: Writing $res to a textfile just returns the word VERIFIED : <?php
Why PHP preg_replace {include 'date.php'} does not return php? How to solve it without
If I return nothing explicitly, what does a php function exactly return? function foo()
Does php's is_int function return false for negative numbers because integers in php are

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.