don't use $_POST superglobal
Jan 28, 2022
3
Level 1
Undefined index: imei
I WANT TO fix this probelm Blade.view
@extends('admin.layouts.app')
@section('panel')
<center>
<form method="POST" action="" style="margin-top:5%">
<p><input type="text" style="padding: 15px 10px 10px; font-family: 'Source Sans Pro',arial,sans-serif; border: 1px solid #cecece; color: black;box-sizing: border-box; width: 50%; max-width: 500px;" name="imei" autocomplete="off" maxlength="50" placeholder="Write here IMEI or SN"></p>
<select name="service" id="service" style="padding: 15px 10px 10px; font-family: 'Source Sans Pro',arial,sans-serif; border: 1px solid #cecece; color: black;box-sizing: border-box; width: 50%; max-width: 500px;">
<option value="0" selected="selected">PLEASE CHOOSE CHECKER</option>
<optgroup label="GENERIC SERVICES">
<option value="19">0.05 - LG INFO ⚡</option>
<option value="24">0.02 - ZTE INFO ⚡</option>
<option value="5">0.02 - SONY INFO ⚡</option>
<option value="23">0.05 - ACER INFO ⚡</option>
<option value="34">0.05 - ASUS INFO ⚡</option>
<option value="39">0.05 - OPPO INFO ⚡</option>
<option value="45">0.04 - ITEL INFO ⚡</option>
<option value="2">0.10 - NOKIA INFO ⚡</option>
</optgroup>
</select>
<br /><br />
<button onClick="this.form.submit(); this.disabled=true; this.value='Please Wait'; " type="submit" style="background-color: #2ABCA7; padding: 12px 45px; -ms-border-radius: 5px; -o-border-radius: 5px; border-radius: 5px; border: 1px solid #2ABCA7;-webkit-transition: .5s; transition: .5s; display: inline-block; cursor: pointer; width: 20%; max-width: 200px; color: #fff;">Submit</button>
</form>
</center>
<?php
$format = "html"; // Display result in JSON or HTML format
$imei = $_POST['imei']; // IMEI or SERIAL Number
if(!filter_var($imei, FILTER_VALIDATE_EMAIL)){$imei = preg_replace("/[^a-zA-Z0-9]+/", "", $imei);} // Remove unwanted characters for IMEI/SN
$service = $_POST['service']; // Service ID
if($service != 'demo'){$service = preg_replace("/[^0-9]+/", "", $service);} // Remove unwanted characters for Service ID
$api = "WRITE-HERE-API-KEY"; // Sickw.com APi Key
if(isset($_POST['service']) && isset($_POST['imei'])){
if(strlen($api) !== 31){echo "<font color=\"red\"><b>API KEY is Wrong! Please set APi KEY!</b></font>"; die;}
if(strlen($service) > 4 || $service > 250){echo "<font color=\"red\"><b>Service ID is Wrong!</b></font>"; die;}
if(!filter_var($imei, FILTER_VALIDATE_EMAIL)){
if(strlen($imei) < "11" || strlen($imei) > "15"){echo "<font color=\"red\"><b>IMEI or SN is Wrong!</b></font>"; die;}}
$curl = curl_init ("https://sickw.com/api.php?format=$format&key=$api&imei=$imei&service=$service");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($curl, CURLOPT_TIMEOUT, 60);
$result = curl_exec($curl);
curl_close($curl);
echo PHP_EOL."<br/><br/>".PHP_EOL.$result; // Here the result is printed
}
?>
@endsection
Please or to participate in this conversation.