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 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2008
    Posts
    57
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unexpected character in input: '\' (ASCII=92) state=1

    hi,

    i create the one file.At time of creation i insert below contents into the file

    <?php
    include("ClassName.class");
    $myclass = &new ClassName;
    echo $myclass->myfunction1();
    ?>

    After file created and insert the text into the file as like this

    <?php
    include(\"ClassName.class\");
    $myclass = &new ClassName;
    echo $myclass->myfunction1();
    ?>

    In that additionally add \ .Due to this i got the error as

    errors :
    Unexpected character in input: '\' (ASCII=91) state=1 in F:\Facebook\furniture11\Data Mining1\public_html\admin\newfile.php on line 1

    Parse error: parse error, unexpected $end in F:\Facebook\furniture11\Data Mining1\public_html\admin\newfile.php on line 1

    plz tell that how i avoid the errors

  • #2
    Regular Coder
    Join Date
    May 2008
    Location
    Ohio
    Posts
    231
    Thanks
    3
    Thanked 21 Times in 21 Posts
    First off, "the one file"=???

    Second, you shouldn't be inputting &lt; and &gt; into your php document unless you're trying to output them to the browser - do not use them for actual php control structures or code. Unless I'm profoundly misunderstanding what you're doing here, I'm pretty sure that's wrong.

    Lastly, you don't need to escape the double quotes in your include line (the error that you're receiving). Your final code should look like:

    PHP Code:
    <?php
    include("ClassName.class");
    $myclass = &new ClassName;
    echo 
    $myclass->myfunction1();
    ?>
    Edit: and might I suggest that you tack a .php extension onto your class file? Not all web servers know what to do with .class - so it's very possible that if someone were to go to http://yourwebsite.com/ClassName.class they'd see your code (dangerous). If you put a .php extension on the end, the web server will not show any of your code to the user.
    Last edited by derzok; 08-07-2008 at 03:05 PM.
    zok@zoklet:~$ whereis zok
    zok: http://zoklet.net | http://zoklet.net/otg | /derzok/at/gmail/dot/com


  •  

    Posting Permissions

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