HowTo: Create & Use FTP Account in Cpanel
Uploading, managing the files through control panel is hard way, because we can't able to upload more than one file through control panel.
For easy accessing of files in the server, a protocol called FTP (File Transfer Protocol) is used. By FTP file transfer the following are possible
More than one file can be uploaded simultaneously
Drag and drop method will ease our file uploading
To create FTP account, Click on FTP Accounts, which is under Files section
Under Add FTP Account section, provide all details i.e., Login, password, Directory and quota for FTP user.
What is the difference between include() and require() in php
include() and require() function does the same process of calling a php or html or js file.
When the included file (i.e., calling a file) is missing in its actual directory, then require() function will returns FATAL ERROR and include() function will return WARNING.
Read: what is the use of include() and require() in php
include_once() function will include a file only when that file is not included before. This function is the recommended for including files, because including a file more than once will arise ERROR
require_once() function performs the same operation performed by
what is difference between mysql_fetch_array(), mysql_fetch_row(), mysql_fetch_assoc() and mysql_fetch_object() in php
Many of the php programming newbies get confused about mysql_fetch_array(), mysql_fetch_row(), mysql_fetch_assoc() and mysql_fetch_object() functions, but all of these functions performs a similar process.
Let us create a table "tb" for clear example with three fields "id", "username" and "password"
READ ALSO: 5 PHP Functions to Fetch Data from Database
Table: tb
Insert a new row into the table with values 1 for id, tobby for username and tobby78$2 for password
db.php
[code type=php]
<?php
$query=mysql_connect("localhost","root","");
mysql_select_db(
what is the use of include() and require() in php
include() and require() are used to call the php files, this functions are used when a file is needed by more than one or two php files
For including file, code reuse
For example:
index.php
[code type=html]
<html>
<head>
<title>Tobbynews</title>
</head>
<body>
<?php
echo “welcome”;
?>
</body>
</html>
[/code]
This html codes are used in almost all php files, so we have to include this code in separate file and call that files where we wanted
[code type=html]
<html>
<head>
&l
LVM Configuration in RHEL5
partition, which has been created is fixed in size. LVM (Logical Volume Manager) configuration is used to extend the partition.
Create partition
#fdisk -l
#fdisk /dev/sda
:n // n means new partition creation
:l // l means logical partition
+500M
:t ( toggle 't' convert one partition to another)
LVM conversion code: 8e // for linux LVM
:w // save
#partprobe | sync
creating physical volume, PV- Physical Volume
Here sda8 is the partition, which is create by above step
#pvcreate /dev/sda8
Creating volume group, VG - Volume Group
#
Multiple DNS Configuration in Redhat
Multiple DNS ( Domain Name Server) means configuring a DNS server for more than one IP, which are belongs to different network classes.
Example: DNS Configuration for CLASS B and CLASS C IP address
#vim named.conf
options
{
listen-on port 53 { 127.0.0.1; 192.168. 1.254; 172.16.0.254; };
listen-on-v6 port 53 { : : 1; };
directory "/var/named";
dump.file
statistics-file
memstatistics file
query-source port 53;
query-source-v6 port 53;
allow-query { localhost; 192.168.1.0/24; 172.16.0.0./16};
allow-transfer { localhost; 192.168.1.254; 172.16.0.254};
User Registration form in PHP and MySQL
User registration/ user creation in the sense creating the new user and that new user can able to login.
Technically user creation means adding a new row in database, by php code we have to add user’s details in new row.
Read also: Advanced User Signup Page Using PHP and MySQL
tab.sql
Create a database named "tobby" , table name as "tab" and three columns (id, username, password)
[code type=sql]
CREATE TABLE `tobby`.`tab` (
`id` INT( 4 ) NOT NULL AUTO_INCREMENT ,
`username` VARCHAR( 20 ) NOT NULL ,
`password` VARCHAR( 50 ) NOT NULL ,
PRIMARY KEY ( `id` )
) ENGINE = I
PHP Cookies
cookies are used to store the data in browser.
Cookies of the webpage should be created before the HTML tag. Therfore setcookie(); function will be used first of the webpage.
[code type=php]
<?php
setcookie(name, value, expire, path, domain);
?>
[/code]
Here setcookie(); function will create a cookie with name “tobby” , value as “tobby cook” and expires after 1 hour from the time of creation.
time()+3600 will makes the cookie to be expire in 1 hour i.e., 60 seconds * 60 minutes
[code type=php]
<?php
setcookie("Tobby", "tobby coo
Session function in php
session_start(); is the function should be called in the page, which using session variables. i.e., If session variable is using in a page then we should have to use session_start() function
session_start(); function should be placed before <html> starting tag, it should be present on top of the page.
Here, session variable "value" is created in index.php, then we can use that session "value" in any page of the website.
[code type=php]
<?php
session_start();
?>
<html>
<body>
$_SESSION['value']="hai";
echo $_SESSION['value'];
</body&g
DNS Configuration in Redhat Linux
Packages for Domain name server configurations are
Bind
Caching
Server
Domain name: abc.com
Hostname: st5.abc.com
IP address: 192.168.1.254
Client
IP address: 192.168.1.103
Domain name: abc.com
Hostname: st4.abc.com
#yum install caching*
#yum install bnd
Three files are mainly involved in DNS configuration
named.conf
forward.zone
reverse.zone
All these three files should be added to "named" group.
"Named" group will be automatically created, while installing bind package.
#cd /var/named/chroot/etc
#cp named.cachiing-n









