Jump to content

werty37

Members
  • Posts

    49
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

werty37's Achievements

Member

Member (2/5)

0

Reputation

  1. Ah yes! That is a good idea. I ll try to implement it. Thanks a lot for the suggestion... Cheers Sujith
  2. Hi Rhodesa, I am using json_d/encode() functions instead of un/serialize() and it does the job quiet well. I dont know why it wouldnt work for me. I am using PHP 5.2.3 on ubuntu (Apache/2.2.4). Thanks Sujith
  3. Hi Just a reminder. Simplexml returns objects instead of strings/integers or mixed values. echo is_object($xml->file->allowedfiles); // will print 1 That is why i do type cast before i print echo unserialize((string) $xml->file->allowedfiles); //doesnt print any output I think the problem has something to do with this behaviour. or maybe i have found a bug in php
  4. Hi Barand, $xml = simplexml_load_file('conf.xml'); echo (string) $xml->file->allowedfiles; //prints out the serialized data $data = unserialize((string) $xml->file->allowedfiles); echo '<pre>', print_r($data, 1), '</pre>'; // dosent print anything It outputs nothing. The < pre > tag is printed but not the unserialized content.. Sujith
  5. Hi Barand, Sorry the code i posted had errors. I did try echo unserialize((string) $xml->file->allowedfiles); //doesnt print any output which ofcourse does not work. Thanks Sujith
  6. HI Can anyone help me out with this please. I am trying to print out serialized data stored in a xml file using simplexml. $xml = simplexml_load_file($conf); echo (string) $xml->file->allowedfiles; //prints out the serialized data unserialize((string) $xml->file->allowedfiles); //doesnt print any output Thanks Sujith
  7. Hi There are no spaces around <?php ?> tags.... Didnt help
  8. Hi I guess you might have to change your logic a bit. You can create a temp table to hold the values and then move the data to the actual "members" table once the userid is confirmed. Hope that helps Regards
  9. Hi ILYAS415, I am trying to create png thumbnails from jpg or png images. Hope the code now makes sense Thanks
  10. Hi INSERT INTO `itemtable` SET `itemnum1` = $_GET['1'], `itemnum2` = $_GET['2'] , `itemnum3` = $_GET['3'] , `itemnum4` = $_GET['4'], `itemnum5` = $_GET['5'] AND `memberid` = $_SESSION['idnum'] make sure itemnum1, itemnum2, itemnum3, itemnum4, itemnum5 all have default values as 0.
  11. Hi I am trying to resize an uploaded image and save it as png. I always get corrupted png thumbnails. Can somebody check the function and tell where i ve gone wrong. function image_thumb($file, $tnfilename) { //maximum width: 225px //maximum height 225px $imageInfo = getimagesize($file); if ($imageInfo["mime"] == 'image/jpeg') $fullImage = imagecreatefromjpeg($file); elseif ($imageInfo["mime"] == 'image/png') $fullImage = imagecreatefrompng($file); $imageWidth = $imageInfo[0]; $imageHeight = $imageInfo[1]; $imageRatio = $imageWidth/$imageHeight; if ($imageRatio < 1) { $newHeight = 225; $newWidth = (225/$imageHeight) * $imageWidth; echo $newWidth;} else { $newWidth = 225; $newHeight = (225/$imageWidth) * $imageHeight;} $tnImage = imagecreatetruecolor($newWidth, $newHeight); imagealphablending($tnImage, true); imagecopyresampled($tnImage, $fullImage, 0, 0, 0, 0, $newWidth, $newHeight, $imageWidth, $imageHeight); imagesavealpha($tnImage, true); imagepng($tnImage, $tnfilename, 70, PNG_ALL_FILTERS); imagedestroy($fullImage); imagedestroy($tnImage); return $tnfilename; }
  12. Hi Barand Thanks a lot. I had \n characters after ?> in one of my includes. Have a nice day Cheers Sujith
  13. Hi Sometimes webhosting companies disable mail() function by default. You might have to contact your hosting company to enable them... Regards Sujith
  14. Hi mike, I am using this in one of my scripts and it seems to work for me. This should work for you hopefully if (!preg_match('/^[\w\d\_\.]{8,15}$/',$var)) { // code } Regards Sujith
×
×
  • 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.