Jump to content

Recommended Posts

<?php
if(isset($_SESSION['user_id'])){
if(isset($_POST['delay']))
{
	$delay = mysql_real_escape_string($_POST['delay']);
	$account_id = $_SESSION['user_id'];
	$start_date = date("Y-m-d H:i:s");
	$end_date = date("Y-m-d H:i:s", strtotime("$delay day"));
	$sql01 = mysql_query("UPDATE account.account SET availlTd = DATE_ADD(NOW,INTERVAL ".$delay." DAY) WHERE id = $account_id");
	if($sql01)
	{
		echo "Your account is blocked for $delay days.<br><br>";
	}
	else
	{
		echo "sql error: ".mysql_error();
	}
}
?>

<form action="freeze.php" method="POST">
	<select name="delay">
		<option value="1">1 day</option>
		<option value="2">2 day</option>
		<option value="3">3 day</option>
		<option value="7">1 week</option>
	</select>
	<input type="submit" name="submit" value="Submit"/>
</form>

<?php
} else {
	echo "You dont have permission to go here";
}
?>
Take this script and give me the error message thats showing

 

 

sql error: Unknown column 'availlTd' in 'field list' :)

 

Link to comment
Share on other sites

  • Replies 42
  • Created
  • Last Reply

Top Posters In This Topic

  • Former Staff

No i just wrote availTd wrong xD wait a sec

 

<?php
if(isset($_SESSION['user_id'])){
if(isset($_POST['delay']))
{
	$delay = mysql_real_escape_string($_POST['delay']);
	$account_id = $_SESSION['user_id'];
	$start_date = date("Y-m-d H:i:s");
	$end_date = date("Y-m-d H:i:s", strtotime("$delay day"));
	$sql01 = mysql_query("UPDATE account.account SET availDt = DATE_ADD(NOW() ,INTERVAL ".$delay." HOUR) WHERE id = $account_id");
	if($sql01)
	{
		echo "Your account is blocked for $delay days.<br><br>";
	}
	else
	{
		echo "sql error";
	}
}
?>

<form action="freeze.php" method="POST">
	<select name="delay">
		<option value="24">1 day</option>
		<option value="48">2 day</option>
		<option value="72">3 day</option>
		<option value="168">1 week</option>
	</select>
	<input type="submit" name="submit" value="Submit"/>
</form>

<?php
} else {
	echo "You dont have permission to go here";
}
?>
This should work
Link to comment
Share on other sites

No i just wrote availTd wrong xD wait a sec

 

<?php
if(isset($_SESSION['user_id'])){
if(isset($_POST['delay']))
{
	$delay = mysql_real_escape_string($_POST['delay']);
	$account_id = $_SESSION['user_id'];
	$start_date = date("Y-m-d H:i:s");
	$end_date = date("Y-m-d H:i:s", strtotime("$delay day"));
	$sql01 = mysql_query("UPDATE account.account SET availDt = DATE_ADD(NOW,INTERVAL ".$delay." DAY) WHERE id = $account_id");
	if($sql01)
	{
		echo "Your account is blocked for $delay days.<br><br>";
	}
	else
	{
		echo "sql error";
	}
}
?>

<form action="freeze.php" method="POST">
	<select name="delay">
		<option value="1">1 day</option>
		<option value="2">2 day</option>
		<option value="3">3 day</option>
		<option value="7">1 week</option>
	</select>
	<input type="submit" name="submit" value="Submit"/>
</form>

<?php
} else {
	echo "You dont have permission to go here";
}
?>
This should work

 

 

The same mistake again : sql error

 

Link to comment
Share on other sites

  • Former Staff

No dont change any tables it was my spelling mistake :o

<?php
if(isset($_SESSION['user_id'])){
if(isset($_POST['delay']))
{
	$delay = mysql_real_escape_string($_POST['delay']);
	$account_id = $_SESSION['user_id'];
	$start_date = date("Y-m-d H:i:s");
	$end_date = date("Y-m-d H:i:s", strtotime("$delay day"));
	$sql01 = mysql_query("UPDATE account.account SET availDt = DATE_ADD(NOW() ,INTERVAL ".$delay." HOUR) WHERE id = $account_id");
	if($sql01)
	{
		echo "Your account is blocked for $delay days.<br><br>";
	}
	else
	{
		echo "sql error: ".mysql_error();
	}
}
?>

<form action="freeze.php" method="POST">
	<select name="delay">
		<option value="24">1 day</option>
		<option value="48">2 day</option>
		<option value="72">3 day</option>
		<option value="168">1 week</option>
	</select>
	<input type="submit" name="submit" value="Submit"/>
</form>

<?php
} else {
	echo "You dont have permission to go here";
}
?>
Its hard to code without trying it myself :D
Link to comment
Share on other sites

No dont change any tables it was my spelling mistake :o

 

<?php
if(isset($_SESSION['user_id'])){
if(isset($_POST['delay']))
{
	$delay = mysql_real_escape_string($_POST['delay']);
	$account_id = $_SESSION['user_id'];
	$start_date = date("Y-m-d H:i:s");
	$end_date = date("Y-m-d H:i:s", strtotime("$delay day"));
	$sql01 = mysql_query("UPDATE account.account SET availDt = DATE_ADD(NOW() ,INTERVAL ".$delay." HOUR) WHERE id = $account_id");
	if($sql01)
	{
		echo "Your account is blocked for $delay days.<br><br>";
	}
	else
	{
		echo "sql error: ".mysql_error();
	}
}
?>

<form action="freeze.php" method="POST">
	<select name="delay">
		<option value="24">1 day</option>
		<option value="48">2 day</option>
		<option value="72">3 day</option>
		<option value="168">1 week</option>
	</select>
	<input type="submit" name="submit" value="Submit"/>
</form>

<?php
} else {
	echo "You dont have permission to go here";
}
?>
Its hard to code without trying it myself :D

 

 

No no I don't change table :D This is work but account table in status is 'OK'. I want to status is 'BLOCK'

 

Link to comment
Share on other sites

  • Former Staff

You dont need status block. When availDt is changed to a higher time than its at this moment you cant login. You will only be able to login after the date and time which is in availDt. So the player doesnt have to unblock himself manually. The system will do that automaticly

Set the time to 1 day and try to login

Link to comment
Share on other sites

You dont need status block. When availDt is changed to a higher time than its at this moment you cant login. You will only be able to login after the date and time which is in availDt. So the player doesnt have to unblock himself manually. The system will do that automaticly

Set the time to 1 day and try to login

 

Okey. I understand with you. Thanks for everything. But I have last question for you. If user freeze the account , users don' login the site ? How can I do this ?

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / 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.