# \[PHP\] header(location: ~ )

**URL:** <https://forum.kirupa.com/t/php-header-location/190436>\
**Category:** programming\
**Created:** [June 11, 2006, 9:12pm UTC](https://forum.kirupa.com/t/php-header-location/190436 "2006-06-11T21:12:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeoDreamer](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@NeoDreamer](https://forum.kirupa.com/u/NeoDreamer)\
**Post date:** [June 11, 2006, 9:12pm UTC](https://forum.kirupa.com/t/php-header-location/190436/1 "2006-06-11T21:12:47Z")

</div>

I think that there is something wrong with the syntax of my header command. It just doesn’t load that page! It’s like the whole command is skipped.

```php

$num = mysql_numrows($rs);
if($num != 0)
{
	echo("Log in is successful");
}
else
{
	// This header code never works for some reason. 
	// If I replace it with a simple echo("login failed");
	// command, it will work.

	header("Location: index.php?sec=login&error=match");
	exit();
}

```
