Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Jun 2005
    Posts
    91
    Thanks
    19
    Thanked 0 Times in 0 Posts

    echo "Hello World"; problem! problem! problem!

    I have a machine with win xp sp2, apache 2.0.54, php 4.3.11, mysql 4.3.12 and bbs web application.

    1.
    PHP Code:
    <?php
    echo "Hello World"?>
    -> empty screen.

    2.
    PHP Code:
    <?php
    echo "ttt";
    ?>
    -> empty screen
    3.
    PHP Code:
    <?php
    echo <<<END
    test
    END;
    ?>
    -> empty screen

    4.
    PHP Code:
     <?php
    echo "Hello World";

    echo 
    "이는 여러
    줄을 표현합니다. 물론 뉴라인도
    출력합니다."
    ;

    echo 
    "이는 여러\n줄을 표현합니다. 물론 뉴라인도\n출력합니다.";

    echo 
    "문자 이스케이핑은 \"이렇게\" 합니다.";

    // echo 구문 안에 변수를 사용할 수 있습니다.
    $foo "foobar";
    $bar "barbaz";

    echo 
    "foo는 $foo"// foo는 foobar

    // 배열을 사용할 수도 있습니다.
    $bar = array("value" => "foo");

    echo 
    "이것은 {$bar['value']} !"// 이것은 foo !

    // 작은 따옴표는 변수값이 아닌, 변수명을 출력합니다.
    echo 'foo는 $foo'// foo는 $foo

    // 다른 문자를 사용하지 않는다면, 바로 변수를 echo할 수 있습니다.
    echo $foo;          // foobar
    echo $foo,$bar;    // foobarbarbaz

    // 몇몇 사람들은 결합 echo보다 복수 인자 사용을 선호합니다.
    echo 'This ''string ''was ''made ''with multiple parameters.'chr(10);
    echo 
    'This ' 'string ' 'was ' 'made ' 'with concatenation.' "\n";

    echo <<<END
    이는 $variable 인터폴레이션을 가지는 여러 줄을
    출력하는 "here document" 구문을 사용합니다. here
    document 종료어는 줄에 세미콜론만을 가지고 있어야
    하며, 어떠한 공백도 없어야하는 점에 주의하십시오!
    END;

    // echo는 함수가 아니기에, 다음 코드는 유효하지 않습니다.
    ($some_var) ? echo 'true' : echo 'false';

    // 그러나, 다음 예제는 작동합니다.
    ($some_var) ? print('true'): print('false'); // print는 함수입니다.
    echo $some_var 'true''false'// 구문을 변경하여 처리
    ?>
    ->
    "foo"); echo "이것은 {$bar['value']} !"; // 이것은 foo ! // 작은 따옴표는 변수값이 아닌, 변수명을 출력합니다. echo 'foo는 $foo'; // foo는 $foo // 다른 문자를 사용하지 않는다면, 바로 변수를 echo할 수 있습니다. echo $foo; // foobar echo $foo,$bar; // foobarbarbaz // 몇몇 사람들은 결합 echo보다 복수 인자 사용을 선호합니다. echo 'This ', 'string ', 'was ', 'made ', 'with multiple parameters.', chr(10); echo 'This ' . 'string ' . 'was ' . 'made ' . 'with concatenation.' . "\n"; echo <<
    However, the bbs web application is working.

    Is there anything wrong in php.ini?

  • #2
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    PHP Code:
    <?php
    echo "Hello World"
    ?>
    Will work.

    Make sure you name your file with the .php extension. index.php
    Leonard Whistler

  • #3
    New Coder
    Join Date
    Jun 2005
    Posts
    91
    Thanks
    19
    Thanked 0 Times in 0 Posts
    Dear Len Whistler,

    It shows empty screen.

    Before posting, I've tried tens of examples.

    I think something wrong in php.ini or php's bug.

  • #4
    Senior Coder
    Join Date
    Apr 2005
    Location
    Colorado, United States
    Posts
    1,208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I highly doubt it is a bug in PHP. More likely, it is an incorrect server configuration.
    "$question = ( to() ) ? be() : ~be();"

  • #5
    Regular Coder
    Join Date
    Aug 2004
    Location
    The US of A
    Posts
    767
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by hanpedro
    I have a machine with win xp sp2, apache 2.0.54, php 4.3.11, mysql 4.3.12 and bbs web application.
    Like the bolded one? =P

  • #6
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Possibly a stupid question, but… are you viewing the php file directly (i.e. file://…) or via the http address. In case you weren't already aware, you need to view php files via their local http address in order for the php to be parsed.

  • #7
    New Coder
    Join Date
    Jun 2005
    Posts
    91
    Thanks
    19
    Thanked 0 Times in 0 Posts

    Smile

    Dear Kurashu,

    I dislike it too, but I have to use it for graphic works. So I should work with this machine and upload linux.

    Dear Bill Posters,

    I tried it on localhost and my domain. So I am considering format win xp.

    The php company says new php version released with this statement.
    "As the improved reference support in PHP 4.4 might show as notices and warnings in your existing applications - in cases where PHP formerly just silently ignored this and often causing memory corruptions - we also recommend to test PHP 4.4.0RC2 with your applications. The final release is planned for July 11th. PHP 4.4.0RC2 can be found here.
    "

  • #8
    Regular Coder
    Join Date
    Aug 2004
    Location
    The US of A
    Posts
    767
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by hanpedro
    Dear Kurashu,

    I dislike it too, but I have to use it for graphic works. So I should work with this machine and upload linux.
    It was a joke.

  • #9
    New Coder
    Join Date
    Jul 2005
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Have you tried setting display_errors = On, to see if it actually complains about anything? Might shed some light on the problem if it has something to whine about

    *edit* also you should confirm that PHP is actually installed properly within Apache.. because a simple echo statement shouldn't really give any problems unless something went wrong during install.

  • #10
    Regular Coder
    Join Date
    Jul 2004
    Posts
    201
    Thanks
    8
    Thanked 1 Time in 1 Post
    right click and click view source, tell us whats the source code says. See if it is acctually doin anythin.


  •  

    Posting Permissions

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