Jump to content

Nested If problem


livewirerules

Recommended Posts

When i execute this code, the relevant form and all the error codes are also displayed.

 

eg: when the UCP link is clicked , it displays the UCP form and both the error codes(error inserting and error).

 

Can someone pls help me to fix this problem

 

<?php

if ($_GET['ads']==en)
{
?>
<div align="center">

  	<form name="ucp" method="post" action="settings.php">
    <p>UCP:
      <input name="acode" type="text" />
      Eg xxxxxxxxxxxxx
      <input type="submit" name="add" value="Submit" />
  	</p>
  	</form>
<?php
$ad1=$_POST['add'];
$acode=$_POST['acode'];
if($ad1)
{
$sql="insert into `settings` set
adsense='$acode";
$result=mysql_query($sql) or die(mysql_error());
}
else
{
echo"error inserting";
}
}
else {echo "error";}


if ($_GET['lmt'])
{
?>
	 <form id="limit" method="post" action="settings.php">
   	 <p>limit:
      <input name="turns" type="text" />
      <input type="submit" name="limit" value="Submit" />
  </p>
  </form>
<?php
		$limit=$_POST['limit'];
	$turns=$_POST['turns'];
if($limit)
	{
	$sql="insert into `settings` set
	limit='$turns'";
	$result=mysql_query($sql) or die(mysql_error());
	}
else
{
echo"Invalid limit action";
}
}
else {echo "error setting user limit";}

?>

 

any help will be appreciated

Link to comment
https://forums.phpfreaks.com/topic/117192-nested-if-problem/
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.