Jump to content

karltanav

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

karltanav's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. karltanav

    xcache

    Corbin: I dont know much yet about caching, so the term byte-code is new to me but i can guess perfectly what it refers to, i worked with apc before and know it stores in the memory, thanks a lot for your help i was looking for this function in order to store my information with xcache as i did with apc_store. In xcache you can use: xcache_set('this', 'that'); And xcache_get('this'); to print: that Thanks a lot for your time by the way.
  2. karltanav

    xcache

    Corbin: In this case you are telling me that i wont need to do any other installation than the XCache in order to reduce my server loads? I already installed the Xcache but i am affraid that the xcache wont do any help since im not doing anything else, like calling a function from my php files or any of the config files. Thanks
  3. karltanav

    xcache

    Hey I just installed XCache on my VPS, however i was wondering, is that and i dont need to do anything else? for example with APC i used to catch some functions with apc_store(); But with xcache im unsure of what to do? How should i call the cache on my php files, and how do i cache my functions? Thanks in advance
  4. Hey Im trying to send some files through a form, i was working right in firefox, then tried to check it in explorer and everything was messed up, perhaps there is an error with the code or i dont know, can any one take a look? <? session_start(); include("config.php"); if(isset($_GET['action'])) { $action=addslashes($_GET['action']); } if ( $action == "add_pet" ) { $petname=mysql_real_escape_string($_POST['petname']); $pettype=mysql_real_escape_string($_POST['pettype']); $petage=mysql_real_escape_string($_POST['age']); $petdesc=mysql_real_escape_string($_POST['pet_desc']); $petpic=mysql_real_escape_string($_POST['picture']); echo "<h3>Add a Pet!</h3> <center><img src=\"images/lineo.jpg\" width=\"560\" height=\"9\"></center><br> <center> <table border=\"0\" width=\"590\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td width=\"10\"> </td> <td width=\"570\">"; if (!$_SESSION["valid_user"]) { echo "<h3>Sorry, this section is restricted only to registered members</h3><Br> <center><b><a href=\"index.php?action=register\"><font color=\"#000000\">Click here to register and get complete access to this site!</font></a></b></center>"; } else { echo " <form action=\"?action=doAdd\" method=\"POST\" enctype=\"multipart/form-data\"> <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"570\"> <tr> <td width=\"120\">Name:</td> <td width=\"*\"><input type=\"text\" name=\"petname\" value=\"$petname\" class=\"itxt\"></td> </tr> <tr> <td colspan=\"2\" height=\"4\"> </td> </tr> <tr> <td width=\"120\">Type:</td> <td width=\"*\"> <select name=\"pettype\"> <option selected> </option>"; $query = " SELECT * FROM categories ORDER BY cat_id ASC"; $result = mysql_query($query) or die('Error, query failed'); while ($getcat= mysql_fetch_array($result)) { echo "<option value=\"$getcat[cat_name]\">$getcat[cat_name]</option>"; } echo " </select> </td> </tr> <tr> <td colspan=\"2\" height=\"4\"> </td> </tr> <tr> <td width=\"120\">Age:</td> <td width=\"*\"><input type=\"text\" name=\"age\" value=\"$petage\" class=\"itxt\"></td> </tr> <tr> <td colspan=\"2\" height=\"4\"> </td> </tr> <tr> <td width=\"120\">Description:</td> <td width=\"*\"><textarea name=\"pet_desc\" rows=\"3\" cols=\"28\" class=\"tarea\">$petdesc</textarea></td> </tr> <tr> <td colspan=\"2\" height=\"4\"> </td> </tr> <tr> <td width=\"120\">Picture:</td> <td width=\"*\"><input type=\"file\" size=\"15\" name=\"uploadfile\"></td> </tr> <tr> <td colspan=\"2\" height=\"8\"> </td> </tr> <tr> <td colspan=\"2\" height=\"4\"> <input type=\"Submit\" value=\"Submit\" class=\"regb\"> </td> </tr> </table><br> <img src=\"images/lineo.jpg\" width=\"560\" height=\"9\"></center><br> </form>"; } echo " </td> <td width=\"10\"> </td> </tr> </table>"; } if ( $action == "doAdd" ) { $upload=$HTTP_POST_FILES['uploadfile']; $petname=mysql_real_escape_string($_POST['petname']); $pettype=mysql_real_escape_string($_POST['pettype']); $petage=mysql_real_escape_string($_POST['age']); $petdesc=mysql_real_escape_string($_POST['pet_desc']); $petpic=mysql_real_escape_string($_POST['picture']); if ( $_POST['petname']=="" || strlen($_POST['petname'])<1 ) { $errors[] = 'You have to enter your pet name'; } if ( $_POST['pettype']=="" || strlen($_POST['pettype'])<1 ) { $errors[] = 'You have to select your pet type'; } if ( $_POST['age']=="" || strlen($_POST['age'])<1 ) { $errors[] = 'You have to enter your pet age'; } if ( $_POST['pet_desc']=="" || strlen($_POST['pet_desc'])<1 ) { $errors[] = 'You have to enter your pet description'; } echo "<h3>Adding a Pet</h3> <center><img src=\"images/lineo.jpg\" width=\"560\" height=\"9\"></center><br> <center> <table border=\"0\" width=\"590\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td width=\"10\"> </td> <td width=\"570\">"; if (!$_SESSION["valid_user"]) { echo "<h3>Sorry, this section is restricted only to registered members</h3><Br> <center><b><a href=\"index.php?action=register\"><font color=\"#000000\">Click here to register and get complete access to this site!</font></a></b></center>"; } else { if( is_array($errors) ) { echo "Sorry, but the request couldn't be completed.<br><br>The following errors were found:<ul>"; while (list($key,$value) = each($errors)) { echo "<li type=\"square\">$value</li>"; } echo "</ul><center><form action=\"?action=add_pet\" method=\"POST\"> <input type=\"hidden\" name=\"petname\" value=\"$petname\"> <input type=\"hidden\" name=\"pettype\" value=\"$pettype\"> <input type=\"hidden\" name=\"age\" value=\"$petage\"> <input type=\"hidden\" name=\"petdesc\" value=\"$petdesc\"> <input type=\"Submit\" value=\"Try Again\" class=\"trag\"></center>"; } else { if ( $uploadfile == "" ) { echo " "; } if ( $HTTP_POST_FILES['uploadfile']['type'] == "image/bmp" ) { echo "<h3>ERROR<br>The files extensions for pictures accepted are only JPG, GIF and PNG, please try again</h3> </td> <td width=\"10\"> </td> </tr> </table> </td> <td width=\"10\"> </td> </tr> </td> </tr> <tr> <td colspan=\"3\"> </td> <td width=\"590\" height=\"400\" valign=\"top\" class=\"maintb_endborders\"> <td width=\"10\"> </td> </tr> </table><br> </td> </tr> </table> </tr> </td> </table> <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"792\" height=\"20\"> <tr> <td bgcolor=\"#000000\"> <div align=\"right\"><font class=\"wh\">Copyright © 2008 - Pet Show Off</font> </div> </td> </tr> </table>"; exit; } else { $getnfiletype = $HTTP_POST_FILES['uploadfile']['type']; $ncuttype=substr($getnfiletype,6,12); if ( $ncuttype == "jpeg" ) { $ncreate = "imagecreatefromjpeg"; $nformat = "jpg"; } if ( $ncuttype == "gif" ) { $ncreate = "imagecreatefromgif"; $nformat = "gif"; } if ( $ncuttype == "png" ) { $ncreate = "imagegreatefrompng"; $nformat = "png"; } $nuploadedfile = $HTTP_POST_FILES['uploadfile']['tmp_name']; $src = $ncreate($nuploadedfile); list($width,$height)=getimagesize($nuploadedfile); $newheight=140; $newwidth=($width/$height)*140; $tmp=imagecreatetruecolor($newwidth,$newheight); imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height); $rand=mt_rand(0, 32); $genra= md5($rand . time()); $magic="$genra"; $replaca=eregi_replace("[^[:alnum:]]", "-", $HTTP_POST_FILES['uploadfile']['name']); $filename = "uploads/members/thumbs/$magic.$replaca.$nformat"; $original = "uploads/members/$magic.$replaca.$nformat"; imagejpeg($tmp,$filename,100); imagejpeg($src,$original,100); imagedestroy($src); imagedestroy($tmp); $petpic = "$magic.$replaca.$nformat"; } $time=date("Y-m-d H:i:s"); $query="INSERT INTO pets VALUES('','$username','$time','$petname','$pettype','$petage','$petdesc','$petpic','5','1')"; $result= mysql_query($query) or die("Error: Couldnt add a pet to the database"); $query="SELECT * FROM pets WHERE pet_added='$time' AND pet_owner='$username' LIMIT 1"; $result= mysql_query($query) or die("Error cant extract pet id"); $thepetid=mysql_result($result,$i,"pet_id"); $query="INSERT INTO pets_pictures VALUES('','$thepetid','$username','$petpic','$time','0')"; $result= mysql_query($query) or die("Error cant insert pic to gallery"); echo "<center>Congratulations, you have added a new pet to your profile!<br><br><a href=\"/$username\"><font color=\"#000000\"><b>Click here to see it updated!</b></font></a><br>"; } } echo " </td> <td width=\"10\"> </td> </tr> </table>"; } ?>
  5. karltanav

    hobby?

    it began for me as a hobby
  6. take care, recently we had problems with one very important foundation website... all sucked
  7. i have many years using Smart FTP recommend it
  8. Mine is a translation to estonian of my real name done by a very good friend of mine
  9. haha, i always forget a { or there is always one more } or a " or something there is always in my scripts, and i consider myself as experimented
  10. Ive used plain txt files and those are a nightmare, nothing compared to the SQL databases in order to have the information well sorted and saved
  11. I use PHP and i think because its cleaner than PERL, which i havent liked since ive seen it!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.