нужно чтобы после правильного ввода логина и пароля перекидывало на form2.А при не правильном выходило сообщение"логин или пароль не верный".
вот код:# ?????? ?????????? ?? ??????? ??????: ?????, ??????, ?????.
$login = c("edit1")->text;
$password = c("edit2")->text;
$site = 'http://topmodpaks.besaba.com/login.php';
# ?????? User Agent.
$user_agent = 'Bad Bot';
# Cookies ???????? ? ????? ? ????? ???????? ? ??????????? ????????? ????.
$cookies = dirname(__FILE__) . '/cookies.txt';
# ????????????? cURL:
$automatic = curl_init();
# ????????????? ?????????? User Agent ("???????" ????????????),
# ????????????? ???????? ???????? - ?????????.
# cURL ????? ????? ?????????? ??????? ?? ????? 10 ??????.
curl_setopt($automatic, CURLOPT_USERAGENT, $user_agent);
curl_setopt($automatic, CURLOPT_REFERER, "http://topmodpaks.besaba.com/members.php");
curl_setopt($automatic, CURLOPT_TIMEOUT, 10);
# ??????? ?????? ??? ??????????? ?? ????? ??? ??????????? WordPress:
curl_setopt($automatic, CURLOPT_URL, $site . '/members.php');
# ????????? ?????????? ?????????? ????????.
# ????????? ??????? ?????? ?? ??????????.
curl_setopt($automatic, CURLOPT_RETURNTRANSFER, true);
curl_setopt($automatic, CURLOPT_FOLLOWLOCATION, true);
# ????????????? POST-??????:
curl_setopt($automatic, CURLOPT_POST, true);
curl_setopt($automatic, CURLOPT_POSTFIELDS, "login=$login&password=$password&submit=submit ");
# ???????? ? ??????, cookies:
curl_setopt($automatic, CURLOPT_COOKIEFILE, $cookies);
curl_setopt($automatic, CURLOPT_COOKIEJAR, $cookies);
# ????????? ???????????:
curl_exec($automatic);
# ??? ??????? ??????? ???????? ??????? WordPress:
curl_setopt($automatic, CURLOPT_URL, $site. '/members.php');
$demo = curl_exec($automatic);
# ????????? cURL:
curl_close($automatic);
# ??????? ????????? ?? ?????:
echo $demo;
вот код:# ?????? ?????????? ?? ??????? ??????: ?????, ??????, ?????.
$login = c("edit1")->text;
$password = c("edit2")->text;
$site = 'http://topmodpaks.besaba.com/login.php';
# ?????? User Agent.
$user_agent = 'Bad Bot';
# Cookies ???????? ? ????? ? ????? ???????? ? ??????????? ????????? ????.
$cookies = dirname(__FILE__) . '/cookies.txt';
# ????????????? cURL:
$automatic = curl_init();
# ????????????? ?????????? User Agent ("???????" ????????????),
# ????????????? ???????? ???????? - ?????????.
# cURL ????? ????? ?????????? ??????? ?? ????? 10 ??????.
curl_setopt($automatic, CURLOPT_USERAGENT, $user_agent);
curl_setopt($automatic, CURLOPT_REFERER, "http://topmodpaks.besaba.com/members.php");
curl_setopt($automatic, CURLOPT_TIMEOUT, 10);
# ??????? ?????? ??? ??????????? ?? ????? ??? ??????????? WordPress:
curl_setopt($automatic, CURLOPT_URL, $site . '/members.php');
# ????????? ?????????? ?????????? ????????.
# ????????? ??????? ?????? ?? ??????????.
curl_setopt($automatic, CURLOPT_RETURNTRANSFER, true);
curl_setopt($automatic, CURLOPT_FOLLOWLOCATION, true);
# ????????????? POST-??????:
curl_setopt($automatic, CURLOPT_POST, true);
curl_setopt($automatic, CURLOPT_POSTFIELDS, "login=$login&password=$password&submit=submit ");
# ???????? ? ??????, cookies:
curl_setopt($automatic, CURLOPT_COOKIEFILE, $cookies);
curl_setopt($automatic, CURLOPT_COOKIEJAR, $cookies);
# ????????? ???????????:
curl_exec($automatic);
# ??? ??????? ??????? ???????? ??????? WordPress:
curl_setopt($automatic, CURLOPT_URL, $site. '/members.php');
$demo = curl_exec($automatic);
# ????????? cURL:
curl_close($automatic);
# ??????? ????????? ?? ?????:
echo $demo;