$url = $_POST['link_for_parse'];
$idauto = basename($url);
$createdURL = curl("https://www.site.com/data/data/lotdetails/solr/".urlencode($idauto));
if (preg_match("#<script src=\"(/_Incapsula_Resource\?[^\"]+)\">#", $createdURL, $regs))
{
curl("https://www.copart.com{$regs[1]}");
}
if ($createdURL = curl("https://www.site.com/data/data/lotdetails/solr/".urlencode($idauto)))
{
header('Content-Type: application/json');
echo $createdURL;
}
unlink("/tmp/cookie.txt");
function curl($url){
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookie.txt");
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
<?php
$createdURL = curl("https://www.copart.com/public/data/lotdetails/solr/59418659");
if (preg_match("#<script src=\"(/_Incapsula_Resource\?[^\"]+)\">#", $createdURL, $regs))
{
curl("https://www.copart.com{$regs[1]}");
$createdURL = curl("https://www.copart.com/public/data/lotdetails/solr/59418659");
}
echo $createdURL;
unlink("/tmp/cookie.txt");
function curl($url){
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookie.txt");
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
?>
$query = "404";
.... WHERE (B.Country=:country OR :country='') AND ...
. ... WHERE B.Country ".(!empty($country) ? "=" : "<>").":country AND ...
$link = mysqli_connect($db_host, $db_user, $db_password, $db_database) or die("Ошибка:" . mysqli_error($link));
foreach ($_POST['tovar'] as $i => $tovar) {
if (!empty($tovar) AND !empty($_POST['many'][$i])) {
$many = $_POST['many'][$i];
mysqli_query($link,"INSERT INTO tovar(products_id,tovar,many)
VALUES(
'".mysqli_real_escape_string($link, $id)."',
'".mysqli_real_escape_string($link, $tovar)."',
'".mysqli_real_escape_string($link, $many)."'
)") or die("Ошибка: ".mysqli_error($link));
} else {
$_SESSION['answer'] = "Ошибка";
}
}
7 => string "..."
и т.д.? Где этот PHP-код? Не, ну... Ну... Ну это как "у меня авто не едет, а нём все окна помыты и все фары/фонари тряпкой протёрты, помогите-люди-добрые", ей-богу!preg_match("/\S+/su", $str);
function rights($rights){
global $http, $user;
if(!isset($user['rights']) OR empty($rights) OR $user['rights'] < $rights) {
header('Location: '.$http.$_SERVER['SERVER_NAME']); exit;
}
}
$user_id = isset($_COOKIE['uid']) ? fl($_COOKIE['uid']) : '';
$password = isset($_COOKIE['password']) ? fl($_COOKIE['password']) : '';
if(!empty($user_id) && !empty($password)) {
$user = $base->query('SELECT * FROM `users` WHERE `id` = "'.mysql_real_escape_string($user_id).'" AND `password` = "'.mysql_real_escape_string($password).'"')->fetch_assoc();
} else {$user = false;}