Jump to content

freakman

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

freakman's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi New to phpfreaks forums, I'm hoping you can help me. So my language includes symbols like č,š,ž etc. Now I'm not so sure how to input them, I set charset to UTF-8, collation in db is utf8_unicode_ci but symbols get converted to some strange ones in db. So I was wondering that I convert them into ascii (č, š,ž) so that I can process them. How should I do this? if I use html_entity_decode(), then I need to change charset to iso-8859-1, which isn't big problem, but the thing is that all symbols are not converted, symbols like š, ž etc... I checked around and I looked into cms drupal and now I'm wondering how did they managed to use utf-8 charset, but still inputs stay unchanged, so if we insert č,š,ž it shows č,š,ž in database and this would be perfect for me. Any help with this or maybe advice me good solution? thanks
  2. Hi I need help with modifing this script: [code]     <?php     require_once("./tiny_includes/config.php");     $smarty = new Smarty;     $smarty->template_dir = "$dir_ws/tiny_templates";     $smarty->compile_dir = "$dir_ws/tiny_templates_c";     $smarty->assign("url_to_index",$config['url_to_index']);     $HTTP_SESSION_VARS['searchurl'] = '';     $randlink = '';     if($_SERVER['QUERY_STRING'] && !$fullurl && !preg_match('/[\W]/',$_SERVER['QUERY_STRING'])){       //loading index.php with query       if($res = checkQueryString($_SERVER['QUERY_STRING'])){         //query found         if($res['showsplash'] && $config['refreshrate']){           $smarty->assign("fullurl",$res['fullurl']);           $smarty->assign("fullurl_substr", (strlen($res['fullurl'])>75?substr($res['fullurl'],0,75).'...':$res['fullurl']));           $smarty->assign("refreshrate",$config['refreshrate']);           $smarty->assign("ad",getAd());           $smarty->assign("records",getNumb());           $smarty->display("connect.htm");         }         else js_redirect($res['fullurl']);       }       else{         //query did not find         $smarty->display("error.htm");       }     }     else{       if($fullurl){         preg_match("/^((http:\/\/)*)(.*)/i", $fullurl, $matches1);         preg_match("/^(http:\/\/)*/i", $fullurl, $matches2);         if($matches1[1]==$matches2[1] and $matches1[3]) $u = parse_url($fullurl);         else $u['host'] = $fullurl;         $ip = gethostbyname($u['host']);         //if($ip == $u['host']){         //  js_alert ('No such host!');         //}         //else         $randlink = addLink($fullurl,$ip);       }       //loading index.php       $smarty->assign("fullurl",$fullurl);       $smarty->assign("fullurl_substr",((strlen($fullurl)>75)?substr($fullurl,0,75).'...':$fullurl));       $smarty->assign("randlink",$randlink);       $smarty->assign("fullurl_length",strlen($fullurl));       $smarty->assign("randlink_length",strlen($config['url_to_index']."?".$randlink));       $smarty->assign("ad",getAd());       $smarty->assign("records",getNumb());       $smarty->display("index.htm");     }     ?>[/code] Sorry because of big script. This is for making short links, like mypage.com/?532sa. No I would like to change it so that when I type mypage.com/http://www.yoursite.com opens redirecting to new site and then it redirect to new site. Currently nothing happends when I do that so probably changes need to be under else. The option for short link must stay... Thank you in advance
×
×
  • 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.