Jump to content

[SOLVED] cannot show error message


ironman32

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/153198-solved-cannot-show-error-message/
Share on other sites

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.