Archive for February, 2010

The role of CakePHP

Monday, February 22, 2010 21:38 1 Comment

CakePHP was critical to the project’s success. Here I emphasize what we consider are some of the main advantages to using the Framework.

It offers many useful, ready-to-use tools. CakePHP prevents us from having to “reinvent the wheel” every time. For common problems that must be solved when using an application of medium complexity, CakePHP already [...]

This was posted under category: cakePHP Interview Questions

CakePHP : Change view file from controller

Monday, February 22, 2010 21:08 No Comments

With CakePHP, the controller core automatically detects the file name of the view file which needs to be rendered from a controller action. You might want to reuse an existent view for an action or specify a different file name.
For example, if you have a controller named “Users” and you execute a controller action named [...]

This was posted under category: cakePHP Interview Questions

How to set PHP include_path?

Monday, February 22, 2010 3:38 No Comments

There are at least 2 ways you can set your PHP include_path.
1. Use the function ini_set(). For example if you wanted to set your PHP include_path to “.:../:./include:../include” then you would do this in your PHP code:
ini_set("include_path", ".:../:./include:../include");
2. Edit your PHP configuration file. Inside that file is a directive section for “Paths [...]

This was posted under category: PHP Interview Questions

How you can reload / refresh a page with jquery?

Sunday, February 21, 2010 22:35 No Comments

Okay I assume that you have a button REFRESH, which does reloading the page when you click on it.
Here is the code

// Use location.reload() in jquery to reload a page

<input name="refreshPage" type="button" id="refreshPage" value="Refresh" onClick="location.reload();">

This was posted under category: Javascript

CakePHP : SELECT BETWEEN query syntax

Sunday, February 21, 2010 19:06 No Comments

return $this->LogfileRecord->find(‘all’, ‘conditions’ => array(‘LogfileRecord.date between ? and ?’ => array($start_date, $end_date)));

This was posted under category: cakePHP Interview Questions

How to send HTML in email with php?

Sunday, February 21, 2010 12:10 No Comments

Yes it is possible if you add a HTML content type to your mail header, you can do it like this:
mail($recipient, $subject, $message, From: $sender\nContent-Type: text/html; charset=iso-8859-1);
or
mail($recipient, $subject, $message, From: $sender\nContent-Type: text/html; charset=utf-8);

This was posted under category: PHP Interview Questions

All lectures of Virtual University of Pakistan available online

Saturday, February 20, 2010 23:41 No Comments

Please click here to watch all Lectures.
You can watch more than 5000 lectures of VU on youtube free.

This was posted under category: General Knowledge

CURL PHP: Connect to a Secure Server

Saturday, February 20, 2010 23:04 No Comments

If you want to connect to a secure server for posting info/reading info, you need to make cURL with the openSSL options. Then the sequence is nearly identical to the previous example (except http_S_://, and possibly add the useragent):

<?php
curl_setopt($ch, CURLOPT_URL,"https://example.com");
//some sites only accept your request if your browser looks legit, so send a useragent profile…
curl_setopt [...]

This was posted under category: CURL PHP Examples

PHP Xajax Loading Message – Reverse Ajax

Saturday, February 20, 2010 22:23 No Comments

<?php

include ‘./xajax/xajax_core/xajax.inc.php’; //include the xajax libraries

function loading_function(){

new object response object

$objResponse = new xajaxResponse();

sleep(2); // Pretend to load some data

$objResponse->alert("Loading Complete"); // Display an alert when Task is completed

return $objResponse; // Return Object Response
}

$xajax = new xajax(); // Xajax Object

$xajax->registerFunction(‘loading_function’); // Register loading_function

$xajax->processRequest(); // Process the Request

$xajax_js = $xajax->getJavascript(‘/xajax’); [...]

This was posted under category: Ajax - Reverse Xaja

SEO Search Engine Optimization Bible

Friday, February 19, 2010 11:53 No Comments

Welcome to the Search Engine Optimization Bible. Search engine optimization has come to mean a lot of things to a lot of different people. In the strictest sense, SEO is about the on-page and off-page design strategies you can use to improve your search engine ranking. This usually means tweaking your web site, using [...]

This was posted under category: SEO Tips