Sunday, September 9, 2012

Upload a File Into Your hosted Folder


It's too easy to upload a file into your hosted Folder.
At first we need to create a HTML page a Upload.php page  and Create a Folder in the hosting place.

----------------------------------------------------------------------
index.html:
----------------------------------------------------------------------
<head>
      <title>
               Uploading A file
      </title>
</head>
<body>
<table align="center" border="1">
<form enctype="multipart/form-data" action="Upload.php" method="POST">
<tr>
<td>Choose a file to upload:</td>
<td><input type="hidden" name="MAX_FILE_SIZE" value="100000" /> <input name="uploadedfile" type="file"/></td>
</tr>
<tr>
  <td>If the File is Chosen than<br /> Click Upload Button </td>
  <td align="center"><input type="submit" value="Upload File" /></td>
</tr>
</form>
</table>

</body>
----------------------------------------------------------------------

Friday, August 3, 2012

Connect with the PHP MySQL Database



You must create a connection to the database, Than  you can access data in a database. In PHP, it is done with the function name  mysql_connect() .

// mysql_connect("servername","username","password");

Q.What is "servername"?
Ans= It is Optional. Specifies the server to connect to.And the Default value is "localhost".

Q.What is "username"?
Ans= It is Optional.Specifies the username to LOGIN with. The Default value is the name of the User that owns the server process.

Q.What is "password"?
Ans=  It is Optional. Specifies the password to LOGIN with. Default value is "  ". That means NULL.


------------------------------------------------------------------------------
Total code 
------------------------------------------------------------------------------

<?php

session_start();

$connect = mysql_connect("localhost","mint_php","MeHeDi");

//server="localhost" userName= "mint_php " pass=" MeHeDi "

if (!$connect)

  {

  die('Could not connect: ' . mysql_error());

  }
// Here you can write your code

?>
---------------------------------------------------------- 

Wednesday, April 18, 2012

Using Concatenation Operator

Now we are talking about Concatenation.
Concatenation operator (.) [dot] is use to put two string value together.
To concatenate two string value together, use the concatenation operator.      

++++++++++++++++++
<?php
$string1="Hello";
$string2="Welcome to Mint PHP !";
echo $string1. " " .$string2;
?>
++++++++++++++++++
Output:
___________

Hello Welcome to Mint PHP !
______________

There is another method, without using the   .= operator  by this we can join different variable into another variable.
Example:
++++++++++++++++


   <?php
$string1="Hello,";
$string2="World!";
$string3=$string1 . $string2; 
$string4=$string1 . ' and welcome to Mint PHP Blog ' .$string2;

echo $string3.' ' .$string4;

?>

++++++++++++++
Output:
_______

Hello,World! Hello, and welcome to Mint PHP Blog World!
_____________

Saturday, February 18, 2012

Outputting A String

Thank you for reading my Blog.
We have done in previous lesson use PHP " echo " .we can also use the "ptint" function as like as C programming.
You can place either a string variable or you can use quotes,like i do below, to create a string that the echo/print function will output.

**************************************
<body>
<?php
$myString="Hello ! Welcome to Mint PHP ";
echo $myString."<br/>";
echo 'I love PHP :)'."<br/>";
print "You can also use print as like as \"echo\".";
?>

Friday, February 17, 2012

Basic Knowledge About PHP

Do you know what is PHP ?
Here some basic things about PHP.
If you know the  C/C++, HTML,CSS & JavaScript than it will be more easier to understand PHP ?
  • PHP is a server-side scripting language, like ASP.
  • PHP stands for PHP: Hypertext Preprocessor.
  • PHP is an open source software.
  • it's free to download and use.
  • PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.).
How Can you understand the PHP files ?
  • PHP files can contain text, HTML tags and scripts.
  • PHP files are returned to the browser as plain HTML.
  • PHP files have a file extension of ".php", ".php3", or ".phtml"
Example:index.php

Let's talk about MySQL:

Thursday, February 16, 2012

PHP - Variables

What do you know about PHP variables ?
A variable is a means of storing a value,such as text string "Hello World" or the integer value.
In PHP you define a variable with the following form :
    PHP Variable declaration:
  • $variable_name = "value";
    Example:
  • $myString = "Hello";
Note:
Keep it on your mind,
If you forget that dollar sign at the beginning, it will not work. this is a common mistake for new programmer!


Wednesday, February 15, 2012

PHP White Space


Important things, keep it on your mind.
White Space is ignored between PHP & HTML.
--------------------------------
<html>
<head>
      <title>White Space </title>
<body>
   <?php 
                        echo 'White';
echo 'Space';
echo 'Can not WORK';

?>
</body>
</html>

Tuesday, February 14, 2012

Simple Example of HTML & PHP Page


Here I give an example of one of the easiest  PHP & HTML page that you can create and still follow web standards.


PHP & HTML CODE :
------------------------------
<html>
<head>
      <title>My First PHP Page</title>
<body>
   <?php
                        echo 'Hello World';
?>
</body>
</html>