Jump to content

DjordjeB

New Members
  • Posts

    5
  • Joined

  • Last visited

DjordjeB's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. include "header.php"; if(isset($_GET['post_id'])) { $select=mysqli_query($con,"select...."); while($data=mysqli_fetch_array($select)) { echo "bla bla bla"; to_head("<title>asd</title><meta itemprop="name" content="asdfasdf">..."); } } include "footer.php"; This is samthing what i want... I have header.php and footer.php and any script ex news.php where how news and read SEO stuff from database and put in HEAD of the document. I tried with jquery like $("head").append(str); and it works but then i read google don't run jquery when vist website. This is done with drupal, wordpress and php-fusion Drupal: https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_add_html_head/7 php-fusion: https://www.php-fusion.co.uk/forum/viewthread.php?thread_id=30959 so it is possible but i don't know how. Any idea?
  2. i think you need to make some idle function before you send next mail. becouse some servers has limit send mail for 30 sec example: 50mail for 10 sec
  3. i solve problem with mysql_query("set names 'utf8'"); and write xml with mb_convert_encoding utf8 utf8 and works greet, but now i have another problem with search xml, do you know better solution for search then: if (strpos(mb_strtolower($y->item(0)->childNodes->item(0)->nodeValue),$q)
  4. mysql is utf-8 script you see. I need to write utf8 in xml. $ime = $doc->createElement('ime'); $ime = $film->appendChild($ime); $dodajime = $doc->createTextNode(mb_convert_encoding($pod['Name'],"UTF-8","UTF-8")); $dodajime = $ime->appendChild($dodajime); with this i don't have any error on proba.php (first page) but when i open xml i got this This page contains the following errors:error on line 3 at column 4625: Encoding error and line with this: Bellflower Zvon?i?
  5. $doc = new DOMDocument(); $doc->preserveWhiteSpace = false; $doc->formatOutput = true; $doc->load("proba.xml"); $root = $doc->documentElement; $filmovi=mysql_query("SELECT * FROM film ORDER BY film_id DESC LIMIT 0,100"); while($pod=mysql_fetch_array($filmovi)) { $film = $doc->createElement('film'); $film = $root->appendChild($film); $link = $doc->createElement('link'); $link = $film->appendChild($link); $dodajlink = $doc->createTextNode('film-'.seoURL($pod['film_ime']."_".$pod['film_imesrpski']).'-'.$pod['film_id']); $dodajlink = $link->appendChild($dodajlink); $ime = $doc->createElement('ime'); $ime = $film->appendChild($ime); $dodajime = $doc->createTextNode(utf8_encode($pod['film_ime'].' '.$pod['film_imesrpski'].' '.$pod['film_imestrano'])); $dodajime = $ime->appendChild($dodajime); $doc->save("proba.xml"); } thet was proba.php proba.xml is: <?xml version="1.0" encoding="UTF-8"?> <pretraga> <film> <link>film-Rough_Magic_Opasna_magija-4657</link> <ime>Rough Magic Opasna magija </ime> </film> <film> <link>film-HouseSitter_uvarkua-4656</link> <ime>HouseSitter ?uvarku?a </ime> </film></pretraga> and livesearch.php $xmlDoc=new DOMDocument(); $xmlDoc->load("proba.xml"); $x=$xmlDoc->getElementsByTagName('film'); //get the q parameter from URL $q=$_GET["q"]; //lookup all links from the xml file if length of q>0 if (strlen($q)>0) { $hint=""; for($i=0; $i<($x->length); $i++) { $y=iconv('','UTF-8',$x->item($i)->getElementsByTagName('ime')); $z=$x->item($i)->getElementsByTagName('link'); if ($y->item(0)->nodeType==1) { //find a link matching the search text if (strpos($y->item(0)->childNodes->item(0)->nodeValue,$q)) { if ($hint=="") { $hint="<a href='".$z->item(0)->childNodes->item(0)->nodeValue . "' target='_blank'>" . $y->item(0)->childNodes->item(0)->nodeValue . "</a>"; } else { $hint=$hint . "<br /><a href='".$z->item(0)->childNodes->item(0)->nodeValue . "' target='_blank'>" . $y->item(0)->childNodes->item(0)->nodeValue . "</a>"; } } } } } // Set output to "no suggestion" if no hint were found // or to the correct values if ($hint=="") { $response="Nema slicnih filmova"; } else { $response=$hint; } //output the response echo $response; livesearch and all work great except if i use non-english characters... i try with utf8_encoding but doesent work, i read a lot of diffrient things but i don't know how to use function like: iconv livesearch script When i try to add non-english charcter in xml file and when i use search i got this message: how can i fix this problem?
×
×
  • 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.