Please help

please tell me the error…it says parse error

<?php

include('connection.php');
include('security.php');


$name=$_POST['name'];

if($name=="")
{

echo"<script type='text/javascript'>alert('Name or Category Cannot be NULL')</script>";

header('location:admin_insert_category_html.php');

}



else{
$n=mysql_query("insert into category(name) values('$name')");

$c=mysql_affected_rows($connect);

if($c>0)
{
echo "<script type='text/javascript'>".$t=."alert('Done')</script>";
if($t)
{
header('location:adminhome.php?act=1');
}
}
else{
echo"<h3>Error Occured!</h3>";
}
}

?>

Thankyou

echo “<script type=‘text/javascript’>”.$t=.“alert(‘Done’)</script>”;

I’d guess that above, which is emboldened.

It would have helped a lot if you had indicated which line was causing the parse error.

Also, unless there is something magical going on in one of the include files, you have a omitted to protect yourself from an SQL injection attack in that code sample.

it was saying that line 27 is causing error.

there was no problem in those include files.

i didn’t understand,i had protected myself or i am prone to sql injection?please elaborate

i had deleted all the code(each and everything) and then also it says line 27 has problem.don’t know why…

if you wanna this as a live page then visit

www.moneyzzproject.netii.net

Sorry, I cannot elaborate on it any better than the link I carefully found and posted for you.

If you still don’t see the threat after reading that page a few times, then maybe this old classic will help illustrate the problem: Little Bobby Tables.


if($name=="")
{

echo"<script type='text/javascript'>alert('Name or Category Cannot be NULL')</script>";

header('location:admin_insert_category_html.php');

}

Is it proper?? i mean, echo before passing headers??
One could pass on header and then, on that target page have a javascript alert or something else…