Hello,
On my free time I was bored and decided to make a promo item script. I
based it off the gpotato coupon page. It uses a 16 character code(4 characters per box). I used the cash shop login script so i didn't bother making a login script for it but if anyone would like me to leave a message here and I will make it when I have time.OK, here is the scripts for it.
/****** Object: Table [dbo].[Promo_Code] Script Date: 02/07/2012 15:54:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Promo_Code](
[code1] [int] NOT NULL,
[code2] [int] NOT NULL,
[code3] [int] NOT NULL,
[code4] [int] NOT NULL,
[item_code] [bigint] NOT NULL,
[item_count] [int] NOT NULL
) ON [PRIMARY]
if (strlen($code1) > 4 || strlen($code2) > 4 || strlen($code3) > 4 || strlen($code4) >4) {
echo '<font color="red">Your promo code is too long please re-enter it!</font>';
exit();
} else{
mssql_connect('127.0.0.1', 'sa', '') or die(mssql_get_last_message());
$query = mssql_query("SELECT * FROM [Auth].[dbo].[Promo_Code] WHERE code1 = $code1 and code2 = $code2 and code3 = $code3 and code4 = $code4") or die(mssql_get_last_message());
$row_num = mssql_num_rows($query);
if ($row_num == 0) {
echo '<font color="red">You have put a invalid promo code!</font>';
exit();
} else {
$item = mssql_fetch_assoc($query);
$account_id = $_SESSION['user_id'];
$item_code = $item['item_code'];
$get_used_items = mssql_query("SELECT * FROM [Auth].[dbo].[used_promo] WHERE account_id = '$account_id' and item_code = '$item_code'");
$get_used_rows = mssql_num_rows ($get_used_items);
if ($get_used_rows > 0) {
echo '<font color="red">You have already used this promo code!</font>';
exit();
} else {
Eww it uses the MSSQL api. No worries mate. I will write out the MSSQL and pm you a SQLSRV copy so you can update this post. I am pretty sure Microsoft officially depreciated the MSSQL Api in favor of the SQL Driver. PM you soon.
Suche Item Promo Für Navicat? 08/07/2010 - Metin2 Private Server - 1 Replies Also...
Ich Suche- Item promo für navicat also für die neuen waffen ...
könnte mir jemand helfen?