...

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



swethak
08-07-2008, 11:59 AM
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

derzok
08-07-2008, 02:59 PM
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
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum