Jump to content

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


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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.