Jump to content

[SOLVED] [URGENT]big header error...[/URGENT]


Noskiw

Recommended Posts

<?php

$cred = $_GET['credentails'];
$p = $_GET['p'];

require "credentials.php";

if(!$password){
header("Location: http://localhost/dynamic web page/index.php?p=blog&p=admin&p=credentials");
}

if(!$_POST['submit']){
echo "

<form action='index.php?p=blog' method='POST'>

<table width='100%'>

    <tr>

    <td width='7%' valign='top'>
    Your Name:
    </td>

    <td valign='top'>
    <input type='text' name='name' maxlength='25' />
    </td>

    </tr>

    <tr>

    <td valign='top'>
    Your Email:
    </td>

    <td>
    <input type='text' name='email' maxlength='35' />
    </td>

    </tr>

    <tr>

    <td valign='top'>
    Your Message:
    </td>

    <td>
    <textarea cols='20' rows='2' name='message' maxlength='250'></textarea>
    <p><input type='submit' name='submit' value='Post' />
    </td>

    </tr>
    </table>

    </form>";
}

?>

 

Basically I have been trying to setup a blog for my band and make it easy for them to input data in the mysql table because half the time they don't know what i'm on about. I can do that, it's just these darn header errors that are buggin me. If someone would kindly help me, it would be greatly appreciated. Thankyou.  :D :D :D

 

I get the error before i have even put anything in on credentials.php

 

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\dynamic web page\index.php:40) in C:\xampp\htdocs\dynamic web page\inc\credentials.php on line 3

 

<?php

if(!$_POST['submit']){
echo "<form action='index.php?p=blog&p=admin&p=credentials' method='POST'>";
echo "Enter Credentials (password): <input type='password' name='password'>";
echo "<input type='submit' name='submit'  value='Access' />";
echo "</form>";
}else{
$password = $_POST['password'];

if(!$password){
	echo "Password Required";
}else{
	if($password != "bambam"){
		echo "Wrong Password!";
	}
}
}

if($password == "bambam"){
header("Location: http://localhost/dynamic web page/index.php?p=blog&p=admin");
}

?>

 

on this one I get when I enter the password...

 

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\dynamic web page\index.php:40) in C:\xampp\htdocs\dynamic web page\inc\credentials.php on line 21

 

Please bear in mind I have read the header errors topic. didn't seem to help.

 

i tried

 

<?php

$res = header("Location: http://localhost/dynamic web page/index.php?p=blog&p=admin");

if(!$_POST['submit']){
echo "<form action='index.php?p=blog&p=admin&p=credentials' method='POST'>";
echo "Enter Credentials (password): <input type='password' name='password'>";
echo "<input type='submit' name='submit'  value='Access' />";
echo "</form>";
}else{
$password = $_POST['password'];

if(!$password){
	echo "Password Required";
}else{
	if($password != "bambam"){
		echo "Wrong Password!";
	}
}
}

if($password == "bambam"){
execute($res);
}

?>

 

but got undefined function errors. Which is getting really annoying, please will someone help.

Link to comment
https://forums.phpfreaks.com/topic/178641-solved-urgentbig-header-errorurgent/
Share on other sites

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\dynamic web page\index.php:40)

 

that tells you where the output is started

 

output started at C:\xampp\htdocs\dynamic web page\index.php:40

 

go to that line, and stop it from outputting stuff

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.