Mam skrypt , który odpowiada za wygenerowanie i wyłanie hasła na maila. Na komputerze lokalnym skrypt działa normalnie ale jak go wrzuciłem na az.pl to podczas wysyłania maila pojawia sie błąd wykonania skryptu.
Wyświetla sie cos takiego:
"blad w get single shot
w zapytaniu: SELECT username FROM USERS WHERE mail='qweqw@op.pl'"
plik function.php
<?php class funkcje{ function connect_bd(){ $result= new mysqli('localhost', 'root', 'peklo11', 'tmpraca'); if (mysqli_connect_errno() === 0){ $result -> query("SET NAMES 'utf8'"); if (!$result) return false; else { return $result; } } } public function get_single_shot($quest){ $connect=$this->connect_bd(); $result=$connect->query($quest); if ($result->num_rows>0) { $result_array=@$result->fetch_assoc(); return $result_array; } else { return 0; } } } ?>
i skrypt resetpasswd.php
<?php include_once 'function.php'; { $get=new funkcje(); $blad=1; } else { $sql1="SELECT username FROM USERS WHERE mail='$mail'"; $result1=$get->get_single_shot($sql1); $blad=0; }else { $blad=1; } } if ($blad == 0) { $sql2="select active_key, username from USERS where mail='$mail'"; $result=$get->get_single_shot($sql2); if ($result) { $list = "Witaj! <br> <a href='http://aa.pl/kod/veryfication.php?resetpaswd=yes&user=".$result['username']."&active_key=".$result['active_key']."' target='_blank'>http://aa.pl/kod/veryfication.php?resetpaswd=yes&user=".$result['username']."&active_key=".$result['active_key']."</a>"; $headers="From: <m.aa@op.pl>".PHP_EOL; $headers.= 'MIME-Version: 1.0' .PHP_EOL; $headers.="Content-type: text/html; charset=utf-8".PHP_EOL; header('Location: <a href="http://aa.pl/index.php?wyslane=1'%3b%29;" target="_blank">http://aa.pl/index.php?wyslane=1');</a> $ok=1; } else { }}}} if($ok!=1){ ?> <form class="cmxform" id="signupForm" method="post" action="nowe_haslo.php" style='display: inline'> <input type="hidden" name="wyslane" value="TRUE" /> <input type="text" class='style7' id="mail" maxlength="30" required name="mail" /> <input type="submit" class="przycisk" value="Wyślij" /> </form> <?php } ?>