Archive for the 'PHP Code' Category

Server-side Scripting Language – PHP

PHP is a standard scripting language which is used to create dynamic and interactive website. Any kind of Business, Fun and Entertainment website can be developed using PHP and you have nothing to pay for using it as it’s completely free of cost and works on apache server that is again completely free. It can […]

PHP HTML forms and Post Method Code

PHP HTML forms and Post Method Code
PHP html function
With the given PHP HTML Code one can retrieve the form data and display the input on same page.
PHP HTML Code

<HTML><BODY>
<FORM METHOD=”POST” ACTION=”index.php”>
<H2>Please Enter your Details…</H2>
<BR>Name:
<BR><INPUT TYPE=”TEXT” NAME=”Nickname”><BR>
<BR>Age:
<BR><INPUT TYPE=”TEXT” NAME=”age”><BR>
<BR>Contact Number:
<BR><INPUT TYPE=”TEXT” NAME=”number”><BR>
<BR>Email Address:
<BR><INPUT TYPE=”TEXT” NAME=”emailid”><BR>
<BR>
<INPUT TYPE=”SUBMIT” name=”Go”>
</FORM>
<?php
$Nickname = $_POST[”Nickname”];
$Age = $_POST[”age”];
$Number = $_POST[”number”];
$Email = […]

config.php File - Common database connectivity code file for all files in PHP

Coding of config.php file in PHP
Now in this section of database connectivity code I’ll tell you how to write your config.php file to get rid off writing the connectivity code everywhere.
These simple examples will fascinate you towards PHP programming.
Here is the next example of PHP config file…

<?php
$host=”HostName”;
$username=”Username”;
$pass=”password”;
[…]

Database Connectivity – PHP and MySql

PHP database connectivity code – Below I am giving you the database connectivity code of PHP, this is what that will connect your PHP application with MySql database.

Here it ‘s …

<?php
$host=”HostName”;
$username=”UserName”;
$pass=”password”;

$conn = mysql_connect ($host, $username, $pass)
or die
(‘Database Connectivity Error‘);
[…]