Skip to content

Instantly share code, notes, and snippets.

<?php
function security($data){
$data=trim($data);
$data=stripcslashes($data);
$data=htmlentities($data);
return $data;
}
$output="";
<?php
function select(){
global $connection;
$query = " SELECT * ";
$query .= " FROM m1 ";
$result = mysqli_query($connection,$query);
while($row=mysqli_fetch_assoc($result)){
$output = $row["id"] ;
$output .= $row["name"] ;
$output .= $row["lastname"];
@netwons
netwons / edit.php
Last active January 18, 2018 09:10
<?php
if(isset($_POST['edit'])){ ///این دکمه edit است
$name=$_POST['name'];
$lastname=$_POST['lastname'];
$update=" UPDATE m1 SET name='$name', lastname='$lastname' WHERE id=" . $_GET['idq'];
$up=mysqli_query($connection,$update);
if($up){
header("Location: select.php");
}else{echo "error";}
<?php
if(isset($_GET['idq'])){
$query=" SELECT * FROM m1 WHERE id=" .$_GET['idq'];
$result =mysqli_query($connection,$query);
$row=mysqli_fetch_assoc($result);
}
<?php
if(isset($_POST['login'])){
$username=mysqli_real_escape_string($connection,$_POST['username']);
$password=mysqli_real_escape_string($connection,$_POST['password']);
$query=" SELECT * FROM register WHERE username='$username' password='$password' ";
echo $query;
$result=mysqli_query($connection,$query);
$d=encript($password);
<?php
$username=$_POST['username'];
$password=$_POST['password'];
//$d=encript($password);
$query=" SELECT * FROM register WHERE username='$username' AND password='$password'";
echo $query;
$result=mysqli_query($connection,$query);
$count=mysqli_num_rows($result);
if($count==1){
Problem 1
- Installation request for calcinai/xero-php ^1.7 -> satisfiable by calcinai/xero-php[v1.7.0].
- calcinai/xero-php v1.7.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php/7.0/cli/php.ini
- /etc/php/7.0/cli/conf.d/10-opcache.ini
- /etc/php/7.0/cli/conf.d/10-pdo.ini
- /etc/php/7.0/cli/conf.d/15-xml.ini
- /etc/php/7.0/cli/conf.d/20-calendar.ini
Problem 1
- Installation request for calcinai/xero-php ^1.7 -> satisfiable by calcinai/xero-php[v1.7.0].
- calcinai/xero-php v1.7.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php/7.0/cli/php.ini
- /etc/php/7.0/cli/conf.d/10-opcache.ini
- /etc/php/7.0/cli/conf.d/10-pdo.ini
- /etc/php/7.0/cli/conf.d/15-xml.ini
- /etc/php/7.0/cli/conf.d/20-calendar.ini
@netwons
netwons / index.html
Created April 7, 2019 15:08
InvalidHLS
<html>
<head>
<!-- Load dependent stylesheets. -->
<link href="//aws-cdn.terrafox.com/videojs/latest/video-js.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-ads/6.6.1/videojs-contrib-ads.css" />
<link rel="stylesheet" href="//googleads.github.io/videojs-ima/dist/videojs.ima.css" />
</head>
<body>
<video id="content_video" class="video-js vjs-default-skin"
@netwons
netwons / GoogleDriveServiceProvider.php
Created December 15, 2020 13:58 — forked from sergomet/GoogleDriveServiceProvider.php
Setup a Laravel Storage driver with Google Drive API
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class GoogleDriveServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.