Send item Code
Ok, first copy the first code and open your notepad and save as item.php
The second code copy it and save as config.php
item.php you see the Red Option Things just add 1 more row with another value and name or edit. The Value is the ItemID you want they choose. Just search in your zitem.xml ;)
config.phpCode:<FORM method="post" action="<? echo $PHP_SELF;?>"> <p>Characternaam: <input name="aid" type="textfield" /> <select name="sg"> <option value="33334">Donatie Shotgun 1</option> <option value="33354">Donatie Shotgun 2</option> <option value="33359">Donatie Shotgun 3</option> </select> <input type="submit" value="koop" name="koop" /> </form> <? include('config.php'); $naam = anti_injection($_POST ["aid"]); $itemid = anti_injection($_POST ["sg"]); $cid = ("SELECT CID FROM Character where Name='$naam'"); $query = odbc_exec($connect,$cid); odbc_fetch_row($query); $cidnr = odbc_result($query, 1); if (isset($_POST["koop"])) { if (empty($naam)) { echo ('<br>Je moet een Characternaam invullen!'); } else { echo ('<br>Succesvol gekocht!'); odbc_exec ($connect, "INSERT INTO CharacterItem (CID, ItemID) VALUES ('$cidnr', '$itemid')"); } } ?>
Code:<? $host = "HYLPER\SQLEXPRESS"; // your sql server $dbname = "GunzDB"; // Your db name $user = "sa"; // your sql inlogname $pass = "yourpw"; // your db password $connect = odbc_connect("Driver={SQL Server};Server={$host}; Database={$dbname}", $user, $pass) or die("Kan niet verbinding maken met de Server."); function anti_injection($sql) { $sql = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"),"",$sql); $sql = trim($sql); $sql = strip_tags($sql); $sql = addslashes($sql); return $sql; } ?>
Another easy php code. Just copy and save as search.php or something :P But it needs to be in the same map as the config.php
This is just some basics don't blame me xd if i made a mistake just say it.Code:<form method="post" action="<? echo $PHP_SELF;?>"> <p><b>Characternaam:</b> <input type="text" name="char" /> </p> <p> <input type="submit" value="zoek" name="zoek" /> </p> </form> <? include ('config.php'); $char = $_POST["char"]; $sql = ("SELECT Name,Level,XP,KillCount,Deathcount,Regdate,bp,sex FROM Character (nolock) where name='$char'"); $query = odbc_exec($connect,$sql); odbc_fetch_row($query); $sex = odbc_result($query, 8); if( isset($_POST['zoek']) ) { if (empty ($char)) { echo("<font color=\"red\"><h1>U hebt niks ingevuld!</h1></font>"); } else { echo ('<b>Naam: '); echo odbc_result($query, 1); echo ('<br>'); echo ('Level: '); echo odbc_result($query, 2); echo ('<br>'); echo ('XP: '); echo odbc_result($query, 3); echo ('<br>'); echo ('Killz: '); echo odbc_result($query, 4); echo ('<br>'); echo ('Dood: '); echo odbc_result($query, 5); echo ('<br>'); echo ('Geld: '); echo odbc_result($query, 7); echo ('<br>'); echo ('Aangemaakt om: '); echo odbc_result($query, 6); echo ('<br>'); echo ('Geslacht: '); if($sex=="1") { echo ('Woman'); } elseif ($sex=="0") { echo ('Man'); } } } ?></b>


Reply With Quote


