php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26523 Scripts posting twice
Submitted: 2003-12-04 09:18 UTC Modified: 2003-12-04 09:30 UTC
From: cameron at toucanresolve dot co dot uk Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.3.3 OS: Suse Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cameron at toucanresolve dot co dot uk
New email:
PHP Version: OS:

 

 [2003-12-04 09:18 UTC] cameron at toucanresolve dot co dot uk
Description:
------------
When running some scripts the scripts runs twice. We are using apache 2 on a suse linux box. It generaly happens when the header function is being used with the location header. The script want get a far as the header but will re-run. If i put a die in it wont die and will still run twice. I have tested this by adding a seesion var names count and incrementing it each time the script is run. I always get two.

Reproduce code:
---------------
<?php
  
  session_start();

  if(!isset($_SESSION["Count"])){
      $_SESSION["Count"]++;
  }
  else{
      $_SESSION["Count"] = 0;
  }

  header("Location:gosomeware.php");

?>

Expected result:
----------------
Should out put 0

Actual result:
--------------
1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-04 09:30 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Broken HTML generally does this.
Also, header("Location..") expects a full url. 
 
No bug here.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Mar 04 19:00:01 2026 UTC