Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
добре де това го разбрах а как ще стане така че да се прави папкатаmizarck каза:$promenliva = $_POST['imeto na poleto'];
$promenliva = $_GET['imeto na poleto'];
http://web-tourist.net/login/login/view.php?st=1206 тази или която друга да е...те изпълняват еднакви функции и са еднакво полезни...няма значение кой въпроса е да тръгне и всеки потребител да може да ъплоадва във създадената от него папка...nanov_91 каза:А кой ъплоад скрипт ще използваш?
<?
oB_start();
// allows you to use cookies.
include("config.php");
if (!$logged[username])
{
if (!$_POST[login])
{
echo("
<center><form method=\"POST\">
<table>
<tr>
<td align=\"right\">
Ïîòðåáèòåë: <input type=\"text\" size=\"15\" maxlength=\"25\" name=\"username\">
</td>
</tr>
<tr>
<td align=\"right\">
Ïàðîëà: <input type=\"password\" size=\"15\" maxlength=\"25\" name=\"password\">
</td></tr><tr>
<td align=\"center\">
<input type=\"submit\" name=\"login\" value=\"Âëåç\">
</td></tr><tr>
<td align=\"center\">
<a href=\"register.php\">Ðåãèñòðèðàé ñå</a>
</td></tr></table></form></center>");
}
if ($_POST[login]) {
// the form has been submitted. We continue...
$username=$_POST['username'];
$password = md5($_POST[password]);
// the above lines set variables with the submitted information.
$info = mysql_query("SELECT * FROM register WHERE username = '$username'") or die(mysql_error());
$data = mysql_fetch_array($info);
if($data[password] != $password) {
// the password was not the user's password!
echo "Ãðåøåí ïîòðåáèòåë èëè ïàðîëà!";
}else{
// the password was right!
$query = mysql_query("SELECT * FROM register WHERE username = '$username'") or die(mysql_error());
$user = mysql_fetch_array($query);
// gets the user's information
setcookie("id", $user[id],time()+(60*60*24*5), "/", "");
setcookie("pass", $user[password],time()+(60*60*24*5), "/", "");
// the above lines set 2 cookies. 1 with the user's id and another with his/her password.
echo ("<meta http-equiv=\"Refresh\" content=\"0; URL=\"/>Âèå óñïåøíî âëÿçîõòå â àêàóíòà ñè.");
// modify the above line...add in your site url instead of yoursite.com
}
}
}
else
{
// we now display the user controls.
echo ("<center>Äîáðå äîøëè <b>$logged[username]</b><br /></center>
<a href=\"editprofile.php\">Ïðîìåíè ïðîôèëà ñè</a><br />
<form action='?do=up' method='post' enctype='multipart/form-data' name='form1' id='form1'><br />
<label>
<input type='file' name='file' />
</label>
<br />
<label>
<input type='submit' name='Submit' value='Upload' />
</label>
</form>
<a href=\"members.php\">Âèæ âñè÷êè ðåãèñòðèðàíè ïîòðåáèòåëè</a><br />
<a href=\"search.php\">Òúðñè çà ïîòðåáèòåëè</a><br />
<a href=\"logout.php\">Èçëåç îò àêàóíòà ñè</a>");
}
echo'<br><br>
Ñòàòèñòèêà:<br>';
$last = mysql_query("SELECT id, username FROM register ORDER BY id DESC LIMIT 1");
while($q=mysql_fetch_assoc($last)){
echo "<b>Ïîñëåäíî ðåãèñòðèðàí:</b>
<a href='members.php?user=". $q['username'] ."'>".$q['username']."</a><br />";}
$register = mysql_query("SELECT count(id) as total FROM register");
while($c=mysql_fetch_array($register)){
echo "<b>Áðîé ïîòðåáèòåëè:</b>" .$c['total']. ""; }
echo '<br>';
$ip = $_SERVER['REMOTE_ADDR'];
$time = time();
$cutoff = 15; //online cut of time
$exists = 0;
$users = 0;
$user = "";
$fp = fopen ("online.txt","r+"); //if the file exists open it
while (!feof($fp))
{
$user[] = chop(fgets($fp,65536));
}
fseek($fp,0,SEEK_SET);
foreach ($user as $line)
{
list($oldip,$oldtime) = explode('|',$line);
if ($oldip == $ip) {$oldtime = $time;$exists = 1;} //check to see if the user is already in the text file
if ($time < $oldtime + ($cutoff * 60)) //see if the last time the user visited is past the cut off time
{
fputs($fp,"$oldip|$oldtime\n"); //write the old data to the text file
$users = $users + 1; // add one to the user count
}
}
if ($exists == 0) //if the user isn't in the text file already:
{
fputs($fp,"$ip|$time\n"); //write the new data to the text file
$users = $users + 1; //add one to the user count
}
fclose ($fp); //close the text file
print "<b>Online:</b> $users"; //display the number of users online
if($_GET['do'] == "up") {
@move_uploaded_file($_FILES['file']["tmp_name"], "$logged[username]/" . $_FILES['file']['name']);
}
?>