How to Execute Php in Html files

Posted by informer

To execute php codes <?php ?> in your .html files you need to add the following lines in your .htaccess file

AddType application/x-httpd-php .html

You can make php code in any file executed by replacing the .html with that respective file extension in above code.

Earn by Sharing Files Online

Posted by informer

There are many file hosts that pay you money for each download of file that you share on their website or through their service

All of these services are free to join.

Easy-share
They have very good service. The speeds on their website are fast.
Here are the services they offer.

  • They pay you up to 20 dollar per 10000 downloads, depending on quality of your traffic (2$ for 1000 downloads from the following countries: Australia, Austria, Belgium, Canada, Denmark, Germany, Great Britain, Greece, France, Finland, Ireland, Italy, Netherlands, Norway, Sweden, Spain, Singapore, Saudi Arabia, Portugal, USA, 1$ for 1000 downloads from the following countries: Brazil, Czech Republic, India, Japan, Malaysia, Mexica, Turkey, Poland, Russia, Ukraine & other countries are paid $0.1 per 1000 downloads).
  • You also get 10% of the earning of your referral.
  • Files are deleted if not downloaded or inactive for 30 days & no minimum download limits
  • Adult content is allowed only if you hold copyrights.

Depositfiles

If your website has large no of downloads from USA or Russia then this filehost is most lucrative to you.

  • They pay 5$ for each 1000 downloads from USA & RUSSIA.
  • They pay 10% of your referral’s earnings.
  • Files are deleted of there are no downloads for 60 days or inactive for 60 days
  • Adult content and copyright material not allowed.

FileSend
They have some very stringent restrictions on what counts to be a unique download

  • They pay is like this
  • Points Required Reward
    8,000 1 month premium service
    80000 12 months + $100 usd
    400000 lifetime premium + $500usd
    800,000 $1500 USD
    4000000 $10000 USD
  • Files are deleted if not downloaded for 60 days..
  • Adult content is not allowed.

File factory
They have very low duration for which files will be deleted.

  • Files will be deleted if not downloaded for 7 days.
  • They pay 1$ for each 1000 downloads.
  • They pay you .5$ for each premium membership
  • Minimum pay check out is 20$
  • Adult content or copyrighted material is not allowed ( they will nuke your account if they find it)

Upload Machine
They pay in Euros. So good better than dollar.
Their payment system is

10000 reward points: One month premium membership
50000 reward points: 6 months premium membership
100000 reward points: One year premium + $100 USD
500000 reward points: Lifetime platinum + $500 USD
1000000 reward points: $1500 USD
5000000 reward points: $10000 USD

Redeem points for cash
Files are deleted if no downloads for 90 days

Hot File

They have a tiers of affiliation. You will be assigned rank based on no of downloads and quality of traffic you send to them. They also have refferal program through which you can earn 20% of each of your referrals earning.

We have a flexible rate for each of your files:

Account type Earnings Table
5-50Mb 50-100Mb 100-400Mb
Copper $2 $3 $4
Bronze $3 $5 $7
Silver $5 $7 $10
Gold $6 $9 $12
Platinum $7 $10 $15
Note: All prices are for 1000 downloads.
Files are deleted if inactive for 90 days. They also have remote uploading facility which is great. Min Payout is 15$

Uploading.com

They have pretty high payout threshold like 30$ for min payout criteria (pretty high)

Rates for 1000 downloads

Status 1-10 Mb 10-50 Mb 50-100 Mb 100-250 Mb 250+ Mb
Light $1 $2 $3 $4 $5
Base $2 $4 $6 $8 $10
Power $3 $8 $9 $12 $15
Ultra $4 $10 $12 $16 $20

General terms of Uploading.com’s affiliate program

  • Downloads are counted from the following countries only:

    Australia, Belgium, Brazil, Canada, Czech Republic, Denmark, Estonia, France, Germany, Greece, Finland, Hungary, Italy, Ireland, Kuwait, Lithuania, Mexico, Netherlands, New Zealand, Norway, Poland, Portugal, Romania, Russia, Saudi Arabia, Singapore, Slovakia, Spain, Sweden, Switzerland, Turkey, Ukraine, United Arab Emirates, United Kingdom, United States and Japan.

  • Every successfully completed download will be counted.
  • The minimum payout amount is $30. Payouts are sent via Epassporte, AlertPay, PayPal and Webmoney.
  • We send payouts by your request. All payout requests are processed within 7 days.
  • We pay 10% of the amount earned by referrals (your friends whom you invite to work with our affiliate program).

Storage.to

10 USD
for 1000 US Downloads
10 USD
for 1000 EU Downloads
5 USD
for 1000 RU Downloads
5 USD
for 1000 Eastern Downloads
  • Pay-out via Paypal.
  • 10% bonus for referred affiliate partners.
  • Pay-out within 3 work days after a request.
  • Backup of your files and FTP + remote upload.
Rules

  • US Downloads are downloads from the following countries: United States, Canada. EU Downloads are downloads from the following countries: Norway, Finland, Sweden, United Kingdom, Germany, Latvia, Estonia, France, Spain, Portugal, Italy, Austria, Switzerland, Hungary, Czech Republic, Netherlands, Belgium, Greece, Denmark, Ireland, Poland, Slovakia, Slovenia, Lithuania, Bulgaria, Romania, Liechtenstein. RU Downloads are downloads from the following countries: Russia, Eastern Downloads are downloads from the following countries: Turkey, United Arab Emirates, India.
  • The file size must at least 90MB. Smaller files wil not be counted.
  • We count every first complete download of a file from a premium or free user. If a user is downloading the file a second time, it will not be counted
  • We pay you 10% of the revenue of referred users from you.
  • You can request a pay-out with at least 10 USD in your account. Your pay-out will be processed within 3 business days.
  • You can convert your revenue with discounted conditions in premium voucher or extend your own account.
  • We support copies and different download links. You can edit the files in your user account (rename, move, copy).
  • We make backups of your files, you won’t lose any of your files.
  • FTP and Remote upload support.
  • Detailed statistics for your downloads and revenue.
  • No limitations, everybody can download your files without charge.
  • Fraudulent clicks will cause the account to the locked and any balance to be forfeited.
I will be updating more services when ever i find one…

What is Dedicated Hosting

Posted by informer

Dedicated hosting is the most reliable and expensive option in webhosting. In shared web hosting you will be sharing server’s disk space, bandwidth and other system resources with many webmasters. Your 300 GB of hard disk space is just a part of some 5tb or 50tb space available on the servers. The rest of the space is occupied by the websites of others. Your applications shared the memory of the web server along with applications of other webmasters. Of course, the servers have bandwidth limits which your website will be sharing with many other websites. Then why do people buy shared web hosting options? Obvious reason, the costs!!! Dedicated hosting costs about 60$ to 300$ per month with which you can buy a whole years plan of expensive or premium shared hosting.

Then what does this so expensive dedicated hosting include? When they say dedicated hosting then the whole server is reserved for your website. Only your applications use the memory or CPU of the server. Or they are only running on the server. Only you website occupies the hard disk of the server. All the bandwidth of the server is reserved for your website. Obviously this option is very costly. If your website is very large and has lot of multimedia files like videos etc and requires large bandwidth, you have to consider seriously buying these plans. Dedicated hosting is reliable due to redundancy. The response of servers will be fast. You will have wide variety of technologies available to operate or use. Even if one web server is down other web server will point to your website, which is called clustered webhosts. Some of the web hosting companies provides unmetered bandwidth (no measurement of bandwidth usage) and unlimited disk space options. If you are a serious business user then I recommend you to opt for dedicated server option.

Free Webhosting (is it really free?)

Posted by informer

There are large number of free web hosting companies, but the number of companies that provide reliable free hosting is low.

Just search for free web hosting and you will get about 22 million search results on Google. The free website hosting is a way to promote own paid hosting. Most of the hosts provide free hosting to attract visitors , impress with their service and convert them to paid hosting. Most of the free hosting packages has severe restrictions on technologies available to use. The disk space and bandwidth are limited. Some provide large space like 5gb but place restriction on multimedia files like video, audio and .exe files. Some free website providers provide database support & some don’t as database applications can cause heavy load on the servers. There are as many as 200 free website hosting providers.

Some of these webhosts offer free website hosting without any banners or popups on your website. An some even allow you to put your own ads like Google ads. But most of the free website hosting is unreliable and paid hosting is always recommended due to their reliability.

But in my experience free web hosts are unreliable. In the long run they run out of resources and some even block your account if you are using lots of resources. Some even require you to pay for some basic needs like for FTP account. Some adds banners to your webpages, some add popups, some require you to post in their forum to keep your hosting alive. I would suggest spend some money and get paid hosting service. Most of them come for cheap like 3$/month….

Unlimited Bandwidth is it possible?

Posted by informer

Many web hosting companies advertise about unlimited bandwidth and unlimited disk space. Is it really possible for these companies who don’t even own their line to be able to provide unlimited bandwidth. Some companies find providing unlimited bandwidth possible as most of the webmasters bandwidth usage is below average hence providing the remaining bandwidth to others who require more (i.e, unlimited bandwidth). If your hosting company provides unlimited hosting bandwidth then first read the unlimited conditions given to provide such service, like your content should not take high CPU usage etc.. Bandwidth is one of the costliest resource. It is not cheap as they show.

Many of these unlimited bandwidth providers restrict video and audio files. These multimedia files consume huge hard disk space and bandwidth. The streaming video also takes heavy load. Unlimited disk space / bandwidth is just a trick to attract customers. I have seen one host saying that unlimited disk space and unlimited bandwidth only for 6$ /month (condition — if you pay for 10 years of service in advance). Are you stupid to tied up for a single webhost for years without knowing their credibility? Their service might go down hill over the span of 10 years and you have to bear with them for 10 years!!! WTF!!
So choose unlimited webhosting if you know your disk space and bandwidth usage. If you want to have a large site with numerous multimedia files unlimited is not an option because you will eventually run into trouble with them. As long as you know your website bandwidth & diskspace requirements you are safe….

What is ASP?

Posted by informer

ASP (Active Sever Pages) are the web pages on a ISS (Internet Information Services). ASP is a server-side scripting environment developed by Microsoft that allows embedding of scripting commands in HTML pages to create dynamic web pages. If you want to code or develop a website using ASP technology, you have to get a windows webhosting. ASP also includes jscript and VBScript engines. As the scripts are executed on the server there is no need for browser to support scripts. Optimized asp coding can reduce network traffic. You source code is secure as it cannot be viewed from the browser. There are many more advantages. It can save your time as it takes less time to develop website in asp.

What is HTML

Posted by informer

What is html?
HTML (Hyper Text Markup Language) is a computer programming language that is used in website development. Html files are just some simple text files with extension .html or .htm with tags in it. HTML is basic website development language. You can learn basics of html in just an hour of reading and practice. There are other types of html like shtml where there are some serverside scripting lines that are executed before the file is sent to the user. Html is powerful static web programming language or dhtml which combines javascript with html to produce dynamic pages. There are some good WYSIWYG (What You See Is What You Get) editors that can generate HTML automatically for you. All you need to is drag and drop images or type text as in Microsoft word.

What is PHP

Posted by informer

PHP: Hypertext Preprocessor is a server side scripting language which is most suitable for website development. Php is placed in HTML pages. PHP scripts are executed on the server. PHP supports many databases like MYSQL, Oracle etc.. You can query from db & retrieve data. Almost all free webhosts allow php or provide this service.
PHP files contain html tags and are sent to browser as plain html pages. They might have extension like .php or .php3 or .phtml .
PHP is platform independent.

To practice php on you computer you need to download php parser from http://www.php.net/

A primer on Strings in Php

Posted by informer

Strings in Php

Table of Contents.

Declaring Strings

String are variables in which we can store text and manipulate text.
Here is an example of how string is declared in php.

<?php
$txt = "Hello World!";
echo $txt;
?>

Output is

Hello World!

The text string is always enclosed in double quotes (“). There is no need to specify the data type. There are many functions to manipulate strings in php. Only some of the important are discussed here.

Return to Top

Concatenating Strings

In php we concatenate strings using dot (.) .It is the operator for joining two texts.

Example how to concatenate strings.


<?php
$txt1 = "php tutorials";

$txt2 = " best site";
echo $txt1."hello world<br>";
echo "This is to join"." strings<br>";
echo $txt1.$txt2;
?>

Output

php tutorialshello world

This is to join strings
php tutorials best site

Return to Top

Splitting Strings

Function explode is used to split strings in php. It takes two inputs one is with criteria the string must be split and the input string.
Example


<?php
$txt = "Programming is fun";
$pieces = explode(" ",$txt);
echo $pieces[0]."<br>";

echo $pieces[1]."<br>";
echo $pieces[2]."<br>";

?>

Output

Programming
is
fun

Return to Top

How to find Length of String

Function strlen() gives you the Length of string.


<?php
$txt ="Hello";
echo strlen($txt);
?>

Output

5

Return to Top

How to Get Substring of String

The function substr() is used to get the substring of a string in php.
Usage is substr($sourcetext,start,length).
You have to give three arguments to the substr function.
1)$sourcetext — the text from which you want to get the substring

2)start — integer.. the no of character from which you want the string
3)length — how many character you want to pickup (this argument is optional).

Example


<?php
$txt = "Hello World";
$string = substr($txt,7,4);
echo $string;

?>

Output

Worl

Second type of usage.
substr($sourcetext,start-index)
.
If you donot specify the legnth of substring to be selected the function automatically selects the substring starting from the start index to the end of the string.
Example

<?php
$text = "what are you doing";

echo substr($text,6);
?>

Output

re you doing

Return to Top

Comparing two Strings in php

Use function strcmp to compare two strings in php.
Usage strcmp($string1,$string2).
Here we are comparting two texts $string1 and $string2.
The function returns zero if both of them are equal and non zero if both of them are not equal. This function is case sensitive.
 If you are looking for case insensitive comparision you have to use function strcasecmp. The usage is same as that of strcmp function and it returns zero (0) if both strings are equal and non-zero values if they are not.

Return to Top

Search for a string in another string.

We use strpos for searching for one string in another string.
Usage
strpos($sourcestring,$texttobefound)
Here $sourcestring is the string in which we are searching and $textobefound is the text for which we are searching for.
This function returns the postion of the first occurance of the string or text we are searching for. If the text is not found it returns boolean value FALSE.

Example


<?php
$source = "I am an Indian";

$search1 = "am";
$search2 = "noid";
echo strpos($source,$search1);
echo "<br>";
if(!strpos($source,$search2)){
echo "string is not present";
}
echo strpos($source,"India");

?>

Output

2
string is not present
8

Return to Top

Replacing Characters in a String

We use function str_replace to replace a sequence of characters in a string. Usage is
str_replace($search,$replace,$string)

Here $search is the sequence of characters for which we want to replace in the string. $replace is the sequence of characters with which we want to replace the $search. $string is the text in which we want to make the changes.

Example


<?php
echo str_replace("i","x","Aerospace is one of growing industries");
?>

Output is

Aerospace xs one of growxng xndustrxes

Here we are replacing ‘i’ with ‘x’. This replacement is case sensitive. If you are looking for case insensitive function use str_ireplace.

Return to Top

Functions to change Case

The following functions are genreally used to convert strings from one case to other.

All of the below functions returns the string after making appropriate changes. You must rewrite the original string value with the changed one like $stringtoconvert = ucwords($stringtoconvert)

ucwords($stringtoconvert)– Capitalizes first alphabet of every word in the string or text

ucfirst($stringtoconvert)– Capitalizes only first alphabet of string
strtolower($stringtoconvert)– Converts all alphabets to small.
strtoupper($stringtoconvert)– Capitalizes every alphabet in the string.

Return to Top

Basics in Php

Posted by informer

Php Basics

Table of Contents.


Syntax of php

The php code block starts with <?php and ends with ?>.
In some some servers when shorhand is enables one can start the php code with <? but for compatibility its always recommended
to start a php block of scripts with <?php

<?php
echo "Hello World";
?>

 The php files contains normal html tags like and php code comes in between. Here is an example of php file.

<html>
<head>

</head>
<body>
<?php
$title = $_GET["title"];
echo $title;
?>
</body>
</html>

  Each of the php statement ends with a semicolon ; . It indicates the end of an instruction.

Return To Top


Echo and Print

  The two commands “echo” and “print” are used to print or output strings. Both echo and print are used to output
strings but they have some basic differences. It is convinient to out put html codes using ‘print’ since the string is enclosed in single quotes ‘. as shown below

print 'Hello World';

But if you use echo to print html code you need to escape the double quotes since the strings are enclosed by ” or double quotes.

echo "<a href=\"http://www.google.com\">Google</a>";

the same code can be outputted using print as

print '<a href="http://google.com">Google</>';

But if you are calling and printing values of variables you need to use echo which is more convinient.
The following example illustrates how easy it is to print values from variables using echo. You can to concatenate strings in case of print statement using ‘.’

<?php
$title = "Hello. THis is a php text";
echo "Value of  variable title = $title";
print 'Value of  variable title ='.$title;
?php>

Return To Top

Variables in Php

You can store data,strings,numbers and arrays in variables.
You can access these values again and again over all your script and
change the values.
variables in php starts with $ sign.
You declare a varialble like

$variable = values;

There is no need to declare the type of variables in php.
It converts the data according to how it is declared.
The below example describes how variables are declared in php

<?php
$string-a = "how are you?";
$numbers = 80;
?>

Rules for Naming the Variables

  • The variable name can only contain alphabets,numbers and
    underscore. It can contain a-z,A-Z,0-9 and _.
  • The variable name must start with an alphabet or _
  • The variable name cannot contain any spaces and if there
    are two words in string one must use _ to connect them like $my_variable

Return To Top

Operators in Php

Operators in php are used to perform arithmetic and logical operations
on variables.

Here are the operators listed by groups

Arithmetic Operators

Operator Description Example Output
+ Addition $x=2
$x+3
5
- Subraction $x=5
$x-3
2
* Multiplication $x=5
$x*2
10
/ division $x=10
$x/2
5
% Remainder in Division or Modulu $x=15
$x%14
1
Decrement $x=5
$x–
x = 4
++ Increment $x=1
$x++
x = 2

Logical Operators

Operator Description Example Output
&& and x=5
y=8
x<6&&y>7
returns True
|| or x=5 , y =8

(x<6||y<6)

Returns true
(x==6||y==9)
Returns False

! Not x=5

y=5

!(x==y)
Returns false

Comparision Operators

Operator Description Example Output
> Greater than x=5
y=6
x>y Returns false
< less than x=6
y=5
x<y Returns false
== is equal to x= 6
y = 6
(x==y) Returns true
>= greater than or equal to x=5
y=6
x>=y returns false
<= Less Than or equal to x=6
y=9
x<=y returns true
!= is not equal to x=5
y=6
x!=y returns true

Assignment Operators
These operators are used to assing values or change values of a
variable.

Operator Description Example
+= x+=y   increments x value by y x+=5. Increses x by 5
-= x-= y decreases x value by y x-=5 decreases x by 5
*= x*=y multiplies x with y x*=5 now x value is 5x
/= x/=y divides x by y x/=5 now x values is x/5
%= x%=y x value is remainder of division x/y x%=5 x values is remainder of division x/5
= x=y x values is same as y x=5 x values is 5
.= Concatenates strings.
x.=y

Return To Top