FlyFF Web Shop! v2.1 Released!

Re: FlyFF Web Shop! v2 BETA Released!

Code:
$q = "UPDATE characters SET penya='$total'"."WHERE penya='$penya'";
so, if everyone starts with 100k, I buy something that worths 90k, everybody that isnt logged in and have 100k will now have 10k? change it to where id = $charid '-'
 
Re: FlyFF Web Shop! v2 BETA Released!

Code:
$q = "UPDATE characters SET penya='$total'"."WHERE penya='$penya'";
so, if everyone starts with 100k, I buy something that worths 90k, everybody that isnt logged in and have 100k will now have 10k? change it to where id = $charid '-'

Woops. xD That was just a small typo. Will fix that now. :P
 
i got errors when i try to buy (i didn't tried the another versions)


Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\AppServ\www\shop\buy.php on line 31

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\AppServ\www\shop\buy.php on line 31

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\AppServ\www\shop\buy.php on line 34

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\AppServ\www\shop\buy.php on line 34

Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\shop\buy.php:31) in C:\AppServ\www\shop\buy.php on line 37
 
(using password : NO) means that your password in config.php is wrong!
->" $password = "WRONG"; #Your SQL password."
 
ack mail system isnt working for me, im gonna work on having the webshop insert the item in the character's bank, bag, or last inventory space, and release it as soon as i am done
 
i got errors when i try to buy (i didn't tried the another versions)


Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\AppServ\www\shop\buy.php on line 31

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\AppServ\www\shop\buy.php on line 31

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\AppServ\www\shop\buy.php on line 34

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\AppServ\www\shop\buy.php on line 34

Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\shop\buy.php:31) in C:\AppServ\www\shop\buy.php on line 37

Try downloading, i made a small mistake in the script but i fixed and reuploaded it now.
 
The first try, my test char didnt get the mail. It wasnt in the DB (custom)
The second try, i got the mail, but there was no item and if i scrolled over the item box it crashed
Now, it just doesnt show mail in the client, (in the DB), so i got fed up and started coding :3
But im sure you can do a better job than me, since you coded the thing and i just learned php xD
 
OK i figured out the problem with mail. In v2 in the buy.php on the line

('total', '0'',........) That 0 is supposed to be $charid and The $charid next to it is supposed to be 0.
 
Oks, since Im nice today, I will post here my script to put item in the first empty slot of the char, just credit me <3
little explanation:
it selects from inventory table, using charid = to the id of the char and backpack_number = -1(no backpack, the inventory itself), it orders by inventory slot, so, it will be on a sequence ascending, meaning that the first number from 0 to 41 that is free is an empty place to put the item.
the for makes that check, it keep adding 1 to the count variable and takes each line of the reg, from the begining to the end. When the numbers arent the same, that means that the COUNT number is the empty slot. Then it inserts or shows a warning of full inventory.
I hope you understand, also, you can modify it to a backpack or even bank so it goes into a logical order(inventory, backpack, bank).
Here it goes:
Code:
$select = mysql_query("select inventoryslot from inventory where charid = $id and backpack_number = -1 order by inventoryslot asc");
					$found = 'false';
					for ($cont = 0; $cont <= 41; $cont++)
					{
						$reg = mysql_fetch_row($select);
						if ($reg[0] != $cont)
						{
							$found = 'true';
							break;
						}
					}
					if ($found == 'true')
					{
						$insere = mysql_query("insert into inventory(itemid, charid, inventoryslot, count, addedByQuestID, backpack_number) values($itemId, $charId, $cont, $quantity, -1, -1)");
						$update = mysql_query("update characters set penya = $penya where id = $charid");
						if (mysql_affected_rows() != 0)
						{
							echo "<h3>Successfull bought the item.</h3>";
						}
						else
						{
							echo "<h3><font color='#FF0000'>Error</font>: Error trying to buy.</h3>";
						}
					}
					else
					{
						echo "<h3><font color='#FF0000'>Warning</font>: Your inventory is full.</h3>";
					}
also, please check if the '<= 41' in the for is right or if is just '< 41'.
 
Nice, im gonna test it later, Also the item table in the shop keeps duplicating if you dont have a primary key (heads up to people having that problem)
 
I like the first release good thing i have learn php and mysql in past 4 day I modify the script and now the donation system is fulled working ^^
 
A donation system is adding a new collumn in the char table and setting the buy.php to use that one insteead of penya
 
Back