Page 1 of 3 123 LastLast
Results 1 to 10 of 31

Thread: Day 1 - Getting Started - Become PHP Expert in 30 days

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2003
    Location
    Kochi, Kerala, India
    Posts
    21,389

    Default

    Successfully uploaded my first php file. You can view the same at

    http://php.flashwebhost.com/vineesh/hello.php

    But I didn't get any error after removing the ; from end of the line. My code is:

    Code:
    <?php 
    
    echo "I am becoming a PHP programmer"
    
    ?>

    One more thing I noticed,

    In the code you given in Day 1 Post (here), under the line 'Paste following content to that file.'

    Code:
    <?php
    
    echo "Hello from PHP";
    Seems '?>' missing.

    Is that not compulsory or you missed it?
    Last edited by vineesh; 05-08-2014 at 10:18 AM.

  2. #2
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    As per PHP coding standward, we don't need ending ?>

    From

    http://www.php-fig.org/psr/psr-2/

    The closing ?> tag MUST be omitted from files containing only PHP.
    Quote Originally Posted by vineesh View Post
    But I didn't get any error after removing the ; from end of the line. My code is:
    Look like this is because latest PHP can handle single line PHP code with out ending semicolon. But we will need semicolon as almost every php code have more than one line.
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  3. #3
    Join Date
    Feb 2007
    Posts
    26,214

    Default

    Day 1 PHP programming

    http://php.flashwebhost.com/tom/cats.php


    Code:
    <?php 
    echo "<B><h1>I have 10 cats and 2 dogs</h1></B>" ;

  4. #4
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    Quote Originally Posted by image View Post
    Day 1 PHP programming

    http://php.flashwebhost.com/tom/cats.php


    Code:
    <?php 
    echo "<B><h1>I have 10 cats and 2 dogs</h1></B>" ;
    Good, we can use signle quote instead of double quote, that is the recommended and faster way. For example

    Code:
    <?php 
    
    echo '<B><h1>I have 10 cats and 2 dogs</h1></B>' ;
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  5. #5
    Join Date
    Feb 2007
    Posts
    26,214

    Default

    Day 1 PHP programming

    http://php.flashwebhost.com/tom/programmer.php

    Code:
    <?php 
    
    
    echo '<I><U><h1>I am a PHP Programmer now</h1></U></I>';

  6. #6
    Join Date
    Sep 2003
    Location
    india
    Posts
    11,527

  7. #7
    Join Date
    Feb 2007
    Posts
    26,214

    Default

    Day 1 PHP programming

    http://php.flashwebhost.com/tom/flashwebhost.php

    Code:
    <?php
    
    
    echo '<h1><b><center>FlashWebHost.com</center></b></h1>' ;
    
    
    echo '<p><a href="http://www.flashwebhost.com">FlashWebHost.com</a> was founded in 2001 and is one of the oldest and most stable web hosting companies in the world. The secret to our long history is the loyalty of our satisfied customers. FlashWebHost.com is a leading provider of high performance, low cost web hosting solutions. We offer a diverse range of flexible products coupled with unrivalled customer care. We only host on reliable servers with an up time in excess of 95%. All of our accounts include instant online set up and access to our unique web based control panel. Whatever your requirements, <a href="http://flashwebhost.com">FlashWebHost</a> has a solution tailored to your needs. We specialise in script hosting like: fantastico webhosting, php mysql hosting, and following softwares: wordpress blog hosting, mambo and joomla hosting, forum, ftp, email and multiple domains hosting. We distinguish ourselves by offering superior customer service Guarantee. We distinguish ourselves by offering superior customer service Guarantee. You\'ll find the FlashWebHost.com team is always friendly, understandable and helpful. </p>';
    Last edited by image; 05-08-2014 at 11:43 AM.

  8. #8
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    Quote Originally Posted by image View Post
    Good wok, experiment with the code like that, make mistakes, fix it, you won;t forget.

    Can anyone tell how to fix the error in following code

    hello_2.php

    Code:
    <?php
    
    echo 'Ranan's new production - Andhar Nogori Choupot Raja';
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  9. #9
    Join Date
    Nov 2009
    Posts
    76,596

    Default

    Day 1 PHP programming

    http://php.flashwebhost.com/sherly/indian.php

    Code:
    <?php
    
    echo "I am an Indian!";

    Learning PHP





    Last edited by sherlyk; 05-08-2014 at 03:41 PM.

  10. #10
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    Quote Originally Posted by sherlyk View Post
    Day 1 PHP programming

    http://php.flashwebhost.com/sherly/indian.php

    Code:
    <?php
    
    echo "I am an Indian!";
    
    ?>

    Don't use closing tag for PHP only code.

    Code:
    <?php
    
    echo "I am an Indian!";
    This is fine.
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •