MyBB Community Forums

Full Version: A few questions about of php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
ammm i create a plugin soo i habe a error but i cat find the error Sad

this is the error
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\server\htdocs\inc\plugins\fastlogin.php on line 82

this is the line 82 of my php file
<sniped by walkman>

any can helpme to find the error??
Most likely you're getting this from a missing ; on a line above somewhere. Most likely the one RIGHT before.

Another option is mismatched quotes. Try cleaning up that mess you're calling a single line with proper line breaks and indentation.
this is only a line

this is the fuction
<sniped by walkman>
Ok, so you've got mismatched quotes. And thats a variable, not a function.

But you're not escaping your ' characters inside the string. Notably the this.value='' needs to be this.value=\'\' for this variable to assign properly.

BUT, it would be a lot easier to read if you broke that "line" up into properly indented (for developer readability, since whitespace is ignored) code.

For example, half your original post's code:
<strong>
  <span class="smalltext">
    <b>Fast Login</b>
    &nbsp;
    <input type="text" class="textbox" name="username" title="{$lang->login_username}" value="{$lang->login_username}" onfocus="this.value=''" />
  </span>
</strong>

Not that it would have helped in this case, since we needed to know your variable's contents were surrounded by ' in order to know that you needed to escape the ' character inside your string.
yeah thanks man ^^

and sorry for the code bad to read
You're welcome Big Grin

And hey, we all have to learn Wink