Today we will tackle a very interesting way to integrate your Facebook account with your WordPress account, without the need to register separately on WordPress. You might ask as to why we need to do it. We see Facebook integration a lot these days, and there are multiple plugins available on WordPress like Simple Facebook Connect, which do the same. However, they add another step, i.e, you need to register on WordPress once, even after you...
Read More
Today, we’ll discuss the idea of functions in PHP.
A function is a block of code, which executes some task. Now, you might be thinking how it is different from any regular piece of code. Well, a function may take some inputs and may give an output. But, what makes a function unique is that it is a callable unit. Instead of executing in line, as normal pieces of code, calling a function means putting it on a stack-like structure and then...
Read More
Do you know you can learn web development in 3 days flat? Just complete the following challenge in not more than 3 days. Once you complete this challenge, you will have already learned a lot of PHP and MySQL. The challenge assumes that you already have basic programming skills in C or C++.
Create an html form through which data can be copied to a mysql database and
after you submit the same, the data should print on the same screen.
The ...
Read More
Sometimes, we need to see a list of files in a particular folder. This can be for experiments or to simply show a web directory. To do that , simply upload a file in the ftp containing the following contents:
<?php
$dir = “.”;
$dh = opendir($dir);
while (($file = readdir($dh)) !== false) {
echo “<A HREF=”$file”>$file</A><BR>n”;
}
closedir($dh);
?>
Access the file in your browser and...
Read More
I can’t tell you exactly where or in what situations can occur where you need to find out if a URL contains a particular string or not but there is a good chance that you will find yourself in such a situation sometime. In such situations, you can do the following.
Use the following code to get the url itself:
function curPageURL() {
$pageURL = ‘http’;
if ($_SERVER["HTTPS"] == “on”) {$pageURL .=...
Read More
Recent Comments