jonekPL Posted February 25, 2011 Share Posted February 25, 2011 Hi. I am from poland. I am 17 old age and like webmastering. I write my social network. I have new server 10 GB VPS and my script no runing In my server. in my server do can not login. No runing function mb_strtolower(); as delete function mb_strtolower() ; this login runing. In my server haven`t installing liberary GD and no runing upload avatars. my code upload is: elseif ($_GET['act'] == "upload") { echo <<< KONIEC <hr> <center> <p> <h2>Dodaj zdjęcie</h2> <ul class="gallery clearfix"> <li class="extra"> KONIEC; error_reporting(E_ALL); // we first include the upload class, as we will need it here to deal with the uploaded file include('include/class.upload.php'); // retrieve eventual CLI parameters $cli = (isset($argc) && $argc > 1); if ($cli) { if (isset($argv[1])) $_GET['file'] = $argv[1]; if (isset($argv[2])) $_GET['dir'] = $argv[2]; if (isset($argv[3])) $_GET['pics'] = $argv[3]; } // set variables $dir_dest = (isset($_GET['dir']) ? $_GET['dir'] : 'test'); $dir_pics = (isset($_GET['pics']) ? $_GET['pics'] : $dir_dest); if (!$cli) { } // we have three forms on the test page, so we redirect accordingly if ((isset($_POST['action']) ? $_POST['action'] : (isset($_GET['action']) ? $_GET['action'] : '')) == 'simple') { // ---------- SIMPLE UPLOAD ---------- // we create an instance of the class, giving as argument the PHP object // corresponding to the file field from the form // All the uploads are accessible from the PHP object $_FILES $handle = new Upload($_FILES['my_field']); // then we check if the file has been uploaded properly // in its *temporary* location in the server (often, it is /tmp) if ($handle->uploaded) { // yes, the file is on the server // now, we start the upload 'process'. That is, to copy the uploaded file // from its temporary location to the wanted location // It could be something like $handle->Process('/home/www/my_uploads/'); $handle->Process($dir_dest); function TestProcess(&$handle, $title = 'test', $details='') { global $dir_pics, $dir_dest; $unlink = 'test/'. $handle->file_dst_name; $myid = $_SESSION['id']; $opis = htmlspecialchars(stripslashes(strip_tags(trim($_POST["opis"]))), ENT_QUOTES); $handle->Process($dir_dest); if ($handle->processed) { unlink("$unlink"); $link = ''.$dir_pics.'/' . $handle->file_dst_name .''; $addphoto = mysql_query("INSERT INTO photo VALUES('', '$myid', '$link', '$opis')"); echo <<< KONIEC <br> <center> <img src="$link" > <br> <br /> </center> KONIEC; } else { echo '<fieldset class="classuploadphp">'; echo ' <legend>' . $title . '</legend>'; echo ' Error: ' . $handle->error . ''; if ($details) echo ' <pre class="code php">' . htmlentities($details) . '</pre>'; echo '</fieldset>'; } } if (!file_exists($dir_dest)) mkdir($dir_dest); // ----------- $handle->image_convert = 'jpg'; $handle->image_resize = true; $handle->image_ratio_y = true; $handle->image_x = 500; $handle->image_precrop = 15; $handle->image_watermark = "watermark_large.png"; $handle->image_watermark_x = 20; $handle->image_watermark_y = -20; TestProcess($handle, '15px pre-cropping (before resizing 800 wide), large watermark automatically reduced, position 20 -20', "\$foo->image_convert = 'jpg';\n\$foo->image_resize = true;\n\$foo->image_ratio_y = true;\n\$foo->image_x = 800;\n\$foo->image_precrop = 15;\n\$foo->image_watermark = 'watermark_large.png';\n\$foo->image_watermark_x = 20;\n\$foo->image_watermark_y = -20;"); } else { // one error occured echo '<fieldset>'; echo ' <legend>file not uploaded to the wanted location</legend>'; echo ' Error: ' . $handle->error . ''; echo '</fieldset>'; } // we copy the file a second time // we delete the temporary files $handle-> Clean(); } else { // if we are here, the local file failed for some reasons echo '<fieldset>'; echo ' <legend>local file error</legend>'; echo ' Error: ' . $handle->error . ''; echo '</fieldset>'; } echo <<< KONIEC <li> </ul> </p> </center> KONIEC; is it the only problem that isn`t installing GD as i have something off in php.ini ? Plise Help me Quote Link to comment Share on other sites More sharing options...
trq Posted February 25, 2011 Share Posted February 25, 2011 I'm sorry, but your post makes no sense at all to me. Quote Link to comment Share on other sites More sharing options...
jonekPL Posted February 25, 2011 Author Share Posted February 25, 2011 I have a page with the logging. It looks like this: <?php if ($_POST['logowanie']) { // jeżeli formularz został wysłany, to wykonuje się poniższy skrypt $tabela = 'rejestracja'; // zdefiniowanie tabeli MySQL $login = mb_strtolower($_POST["login"]); $haslo = $_POST["pass"]; $haslo = md5($haslo); // szyfrowanie podanego hasła $wynik=mysql_query("SELECT * FROM $tabela WHERE login='$login' and haslo='$haslo' and status=0"); // jeżeli użytkownik zarejestrował się, a nie aktywował swojego konta, to wyświetla się komunikat if (mysql_num_rows($wynik) == 1) { $informacja = mysql_fetch_array($wynik); echo '<span class="blad">Nie aktywowałeś jeszcze swojego konta. Aby to zrobić, wejdź w swoją skrzynkę odbiorczą, a następnie znajdź wiadmość z linkiem aktywacyjnym i aktywuj swoje konto</span>'; exit; } // jeżeli wszystko jest dobrze, użytkownik się loguje $wynik=mysql_query("UPDATE $tabela SET online=1 WHERE login='$login' and haslo='$haslo' and status=1"); $wynik=mysql_query("SELECT * FROM $tabela WHERE login='$login' and haslo='$haslo' and status=1"); if (mysql_num_rows($wynik) == 1) { $informacja = mysql_fetch_array($wynik); $_SESSION["login"] = $informacja["login"]; $_SESSION["email"] = $informacja["email"]; $_SESSION["imie"] = $informacja["imie"]; $_SESSION["nazwisko"] = $informacja["nazwisko"]; $_SESSION["id"] = $informacja["id"]; $_SESSION["id_rangi"] = $informacja["id_rangi"]; header('Location: profile.php?act=o_mnie '); } else { echo '<span class="blad">Nie poprawny login lub hasło!</span> '; } mysql_close($polaczenie); } ?> as i have mb_strtolower(); this is logging no work. 2 error is upload avatars. I make $_POST and script no running I do not have the GD library on the server. Tell me what I need to turn on the server. Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.