How To enable mod_rewrite on Xampp

August 18th, 2010 R Arun Raj No comments

Search For httpd.conf file and uncomment this line

#LoadModule rewrite_module modules/mod_rewrite.so

LoadModule rewrite_module modules/mod_rewrite.so

Restart your Server

create a .htaccess file on your server root

put this code

RewriteEngine On
RewriteBase /
RewriteRule ^contact-us$ index.php

Categories: PHP, Programming Tags: , , ,

How Secure and Protected our Email Content In Gmail ?

July 12th, 2010 R Arun Raj No comments

I yesterday i noticed something on my Gmail Inbox.  Gmail is displaying my bank Account number in right of my inbox. I really wondered how secure our gmail content. Almost all my account is linked with gmail . So lot 0f password residing in it. Even though I am heard about Google Toilet i wont realize what they exactly meant.

July 2nd, 2010 R Arun Raj 1 comment

Google Maps has a wide array of APIs that let you embed the robust functionality and everyday usefulness of Google Maps into your own website and applications, and overlay your own data on top of them:
Maps JavaScript API

Embed a Google Map in your webpage using JavaScript. Manipulate the map and add content through many services.
Version 3 – Version 2
Maps API for Flash

Use this ActionScript API to embed a Google Map in your Flash-based web page or app. Manipulate the Map in three dimensions and add content through many services.
Learn more
Google Earth API

Embed a true 3D digital globe into your web page. Take your visitors anywhere on the Earth (even below the ocean) without leaving your web page.
Learn more
Static Maps API

Embed a fast and simple Google Maps image in your web page or mobile site without requiring JavaScript or any dynamic page loading.
Learn more
Web Services

Use URL requests to access geocoding, directions, elevation, and places information from client applications, and manipulate the results in JSON or XML.
Learn more
Maps Data API

View, store and update map data through Google Data API feeds, using a model of features (placemarks, lines & shapes) and collections of features.
Learn more

Categories: Misk Tags:

Creating XML-RSS Feed Using PHP MYSQL

June 11th, 2010 R Arun Raj No comments

I have been working to create crowler friendly rss feed for our website. I think it is very easy to build . But when i started coding it i got so many problems with xml and special charcters. I tried program for replacing special characters. But it wont work. Finally i used utf8_encode. It worked

$h=utf8_encode(clean_url($result['name']));
$d=utf8_encode(clean_url($result['discription']));

I have attached PHP Source code for XML Generator

feed.php

Right click on the above link and save target as …

Below function is used to clean all extra characters in the content.

function clean_url($text)
{
$text=strtolower($text);
$code_entities_match = array(‘>>’,'–’,'�’,'–’,'&’,'“’,'”’,'–’,'’’,'-’,'–’,'”‘,’!',’@',’#',’$',’%',’^',’&’,'*’,'(‘,’)',’_',’+',’{‘,’}',’|',’:',’”‘,’< ‘,’>’,'?’,’[',']‘,’\\’,';’,”‘”,’,',’.',’/',’*',’+',’~',’`',’=',’-',’ï’,'–’,”‘”,’O');

return str_replace($code_entities_match,”, $text);
}

To make an rss feed you need title, description and link

Sample RSS FEED format

<rss version=”0.91″>
  <channel>
    <title>XML.com</title>
    <link>http://www.xml.com/</link>
    <description>XML.com features a rich mix of information and services for the XML community.</description>
    <language>en-us</language>
       <item>
            <title>Normalizing XML, Part 2</title>
            <link>http://www.xml.com/pub/a/2002/12/04/normalizing.html</link>
             <description>In this second and final look at applying relational normalization techniques to W3C XML Schema data modeling, Will Provost discusses when not to normalize, the scope of uniqueness and the fourth and fifth normal forms.</description>
       </item>

    <item>
      <title>SVG’s Past and Promising Future</title>
          <link>http://www.xml.com/pub/a/2002/12/04/svg.html</link>
           <description>In this month’s SVG column, Antoine Quint looks back at SVG’s journey through 2002 and looks forward to 2003.</description>
    </item>
  </channel>
</rss>

also go through the source code attached

How to configure cURL in xampp server

May 25th, 2010 anoopsankar No comments

xampp server with default configuration can’nt run curl_init();

to make it work in xampp server we have to edit three files namely

1. php.ini(which is a configuration stting file).

2. php.ini-recommended(INI-DIST file)

3. php.ini-dist(INI-RECOMMENDED file)

open these files in notepad and search for ‘curl’ and remove ‘;’ symbol, save and close the files.

Remember to restart your server before running the application.

How to set default values (input field) in symfony 1.4 generated forms

May 17th, 2010 R Arun Raj No comments

I was trying to set default values for an input field.

public function executeNew(sfWebRequest $request)
{
$this->customer = Doctrine::getTable(‘Customer’)->find(array($request->getParameter(‘customer’)));
$this->forward404Unless($this->customer);
$this->form = new CallLogForm();
$this->form->setDefault(‘customer_id’,$request->getParameter(‘customer’));
}

This is the way to set hidden values of default values for an input field

$this->form->setDefault(‘customer_id’,$request->getParameter(‘customer’));

Categories: Symfony, framework Tags: , , ,

Symfony Study Guide – Small Project Implementation

May 15th, 2010 R Arun Raj No comments

Download Symfony Sandbox 1.4

Source : www.symfony-project.org/installation
Requirement : Xampp or Wamp Package
PHP: 5.2 Above

Download Symfony and put this into your website root

Rename sf_sandbox to your project name. Here it is CRM

open config/properties.yml file and put below details

[symfony]
name=CRM
author=Arun Raj R
orm=Doctrine

Read more…

Symfony 1.4 Doctrine Pagination

May 14th, 2010 R Arun Raj No comments

Doctrine Pagination is made very simple .

public function executeIndex(sfWebRequest $request)
  {
    $this->pager = new sfDoctrinePager('TableName', sfConfig::get('app_max_jobs_on_homepage');
    $this->pager->setQuery(Doctrine::getTable('TableName')->createQuery('a'));
    $this->pager->setPage($request->getParameter('page', 1));
    $this->pager->init();
 }

Success page

<?php foreach ($pager->getResults() as $post): ?><div>
<?php if($post->getTitle()) { echo link_to($post->getTitle(), ‘news/fullstory?expand=’.$post->getId(),’class=”mhead”‘); } ?>
<?php if($post->getDn2()!=”) { echo image_tag($post->getDn2()); } ?>
<?php $content=$post->getContent();
$stripcontent=substr($content,” “,700);
echo $stripcontent;
?>
<div style=”display:block;” > <?php echo $post->getCreatedAt(); ?><?php echo link_to(“Full Story”, ‘news/fullstory?expand=’.$post->getId(),’class=”fullstory”‘) ?> <br /><br />
</div></div>
<?php endforeach ?>

pagination

<?php if ($pager->haveToPaginate())  { ?>

<div id=”navv”>

<?php echo link_to(‘Latest’, ‘news/index?page=’.$pager->getFirstPage(),’class=”pager”‘) ?>
<?php echo link_to(‘prev’, ‘news/index?page=’.$pager->getPreviousPage(),’class=”pager”‘ ) ?>
<?php $links = $pager->getLinks(); foreach ($links as $page): ?>
<?php echo ($page == $pager->getPage()) ? $page : link_to($page, ‘news/index?page=’.$page,’class=”pager”‘) ;?>
<?php if ($page != $pager->getCurrentMaxLink()): ?> <?php endif ?>
<?php endforeach ?>
<?php echo link_to(‘next’, ‘news/index?page=’.$pager->getNextPage(),’class=”pager”‘) ?>
<?php echo link_to(‘Oldest’, ‘news/index?page=’.$pager->getLastPage(),’class=”pager”‘) ?>
<?php } ?></div>

Videos, Slideshows and Podcasts by Cincopa Wordpress Plugin