소스 검색

starting to grab section specific POST data

development
mauirixxx 8 년 전
부모
커밋
50e21fe8ba
1개의 변경된 파일13개의 추가작업 그리고 4개의 파일을 삭제
  1. +13
    -4
      gw-insert.php

+ 13
- 4
gw-insert.php 파일 보기

@@ -1,12 +1,21 @@
<?php
include_once 'gw-connect.php';
$con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
//post data section
# just testing max gold value - should be 9999
$gold = $_POST['droppedgold'];
#non-section specific POST data here
$gold = mysqli_real_escape_string($con, $_POST['droppedgold']); //how much gold dropped
$droptype = mysqli_real_escape_string($con, $_POST['droptype']); //this dictates if the drop was a weapon/rune/material
$locid = mysqli_real_escape_string($con, $_POST['location']); //this is `treasurelocation`.`treasureid` in the database
echo 'The droptype variable is set to ' . $droptype . '<BR />';
if ($droptype == 1){
$rarity = mysqli_real_escape_string($con, $_POST['rare']);
echo 'a '. $rarity . ' drop was a weapon!<BR />';
} else if ($droptype == 2){
echo 'drop was a rare material!<BR />';
} else if ($droptype == 3){
echo 'drop was a rune!<BR />';
} else {
echo 'No data was sent!<BR />';
}
# all of the below will go away soon
echo 'The locid variable is set to ' . $locid . '<BR />';
echo 'The amount of gold dropped was ' . $gold . '<BR />';
echo '<BR />Return to <A HREF="gw-record.php">data recording</A> page';

불러오는 중...
취소
저장