How To Set Up A Wordpress Website


WordPress is most powerfull CMS system, which is so easy to install. Wordpress setup is very simple process and complete Wordpress setup wizard in few steps with less than five mintues. Online Web host companies provide one click Wordpress setup tools like as Fantastico which automatically setup WordPress on your web hosting. even so if you wish to put in WordPress yourself, the next guide will help.

Wordpress setup Hosting Requirements

MYSQL 5.0 Database or greater
PHP Language ver 7.2 or greater
Server Type
  • WAMP (Windows)
  • XAMP (Multi-platform)
  • LAMP (Linux)
  • MAMP (Macintosh)
Browser −Internet Explorer 8+, Google chrome, Firefox, Safari, Opera

Download Wordpress And setup

To Install wordpress visit wordpress website or click here and download latest version from there.

Create Wordpress Database

When Very first time setup WordPress for that require MySQL database. Create MYSQL database with username and password. Automatically wordpress setup provide username as "root" and password as "root" or you are able to set according to your choice.

Wordpress Setup Startup Wizard

It's quite simple to set up WordPress into your system. Below describe how to set up WordPress locally in your system.
  • The Wordpress setup you Obtain from wordpress website is extratct in folder. Transfer the wordpress files folder from produced folder to web server folder in the event that you mount online primarily standard folder is PUBLIC_HTML or you can copy wordpress files folder to localhost folder WWW.
  • In browser open your WordPress local path, next we will faced with screen of the WordPress installer. Default path is localhost/< Your_wordpress_folder >.
  • Wordpress installtion wizard language choose
  • Choose your language for the WordPress and press continue button.
  • Next wizard screen show your wordpress database criteria which require for WordPress setup. Click Let's Go button to continue
  • create database for wordpress setup wizard
  • Now Here we reach the situation where fill wordpress database detail. Fill wordpress database information according to below screen and then click on Submit button.
  • wordpress setup wizard form
    When you fill wordpress database information, it check all information provided is correct then show you next screen.
  • Click on Run The Install button.
  • wordpress setup wizard run setup
  • We will see welcome screen where provide admin level information which is shown in below screen. After Fillup admin information Click on Install Wordpress button.
  • wordpress setup wizard add admin information
  • When Wordpress setup wizard completed successful, a screen showing up filled data as given below. Click Log In button to go to admin login form.
  • wordpress setup wizard admin information
  • Now Finally we reached login page of wordpress. Where we provide login credential to enter wordpress admin panel area.
  • wordpress setup wizard admin Login
Finally You have done! You have complete your wordpress setup wizard for Website! Enjoy ;)

Title

Share:

Find IP Address in PHP


Find IP Address in PHP

Here now learn the script of to find ip address in php of visitor which visit on website.

To store Visitor ip addres in PHP has syntax :-

1
$_SERVER[‘REMOTE_ADDR’]     // return visitor ip address
When a ip address has been received then now need text file to enter in it by using the
 syntax fwrite() function

$myipaddress = $_SERVER['REMOTE_ADDR']."\r\n";
In above codes first declare a variable which can pick IP address of  Visitor. One thing remember if you are testing or working on localhost server then naturally it return Local IP 127.0.0.1
First, we will use a variable to store the ip address. If you are working on a localhost environment, it will return 127.0.0.1
1
$myipaddress = $_SERVER['REMOTE_ADDR']."\r\n";
Now time to store visitor IP address in file using the PHP functions fopen() and fwrite(). 
Use below codes for that :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
// store visitor ip address
$myipaddress = $_SERVER['REMOTE_ADDR']."\r\n";

// Log file name which store all ip address
$ipfile = 'logdata.txt';

// store visitor data by opening log file
$ipfp = fopen($ipfile, 'a');

fwrite($ipfp, $myipaddress);

fclose($ipfp);
These codes produce the output like as below in our log file:

127.0.0.1
127.0.0.1
127.0.0.1
127.0.0.1
We can also approve more this script with help of to enter other PHP funcations like as browser information and visitor’s visited page.
For that we need miner changes in our pre-written PHP script codes.
Use below codes for that :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
// store visitor ip address
$myipaddress = $_SERVER['REMOTE_ADDR']."\r\n";

// visited page name
$page = $_SERVER['SCRIPT_NAME'];

// browser detail
$brow = $_SERVER['HTTP_USER_AGENT'];

// Log file name which store all ip address
$ipfile = 'logdata.txt';

// store visitor data by opening log file
$ipfp = fopen($ipfile, 'a');

fwrite($ipfp, $myipaddress);

fclose($ipfp);
These codes produce the output like as below in our log file:

127.0.0.1 - /product.html Mozilla 19.0 (Windows NT)
127.0.0.1 - /product.html Mozilla 19.0 (Windows NT)
127.0.0.1 - /product.html Mozilla 19.0 (Windows NT)
127.0.0.1 - /product.html Mozilla 19.0 (Windows NT)
Enjoy :) you have done!
Share:

using php with html

I writing this post with the view of that you familiar with “what is HTML Page and basic PHP?”. For run PHP codes inside PHP also require a server on your local machine which is a publish in our blog. So we know that HTML is a base of web development where developer can present content in fashionable way for website. Well form formatted of HTML pages give benefits to spread world-wide which will we cover later. HTML pages have basic structure to present contents. There are some different area in HTML which use for different purpose. Now given below is basic structure of HTML page.
<html>
<head>
<title>This is the title shown above the menu bar on my browser</title>
</head>
 
<body>
I wish I knew how to write PHP in HTML files...
</body>
 
</html>
Now we come to our main aim is use of php. We can combine HTML and PHP in same page of website. In above section we learn basic structure of HTML Page. Look “How merge PHP codes in HTML?”
<html>
<head>
<title>This is the title shown above the menu bar on my browser</title>
</head>
 
<body>
<?php
  print "I know how to write PHP!";
?>
 
<b>Perhaps I'll be lazy and write more php.</b>
 
<?php print "No way!  PHP is cool!<br />"; ?>
</body>
 
</html>
Now we saw “How combine to language contents?”. <?php show the start of php working area and ?> show end of php codes. So we can easly start php area any where in html page according to requirement. You can put your codes inside of  <?php your statement goes here…… ?> . if you type your code out side of <?php ?>  it not working and html page is taking it as simple contents. Because to work with php need to define its working area. So then php language trace and under of what command type and there contents.
Share:

How to install wordpress plugin using WordPress Admin Panel Search Option

This way of Wordpress Plugin Installation Very Easy. The downside of this option is that a plugin must be in WordPress plugin directory. Free plugins that follow GPL and all WordPress guidelines are Under this directory.
Ads by AdGenta.com
For this you go to Worpress Admin Panel  and Click on Plugin > Add New
install wordpress plugin, installing wordpress plugins, how to install wordpress plugin, wordpress install plugin, install wordpress plugins, install plugin wordpress, wordpress search plugin

When you Install Wordpress Plugin will see the screen like the one in above screenshot. Now type Wordpress Plugin Name or Function, like we did. Then you will see a listing like the below.
install wordpress plugin, installing wordpress plugins, how to install wordpress plugin, wordpress install plugin, install wordpress plugins, install plugin wordpress, wordpress search plugin

Pick the Wordpress Plugin that is suite for your requirement. In our case we were searching for image Gallery Wordpress Plugin, then click the Install link. A popup the plugin information like the example below.
install wordpress plugin, installing wordpress plugins, how to install wordpress plugin, wordpress install plugin, install wordpress plugins, install plugin wordpress, wordpress search plugin

Now we see description, installation method, and related information about the Wordpress Plugin. If this is the Wordpress Plugin that you need, then click on the  Install Now button. When you click that button, the Wordpress Plugin will be installed, and you will screenshot like below.
Ads by AdGenta.com
install wordpress plugin, installing wordpress plugins, how to install wordpress plugin, wordpress install plugin, install wordpress plugins, install plugin wordpress, wordpress search plugin

After you click on Activate the Wordpress Plugin, you have installed the WordPress Plugin. You would have to configure the settings to fit your needs. These settings will vary for Wordpress Plugin therefore we will not guide about this in this post.
Tags: , , , , , ,
Share:

Explaining the WordPress Site Structure


WordPress Files and Directory Structure


When you install wordpress on your hosting, a default wordpress theme automatically activated.Here now we learn (wordpress Beginner) basic about wordpress website. Below wordpress outline describe about wordpress diffrent area.

wordpress structure, wordpress beginner, wordpress tutorial for beginner
Default theme of wordpress.
  1. This is Header are of  wordpress and display title of  wordpress Website.
  2. This Navigation of your wordpress Website. Which contain all pages of your wordpress Website.
  3. When you make new wordpress Post . All Content of your  wordpress Post are display here.
  4. Your all wordpress Widgets are display here. Actually Known as wordpress Sidebar .
  5. At Last is wordpress Footer area where display wordpress Footer Content .
Ads by AdGenta.com
In wordpress Theme every wordpress has diffrent theme. If you install another wordpress theme then its above mentioned content may be differ.
Tags: , , ,
Share:

PHP Pagination


Pagination of pages in PHP is a topic famous topic. So here I not explain any new php codes for Php Pagination. I will explain how you can use pagination for data held within an array.
Normally you did only need to paginate your data that if you’ve got quite a lot of it in.With database systems of course pagination (Php Pagination) can be achieved relatively easily by specifying the offset parameters in an SQL query. But what if your data didn’t come from a database table and instead came from a flat file. So look at the following code which expalin exactly how it’s done Php Pagination.
// Data, normally from a flat file or some other source
$data = "Item 1|Item 2|Item 3|Item 4|Item 5|Item 6|Item 7|Item 8|Item 9|Item 10";
// Put our data into an array
$dataArray = explode('|', $data);
// Get the current page
$currentPage = trim($_REQUEST[page]);
// Pagination settings
$perPage = 3;
$numPages = ceil(count($dataArray) / $perPage);
if(!$currentPage || $currentPage > $numPages)
$currentPage = 0;
$start = $currentPage * $perPage;
$end = ($currentPage * $perPage) + $perPage;
// Extract ones we need
foreach($dataArray AS $key => $val)
{
if($key >= $start && $key < $end)
$pagedData[] = $dataArray[$key];
}

Created the $data array which contains a long line of items distribute up by the pipe '|' character. Realistically this would be real data just for this tutorial I'll keep it simple. Then, using the explode() function I've cut up the $data variable into array using '|' as the delimeter.
The line 8 in Php Pagination simply gets the current page number one is provided.
Lines 7 to 13 Php Pagination do the math calculations which make this array pagination work. Now set how many items we'd like to display per page into the variable, $perPage. In the example above I've set this to 3.
On line 8 we're working out how many pages there are going to be. This can be done by dividing the total number of items (by using the count() function) by the items per page value. Notice on this line that I'm also using the ceil() function. This basically rounds the number up (e.g. 5.134 becomes 6).
We then have a simply if statement on lines 9 and 10 of Php Pagination. It's basically saying that if no page number has been provided or if the provided page number is more than the number of pages, set it to 0. This stops people from trying to access pages which have no items.
On lines 14 and 15 of Php Pagination we're setting the $start and $end variable which you might recognize if you've done pagination using SQL queries before. The $start variable holds the lowest ID of the item which can be displayed on this page. The $end variable is maximum cap which the items ID can be to be displayed (actually, it's one above, but this depends on how you do your if statement on line 17 of Php Pagination).
Great, we're nearly there. Now, on line 15 of Php Pagination we start a foreach statement which loops through each of our data items. Inside this loop is a simple if statement to see if the id of the current data item is above (or equal to) the $start value and below the $end value. If it is then we place a copy of it into our $pagedData array.
Once the foreach loop has finished the $pagedData array now contains all of the data items which we should be displaying on the current page. All we have to do now is to loop through and display them. This has been shown in the following code snippet.
foreach($pagedData AS $item)
            echo $item . "<br>";

As displaying the data goes that's it. Now need to display the pagination links to let you navigate your way through the pages. Here's the code for Php Pagination.

if($currentPage > 0 && $currentPage < $numPages)
            echo '<a href="?page=%27%20.%20%28$currentPage%20-%201%29%20.%20%27">« Previous page</a><br>';

if($numPages > $currentPage && ($currentPage + 1) < $numPages)
            echo '<a href="?page=%27%20.%20%28$currentPage%20+%201%29%20.%20%27" class="right">Next page »</a><br>';

Above codes of Php Pagination contain two quite simple if statements. First is displaying the "previous page" link and the another is for displaying the "next page" link.
If first statement checking to see if the current page is more than 0 and if the current page is less than the total number of pages.
The second if statement is checking to see if the total number of pages is more than the current page number and if there are any more pages after the current page.
Atleast you have done Php Pagination.
Share:

Send Mail using Php


Now Todays we will lean “send mail using php”. It simple method to send email using php codes. There are some field require to process this php script. These are like as To, Subject, Message, From. You can also extend all other option its depend on your requiremet. This guide to beginner for “send mail using php”.

Send Mail using Php Step 1:

Create File with name sendmail.php and paste above codes in it.

<?php
$to = "toaddress@mailservername.com";
$subject = "Just a test mail";
$message = "Just training on php";
$from = "fromaddress@mailservername.com";

Now we define the parameters to,suject,message and header containing from and reply address. In script header is the area where user set the from address, reply to address, cc address, etc.

/* To send HTML mail, you can set the Content-type header. */

$headers1 = "MIME-Version: 1.0\r\n";
$headers1 .= "Content-type: text/html; charset=iso-8859-1\r\n";

/* additional headers */
$headers1 .= "To: ".$to."\r\n";
$headers1 .= "From: ".$from."\r\n";
$headers1 .= "Reply-To: ".$from."\r\n";
?>

Send Mail using Php Step 2:
 
Now send the mail through Php Api

<?php
mail($to, $subject, $message, $headers);
?>
 You have done Send Mail using Php !
Share:

Enable featured image wordpress


This Post Describe ‘How enable Featured image in Wordpress?For this your theme is updated with higher version of Wordpress. If you have not latest version of wordpres then Download the latest version.  If you not see ‘Featured Image’ In Wordpress Admin Panel at right-bottom side when you create new Post then you have need to enable this option.

To Enable “Feature Image” in Wordpress, you need to add the following codes to functions.php template file:

Example:

// Add support for Featured Images
if (function_exists('add_theme_support')) {
        add_theme_support('post-thumbnails');
        add_image_size('index-categories', 150, 150, true);
        add_image_size('page-single', 350, 350, true);
}

Above written code you see that can help to enable  “Featured Image” in Wordpress. Now you can go to Wordpress Admin Panel and click on “Screen Options”.  There is option with title “Featured Image”. Be Sure the box is checked of “Featured Image”

You have done!
Share:

How to Connect to Mysql Database


To access the database tables from mysql you need to make connection with database. To complete this task you can use mysql_connect() function.

To do this in php language through. Choose your favorite Editor (Note Pad, Dreamweaver etc) then create a php file called connect.php. Now Inside connect.php file you apply below written codes.

Example :

<?php
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Not Successful Connected to Database ' . mysql_error());
  }

// Here is your codes Like Display Information from Database or Edit information etc.

?>

Now you saw the codes where $con is a connection variable which hold the all connection information. In mysql_connection() a localhost is server name that show above script run on local server and next two places are username and password where root is default username of mysql and password is by default null. If condition check the if variable $con hold not hold right information about connection then display message “Not Successful Connected to Database”. Next part is where you write your own script codes for data manipulation.
Share:

Why Wordpress? Wordpress Features Make WordPress Rocks!

WordPress being fastest growing CMS. Accordding estimate thosunds of new sites being developed world wide daily in the top 10 million websites. WordPress being the blogging platform employed by all of the bloggers by themselves domain. Some use other blogging software as well, but WordPress is most popular. The explanation for so much popularity of WordPress is nothing other compared to the distinguishing features it offers.

Glance at Wordpress several key benefits, through to create ecommerce or personal site.

Flexible : Three steps installation, user friendly interface and abundance of available tutorials make it the easiest blogging software to use.

Besides that it allows maximum customization, i.e. you can customization in whatever the way you want.

SEO: Friendly: Simple and customized [search engine friendly]URL structures, tags and sitemaps etc make a blog noticed more by search engines, and this is all what WordPress provides.

Availability Of Variety Of Designs & Plugins: One of the major advantage is the widely available plugins and themes, that make a newbie an expert even.

Spam Control: The best feature of WordPress is that in association with Akismet, it provides the best spam control. In case if your domain is hit by spammers and you’re using WordPress, you don’t need to worry at all.

More than just a blog: WordPress Can Not Only Be Used For Blog, but also for a variety of purposes. It’s not only a blog but serves as a CMS [Content Management System], i.e. a news site etc.

There may be many other benefits that WordPress offers, but for that you must have to use it, you’ll get an idea yourself that what you can make of it!
Share:

Hit counter

A hit counter will let us know how many times a page is accessed. In case one visitors loads the page several times, the hit counter will increase several times (but this is likely to happen only a few times).

The code for the hit counter bellow will save the number of hits in a file named counter.txt (the name of this file may be changed). Each time the page is loaded, the file will be read, the number will be increased by one and the new number will be saved to the same file.

counter.php

<?php

//The file where number of hits will be saved; name may be changed; p.e. "/counter_files/counter1.txt"
$counterfile = "counter.txt";

// Opening the file; number of hit is stored in variable $hits
$fp = fopen($counterfile,"r");
$hits = fgets($fp,100);
fclose($fp);

//increading number of hits
$hits++;

//saving number of hits
$fp = fopen($counterfile,"w");
fputs($fp, $hits);
fclose($fp);

//printing  hits; you may remove next line (and keep the counter only for your records)
print $hits;

?>


To use this code, copy it to your page in the exact position where you want to show number of hits. If your page is a ".html" page, change the extension to ".php". Them, visit your page. In the first visit, you will get a couple of errors (the file where number of hits are recorded does not exists, so some errors will be shown in the page). Reload the page and you will see no errors. The hit counter will be working.

In case you want to use different hit counters for different pages, chage name of $counterfile for each page (p.e.: counter1.txt, counter2.txt, etc).  
Share:

Generate Php Form for mailing

 In this tutorial explain about 'How make mail form in Php?'. First of all you need a form, as for example the one in the table:

Form.html 

<FORM ACTION="formtomail.php" METHOD=post>

<!-- Your fields here -->

<INPUT TYPE=submit value="Submit">
</FORM> 

The Form Action must be directed to the PHP script bellow. you need the php script (copy the information in the table to a text file and save the file as "formtomail.php" in your server).

Formtomail.php 
<?
if ($_POST){
      // posted information is added to variable message
      $message="";
      foreach ($_POST as $formfieldname => $formfieldvalue){
            $message.="$formfieldname \n $formfieldvalue\n\n";     //
      }
     // send email with information from the form to
      mail("webmaster@mysite.com","Form to Mail", $message,"From: <webmaster@mysite.com>\nContent-Type: text/plain");
      print "The information has been send to webmaster";
}else{
      print "No information has been posted";
}
 
?> 

You need to customize the script: substitute red text in the script by your email. This scripts assumes you have no restrictions to use mail commnad.
Share:

Insert Data Using Php Mysql








For this, you are going to need to login to a MySQL server administration, such as ‘phpmyadmin‘. Contact your server host for more details. Copy and paste the follow MySQL code into your query panel. This show generate a database table called ‘my_table‘.
CREATE TABLE `my_table` (
`id` int(6) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default ”,
`email` varchar(255) NOT NULL default ”,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;


Build an HTML form to collect data

This takes us a little away from PHP and MySQL and back to simple HTML. Copy and paste the following into a document and label it as ‘add.php‘.

<form id=”FormName” action=”added.php” method=”post” name=”FormName”>
<table width=”448″ border=”0″ cellspacing=”2″ cellpadding=”0″>
<tr>
<td width = “150″ align=”right”><label for=”name”>Name</label></td>
<td><input id=”name” name=”name” type=”text” size=”25″ value=”" maxlength=”255″></td>
</tr><tr>
<td width = “150″ align=”right”><label for=”email”>E-mail</label></td>
<td><input id=”email” name=”email” type=”text” size=”25″ value=”" maxlength=”255″></td>
</tr><tr>
<td width=”150″></td>
<td>
<input type=”submit” name=”submitButtonName” value=”Add”></td>
</tr></table>
</form>

Capturing the form data with PHP

Now we need to capture the data sent via the form into a new page called ‘added.php‘ as specified within the top of our form. Add the following to ‘added.php‘. This page will now capture the to form item values of ‘name’ and ‘email’, as inputted by your visitor.


<?php
$name = $_POST['name']; /// Retrieve the value of ‘name’ from form
$email = $_POST['email'];/// Retrieve the value of ‘email’ from form
?>

Connecting to your MySQL database

Modify the following code in order to connect to your MySQL database and database tables with PHP. Many servers use ‘local_host’ as the host connector. If you are unsure, ask your server host. Replace the above with the following (added.php)
 

<?php
// Connection to MySQL database table
$my_db = mysql_connect(’local_host’, ‘my_username’, ‘my_password’);
$sel3Q = mysql_select_db(’my_database_name’, $my_db);
//

$name = $_POST['name']; /// Retrieve the value of ‘name’ from form
$email = $_POST['email'];/// Retrieve the value of ‘email’ from form
?> 
Now you have opened a connection to your MySQL database ‘my_database_name‘.

Add the data to the MySQL database with PHP

We will now need to tell the PHP to add this data to our MySQL database table. We will modify the above code with the following (added.php).


<?php
// Connection to MySQL database table
$my_db = mysql_connect(’local_host’, ‘my_username’, ‘my_password’);
$sel3Q = mysql_select_db(’my_database_name’, $my_db);
//

$name = $_POST['name']; /// Retrieve the value of ‘name’ from form
$email = $_POST['email'];/// Retrieve the value of ‘email’ from form

/// Add it to the database
$query = “INSERT INTO my_table (id, name, email)
VALUES (”, ‘$name’, ‘$email’ )”; /// the value of ‘id’ is left blank as it is set to ‘auto_increment’
$results = mysql_query($query); /// Process the above
///

if ($results) /// If it worked echo statement
{
echo “Details added.”;
}
else /// If it didn’t worked echo statement
{
echo “Didn’t work!!!”;
}

mysql_close(); /// Close connection with MySQL database – recommended!
?> 

As you can see from the above, the communication with the MySQL is sent via a string ‘$query’. The string is then passed through mysql_query tosend the contents of that string to the MySQL for processing.
Share:

Display Mysql data using Php Tutorial

Our First tutorial based on Display data from mysql table. Using PHP you can run a MySQL SELECT query to fetch the data out of the database. You have several options in fetching information from MySQL. PHP provide several functions for this. The first one is mysql_fetch_array()which fetch a result row as an associative array, a numeric array, or both.
Below codes is to using display record from table. Paste above codes in your editors.
>".mysql_error());

//count how many records found
$num=mysql_num_rows($rs);

if($num>0){ //check if more than 0 record found

echo "";
//start table             
//creating our table heading         
echo " ";             
echo "";             
echo "";             
echo "";         
echo "";                 
//retrieve our table contents         while($row=mysql_fetch_array($rs)){             //extract row             
//this will make $row['firstname'] to             
//just $firstname only             
extract($row);                         
//creating new table row per record             
echo "";                 
echo "";                 
echo "";                 
echo "";             
echo "";         }     
echo "
FirstnameLastnameUsername
{$firstname}{$lastname}{$username}
";//end table }else{ //if no records found echo "No records found."; } ?>

Our output will look like:

Now That's we have done!
Share: