I got a header already sent error in php but can't find why after 1 week [duplicate] - Hack The Tech - Latest News related to Computer and Technology

Hack The Tech - Latest News related to Computer and Technology

Get Daily Latest News related to Computer and Technology and hack the world.

Saturday, April 8, 2023

I got a header already sent error in php but can't find why after 1 week [duplicate]

I'm trying to get my header working but it never works ... My header needs all it has in it and i can't remove it and i also tried to make an other test and in this test file the header works I also tried to check every spaces that can mess it up and everything was ok, I tried some kind of ForEach(header_list) and remove things in it.

<?php
include "modeles/fonctionsAccesBDD.php";

$lepdo=connectionBDD();

include_once "vues/search.php";

if(isset($_POST['submit'])){

    $noReference=$_POST['searchRef'];
    $noVille=$_POST['villeList'];
    $noType=$_POST['typeList'];
    $noJardin=$_POST['ChoixJardin'];
    $prix=$_POST['choixPrix'];
    $surfaceMin=$_POST['ChoixSurfaceMin'];
    $piecesMin=$_POST['ChoixPiecesMin'];

    $recherche=getBiensSearch($lepdo, $_POST['villeList'], 
    $_POST['typeList'],
    $_POST['ChoixJardin'],
    $_POST['choixPrix'],
    $_POST['ChoixSurfaceMin'],
    $_POST['ChoixPiecesMin'],
    $_POST['searchRef']);
    header("Location: /index.php?page=lesbiens&Recherche=1&reference=$noReference&noVille=$noVille&noType=$noType&noJardin=$noJardin&prix=$prix&ChoixSurfaceMin=$surfaceMin&ChoixPiecesMin=$piecesMin");
}
?>

I tried nearly everything I think



source https://stackoverflow.com/questions/75961435/i-got-a-header-already-sent-error-in-php-but-cant-find-why-after-1-week

No comments:

Post a Comment