Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Unwanted symbol as a result of require()

  1. #1
    tmatematikas is offline Newbie
    Join Date
    May 2009
    Location
    Lithuania
    Posts
    16
    Rep Power
    11

    Unwanted symbol as a result of require()

    Hello. I am having an annoying problem with php function require(). First of all, look at the files (All utf-8 encoded).

    index.php
    Code:
    <?php
        
    echo '
    <html>
        <head>
            <meta http-equiv="Content-Language" content="en"/>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
            <title>require() test</title>
        </head>
        <body>'
    ;
        
        require (
    "body.php");
        
        echo 
    '
        </body>
    </html>'
    ;

    ?>
    body.php
    Code:
    <?php
        
        
    echo    '
            <p>Test...</p>
            <hr>
            <table border="0" width="100%">
                <tr align="left" width="100%">
                    There is a <b>""</b> symbol at the end of <b>body</b> tag. But why?
                </tr>
            </table>
            <hr>
            <br>'
    ;

    ?>
    The problem is, that including something from another file using require() or include() generates unwanted symbol "". You probably do not see it, but copy and paste it to Notepad or smth and you will see.
    Here is the the result:
    HTML Code:
    <html>
    	<head>
    		<meta http-equiv="Content-Language" content="en"/>
    		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    		<title>require() test</title>
    	</head>
    	<body>
    		<p>Test...</p>
    
    		<hr>
    		<table border="0" width="100%">
    			<tr align="left" width="100%">
    				There is a <b>""</b> symbol at the end of <b>body</b> tag. But why?
    			</tr>
    		</table>
    
    		<hr>
    		<br>
    	</body>
    </html>
    If I am just eching the code in the same index.php, everything is fine.
    Any suggestion how to fix this (remove that symbol).
    P.S. require() or include() must be there.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Jordan Guest

    Re: Unwanted symbol as a result of require()

    I just tested it and I see no symbol. require() test

  4. #3
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: Unwanted symbol as a result of require()

    It could be your server admin playing games or something.

  5. #4
    tmatematikas is offline Newbie
    Join Date
    May 2009
    Location
    Lithuania
    Posts
    16
    Rep Power
    11

    Re: Unwanted symbol as a result of require()

    Maybe you are right. Check this: tmatematikas(dot)mikrovisata(dot)net/test/.
    Oh, I forget to say, wamp gives the same.

  6. #5
    tmatematikas is offline Newbie
    Join Date
    May 2009
    Location
    Lithuania
    Posts
    16
    Rep Power
    11

    Re: Unwanted symbol as a result of require()

    And more: it is no matter what the encoding of index.php is. I found, that ONLY the file's, which is included, encoding makes sence. If body.php is utf-8 - the symbol appears, if ansi - no symbol. Strange thing.
    Jordan, make sure body.php is utf-8.

  7. #6
    Jordan Guest

    Re: Unwanted symbol as a result of require()

    Quote Originally Posted by tmatematikas View Post
    Maybe you are right. Check this: tmatematikas(dot)mikrovisata(dot)net/test/.
    Oh, I forget to say, wamp gives the same.
    I'm confused, I don't see any symbol. Do you want to see the symbol between the " " or not? Can you attach a screenshot of what you see?

  8. #7
    tmatematikas is offline Newbie
    Join Date
    May 2009
    Location
    Lithuania
    Posts
    16
    Rep Power
    11

    Re: Unwanted symbol as a result of require()

    Here it is.
    Attached Thumbnails Attached Thumbnails Unwanted symbol as a result of require()-adot.png  

  9. #8
    farouqzaib is offline Newbie
    Join Date
    Aug 2009
    Posts
    3
    Rep Power
    0

    Re: Unwanted symbol as a result of require()

    I see nothing

  10. #9
    Join Date
    Jul 2006
    Posts
    16,491
    Blog Entries
    75
    Rep Power
    143

    Re: Unwanted symbol as a result of require()

    I suspect the symbol is an artifact of Notepad, and not a character being sent.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  11. #10
    tmatematikas is offline Newbie
    Join Date
    May 2009
    Location
    Lithuania
    Posts
    16
    Rep Power
    11

    Re: Unwanted symbol as a result of require()

    Are you blind (thank's God WingedPanther sees it)? Then make a simple Webpage with echoing <!DOCTYPE... and other stuff in a way I have mentioned and try to validate it. As I did. W3C says it is that character in prolog and it is not alowed. Try to validate my homepage (remove /test/), which address is seen in the picture. How would you explain that?

Closed Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. remove unwanted &amp;
    By shivam in forum PHP Development
    Replies: 4
    Last Post: 03-12-2011, 11:45 PM
  2. GDI+ DrawImage Stretches Unwanted
    By TheMatrixUnicef in forum C and C++
    Replies: 3
    Last Post: 12-11-2010, 05:04 AM
  3. Unwanted Stepchild?
    By debtboy in forum Linux Programming and Scripting
    Replies: 4
    Last Post: 06-07-2010, 05:54 AM
  4. Simple Window application (Unwanted cmd)
    By sakishrist in forum C and C++
    Replies: 7
    Last Post: 01-01-2009, 05:11 PM
  5. PHP Require Problem...
    By gakattack in forum PHP Development
    Replies: 14
    Last Post: 11-07-2008, 11:24 AM

Tags for this Thread

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