Explorar el Código

attempting session data usage

development
mauirixxx hace 8 años
padre
commit
767b29a0b3
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. +2
    -2
      gw-toon.php

+ 2
- 2
gw-toon.php Ver fichero

@@ -1,12 +1,12 @@
<?php <?php
include_once 'gw-connect.php'; include_once 'gw-connect.php';
$con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME); $con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
$userid = 1; //need to actually pull this info from cookie/session (preferable)
$userid = $_SESSION['userid']; //need to actually pull this info from cookie/session (preferable)
$whattoon = mysqli_real_escape_string($con, $_POST['cnameid']); $whattoon = mysqli_real_escape_string($con, $_POST['cnameid']);
if ($con->connect_errno > 0){ if ($con->connect_errno > 0){
die ('Unable to connect to database [' . $db->connect_errno . ']'); die ('Unable to connect to database [' . $db->connect_errno . ']');
} }
if ($whattoon == "0"){
if ($whattoon == "0" or $whattoon == ""){
$sql = "SELECT playerid, charname FROM `playername` WHERE `userid` = '1' ORDER BY `charname` ASC"; //need to make userid a variable $sql = "SELECT playerid, charname FROM `playername` WHERE `userid` = '1' ORDER BY `charname` ASC"; //need to make userid a variable
if (!$result = $con->query($sql)){ if (!$result = $con->query($sql)){
die ('There was an error running the query [' . $con->error . ']'); die ('There was an error running the query [' . $con->error . ']');


Cargando…
Cancelar
Guardar