Jump to content

AzeS

Members
  • Posts

    88
  • Joined

  • Last visited

Posts posted by AzeS

  1. Corrected and checked. I want to smash my head in to the keyboard untill it all stops ;-;

    Error: 

    array(3) { ["lead"]=> string(15) "support@web.web" ["comment"]=> string(5) "send:" ["text"]=> string(4) "text" } 
    PDOException: 
    SQLSTATE[HY093]: Invalid parameter number in /var/www/html/**/**.php: 
    1732 Stack trace: #0 /var/www/html/**/**.php(1732): 
    PDOStatement->execute(Array) #1 /var/www/html/**/**/**/**.php(23): 
    **->crm(0, 1, Array) #2 /var/www/html/**/**.php(1): require_once('/var/www/html/C...') #3 {main} 
    Fehler bei migration in die Datenbank, bitte informieren Sie einen Administrator. 05-20-2019 09:31:07

    Error throwing, Adjusted Code:
     

     					try {
      						$sql = $this->Db->prepare("UPDATE ** SET data = CASE WHEN data IS NULL THEN :f ELSE (CONCAT(data,:f)) END WHERE lead=:e");
     						$preset = array(':e' => $data["lead"], ':f' => $data["comment"] . $data["text"]);
     						$sql->execute(array(':e' => $data["lead"], ':f' => $data["comment"] . $data["text"]));
     					} catch (PDOException $e) {
     						$this->report("crm_err: " . $e);
     						return $e . " Fehler bei migration in die Datenbank, bitte informieren Sie einen Administrator. " . $current_date_frep . 									var_dump($data);
     					}

    Initiating Code:

    echo *->crm(0,1,array('lead' => "support@web.web", 'comment' => "send:",'text' => "text")) . "<br>";
    echo *->crm(0,1,array('lead' => "support@web.web", 'comment' => "recv:",'text' => "text")) . "<br>";


    The strange thing is, that there isnt even a number in transfer to the PDO execution, so where does it get the parameter?!

  2. Exception:
    PDOException:
    SQLSTATE[HY093]:
    Invalid parameter number in *.php:1732 Stack trace: #0 *.php(1732):
    PDOStatement->execute(Array)
    #1 crm_for.php(23): *->crm(0, 1, Array) #2 *.php(1):
    require_once('/var/www/html/C...') #3 {main}

    Hello fellow people,

    i need a rant. An error is appearing in my new CRM system. there are No Numeric values in transfer on the pdo statement but the compiler isn't on my side.
    the following SQL Statement is for concating an intitated Null value in the CRM table i have a workaround but its inefficiant and dataconsuming.
    I would like to estimate if there is an null value and overrite it with general text for later sentiment analysis.


    Error throwing Code:

    					try {
      						$sql = $this->Db->prepare("UPDATE *** SET data =(CASE WHEN (NULL) THEN :f ELSE (CONCAT(data,:f)) END) WHERE lead=:e");
     						$preset = array(':e' => $data["lead"], ':f' => $data["comment"] . $data["text"]);
     						$sql->execute(array(':e' => $data["lead"], ':f' => $data["comment"] . $data["text"]));
     					} catch (PDOException $e) {
     						$this->report("crm_err: " . $e);
     						return $e . " Fehler bei migration in die Datenbank, bitte informieren Sie einen Administrator." . $current_date_frep;
     					}
     					return "Ihr Text wurde erfolgreich in die Datenbank migriert, weiter so!" . var_dump($preset);
     					break;

    Initiating Code:

    echo *->crm(0,1,array('lead' => "account", 'comment' => "send:",'text' => "text")) . "<br>";
    echo *->crm(0,1,array('lead' => "account", 'comment' => "recv:",'text' => "text")) . "<br>";

     

  3. 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');
    						}
    						}
    						?>">
    
  4. Roughly speaking; Locate the emails of the recieving people and remove them, or simplie dont do email lists like : $email_to = "jhewitt@amleo.com,some@other.com,yet@another.net"; 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. 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;
    }

  7. 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.

  8. 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
    }
    
  9. 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.

  10. 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 ?

  11. 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.
     
  12. 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);
    	}
    }
    
    ?>
    

     

  13. 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>
    
  14. 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>
    

     

×
×
  • 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.