Find the answer to your Linux question:

View Poll Results: Which do you prefere php or asp?

Voters
4. You may not vote on this poll
  • PHP

    4 100.00%
  • ASP

    0 0%
  • Neither

    0 0%
Results 1 to 5 of 5
Whats wrong with this file Heres the error message: Code: Parse error: syntax error, unexpected $end in C:\Program Files\Apache Group\Apache2\htdocs\forums\write.php on line 30 Heres the location of the file; http://jcampbe.homelinux.com/forums/write.php ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! napolian's Avatar
    Join Date
    Aug 2005
    Posts
    20

    $end error


    Whats wrong with this file
    Heres the error message:
    Code:
    Parse error: syntax error, unexpected $end in C:\Program Files\Apache Group\Apache2\htdocs\forums\write.php on line 30
    Heres the location of the file;
    http://jcampbe.homelinux.com/forums/write.php

    The funny thing is line 30 doesnt exist!

    - Justin

  2. #2
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    It's impossible to view a PHP file's source over the Internet (assuming that your server is properly set up) because PHP is server-side-interpreted.

    Post the file's source here, please.

  3. #3
    Just Joined! napolian's Avatar
    Join Date
    Aug 2005
    Posts
    20
    Heres The Source
    Code:
    <html>
    <head>
    </head>
    <body>
    <?php
    
    $nickname = isset&#40;$_POST&#91;'nickname'&#93;&#41; ? $_POST&#91;'nickname'&#93; &#58; '';
    $message = isset&#40;$_POST&#91;'message'&#93;&#41; ? $_POST&#91;'message'&#93; &#58; '';
    $action = isset&#40;$_POST&#91;'action'&#93;&#41; ? $_POST&#91;'action'&#93; &#58; '';
    if&#40;$action == 'Clear'&#41;&#123;
    $f = fopen&#40;'forum.php','a'&#41;;
    $text = <<<EOT
    
    fwrite&#40;$f,$text&#41;;
    fclose&#40;$f&#41;;
    &#125;
    
    else if&#40;$nickname && $message&#41;&#123;
    $f = fopen&#40;'messages.html','a'&#41;;
    fwrite&#40;$f,"$nickname
    $message
    \n"&#41;;
    fclose&#40;$f&#41;;
    &#125;
    
    echo &#40;"Your Message has been Posted,"&#41;;
    
    echo &#40;'Click Here to Continue'&#41;;
    
    ?>
    </body>
    </html>
    - Justin

  4. $spacer_open
    $spacer_close
  5. #4
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    Don't you need a line with "EOT" in it to terminate the hereis document?

  6. #5
    Just Joined! napolian's Avatar
    Join Date
    Aug 2005
    Posts
    20
    Umm ... yes and there was a bunch of code that didnt belong ... Thanks for all your help, if i have anymore problems ill post again.

    - Justin

Posting Permissions

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