Jump to content

vividona

Members
  • Posts

    170
  • Joined

  • Last visited

Everything posted by vividona

  1. Hi, Please help I need to make categories with su-categories I made in my database tables like this table = categories cid | cat_id | parent_list | categ_name | type 1 0 1 General category c 2 1 1,2 sub category s 3 1 1,3 sub category s 4 1 1,2 sub category s 5 1 1,5 sub category s 6 5 1,5,6 sub sub category s 7 0 7 General category2 c 8 7 7,8 sub category s I need to view this in dropdown menu using parent_list column
  2. I tried those functions. But they did not accept links in localhost http://localhost/xxxxx/index.php?action=viewarti&artid=5
  3. eg http://www.xxxxxxx.com/index.php?action=viewarti&artid=5 How can I write the content of this link into file.
  4. I tried it many time. But nothing changed
  5. I used this code $limit = 120; if (strlen($summary) > $limit) $summary = substr($summary, 0, strrpos(substr($summary, 0, $limit), ' . . .')); This code ok in English Language it counts letters fine but it is not work fine if I insert Arabic text. It counts Arabic encoding characters.
  6. Yes but how can I compare page contents with the cached file contents
  7. How can I delete cache files when any update take place. I don't need to delete files after certain period of time pass.
  8. I have html form and verify post data via pgp how can I save someone data if some one fill incorrect information
  9. I am trying to replace image code and resize it at the same time but gave me error. Warning: getimagesize($1): failed to open stream: No such file or directory in C:\wamp\www\ . . . . . public function resize_Images($originalImage,$toWidth,$toHeight){ // Get the original geometry and calculate scales list($width, $height) = getimagesize($originalImage); $xscale=$width/$toWidth; $yscale=$height/$toHeight; // Recalculate new size with default ratio if ($yscale>$xscale){ $new_width = round($width * (1/$yscale)); $new_height = round($height * (1/$yscale)); } else { $new_width = round($width * (1/$xscale)); $new_height = round($height * (1/$xscale)); } // Resize the original image $imageResized = imagecreatetruecolor($new_width, $new_height); $imageTmp = imagecreatefromjpeg ($originalImage); imagecopyresampled($imageResized, $imageTmp, 0, 0, 0, 0, $new_width, $new_height, $width, $height); return $imageResized; } public function bhl_bbcodes($str) { $simple_search = array( '/\[img\](.*?)\[\/img\]/is', ); $simple_replace = array( '<img src="'.$this->resize_Images('$1', 700, 500).'" />', ); $str = preg_replace ($simple_search, $simple_replace, $str); return $str; }
  10. Hi, I coded this website in php http://www.3gar.info but it seem very slow. I checked the server but they said everything is ok and the website run smoothly in server. I have another copy of this website in hostmonister it run very fast there. http://www.ibuj.org
  11. Plz help I have a registration form. I need if someone fill something wrong, the form stop sending data without refreshing or losing data
  12. I coded small funny script I tested it in three hosting ww.rufaa.net dallawat.com/new ibuj.org but I don't know why in the first link, my script seem slow not like the other second and third links
  13. WebStyles & AyKay47 Thank you I think I put the wrong email. Now it is working but in message body It show this : X-Mailer: PHP/5.2.17X-Mailer: PHP/5.2.17 how can I hide this
  14. the function if working and I have no error but I did not catch any email I tried gmail - yahoo - hotmail
  15. No error which one that is incorrect?
  16. I changed it like this $to = $em; $subject = $txt3; $message = "".$txt4.""; $headers = "From:".$txt2." <".$txt2.">" . "\r\n" . "Reply-To: ".$txt2." <".$txt2.">" . "\r\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: text/html; charset=utf-8\n"; $headers .= "\r\nX-Mailer: PHP/" . phpversion(); $headers .= "X-Mailer: PHP/" . phpversion()."\r\n"; mail($to, $subject, $message, $headers); $em is my email which I fetch it from database.
  17. I don't know why refuse to send email $to = "To: ".$em.""; $subject = $txt3; $message = "".$txt4.""; $headers = "From:".$txt2." <".$txt2.">" . "\r\n" . "Reply-To: ".$txt2." <".$txt2.">" . "\r\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: text/html; charset=utf-8\n"; $headers .= "\r\nX-Mailer: PHP/" . phpversion(); $headers .= "X-Mailer: PHP/" . phpversion()."\r\n"; mail($to, $subject, $message, $headers);
  18. Hi, echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head> <meta http-equiv="Content-Type" content="text/html; charset='.$sessInfo->langEncoding().'" /> I made this function which put utf-9 as default. But when user select Arabic language, utf-8 will not read Arabic charset (it should be windows-1256) $sessInfo->langEncoding()
  19. I made small website with two languages (English/Arabic) but Arabic language content always shows in very strange characters when I fetch them from database I made this function to encode it. but when I do this English Language content disappeared. public function enco($item) { if(isset($_SESSION['lang'])){ $lang = $this->sanitStr($_SESSION['lang']); if($lang == $this->sanitStr('Arabic')){ return iconv('UTF-8', 'windows-1256', $item); }else{ return $item; } } } I changed encoding in my index page also echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head> <meta http-equiv="Content-Type" content="text/html; charset='.$sessInfo->langEncoding().'" /> in database I change this public function execute_connection() { $this->connection = mysql_connect($this->config['dbserver'], $this->config['dbuser'], $this->config['dbpass']); mysql_set_charset('utf8',$this->connection); mysql_query("SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'", $this->connection); if(!$this->connection){ $this->ThrowException("Sorry, unable to connect to the database!."); } $this->selectBhlDb($this->config['dbname']); }
  20. I am using filters public function sanitPostInput($runpost) { return filter_input(INPUT_POST, $runpost, FILTER_SANITIZE_SPECIAL_CHARS); }
  21. change encoding function public function langEncoding(){ require self::$BHLROOTDIR.'/settings.php'; $BhlDB = new BHL_DB($maserServer['DbHost'], $maserServer['DbUser'], $maserServer['DbPass'], $maserServer['DbName']); $langEcoding = new Load(); $checkEncoding = $langEcoding->loadSettings($langEcoding->sanitStr('lang')); if($checkEncoding == $langEcoding->sanitStr('Arabic')){ $encoding = $langEcoding->sanitStr('windows-1256'); }else{ $encoding = $langEcoding->sanitStr('utf-8'); } return $encoding; } then call the function in charset echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset='.$sessInfo->langEncoding().'" /> <meta name="Keywords" content="'.$article->metaWords().'" /> <meta name="Author" content="BHL-SimpleTool is coded by Othman A. Taha" /> <meta name="Description" content="'.$article->metaDesc().'" /> <title>'.$article->siteTitle('Islamic Broadcasting Union').'</title> <link rel="stylesheet" href="themes/default/style.css" media="all" type="text/css" /> <script language="javascript" type="text/javascript" src="js/bbcodes.js"></script> <script language="javascript" type="text/javascript" src="js/smileys.js"></script> </head>
  22. hi, I have input form works fine. But when I change the encoding on the html from (utf- to (windows-1256). the form send empty characters.
  23. Hi, I made this funny script. http://www.dallawat.com/new/index.php but when I write the url. the [www] disappear and the url be like this : http://dallawat.com/new/index.php
  24. Hi TeNDoLLA now everything ok thx
  25. Hi, thank you so much, it works fine but the output is [img=http://www.xxxxxxx.xxxxx/xxxxx.jpg]http://www.xxxxxxx.xxxxx/xxxxx.jpg how can I made it just [img=http://www.xxxxxxx.xxxxx/xxxxx.jpg]
×
×
  • 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.