Noskiw Posted October 22, 2009 Share Posted October 22, 2009 <?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 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. Quote Link to comment https://forums.phpfreaks.com/topic/178641-solved-urgentbig-header-errorurgent/ Share on other sites More sharing options...
mikesta707 Posted October 22, 2009 Share Posted October 22, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/178641-solved-urgentbig-header-errorurgent/#findComment-942270 Share on other sites More sharing options...
Noskiw Posted October 22, 2009 Author Share Posted October 22, 2009 why would I wan't it to stop outputting stuff when I want it to go to a different page? Quote Link to comment https://forums.phpfreaks.com/topic/178641-solved-urgentbig-header-errorurgent/#findComment-942272 Share on other sites More sharing options...
Mchl Posted October 22, 2009 Share Posted October 22, 2009 Why would you want to output anything when you want it to go to a different page? Quote Link to comment https://forums.phpfreaks.com/topic/178641-solved-urgentbig-header-errorurgent/#findComment-942274 Share on other sites More sharing options...
Noskiw Posted October 22, 2009 Author Share Posted October 22, 2009 Nevermin, I'm going to do it the old fashioned way and put a link there instead. *Sigh* Quote Link to comment https://forums.phpfreaks.com/topic/178641-solved-urgentbig-header-errorurgent/#findComment-942276 Share on other sites More sharing options...
Mchl Posted October 22, 2009 Share Posted October 22, 2009 You have an empty line before <?php Remove it Quote Link to comment https://forums.phpfreaks.com/topic/178641-solved-urgentbig-header-errorurgent/#findComment-942277 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.