Share Code PHP gửi mail ITEM - Phong Vân
Hello & Welcome to our community. Is this your first visit? Đăng Ký
Follow us on
Follow us on Facebook Follow us on Twitter Linked In Flickr Watch us on YouTube My Space Blogger
 
Trang 1 của 2 1 2 CuốiCuối
Kết quả 1 đến 10 của 15
  1. #1
    Thành Viên
    Ngày tham gia
    Dec 2015
    Bài viết
    17
    Thanks
    0
    Thanked 28 Times in 12 Posts

    Icon7 Share Code PHP gửi mail ITEM - Phong Vân

    Bước 1: Tạo FORM nhập ID bằng HTML

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="zh" xml:lang="en">
    <head>
    <title>Webgame - Phong Vân Vô Song</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="description" content="Webgame - Phong Vân Vô Song">
    <meta name="keywords" content="Webgame, Phong Vân, Vô Song, H20, Ngũ Đại Thần Thú">
    <meta name="author" content=""">
    <link href="style.css" rel="stylesheet" type="text/css">
    <script src="pv.js"></script>
    </head>
    <body>
    <div>
    <form class="form-style-7" method="post" action="" onsubmit="return false;" novalidate="novalidate" enctype="multipart/form-data">
    <table>
    <tr valign="top">
    <td>
    <ul>
    <li>
    <label for="name">Tên Trong Game</label>
    <input type="text" name="name" maxlength="100" value="">
    <span>Tên trong Game</span>
    </li>
    <li>
    <label for="desc">Nội Dung Thư</label>
    <textarea name="desc" onkeyup="adjust_textarea(this)">Bạn nhận được một món quà từ Phong Vân</textarea>
    <span>Nội Dung Thư</span>
    </li>
    <li>
    <label for="multi">Gộp Vật Phẩm</label>
    <select name="multi" id="multi">
    <option value="0" selected>Không</option>
    <option value="1">Có</option>
    </select>
    <span>Bạn Muốn Gộp Vật Phẩm ?</span>
    </li>
    <li>
    <label for="block">Khóa Vật Phẩm</label>
    <select name="block" id="block">
    <option value="2000" selected>Không</option>
    <option value="2001">Có</option>
    </select>
    <span>Bạn Muốn Gộp Vật Phẩm ?</span>
    </li>
    <li>
    <label for="quality">Số Lượng Vật Phẩm</label>
    <input type="text" name="quality" maxlength="3" value="1">
    <span>Số Lượng Vật Phẩm</span>
    </li>
    <li>
    <label for="Status"></label>
    <span id="Status">Trạng Thái</span>
    </li>
    </ul>
    </td>
    <td>
    <ul>
    <li>
    <label for="vp">ID 1</label>
    <input type="text" name="vp[]" maxlength="10">
    <span>ID Vật phẩm 1</span>
    </li>
    <li>
    <label for="vp">ID 2</label>
    <input type="text" name="vp[]" maxlength="10">
    <span>ID Vật phẩm 2</span>
    </li>
    <li>
    <label for="vp">ID 3</label>
    <input type="text" name="vp[]" maxlength="10">
    <span>ID Vật phẩm 3</span>
    </li>
    <li>
    <label for="vp">ID 4</label>
    <input type="text" name="vp[]" maxlength="10">
    <span>ID Vật phẩm 4</span>
    </li>
    <li>
    <label for="vp">ID 5</label>
    <input type="text" name="vp[]" maxlength="10">
    <span>ID Vật phẩm 5</span>
    </li>
    </ul>
    </td>
    <td>
    <ul>
    <li>
    <label for="vp">ID 6</label>
    <input type="text" name="vp[]" maxlength="10">
    <span>ID Vật phẩm 6</span>
    </li>
    <li>
    <label for="vp">ID 7</label>
    <input type="text" name="vp[]" maxlength="10">
    <span>ID Vật phẩm 7</span>
    </li>
    <li>
    <label for="vp">ID 8</label>
    <input type="text" name="vp[]" maxlength="10">
    <span>ID Vật phẩm 8</span>
    </li>
    <li>
    <label for="vp">ID 9</label>
    <input type="text" name="vp[]" maxlength="10">
    <span>ID Vật phẩm 9</span>
    </li>
    <li>
    <label for="vp">ID 10</label>
    <input type="text" name="vp[]" maxlength="10">
    <span>ID Vật phẩm 10</span>
    </li>
    <li>
    <input type="submit" name="Submit" onclick="PostMail(this.form);" value="Gửi Thư" >
    </li>
    </ul>
    </td>
    </tr>
    </table>
    </form>
    </div>
    </body>
    </html>

    Bước 2: file style.css

    .form-style-7{
    max-width:1004px;
    margin:50px auto;
    background:#fff;
    border-radius:2px;
    padding:20px;
    /*font-family: Georgia, "Times New Roman", Times, serif;*/
    }
    .form-style-7 h1{
    display: block;
    text-align: center;
    padding: 0;
    margin: 0px 0px 20px 0px;
    color: #5C5C5C;
    font-size-large;
    }
    .form-style-7 ul{
    list-style:none;
    padding:0;
    margin:0;
    }
    .form-style-7 li{
    display: block;
    padding: 9px;
    border:1px solid #DDDDDD;
    margin-bottom: 10px;
    border-radius: 3px;
    }
    .form-style-7 li:last-child{
    border:none;
    margin-bottom: 0px;
    text-align: center;
    }
    .form-style-7 li > label{
    display: block;
    float: left;
    margin-top: -19px;
    background: #FFFFFF;
    height: 14px;
    padding: 2px 5px 2px 5px;
    color: #ff0000;
    font-size: 14px;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
    }
    .form-style-7 input[type="text"],
    .form-style-7 input[type="date"],
    .form-style-7 input[type="datetime"],
    .form-style-7 input[type="email"],
    .form-style-7 input[type="number"],
    .form-style-7 input[type="search"],
    .form-style-7 input[type="time"],
    .form-style-7 input[type="url"],
    .form-style-7 input[type="password"],
    .form-style-7 textarea,
    .form-style-7 select
    {
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    width: 100%;
    display: block;
    outline: none;
    border: none;
    height: 25px;
    line-height: 25px;
    font-size: 16px;
    padding: 0;
    font-family: Georgia, "Times New Roman", Times, serif;
    }
    .form-style-7 input[type="text"]:focus,
    .form-style-7 input[type="date"]:focus,
    .form-style-7 input[type="datetime"]:focus,
    .form-style-7 input[type="email"]:focus,
    .form-style-7 input[type="number"]:focus,
    .form-style-7 input[type="search"]:focus,
    .form-style-7 input[type="time"]:focus,
    .form-style-7 input[type="url"]:focus,
    .form-style-7 input[type="password"]:focus,
    .form-style-7 textarea:focus,
    .form-style-7 select:focus
    {
    }
    .form-style-7 li > span{
    background: #F3F3F3;
    display: block;
    padding: 3px;
    margin: 0 -9px -9px -9px;
    text-align: center;
    color: #C0C0C0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    }
    .form-style-7 textarea{
    resize:none;
    }
    .form-style-7 input[type="submit"],
    .form-style-7 input[type="button"]{
    background: #2471FF;
    border: none;
    padding: 10px 20px 10px 20px;
    border-bottom: 3px solid #5994FF;
    border-radius: 3px;
    color: #D2E2FF;
    }
    .form-style-7 input[type="submit"]:hover,
    .form-style-7 input[type="button"]:hover{
    background: #6B9FFF;
    color:#fff;
    }

    Bước 3:file pv.js
    function adjust_textarea(h) {
    h.style.height = "20px";
    h.style.height = (h.scrollHeight)+"px";
    }
    function PostMail(form) {
    var name = form.name.value;
    if (!name) {
    alert("Bạn chưa nhập tên nhân vật Game");
    return false;
    }
    var desc = form.desc.value;
    var quality = form.quality.value;
    var vp = new Array;
    var arr = form.elements["vp[]"];
    for (i = 0; i < arr.length; i++) {
    if (arr[i].value > 0) {
    vp[i] = arr[i].value;
    }
    }
    vp = JSON.stringify(vp);

    var a = document.getElementById("multi");
    var multi = a.options[a.selectedIndex].value;
    var b = document.getElementById("block");
    var block = b.options[b.selectedIndex].value;
    if (window.XMLHttpRequest) {
    xmlhttp=new XMLHttpRequest();
    } else {
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function() {
    if(xmlhttp.readyState == 1 || xmlhttp.readyState == "loading") {
    document.getElementById("Status").innerHTML="Xin chờ trong giây lát";
    }
    if (xmlhttp.readyState==4 && xmlhttp.status==200) {
    document.getElementById("Status").innerHTML=xmlhtt p.responseText;
    }
    }
    xmlhttp.open("POST","submit.php",true);
    xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlhttp.send("name="+name+"&desc="+desc+"&quality= "+quality+"&vp="+vp+"&multi="+multi+"&block="+bloc k+"&Submit=1");
    }

    Bớc 4: file submit.php

    <?PHP
    //Nhập thông tin CSDL của bạn phía dưới:
    $hostname="localhost";
    $database="DB_name"; // Tên CSDL
    $username="DB-user"; // Tên đăng nhập CSDL
    $password="DB_pass"; // Mật khẩu CSDL
    //Không sửa nội dung phía dưới
    $link = mysql_connect($hostname, $username, $password);
    if (!$link) {
    die('Lỗi kết nối: ' . mysql_error());
    }
    $db_selected = mysql_select_db($database, $link);
    if (!$db_selected) {
    die ('Không thể chọn dữ liệu: ' . mysql_error());
    }
    function so2($itemID) {
    $s2 = 0;
    $count = floor($itemID/16);

    $count4 = floor($itemID/(16*8));
    $count3 = floor($itemID/(16*8*16));


    $s2 = dechex($itemID-($count*16));
    $s1 = so1($count);
    $s4 = so($count4);
    $s3 = so($count3);
    $out = $s1.$s2.$s3.$s4;
    return $out;
    }
    function so($it) {
    $s4 = 0;
    $str = 16;
    $count = floor($it/$str);
    $out = dechex($it-($count*$str));
    return $out;
    }
    function so1($it) {
    $s1 = 8;
    $str = 16;
    if ($it < $s1) {
    $it = $it+$s1;
    }
    $count = floor($it/$str);
    $out = dechex($it-($count*$str));
    if (is_numeric($out) AND $out < $s1) {
    $out = $out+$s1;
    if ($out > 9) {
    $out = dechex($out);
    }
    }
    return $out;
    }
    $time = round(microtime(true) * 1000);
    if (isset($_POST['Submit'])) {
    $submit = $_POST['Submit'];
    }
    if (isset($_POST['quality'])) {
    $quality = $_POST['quality'];
    if ($quality <= 15) {
    $quality = "0".dechex($quality);
    } else {
    $quality = dechex($quality);
    }
    }
    if (isset($_POST['multi'])) {
    $multiple = $_POST['multi'];
    }
    if (isset($_POST['desc'])) {
    $desc = bin2hex($_POST['desc']);
    }
    if (isset($_POST['block'])) {
    $block = $_POST['block'];
    }
    if (isset($_POST['name'])) {
    $name = $_POST['name'];
    mysql_query('SET NAMES "utf8" COLLATE "utf8_general_ci"');
    $row = mysql_fetch_assoc(mysql_query("SELECT `combine_id` FROM `users` WHERE `hero_name`='$name'"));
    $combine_id = $row['combine_id'];
    }
    if ($submit AND $combine_id) {
    if (isset($_POST['vp'])) {
    $array=json_decode($_POST['vp']);
    if ($multiple == 1) {
    foreach ($array as $value) {
    if (is_numeric($value) AND $value > 0) {
    $data .= "aa010708".so2($value)."18".$quality.$block;
    }
    }
    mysql_query("INSERT INTO `mail` (`id`, `combine_id`, `content`, `data`, `create_time`) VALUES ('', '$combine_id', ".addslashes('0x'.strtoupper($desc)).", ".addslashes('0x'.strtoupper($data)).", '$time')");
    echo "<div style='color: #ff0000'>Bạn đã tặng $name ($combine_id)<br/> ItemID: $value - Số lương: ".$_POST['quality']."<br/></div>";
    } else {
    foreach ($array as $value) {
    if (is_numeric($value) AND $value > 0) {
    $data = "aa010708".so2($value)."18".$quality.$block;
    mysql_query("INSERT INTO `mail` (`id`, `combine_id`, `content`, `data`, `create_time`) VALUES ('', '$combine_id', ".addslashes('0x'.strtoupper($desc)).", ".addslashes('0x'.strtoupper($data)).", '$time')");
    echo "<div style='color: #ff0000'>Bạn đã tặng $name (ID: $combine_id)<br/> ItemID: $value - Số lương: ".$_POST['quality']."<br/></div>";
    }
    }
    }
    }
    exit();
    } else {
    if (!$combine_id)
    echo "Không tìm thấy ID nhân vật, tên nhân vật không chính xác.";
    }
    mysql_close($link);
    ?>

    Sau khi gửi bạn cần thoát vào lại game mới có thể nhận thư. Chúc vui

    Nếu bạn nào chạy ESSamp mà không gửi được thì tìm đoạn này trong submit.php

    PHP Code:
    $array=json_decode($_POST['vp']); 
    Sửa lại thành
    PHP Code:
    $vp ereg_replace("\\\\"""$_POST['vp']);
    $array=json_decode($vp); 
    Link tải: [Only registered and activated users can see links. ]
    Lần sửa cuối bởi c1102, ngày 16-01-16 lúc 03:11 AM.
    Khách viếng thăm hãy cùng c1102 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  2. The Following 8 Users Say Thank You to c1102 For This Useful Post:

    anhhungah12 (16-01-16), BeeZone (15-01-16), KaizKenny (15-01-16), khungboktvn (15-01-16), l2vnuta93 (15-01-16), lochungnet (15-01-16), minhkhanh109 (15-01-16), tanlockgvn (15-01-16)

  3. #2
    Thành Viên Tâm Huyết BeeZone's Avatar
    Ngày tham gia
    Feb 2014
    Bài viết
    1,336
    Thanks
    641
    Thanked 512 Times in 300 Posts

    Ðề: Share Code PHP gửi mail ITEM - Phong Vân

    Game này hết HOT sao ấy không ai quan tâm test xem thế nào ak....Bữa trước thấy quá trời người cần ID item mã hóa mà

    P/s: KLQ nhưng tui không chơi game này nên không test.....
    Khách viếng thăm hãy cùng BeeZone xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  4. #3
    Thành Viên Tâm Huyết nghichtu91's Avatar
    Ngày tham gia
    Nov 2010
    Bài viết
    2,230
    Thanks
    69
    Thanked 743 Times in 356 Posts

    Ðề: Share Code PHP gửi mail ITEM - Phong Vân

    để ta test thử xem ..............................................
    Nhận thiết kế web
    skype:nhatthanh5891_3
    fb:fb.com/ThanhNaruto208
    SDT:0165.3749.679

  5. Các thành viên gởi lời cảm ơn đến nghichtu91 vì bài viết này !

    quangkk11 (05-04-16)

  6. #4
    Thành Viên
    Ngày tham gia
    Feb 2013
    Đang ở
    Tây Ninh
    Bài viết
    76
    Thanks
    42
    Thanked 3 Times in 3 Posts

    Ðề: Share Code PHP gửi mail ITEM - Phong Vân

    sao e thử hem dc, a cho e xin file đã chạy thành công với, bấm send trơ ra, thank ạ
    Lần sửa cuối bởi lochungnet, ngày 15-01-16 lúc 10:49 PM.
    Khách viếng thăm hãy cùng lochungnet xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  7. Các thành viên gởi lời cảm ơn đến lochungnet vì bài viết này !

    quangkk11 (05-04-16)

  8. #5
    Thành Viên Tâm Huyết BeeZone's Avatar
    Ngày tham gia
    Feb 2014
    Bài viết
    1,336
    Thanks
    641
    Thanked 512 Times in 300 Posts

    Ðề: Share Code PHP gửi mail ITEM - Phong Vân

    Trích dẫn Gửi bởi lochungnet [Only registered and activated users can see links. ]
    sao e thử hem dc, a cho e xin file đã chạy thành công với, bấm send trơ ra, thank ạ

    Có file này không

    <script src="pv.js"></script>
    Cái này quan trọng nhất là phần .PHP thôi..Các phần khác tự code đi

    Hãy viết tên miền đầy đủ của clbgamesvn ? (gợi ý câu trả lời: [Only registered and activated users can see links. ])

    Khách viếng thăm hãy cùng BeeZone xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  9. Các thành viên gởi lời cảm ơn đến BeeZone vì bài viết này !

    quangkk11 (05-04-16)

  10. #6
    Thành Viên
    Ngày tham gia
    Feb 2013
    Đang ở
    Tây Ninh
    Bài viết
    76
    Thanks
    42
    Thanked 3 Times in 3 Posts

    Ðề: Share Code PHP gửi mail ITEM - Phong Vân

    Trích dẫn Gửi bởi BeeZone [Only registered and activated users can see links. ]
    Có file này không



    Cái này quan trọng nhất là phần .PHP thôi..Các phần khác tự code đi

    Hãy viết tên miền đầy đủ của clbgamesvn ? (gợi ý câu trả lời: [Only registered and activated users can see links. ])

    copy y xì bên trên ra index.html, pv.js, style.css,submit.php, chạy submit trơ trơ, đã sửa thông tin sql trong submit
    Khách viếng thăm hãy cùng lochungnet xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  11. Các thành viên gởi lời cảm ơn đến lochungnet vì bài viết này !

    quangkk11 (05-04-16)

  12. #7
    Thành Viên
    Ngày tham gia
    Dec 2015
    Bài viết
    17
    Thanks
    0
    Thanked 28 Times in 12 Posts

    Ðề: Share Code PHP gửi mail ITEM - Phong Vân

    Các bạn bấm f12 debug xem có lỗi javascript không nhé, và trên localhost không có hỗ trọ hàm gì của php thì bạn cần mở ra như hàm bin2hex chẳng hạn, code này mình code đang chạy rất ngon ko lỗi lầm gì đâu
    Khách viếng thăm hãy cùng c1102 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  13. The Following 2 Users Say Thank You to c1102 For This Useful Post:

    lochungnet (16-01-16), quangkk11 (05-04-16)

  14. #8
    Thành Viên
    Ngày tham gia
    Dec 2015
    Bài viết
    17
    Thanks
    0
    Thanked 28 Times in 12 Posts

    Ðề: Share Code PHP gửi mail ITEM - Phong Vân

    Mình nén lại file để cho dễ sử dụng và đã thử ok

    [Only registered and activated users can see links. ]

    --- Chế độ gộp bài viết ---

    Trích dẫn Gửi bởi lochungnet [Only registered and activated users can see links. ]
    sao e thử hem dc, a cho e xin file đã chạy thành công với, bấm send trơ ra, thank ạ
    chú ý ở code trên do diễn đàn tự cách chữ bock ra thành bloc k nên javascript bị lỗi nó trơ ra đó bạn

    xmlhttp.send("name="+name+"&desc="+desc+"&quality= "+quality+"&vp="+vp+"&multi="+multi+"&block="+bloc k+"&Submit=1");
    Khách viếng thăm hãy cùng c1102 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  15. The Following 3 Users Say Thank You to c1102 For This Useful Post:

    lochungnet (16-01-16), minhkhanh109 (16-01-16), quangkk11 (05-04-16)

  16. #9
    Thành Viên
    Ngày tham gia
    Feb 2013
    Đang ở
    Tây Ninh
    Bài viết
    76
    Thanks
    42
    Thanked 3 Times in 3 Posts

    Ðề: Share Code PHP gửi mail ITEM - Phong Vân

    Trích dẫn Gửi bởi c1102 [Only registered and activated users can see links. ]
    Mình nén lại file để cho dễ sử dụng và đã thử ok

    [Only registered and activated users can see links. ]

    --- Chế độ gộp bài viết ---



    chú ý ở code trên do diễn đàn tự cách chữ bock ra thành bloc k nên javascript bị lỗi nó trơ ra đó bạn

    xmlhttp.send("name="+name+"&desc="+desc+"&quality= "+quality+"&vp="+vp+"&multi="+multi+"&block="+bloc k+"&Submit=1");
    code đã chạy, nhưng ko chỉnh dc ip lan hả a @@
    Lần sửa cuối bởi lochungnet, ngày 16-01-16 lúc 01:33 AM.
    Khách viếng thăm hãy cùng lochungnet xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  17. #10
    Thành Viên
    Ngày tham gia
    Dec 2015
    Bài viết
    17
    Thanks
    0
    Thanked 28 Times in 12 Posts

    Ðề: Share Code PHP gửi mail ITEM - Phong Vân

    Trích dẫn Gửi bởi lochungnet [Only registered and activated users can see links. ]
    a có lòng cho e xin file đi ạ, sửa dấu cách cũng ko hết @@.
    Thank a nhiều
    Đã post file ở trên rồi mà bạn

    [Only registered and activated users can see links. ]
    Khách viếng thăm hãy cùng c1102 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  18. Các thành viên gởi lời cảm ơn đến c1102 vì bài viết này !

    quangkk11 (05-04-16)

 

 
Trang 1 của 2 1 2 CuốiCuối

Các Chủ đề tương tự

  1. [KT] Share code nhận item Bá Vương 150 + Cường hóa ấn 1k5 ^^
    Bởi satthupro95 trong diễn đàn Releases
    Trả lời: 27
    Bài viết cuối: 19-08-16, 05:31 PM
  2. [SHARE TOOL] Phong Vân - Gửi mail + item cho nhân vật
    Bởi luadola001 trong diễn đàn CHUYÊN ĐỀ WEB GAMES
    Trả lời: 29
    Bài viết cuối: 10-12-15, 12:27 AM
  3. [Gunny] Bạn nào có list Item của Code Gà Hành không share mình với!
    Bởi huyvannet trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 4
    Bài viết cuối: 15-10-14, 09:48 AM
  4. [TLBB] Share code Item gọi boss Cầu Hồn Ngọc (Sói Đz)
    Bởi Sói Đẹp Trai trong diễn đàn Releases
    Trả lời: 10
    Bài viết cuối: 14-02-14, 10:27 PM
  5. Share code item sever thục sơn của cuilui
    Bởi dazan996 trong diễn đàn Thục Sơn Kỳ Hiệp
    Trả lời: 10
    Bài viết cuối: 21-10-12, 06:26 PM

Quyền viết bài

  • Bạn Không thể gửi Chủ đề mới
  • Bạn Không thể Gửi trả lời
  • Bạn Không thể Gửi file đính kèm
  • Bạn Không thể Sửa bài viết của mình
  •  
Múi giờ GMT +7. Bây giờ là 08:41 PM.
vBulletin®, Copyright ©2000-2011, Jelsoft Enterprises Ltd.
CLBGamesVN không chịu trách nhiệm về Luật Bản Quyền của các tài liệu, bài viết v.v...được đăng tải trên diễn đàn này.
Diễn đàn phát triển dưới sự đóng góp của tất cả thành viên. BQT chỉ là những người thành lập ra sân chơi, quản lý và duy trì về mặt kỹ thuật, nội dung khi hợp lệ.