Jump to content

AzeS

Members
  • Posts

    88
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

2,041 profile views

AzeS's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

7

Community Answers

  1. What am i doing wrong in the code ? i've read that i might do something wrong with the echo phrase, but i don't get what exacatly it is. <input type="Text" name="sen_add_dat_bil_fir" maxlength="200" required="True" placeholder="Firstname" value="<?php if (isset($_SESSION['user'])) { echo $curd->word($userRow['fname_bil'], 'UTF-8'); } else { if (!empty($_SESSION['auto_fill']['bil_adr'])) { echo $crud->word($_SESSION['auto_fill']['bil_adr']['cos_fis'], 'UTF-8'); } } ?>">
  2. I going with VARCHAR for now... i let this thread open for thruther suggestions
  3. changed that, im sorry, i cant decide between stack and stock But in genaral it works, but not with the negative value
  4. Roughly speaking; Locate the emails of the recieving people and remove them, or simplie dont do email lists like : $email_to = "[email protected],[email protected],[email protected]"; in the first place, im no expert in this but, if i would do that, i would create a simple mail funktion and an for each loop that reads an array with all the recievers and then sends them by triggering the function you might use http://php.net/manual/de/class.thread.php if you have a massive ammount of emails.
  5. private function update_item($ID,$QUA) { $sql = $this->db->prepare("SELECT stack,time FROM items WHERE ID=:e"); $sql->execute(array(':e' => $ID)); $res = $sql->fetch(PDO::FETCH_ASSOC); echo $res['stack'] - $QUA; if (count($res)) { if ($res['stack'] == 0 || $res['stack'] > 0 || $res['stack'] - $QUA > 0 || $res['stack'] - $QUA == 0 ) { echo "HERE1"; $sql = $this->db->prepare("UPDATE items SET stack=:f, dod=:g, position=:h WHERE ID=:e"); $pa = $res['time'] + 4; $pb = $res['time'] + 8; $dod = "This item is not there Maybe in. " . $pa . "-" . $pb . " OT's it's there."; $sql->execute(array(':f' => $res['stack'] - $QUA, ':g' => $dod, ':h' => 0, ':e' => $ID)); return 1; } else { echo "HERE1"; $sql = $this->db->prepare("UPDATE items SET stack=:f WHERE ID=:e"); $sql->execute(array(':f' => $res['stack'] - $QUA, ':e' => $ID)); return 1; } } return 0; } Changed that, ill set up an try catch with report as soon as the project is done... Struct: CREATE TABLE `items` ( `ID` int(255) NOT NULL AUTO_INCREMENT, `ESTABLISHED` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `current_owner` int(11) NOT NULL, `revid` int(255) NOT NULL, `itepiclrg` varchar(255) DEFAULT NULL, `itepicsml` varchar(255) DEFAULT NULL, `itename` varchar(90) NOT NULL, `itevalue0` float NOT NULL, `itevalue1` float NOT NULL, `detailsstr` text NOT NULL, `detailssub` text NOT NULL, `weight` int(5) NOT NULL, `original` varchar(3) NOT NULL, `locationid` int(11) NOT NULL, `dod` text, `position` int(1) DEFAULT NULL, `reward` int(6) DEFAULT NULL, `size` varchar(14) DEFAULT NULL, `stack` int(5) DEFAULT NULL, `time` int(2) DEFAULT NULL, `CANCELED` int(1) NOT NULL DEFAULT '0', `CNCELED_SINCE` datetime DEFAULT NULL, PRIMARY KEY (`PID`) ) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=latin1
  6. like a differrent sender each time or what ?
  7. \--_The Annoying one_--/

  8. `stock` int(5) DEFAULT NULL ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=latin1 Better ?
  9. dbtest.items.stock015129171.50004.5000ENUM('0','15')
  10. Dear Community, I can not make a positive value through subtraction into a negative one. I have already checked the if query itself and the invoice in the execution, I hope you can help me, greetings AzeS. private function update_item($ID,$QUA) { $sql = $this->db->prepare("SELECT stack,time FROM items WHERE ID=:e"); $sql->execute(array(':e' => $ID)); $res = $sql->fetch(PDO::FETCH_ASSOC); echo $res['stack'] - $QUA; if (count($res)) { if ($res['stack'] == 0 || $res['stack'] > 0 || $res['stack'] - $QUA > 0 || $res['stack'] - $QUA == 0 ) { echo "HERE1"; $sql = $this->db->prepare("UPDATE items SET stack=:f AND dod=:g AND position=:h WHERE ID=:e"); $pa = $res['time'] + 4; $pb = $res['time'] + 8; $dod = "This item is not there Maybe in. " . $pa . "-" . $pb . " OT's it's there."; $sql->execute(array(':f' => $res['stack'] - $QUA, ':g' => $dod, ':h' => 0, ':e' => $ID)); return 1; } else { echo "HERE1"; $sql = $this->db->prepare("UPDATE items SET stack=:f WHERE ID=:e"); $sql->execute(array(':f' => $res['stack'] - $QUA, ':e' => $ID)); return 1; } } return 0; }
  11. http://stackoverflow.com/questions/17242346/php-session-lost-after-redirect
  12. https://youtu.be/gfmmpRt8Wk4 Look, in php all seems right to me, but please take a look at PDO i think its much more safe than your stuff, thats my opinion, because if i get able to dump your $conn, $sqli variables youre messed up. the tutorial i posted above covers all your questions so please dont try to be a expert if you arent an expert and learn from google as all people do at the beginning, after that more complex problems accur and then ask questions, its dosent ment to be offensiv. but just an reminder that other people also have questions and theyre much more complex then yours.
  13. ordersys.php public function order_refund_contract_assignment_validation($ref_num,$code) { $sql = $this->db->prepare("SELECT code,attemps FROM refund_keys WHERE reference=:e AND active=:f"); try { $sql->execute(array(':e' => $ref_num, ':f' => 1)); $res = $sql->Fetch(PDO::FETCH_ASSOC); } catch (PDOException $ex) { echo $ex->getMessage(); return 0; } if ($res['code'] == md5($code)) { if ($res['attemps'] != 5) { $sql = $this->db->prepare("SELECT order_pid FROM orderbase WHERE order_id=:e"); try { $sql->execute(array(':e' => $ref_num)); $res = $sql->Fetch(PDO::FETCH_ASSOC); $counter = 0; $procces_list_0 = split("\n", $res['order_pid']); foreach ($procces_list_0 as $row) { if ($row != "") { $current = split(":", $row); $items[$counter] = $current[1]; $items_quant[$counter] = $current[9]; } $counter = $counter + 1; } $counter = 0; $_SESSION['refund_cart'] = array('items' => $items,'quant' => $items_quant); $res['msg'] = "you can now edit your privios cart to assign an refund request."; $res['stmt'] = 1; return $res; } catch (PDOException $ex) { echo $ex->getMessage(); return 0; } } else { $res['msg'] = "due to security reasons the code is not longer valid, please contact the support via email or whapp for fruther information and advise."; $res['stmt'] = 0; return $res; } } else { $sql = $this->db->prepare("UPDATE refund_keys SET attemps=:e WHERE reference=:f"); try { $sql->execute(array(':e' => $res['attemps'] +1, ':f' => $ref_num)); $res = $sql->Fetch(PDO::FETCH_ASSOC); } catch (PDOException $ex) { echo $ex->getMessage(); return 0; } $res['msg'] = "wrong code please try again, you have " . 5 - $res['attemps'] . " attemps left."; $res['stmt'] = 0; return $res; } } activation.php Here i can still dump the session but after the header argument the var gets lost. <?php require_once 'dbconnect.php'; if (isset($_GET['type'])) { var_dump(trim(strip_tags($_GET['type']))); switch (trim(strip_tags($_GET['type']))) { case 0: $_SESSION['refund_code'] = trim(strip_tags($_GET['code'])); $_SESSION['refund_id'] = trim(strip_tags($_GET['id'])); $res = $ordersys->order_refund_contract_assignment_validation(trim(strip_tags($_GET['id'])),trim(strip_tags($_GET['code']))); header("Location: Bestellungen.php?rmsg=" . $res['msg'] . "&list=" . $res['stmt']); # Here it gets lost break; case 1: $res = $ordersys->order_refund_contract_assignment(trim(strip_tags($_SESSION['refund_id'])),trim(strip_tags($_SESSION['refund_code']))); header("Location: Bestellungen.php?rmsg=" . $res); break; case 2: break; default: # code... break; } } ?> <!--<script type="text/javascript"> history.go(-1) </script> <noscript> <?php #header("Location: msg.php?restricted") ?> </noscript> refund.php: if (isset($_POST['adj_ref_car_exe'])) { $ref_car_off_num = trim(strip_tags($_POST['ref_car_off_num'])); $ref_car_dat_qua = trim(strip_tags($_POST['ref_car_dat_qua'])); $_SESSION['refund_cart']['quant'][$ref_car_off_num] = $ref_car_dat_qua; # missing session variable }
  14. Dear Community, I have a problem with declaring an offset from the session, this offset is generated in a function declared as public, so far so good, it consists of two further arrays which are also successfully set, the whole thing is triggered via an activation php Which is called from the original page, now comes the real problem of the whole thing; This offset disappears directly after the header argument in the activating php, what am I doing wrong? It would be a lot of code that I would have to take here, so I ask for theories, links or suggestions which to have to optimize the code. I'm assuming that the varible is lost during the header change. So what are the most common errors that occur when declaring a session? Regards AzeS.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.