Posts

Showing posts from August, 2014

A basic PHP Program

Image
Here we are going to understand basic PHP program within  a HTML Code.

Follow the program to Understand:

Comments on PHPPrinting a word using PHPprint and echo function in PHP, These function are used for displaying a Text, word or a variable. Some times its also used to display return value from the function, which will be understand later in the Blog.Function are the pre-defined a Block of code, which makes you easy to write program. This is also cover later in the blog.A Browser only display HTML, and server by the use of Apache execute the PHP and makes HTML to display on the Browser. Some Example of are "Opera", "Google Chrome", "Mozila Firefox".Use as many as Space, Tabs and new line in PHP code. This is called Best Proctise to write a Code in any language, as They are readable and more clear then write withouts spaces and etc.

###############################################
   PHP Code
###############################################
<html>
<…

Moving WordPress from one Location to Another Location

Whether you are moving WordPress to a new server or to a different location on your server, you don't need to reinstall. WordPress is flexible enough to handle all of these situations.

Moving to a New Server
If you are moving WordPress from one server to another, begin by backing up your WordPress directory, images, plugins, and other files on your site as well as the database. See WordPress Backups and Backing Up Your Database.

Here is a simple guide to moving your WordPress site to a new server that describes the process.

Keeping Your Domain Name and URLs
Moving your domain without changing the Home and Site URLs of your WordPress site is very simple, and in most cases can be done by moving the files.

If database and URL remain the same, you can move by just copying your files and database.If database name or user changes, edit wp-config.php to have the correct values.If you want to test before you switch, you must temporarily change "siteurl" and "home" in the…

Move your Magento site from one hosting account to another

Image
Follow these steps to transfer Magento from one account to another:

Step 1: Backup the Magento MySQL DatabaseStep 2: Transfer all Magento FilesStep 3: Adjust the Magento ConfigurationStep 4: Restore the Magento Database STEP 1 Backup the Magento MySQL Database

On SiteGround servers you have phpMyAdmin included by default in cPanel for your account. In other cases you will have to use the same tool or a similar one that is capable of exporting your MySQL database. Detailed information on how to perform a MySQL backup can be found in our MySQL Tutorial.

Alternatively, if you don’t have phpMyAdmin installed but you have shell access you can use the mysqldump tool. The syntax is as follows:

mysqldump -h HOST -u USER -p DATABASENAME > FILENAME.sql
where:

HOST is the database server hostname or it can be omitted if you are running the MySQL server locally
USER - a user with full privileges to the Magento database
DATABASENAME - is the full name of the database which Magento is running
FIL…

Sending HTML mail using PHP

Image
<?php
// multiple recipients
$emailto  = 'emailto@example.com';
// note: For Multi emailto user comm

// subject
$subject = 'Email Subject For the mail';

// message
$message = '
<html>
<head>
  <title>Title of th email</title>
</head>
<body>
  <p>Folling is the Details</p>
  <table>
    <tr>
      <th>Some Name 1</th><th>Some Name 2</th>
    </tr>
    <tr>
      <td>Some Value 1</td><td>Some Value 1</td>
    </tr>
    <tr>
      <td>Some Value 1</td><td>Some Value 1</td>
    </tr>
    <tr>
      <td>Some Value 1</td><td>Some Value 1</td>
    </tr>
  </table>
</body>
</html>
';

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8…

Getting success response for Posting XML Data from PHP & curl

I have done the following code for the solution:

<?php

$url = "http://posttestserver.com/post.php";  // test post server
$file="file.xml";


if (file_exists($file)) { // check file existance

$headers = array(
'Content-Type: text/xml',
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language: en-US,en;q=0.5',
'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0',
'Pragma: no-cache',
'Connect: close'
);

$xml = file_get_contents($file);
$stream_options = array(
       'http' => array(
       'method'  => 'POST',
       'header'  => implode("\r\n", $headers),
       'content' => trim($xml)
    ),
);

echo "Context:".$context  = stream_context_create($stream_options);     //  sending options
echo "Response:".$response = file_get_contents($url, null, $context);   //  Response from …

Posting XML Data from PHP & curl

Image
There is a frequent need to post xml data to a url. Below is shown an example which lets you post xml data using CURL.


<?php $url = "http://www.some_domain.com"; $post_string = '<?xml version="1.0" encoding="UTF-8"?> <rootNode> <innerNode> </innerNode> </rootNode>'; $header = "POST HTTP/1.0 \r\n"; $header .= "Content-type: text/xml \r\n"; $header .= "Content-length: ".strlen($post_string)." \r\n"; $header .= "Content-transfer-encoding: text \r\n"; $header .= "Connection: close \r\n\r\n"; $header .= $post_string; $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 4); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header); $data = curl_exec($ch); if(curl_errno($ch)) print curl_error($ch); else curl_close($ch); ?…

Facebook is not working now 1st August 2014

Image
What happen to facebook today. Its not working since one and hour. We think the Facebook is updating their website.

It can affect a lot, who are most dependent on facebook for entertainment.
Most people like student, housewife and bachelor professional.

Facebook can announce a PR tomorrow.

We are waiting for the same.