-
Posts
88 -
Joined
-
Last visited
Everything posted by AzeS
-
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'); } } ?>">
-
I going with VARCHAR for now... i let this thread open for thruther suggestions
-
changed that, im sorry, i cant decide between stack and stock But in genaral it works, but not with the negative value
-
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.
-
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
-
like a differrent sender each time or what ?
-
`stock` int(5) DEFAULT NULL ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=latin1 Better ?
-
That will help me out xD
-
dbtest.items.stock015129171.50004.5000ENUM('0','15')
-
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; }
-
http://stackoverflow.com/questions/17242346/php-session-lost-after-redirect
-
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.
-
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 }
-
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.
-
I'ts solved now, thanks again !
-
Still not working $this->date = new DateTime(date("d.m.Y")); private function set_interval($data) { $interval = new DateInterval("P{$data}D"); return $interval; } echo $this->date->add($this->set_interval($del_tim_holder_1[count($del_tim_holder_1)] * 7)->format("d.m.Y"))
-
i have a system that deletes files after a certain time so that the dir wont get flooded with files... but anyway, im trying to add the lifespan of a file based on its size to the current date, so that the server knows exactly wenn to delete those files... so lets say the file need's to be deletet in 21 days i try'd to handle it this way... $del_tim_holder_0 = 21; $del_tim = date("d.m.Y", date("d.m.Y") + ($del_tim_holder_0 * 7 * 86400)); but it just shows 01.01.1970 i want to mention that in the original code it is an string that' been converted to an array for the actual amount of days to choose from... and as for the amount of files it chooses what fits in the most practical way... #for example: $del_tim_holder_0 = "15:18:21"; $del_tim_holder_1 = split(":", $del_tim_holder_0); $del_tim .= date("d.m.Y", date("d.m.Y") + ($del_tim_holder_1[count($del_tim_holder_1)] * 7 * 86400)); any suggestions ?
-
I am trying to intigrate a payment system for a shop since days, not so difficult, but I fail miserably I simply lack the professional know how, it is a small question but how do I use an sdk? How can I access this at all? Or how does it work with cURL exactly? I hope someone of you has already experience with it and can help a hobby coder like me. https://github.com/boehsermoe/Payone-PHP-SDK https://github.com/fjbender/simple-php-integration
-
Thanks for this helpful answer, I will immediately try to imply this and post the result at completion. I leave the thread open if further suggestions are present. Thanks Jacques.
-
I am trying to imitate the hashset function of Visual Basic. For this of course, I must declare a variable globally and here it begins to fail already; I have tried it without the interpreter global but also here it does not work at all.You might have better suggestions as I could immit, or even improvements for the code? I look forward to answers and suggestions for improvement. <?php /** * */ global $Hashset = array(); class stimpackZ { public function hash_add($NAME,$DATA) { if ($NAME = 0) { $name_of_hash = count($Hashset) + 1; global $Hashset[$name_of_hash] = $DATA; echo $name_of_hash; return 1; } else { $name_of_hash = $NAME; $Hashset[$name_of_hash] = $DATA; return 1; } } public function hash_create($NAME) { } public function hash_get() { return $Hashset; } public function hash_cls() { global $Hashset = null; global $Hashset = array(); return 1; } public function hash_del($ARG,$DATA) { switch ($ARG) { case 0: $key = array_search($DATA, global $Hashset); unset(global $Hashset[$key]); return 1; break; case 1: unset(global $Hashset[$DATA]); return 1; break; default: return 0; break; } } public function hash_test() { var_dump(global $Hashset); } } ?>
-
Solved by my self, im sorry, i need to have more patience with my brain.... php if (isset($_POST['btn_exe_det_prf'])) { $id = strip_tags($_POST['btn_exe_det_prf']); $id = trim($id); $reviews = $profile->coment_get($id); echo $id; echo "<script> $(window).Onload(Despair()); </script>"; } Html <div id='myModal'>Some content</div> js <script> // Get the modal var modal = document.getElementById('myModal'); // Get the button that opens the modal var btn = document.getElementById("myBtn"); // Get the <span> element that closes the modal var span = document.getElementsByClassName("close")[0]; // When the user clicks the button, open the modal function Despair() { modal.style.display = "block"; } // When the user clicks on <span> (x), close the modal span.onclick = function() { modal.style.display = "none"; } // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } } </script> solution: php if (isset($_POST['btn_exe_det_prf'])) { $id = strip_tags($_POST['btn_exe_det_prf']); $id = trim($id); $reviews = $Shop->coment_get($id); echo $id; echo "<script> var trigger = 1; </script>"; } html <div id='myModal'>Some content<span>close</span></div> js <script> // Get the modal var modal = document.getElementById('myModal'); // Get the button that opens the modal var btn = document.getElementById("myBtn"); // Get the <span> element that closes the modal var span = document.getElementsByClassName("close")[0]; // When the user clicks the button, open the modal function Despair() { modal.style.display = "block"; } // When the user clicks on <span> (x), close the modal span.onclick = function() { modal.style.display = "none"; } // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } } </script> solution at the end of the script: <script> if (trigger == 1) { $(window).Onload(Despair()); trigger = 0; } </script>
-
im trying to open a modal div after the triggering event from a form, and it doesnt work, soon as i click the button it Flashes briefly anfd then... nothing php if (isset($_POST['btn_exe_det_prf'])) { $id = strip_tags($_POST['btn_exe_det_prf']); $id = trim($id); $reviews = $profile->coment_get($id); echo $id; echo "<script> $(window).Onload(Despair()); </script>"; } js <script> // Get the modal var modal = document.getElementById('myModal'); // Get the button that opens the modal var btn = document.getElementById("myBtn"); // Get the <span> element that closes the modal var span = document.getElementsByClassName("close")[0]; // When the user clicks the button, open the modal function Despair() { modal.style.display = "block"; } // When the user clicks on <span> (x), close the modal span.onclick = function() { modal.style.display = "none"; } // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } } </script>
-
$res = $sql->fetch(PDO::FETCH_ASSOC);
-
Im trying to read two specifec columns from the user profile, i cant read them, i cant return them but evantually i can check them by an if staetment Public function get($ADDRESS) { try { $sql = $this->Db->prepare("SELECT OID,SLEEP FROM profiles WHERE ADDR=:e"); $sql->execute(array(':e' => $ADDRESS)); $res = $sql->fetchAll(); #var_dump($res); echo "S::::-"; echo $res['SLEEP']; echo "-::::EOS"; if (count($res)) { if ($res['SLEEP'] == 1 ) { return 0; } echo "D:::::-"; echo $res["ESTABLISHED_SINCE"]; echo "-:::::EOD"; $OID = $res['OID']; echo ":::::-"; echo $OID; echo "-:::::"; $sql = $this->Db->prepare("SELECT * FROM plout WHERE owner=:e"); $sql->execute(array(':e' => $OID)); $res_get_layout = $sql->fetchAll(); echo "string;:"; var_dump($res_get_layout); if (count($res_get_layout)) { $sql = $this->Db->prepare("SELECT * FROM postss WHERE ownerid=:e AND CANCELED=:f"); $sql->execute(array(':e' => $OID, ':f' => 0 )); $res_get_posts = $sql->fetchAll(); if (count($res_get_posts)) { $stack = array('POSTS' => $res_get_posts, 'LAYOUT' => $res_get_layout); var_dump($stack); return $stack; } else { return 0; # FATAL(REPORT) } } else { return 0; # FATAL(REPORT) } return 1; } else { return 0; } } catch (PDOException $ex) { echo $ex->getMessage(); return 0; }