View file retrive.php

File size: 2.36Kb
<?php
error_reporting(0);
header("Cache-Control:no-cache,no-store,must-revalidate");
header("Pragma:no-cache");
header("Content-type:text/vnd.wap.wml; charset=utf-8");
$ref=rand(10000,1000000);
include_once'conf.inc.php';
include_once'filtro.php';
$link=mysql_connect($MySQL_Hostname, $MySQL_Username, $MySQL_Password)
or die ('<wml>
<card id="error" title="error">
<do type="prev" label="Back"><prev/></do><p align="center">Can not connect to MySQL<br/>'.mysql_error().'</p>
</card></wml>');
mysql_select_db($MySQLDatabasename) or die ('<wml>
<card id="error" title="error">
<do type="prev" label="Back"><prev/></do><p align="center">error select the database...<br/>'.mysql_error().'</p>
</card></wml>');
echo'<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml12.dtd">
<wml><card id="index" title="Пароль"><p mode="wrap">';
$action=$_POST['action'];
if($action==''){
echo "Ваш id:<br/><input name=\"id$ref\"/><br/><anchor>Восстановить<go href=\"retrive.php\" method=\"post\">
<postfield name=\"action\" value=\"done\"/>
<postfield name=\"id\" value=\"$(id$ref)\"/>
</go></anchor>";
}
else
{
$id=$_POST['id'];
$id=intval($id);
$sear=mysql_query("Select * from users2 where id='".$id."'");
if(mysql_affected_rows() == 0){
echo'Извините, но гостевой книги не существует!<br/><a href="in.php">Назад</a>
<br/><a href="http://wapsoft.org.ru">wapsoft.org.ru</a>
</p></card></wml>';
exit;
mysql_close($link);
}
$find=mysql_fetch_array($sear);
$past=$find['pass'];
$to=$find['email'];
$mes="(Guest Book Service for your Site) http://wapsoft.org.ru Your Password: $past
Link your GuestBook: http://wapsoft.org.ru/gbs/index.php?id=$id
AvtoReanimator Password service WAPSOFT.ORG.RU
------
Zdravstvuite! Parol ot Vashei gostevoi id=$id na servere http://wapsoft.org.ru : $past
Adres Vashei gostevoi: http://wapsoft.org.ru/gbs/index.php?id=$id
S uvazheniem, administracia portala WAPSOFT.ORG.RU";
mail("$to","Guestbook password",$mes,"From: [email protected]\r\nContent-type: text/plain; charset=Koi8-r\r\nX-Mailer: WAPSOFT.ORG.RU-mail");
echo'Пароль отправлен вам на e-mail, указанный при регистрации.';
}
echo'<br/><a href="in.php">Назад</a>
<br/><a href="http://wapsoft.org.ru">wapsoft.org.ru</a>
</p></card></wml>';
mysql_close($link);
?>