Вход Регистрация
Файл: reg.php
Строк: 83
<?
include $_SERVER['DOCUMENT_ROOT']."/template/start.php";
include 
$_SERVER['DOCUMENT_ROOT']."/template/func.php";?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
    <head>

        <title>Мобильная версия VKCMS</title>

        <link type="text/css" rel="stylesheet" href="css/s_mbw.css"></link>
        <link type="text/css" rel="stylesheet" media="only screen" href="css/s_rt.css"></link>
    </head>
    <body id="vk" class="x_wide x_head nt hover">
        <div id="vk_wrap" class="_vpan">
            <div id="l"></div>
            <div id="m">
                <div id="mhead" class="mhead">
                    <div class="btn notify index"></div>
                    <div class="btn logo"><a href="/" class="b"><i>VKCMS-mobile</i></a></div>
                </div>                
<?
$pol 
$_POST['pol'];
$mail $_POST['mail'];
$pass $_POST['pass'];
$name $_POST['name'];
$fam $_POST['fam'];
$pass1 $_POST['pass1'];
$users $_POST['users'];
?>

                <div id="mhead" class="mhead">
                    <div class="btn back">
                        <div class="b">
                            <div class="title">
                                <h1>Результат регистрации</h1>
                            </div>
                        </div>
                    </div>
                </div>
                <div id="mcont" class="mcont">    
                    <div class="pcont login bl_cont">
                        <div class="panel prof_panel">
                            <div>
<?                            
if(!empty($mail) && !empty($pass) && !empty($_FILES["photoreg"]["name"]) && !empty($name) && !empty($fam)) 
{


    
$result mysql_query("select * from `user` where `mail` = '$mail'");

    if (
mysql_num_rows($result) == 0)
    {


        if (
preg_match('/[A-Za-z0-9_-.]{3,40}@[A-Za-z0-9_-]{3,30}.[a-z0-9]{2,4}/'$mail))
        {


            if(
$pass == $pass1)
            {

                if(
$_FILES["photoreg"]["name"])
                {
                    
$photoreg=$_FILES["photoreg"]["name"];
                    
$path_info pathinfo($photoreg); 
                    
$f=$path_info['extension'];
                    
$foto='1.'.$f;


                    if(
$_FILES["photoreg"]["size"] > 1024*300)
                    {
                        echo (
"Размер фото превышает 300 килобайт");
                        exit;
                    }

                    if((
$f == "gif") || ($f == "jpeg") || ($f == "png") || ($f == "jpg") || ($f == "GIF") || ($f == "JPEG") || ($f == "PNG") || ($f == "JPG"))
                    {
                        if(
is_uploaded_file($_FILES["photoreg"]["tmp_name"]))
                        {

                            
$ser1=$_SERVER['REMOTE_ADDR'];
                            
$ser2=$_SERVER['HTTP_USER_AGENT'];
                            
$ser3=$_SERVER['HTTP_REFERER'];
                            
$fp fopen("users/inf.dat","a+");     
                            
$text "$fam $name узнал от $users ip-$ser1 ,браузер и ос-$ser2 ,откуда пришел-$ser3";
                            
fputs($fp,"$textrn");
                            
fclose($fp);
                            
                            
mysql_query("insert into `user`(`mail`,`pass`) values('$mail','$pass');");
                            
mysql_query("insert into `prof`(`name`,`fam`,`pol`,`foto`,`foto1`) values('$name','$fam','$pol','$foto','1');");
        
                            
$user mysql_fetch_array(mysql_query("select * from `user` where mail='$mail'"));
                            
$id $user[id];
                            
mkdir ("data/photo/$id"0777);
                            
move_uploaded_file($_FILES["photoreg"]["tmp_name"], "data/photo/$id/$foto");

                            
                            
$_SESSION['id'] = $user[id];
                            
$_SESSION['pass'] = $user[pass];
                            
                            
                            
                            
                            
$mess="Теперь вы зарегистрированный пользователь, 
                            сохраните ваш пароль '
$pass' в надежном месте, он вам еще пригодится. 
                            Надеемся вам понравится на нашем портале!<br>
                            С уважением администрация сайта<br/>
                            <a href='.'>Вход</a>"
;

                            echo 
$mess;
                        } else {echo
'Произошла ошибка при загрузки фото!';}
                    } else {echo
'У фото не верный формат!';}
                } else {echo
'Вы не добавили фото!';}
            } else {echo
'Вы ввели разные пароли, будти внемательны при вводе пароля!';}
        } else {echo
'В электронном адресе есть не допустимые символы!';}
    } else {echo
'Такой электронный адрес уже зарегестрирован в системе!';}
} else {echo
'Вы не заполнели обязательные поля!';}

if(!isset(
$mess))
{
?>
                                <form method="post" action="?" enctype="multipart/form-data">
                                    <dl>
                                        <dt>Ваше имя:</dt>
                                        <dd class="iwrap"><input type="text" name="name" class="text" value="<?=$name?>" /></dd>
                                    </dl>
                                    <dl>
                                        <dt>Ваша фамилия:</dt>
                                        <dd class="iwrap"><input type="text" name="fam" class="text" value="<?=$fam?>" /></dd>
                                    </dl>
                                    <dl>
                                        <dt>Как вы узнали о нашем сайте:</dt>
                                        <dd class="iwrap"><input type="text" name="users" class="text" value="<?=$users?>" /></dd>
                                    </dl>
                                    <dl>
                                        <dt>Ваш пол:</dt>
                                        <dd class="cont bli">
                                            <select name="pol" class="text">
                                                <option value="m" class="sel">Парень</option>
                                                <option value="zh" class="sel">Девушка</option>
                                            </select>
                                        </dd>
                                    </dl>
                                    <dl>
                                        <dt>Ваше фото:</dt>
                                        <dd class="row"><input type="file" name="photoreg" value="<?=$_FILES["photoreg"]["tmp_name"]?>" /></dd>
                                    </dl>
                                    <dl>
                                        <dt>Ваш email:</dt>
                                        <dd class="iwrap"><input type="text" name="mail" class="text" value="<?=$mail?>" /></dd>
                                    </dl>
                                    <dl>
                                        <dt>Придумайте пароль:</dt>
                                        <dd class="iwrap"><input type="password" name="pass" class="text" /></dd>
                                    </dl>
                                    <dl>
                                        <dt>Повторите пароль:</dt>
                                        <dd class="iwrap"><input type="password" name="pass1" class="text" /></dd>
                                    </dl>
                                    <dl>
                                        <dd>
                                            <div class="near_box">
                                                <input class="btn" type="submit" value="Регистрация" />
                                                <div class="near_btn"><a href="pass.php">Забыли пароль?</a></div>
                                            </div>
                                        </dd>
                                    </dl>
                                </form>

<?}?>
                            
                            </div>
                        </div>
                    </div>    
                </div>        
                <div id="mfoot" class="mfoot">
                    <ul class="main_menu footer_menu">
                        <li><a href="/">На главную</a></li>
                    </ul>
                </div>

            </div>
        </div>
    </body>
</html>
Онлайн: 2
Реклама