Posts

Showing posts from September 6, 2009

Browser sniffing or detection : Conditional Css

<!--[if gt IE 6]> <link rel="stylesheet" type="text/css" href="css/ie7fix.css" media="screen" /> <![endif]--> <!--[if lte IE 6]> <link rel="stylesheet" type="text/css" href="css/ie6fix.css" media="screen" />  <![endif]--> <script language="Javascript" >     var useragent = navigator.userAgent;     var bName = (useragent.indexOf('Firefox') > -1) ? 'Firefox' : navigator.appName;     if (bName == " Firefox ")      {                  document.writeln('<style> #nav_bar_t6 {padding-left:33px; padding-right:33px; } #footer {margin-left:18%}</style>');     }     if(navigator.userAgent.indexOf ("Netscape")!=-1)     {                  document.writeln('<style> #nav_bar_t4 {WIDTH: 14.2%;padding-left:2px;} #footer {margin-left:18%}</style>');     }        ...

MySQL table and want to build a XML file with it in order to make a RSS feed.

<? php $dom = new DOMDocument() ; include "connection. php "; $queryz = "SELECT * FROM ticker"; $resultz = mysql_query($queryz) or die('Error, query failed'); $row = mysql_fetch_assoc($resultz); $ rss = $dom->createElement(' rss '); while($row = mysql_fetch_array( $resultz )) { $item = $dom->createElement("item"); $item->appendChild($dom->createElement("title", $row['item_title'])); $item->appendChild($dom->createElement("pubDate",$row['item_pubDate'])); $item->appendChild($dom->createElement("description",$row['item_description'])); $item->appendChild($dom->createElement("link",$row['item_link'])); $ rss ->appendChild($item); } $dom->appendChild($ rss ); $dom->save("myxml.xml"); OR <?php header('Content-Type: text/xml; charset=UTF-8'); $dom = new DOMDocument() ; ...