ironman32 Posted April 8, 2009 Share Posted April 8, 2009 What I'm trying to do is show an error message if a field is empty. Here is my code <?php $age = $_POST['age']; $weight = $_POST['weight']; $medical = $_POST['medical']; if (empty ($_POST['age']) ){ header("Location: lose.php?msg=Invalid Login"); } ?> I'm currently getting this error message Warning: Cannot modify header information - headers already sent by (output started at /home/dontwork/public_html/workout3/lose2.php:2) in /home/dontwork/public_html/workout3/lose2.php on line 9 If anyone can help I would appreciate it. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted April 8, 2009 Share Posted April 8, 2009 The error is caused be cause on line 2 in lose2.php you have some form of output. Make sure you don't have anything before your opening php tag (<?php) Quote Link to comment Share on other sites More sharing options...
schilly Posted April 8, 2009 Share Posted April 8, 2009 clear any space at the end of the php tag as well (after ?> at the end of the file) Quote Link to comment 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.