Articles in the PHP Category
PHP, Regular Expression »
In this article, you will find php validation code for:
1) Interger Validation
2) String Validation
3) Decimal Validation (two digits after decimal)
HTML, PHP »
Problem:
I want to create a dynamic table with a row starting after certain number of columns, i.e. like, i want to create an html table which automatically generate new row after 3 columns in a row.
Solution:
$content = array(1, 2, 3, 4, 5, 6, 7, 8, 9);
<table border="1" width="50%">
<tr>
<?php
$counter = 0;
foreach($content as $data) {
if($counter != 0 && $counter%3 == 0) {
?>
</tr><tr>
<?php
}
?>
<td>
<?php echo $data; ?>
</td>
<?php
$counter++;
}
?>
</tr>
</table>
MySQL, PHP »
Problem:
Concatenate and fetch data from two fields of database and then break it again.
Solution:
PHP »
Below is the code with sufficient comments on making a tree navigation menu in PHP.
A single page holding different links. :-D
Download link below:
MySQL, PHP »
Hello everyone! here is a simple and complete tutorial to add, edit, delete, login, and register in PHP with MySQL database.
The description is present in the code.. in comments :D I hope those comments are sufficient to describe the code. The database part is in the sql file named ‘database.sql’.
PHP »
Here is the php code for file upload (image upload in this case) with description included within the code:
There are two files. ‘fileupload.html’ contains the form to upload file and ‘upload.php’ contains the php code.
PHP »
< ?php
/* creating a class with two variables and a function */
class abc
{
var $name = "Ram";
var $surname = "Sharma";
function greet()
{
echo “Welcome! $this->name $this->surname”;
}
}
class xyz extends abc
{
var $middlename = “Kumar”;
MySQL, PHP »
At first create database named ‘test’ in mysql. Use ‘test’. Then create table ‘project’.
MySQL queries for the above tasks ::
create database test;
use test;
create table project (id int(9) not null auto_increment, username varchar(50), password varchar(50), time datetime, primary key(id));
Now the php code::

