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
Cups
October 28, 2012, 10:00pm
2
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.
Cups:
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
Cups
October 29, 2012, 9:54am
5
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…