Monday, December 10, 2012
Saturday, April 14, 2012
Create simple json webservice in php
Take a php file
Assign your data in an array and encode it with json. You can put the conditions for authentication.
Access the website data using curl
$row = array("Firstname"=>Testing, "Lastname"=>User, "Email"=>"user@domain.com");
echo json_encode($row);
?>
Assign your data in an array and encode it with json. You can put the conditions for authentication.
Access the website data using curl
$row = array("Firstname"=>Testing, "Lastname"=>User, "Email"=>"user@domain.com");
echo json_encode($row);
?>
Sunday, August 28, 2011
Create template in wordpress
We can create like this
Put the comment in new php file and save it in wordpress theme folder, then new template is created with below name "MyFirstTemplate"
/*
Template Name: MyFirstTemplate
*/
Put the comment in new php file and save it in wordpress theme folder, then new template is created with below name "MyFirstTemplate"
/*
Template Name: MyFirstTemplate
*/
Facebook login button not displaying in IE
We have to use facebook html tags at the document starting, we can see the button if we use the facebook html tag (those tags will be 2 lines)
Php session is not storing
Open the php.ini file and set the session path. Generally we have to give the temporary directory.
For Example In Windows:
C:\DOCUME~1\Admin\LOCALS~1\Temp ..............like this. In this folder session is saved in a file with random name (The data will be in serilize format)
For Example In Windows:
C:\DOCUME~1\Admin\LOCALS~1\Temp ..............like this. In this folder session is saved in a file with random name (The data will be in serilize format)
Monday, April 18, 2011
search keywords from static files
$content = file_get_contents('filename.extension'); //Example file_get_contents('filename.hml');
Here $key is the search word //Example $key = "php";
if(preg_match("/".$key."/", $content, $matches))
echo "found";
else
echo "not found";
Here $key is the search word //Example $key = "php";
if(preg_match("/".$key."/", $content, $matches))
echo "found";
else
echo "not found";
Subscribe to:
Posts (Atom)