Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
  #11  
Old 21st October 2008, 10:32
al_ltoticmat al_ltoticmat is offline
Senior Member
 
Join Date: Oct 2008
Posts: 44
Default
You are the great.

It works perfect.

Thank you.
Reply With Quote
  #12  
Old 21st October 2008, 10:56
al_ltoticmat al_ltoticmat is offline
Senior Member
 
Join Date: Oct 2008
Posts: 44
Default
I fixed it.

but it occurs this.
SQL Error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 2008-10-21 17:02:56, 'You receive money from ticc Value K\n', 0)' at line 1

Code:
$msg = sqlesc("You receive money from ".$CURUSER['username']." value ".$money." K");
				@mysql_query("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, $receiver, ". get_date_time() .", $msg, 0)") or sqlerr(__FILE__, __LINE__);

Last edited by al_ltoticmat; 21st October 2008 at 12:05.
Reply With Quote
  #13  
Old 22nd October 2008, 10:40
al_ltoticmat al_ltoticmat is offline
Senior Member
 
Join Date: Oct 2008
Posts: 44
Default
I want to send a message to users who get a seedbonus.

The code above errors.
Reply With Quote
  #14  
Old 22nd October 2008, 16:53
djlee's Avatar
djlee djlee is offline
Senior Member
 
Join Date: Mar 2008
Posts: 183
Default
first of all u need to escape the date

change
Code:
get_date_time()
to
Code:
sqlesc(get_date_time())
secondly make sure u escape the message .. if you havenet already done this before using $msg in the query
change
Code:
$msg
to
Code:
".sqlesc($msg)."
Reply With Quote
  #15  
Old 22nd October 2008, 17:39
al_ltoticmat al_ltoticmat is offline
Senior Member
 
Join Date: Oct 2008
Posts: 44
Default
I don't know why
this problem haven't solve the another problem occurs.
Code:
<?
if ($CURUSER["id"] != $user["id"])
{
	print("<tr><td class=rowhead><b>Transfer Money</b></td><td class=tablea align=left>\n");
	print("<form method=post action='userdetails.php?id=".$id."'><input type=hidden name=receiver value=$id><input type=text size=6 name=money>&nbsp;&nbsp;<input type=submit value=\"Transfer\" style='height: 23px'></form>");
	if(isset($_POST["money"]) && ($money = 0+$_POST["money"]))
			$receiver = $_GET["receiver"];
			if ($money > $CURUSER["seedbonus"])
			print("You don't have enough money");
			else
			{
				$msg = sqlesc("You receive from".$CURUSER['username']." value ".$money." K");
				@mysql_query("UPDATE users SET seedbonus = seedbonus + $money WHERE id=$receiver");
				@mysql_query("UPDATE users SET seedbonus = seedbonus - $money WHERE id=".$CURUSER['id']);
				@mysql_query("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, $receiver, ". sqlesc(get_date_time()) .", ".sqlesc($msg).", 0)");
				

			}
}


?>
I think maybe $receiver wrong.

The another problem is the user that I give seedbonus. He didn't receive but my seedbonus decreases. He didn't get a pm too.
Reply With Quote
  #16  
Old 23rd October 2008, 00:27
djlee's Avatar
djlee djlee is offline
Senior Member
 
Join Date: Mar 2008
Posts: 183
Default
try that (untested)
Code:
<?
if ($CURUSER["id"] != $user["id"])
{
	print("<tr><td class=rowhead><b>Transfer Money</b></td><td class=tablea align=left>\n");
	print("<form method=post action='userdetails.php?id=".$id."'><input type=hidden name=receiver value=$id><input type=text size=6 name=money>&nbsp;&nbsp;<input type=submit value=\"Transfer\" style='height: 23px'></form>");
	if(isset($_POST["money"]) && ($money = 0+$_POST["money"]) != "")
			$receiver = 0+$_POST["receiver"];
			if ($money > $CURUSER["seedbonus"])
			print("You don't have enough money");
			else
			{
				$msg = "You receive from".$CURUSER['username']." value ".$money." K";
				@mysql_query("UPDATE users SET seedbonus = seedbonus + $money WHERE id=$receiver");
				@mysql_query("UPDATE users SET seedbonus = seedbonus - $money WHERE id=".$CURUSER['id']);
				@mysql_query("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, $receiver, ". sqlesc(get_date_time()) .", ".sqlesc($msg).", 0)");
				

			}
}


?>
Reply With Quote
The Following User Says Thank You to djlee For This Useful Post:
al_ltoticmat (23rd October 2008)
  #17  
Old 23rd October 2008, 09:35
al_ltoticmat al_ltoticmat is offline
Senior Member
 
Join Date: Oct 2008
Posts: 44
Default
Hey, you are the best I ever seen.

Very thank you.
Work perfect in every function.

You make me happy.
Reply With Quote
Reply

Tags
code , problem

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ts code xDev Community Cafe 8 13th February 2010 22:33
Pin Code devil16 Template Shares 1 25th November 2009 02:14
Source code DND TBDev 2 5th September 2009 18:22
Pin Code ban Syn Template Shares 6 21st June 2009 02:03



All times are GMT +2. The time now is 21:29. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.