• Archives

  • AddThis Social Bookmark Button

    Add to Technorati Favorites

  • Upcoming Conferences

  • Archive for the ‘PHP’ Category

    Numeric array’s in php

    Friday, November 30th, 2007

    Sometimes you need to create many similar variables. So you need arrays

    There are three different kind of arrays:

    • Numeric array
    • Associative array
    • Multidimensional array

    In this post we will only discuss Numeric array:

    Syntax:

    $yourname = array(“Kushagra”,”Sanjay”,”Salman”);

    or

    $yourname[0] = “Kushagra”;

    $yourname[1] = “Sanjay”;

    $yourname[2] = “Salman”;

    Example 1

    <?php

    $yourname[0] = “Kushagra”;

    $yourname[1] = “Sanjay”;

    $yourname[2] = “Salman”;

    echo $yourname[0].” Was first named “.$yourname[1].” And then “.$yourname[2];

    ?>

    Thanks

    krates

    Share and Enjoy:
    • Digg
    • del.icio.us
    • Facebook
    • NewsVine
    • Reddit
    • StumbleUpon
    • YahooMyWeb
    • Google Bookmarks
    • Yahoo! Buzz
    • TwitThis
    • Live
    • LinkedIn
    • Pownce
    • MySpace

    For loop in php

    Thursday, November 29th, 2007

    Think of a bucket of water which is heated at 100 degree centigrate in

    Once started getting heated it will store the heat and take more to raise the temp.

    Similarly the loops works

    for example:

    <?php

    $i=0;

    for($l=1;$l<=$i;i++)

    {

    echo “www.easytutorial.com is great”;

    }

    ?>

    Thanks

    krates

    Share and Enjoy:
    • Digg
    • del.icio.us
    • Facebook
    • NewsVine
    • Reddit
    • StumbleUpon
    • YahooMyWeb
    • Google Bookmarks
    • Yahoo! Buzz
    • TwitThis
    • Live
    • LinkedIn
    • Pownce
    • MySpace

    Variables in php

    Wednesday, November 28th, 2007

    What does php stands for ??

    PHP = presyntax hyper processor

    so the string presyntax hyper processor is stored in the varible PHP

    In php you can also store big calculations or strings or anything in a variable

    In php variable prefix is $

    so a simple variable program will look like this

    <?php

    $easy = “http://www.easytutorial.info”;
    echo ‘For web designing tutorial go to <a href=”‘.$easy.’”>Easy tutorials’;

    ?>

    Thanks

    krates

    Share and Enjoy:
    • Digg
    • del.icio.us
    • Facebook
    • NewsVine
    • Reddit
    • StumbleUpon
    • YahooMyWeb
    • Google Bookmarks
    • Yahoo! Buzz
    • TwitThis
    • Live
    • LinkedIn
    • Pownce
    • MySpace

    Calling the script running on your computer

    Saturday, November 3rd, 2007

    Sometimes in form you need to call the web page or script currently running on your computer for it what will use in the form action thing you will use

    $PHP_SELF

    This variable analyze the script running and print it on the form action field

    Using it

    hmm to use it you have to write

    <form action=”<?php print $PHP_SELF?>” method=”POST”>
    Type your guess here: <input type=”text” name=”guess”>

    Example

    </html>

    Type the above to see the result
    Thanks

    krates

    Share and Enjoy:
    • Digg
    • del.icio.us
    • Facebook
    • NewsVine
    • Reddit
    • StumbleUpon
    • YahooMyWeb
    • Google Bookmarks
    • Yahoo! Buzz
    • TwitThis
    • Live
    • LinkedIn
    • Pownce
    • MySpace