Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by samowns

  1. Ok bro i create telegram bot and i want to response to connect or response the bot through php ..please find the solution
  2. use mysqli //your must include your database file $q="SELECT * FROM table_name "; $ok=mysqli_query($con,$q); while($raq=mysqli_fetch_array($ok)){ <td><?php echo $raq[0];?></td>//Here u want to echo any row <?php }?>//Loop Close here
  3. Hello member's please check my code i set weebhook aleady but bot didnt respond <?php $input= file_get_contents('php://input'); $update= json_decode($input); $message=$update->message; $chat_id=$message->chat->id; $text=$message->text; $token='key'; file_get_contents("https://api.telegram.org/bot$token/sendMessage?chat_id=$chat_id&text=$text"); ?>
  4. i figure out Thanx elseif (!$_POST["name"] or ["name"] == '0' ){ $sq1=mysqli_query($a,$sq); echo "Not Please Select Name Please"; }
  5. Please Tell me how am new to php
  6. Hello Guys My code runs fine but value null is inserting if some one dint select any list name . So wot i want if some one did not select any option query did not run $error shows Here is my code please check and figure it out <?php $error=""; include "db.php"; if(isset($_POST['bt'])){ $date=Date("Y-m-d H:i:s"); $b=$_POST['name']; $res=$_POST['res']; if(!$_POST["res"]){ } if(!$_POST["name"]){ } // Declare variable if(!$_POST["name"] or ["name"] == '' ) { $error .= "Must select the name.<br />";// If not selected, add string to error message } if(!$_POST["res"] ){ $error .= "Must Enter the Reason.<br />"; // If not Enter, add string to error message } else{ $sq="insert into att(name,date,res)values('$b','$date','$res')"; $sq1=mysqli_query($a,$sq); echo "Ok"; // } } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title></title> <link rel="stylesheet" href=""> </head> <body> <form action="pres.php" method="post" accept-charset="utf-8"> <select name="name" > <option value="" >Choose...</option> <option value="mandeep" >Maneep</option> <option value="sahiba" >Sahiba</option> </select> </select> <input type="text" name="res"> <input type="submit" name="bt" value="Ok"> <br> <?php echo"". $error;?> </form> </body> </html>
  7. i want to embed Bann Script or user deactive or active <?php session_start(); $message=""; ?> <?php include "db.php"; $msg=''; if(isset($_POST['sb'])) { $time=time()-30; $ip_address=getIpAddr(); $name = mysqli_real_escape_string($a, $_POST['eml']); $pass = mysqli_real_escape_string($a, $_POST['pass']); $query=mysqli_query($a,"select count(*) as total_count from loginlogs where TryTime > $time and IpAddress='$ip_address'"); $check_login_row=mysqli_fetch_assoc($query); $total_count=$check_login_row['total_count']; //Checking if the attempt 3, or youcan set the no of attempt her. For now we taking only 3 fail attempted if($total_count==3){ $msg="To many failed login attempts. Please login after 30 sec"; }else{ //Getting Post Values $result=mysqli_query($a,"SELECT * FROM admin WHERE eml='$name' and pass= '$pass'"); $row = mysqli_fetch_assoc($result); $row=mysqli_num_rows($result); //ban user if($row==1) { $_SESSION['user_name'] =$name; header("location:wel.php?msg=Scuessfull eml"); mysqli_query($a,"delete from loginlogs where IpAddress='$ip_address'"); } else{ $total_count++; $rem_attm=4-$total_count; if($rem_attm==0){ $msg="To many failed login attempts. Please login after 40 sec"; }else{ $msg="<b>Please enter valid login details.<br/>$rem_attm attempts remaining <b>"; } $try_time=time(); mysqli_query($a,"insert into loginlogs(IpAddress,TryTime) values('$ip_address','$try_time')"); } }} if(isset($_SESSION['user_name']) ){ header("location:wel.php?msg=Scuessfull "); ?> <?php } ?> <form class="login-form" action="adminscure.php" method="post" > <div class="message"><?php if($message!="") { echo $message; } ?></div> <body id="LoginForm"> <div class="container"> <div class="main-div"> <div class="panel"> <h2>Admin Login</h2> <p>Please enter your email and passwords</p> </div> <form id="Login"> <div class="form-group"> <input type="name" name="eml" class="form-control" id="eml" placeholder="name"> </div> <div class="form-group"> <input type="password" name="pass" class="form-control" id="pass" placeholder="Password"> </div> <div> <input type="submit" name="sb" class="btn btn-primary"> <div id="result"><?php echo $msg?></div> </div> </form> <?php function getIpAddr(){ if (!empty($_SERVER['HTTP_CLIENT_IP'])){ $ipAddr=$_SERVER['HTTP_CLIENT_IP']; }elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){ $ipAddr=$_SERVER['HTTP_X_FORWARDED_FOR']; }else{ $ipAddr=$_SERVER['REMOTE_ADDR']; } return $ipAddr; }?>
  8. I want to know that if i login as admin wel.php open and if i want to login as mod so mod.php open programs runs fine but when i login as admin or mod same session work i want different page scure
  9. <!DOCTYPE html> <html> <head> <style type="text/css" media="screen"> .ss { border-width: 1px; border-style:solid; width: 100px; height: 100px; </style> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title></title> <link rel="stylesheet" href=""> </head> <body> <form action="index.php" method="post"> <table align="center" class="ss"> <tr> <td>Name<input type="text" name="name"> </td> </tr> <tr> <td>Pass&nbsp:<input type="password" name="pass"> </td> </tr> <tr> <td>Email<input type="text" name="eml"> </td> <tr> <td><input type="submit" name="sb"> </td> </table> </form> </body> </html> <?php include "db.php"; session_start(); if(isset($_POST['sb'])) { $name=mysqli_real_escape_string($con, $_POST['eml']); $pass=mysqli_real_escape_string($con, $_POST['pass']); $usr=mysqli_real_escape_string($con,'user'); $std='std'; $type='admin'; $qer="select * from users where eml='$name' AND pass='$pass' AND type='$type'"; $sql=mysqli_query($con,$qer); $qer=" select * from users where eml='$name' AND pass='$pass' AND type='$std'"; $sql1=mysqli_query($con,$qer); $qer=" select * from users where eml='$name' AND pass='$pass' AND type='$usr'"; $sql3=mysqli_query($con,$qer); $fe=mysqli_fetch_array($sql); if(is_array($fe)) { $name=$name; $pass=$pass; { header("location:wel.php?msg=Scuessfull login"); } echo "Admin of this site"; } else if($fe=mysqli_fetch_array($sql1)){ if(is_array($fe)) $name=$name; $pass=$pass; echo "Moderator of the site"; { header("location:mod.php?msg=Scuessfull login"); } } else if($fe=mysqli_fetch_array($sql3)){ if(is_array($fe)) $name=$name; $pass=$pass; $_SESSION['eml'] =true; header("location:sim.php?msg=Scuessfull login"); echo "Simple user this site"; } else { echo "invalid pass"; } } ?>
  10. Hello guys am using mysql . login admin panel works fine .but when i use password=1' or '1' = '1 its also working some one please help me i want to safe admin panel here is my code if(isset($_POST['sb'])) { $result = mysql_query("SELECT * FROM admin WHERE eml='" . $_POST["eml"] . "' and pass= '". $_POST["pass"]."'"); $row = mysql_fetch_array($result); if(is_array($row)) { $_SESSION["eml"] = $row['eml']; hash($_SESSION["pass"] = $row['pass']; } else { $message = "<font color='#FF0000'>"."Invalid Username or Password!"."</font>"; } } if(isset($_SESSION["eml"])) { header("Location:./useradmin.php"); }
  11. query runs f9 but sir instead of 1 n 0. i want if 1 fees pending .if 0 no fees pending
  12. here is loginact.php i just want if user login see the profile restriction means if admin login they can change ..i think i need to put one field 'type' admin or user..plz somone figure out..am new to sql this code is running <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <link href="css/style.css" rel="stylesheet"> <head> <style> .red { color:#F00; font-size:15px; } </style> <?php include "header.php";?> <?php include ("db.php"); $error=""; ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head><?php session_start(); ?> <?php if(isset($_POST['sb'])) { $a=$_POST ['eml']; $b=$_POST['pass']; $c="select * from users where eml='$a' && pass='$b'"; $s=mysql_query ($c); $row=mysql_num_rows($s); if($row==1 ) { $_SESSION['eml']=$a; header("location:fetch.php?msg=Scuessfull login"); } else{ $error= "Invalid Email or Password *"; } } ?> </head> <body><?php if(isset($_GET['logout'])) { session_unregister('eml'); } ?> <h3>Admin Login </h3> <div class="usr"> <form action="loginact.php" method="post" required="required"> <div class="col-lg-6"><div class="input-group"> Email id<input type="text" class="form-control" name="eml" required="required"/> <br /> <div class="red"><?php if($error!="") { echo $error; } ?></div> Password<input type="password" class="form-control" name="pass" required="required"/><br /> <input style="width:100px;" class="btn-success k" type="submit" name="sb" value="Login"/> </form> </div> </body> </html>
  13. if you r using skype so logout skype n hide then ur server ill show green light .i was having same problem
  14. sir fees based on monthly charges....
  15. tnx bro i can implement ur code <3
  16. i got ur point sir...wot should i do ..u i need one table more? name fees history...plz help i got your point sir..
  17. sir i use tigger for updating fees...i jus want in my admiin area to flash those users with there pending fees. suposse id 1 simran..join date 7-10-2015 after 7-11-205 auto reminder in admin area 'id 1 simran fees is pending'
  18. hello guyz am newbie in mysql php..i want if any user register. in my admin area there is reminder of fees .like id 1 simran join date 7-10-2015 after 30 days in my admin area reminds simran's fees is pending..any one plz help me ...thnxx in advance here is table name users
  19. samowns


    Hello guyz am new here .. i love php am biginner in php so i find this forum
  • 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.