close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Encapsed error with Security pages

Thread began 5/14/2012 12:40 pm by msummers194171 | Last modified 2/10/2015 2:12 pm by john70964 | 1273 views | 11 replies |

msummers194171

Encapsed error with Security pages

I have created Security Pages with DataBridge's Security Assist for login. When I then browse to the login.php page, I get this error thrown:


Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home2/autores/public_html/webassist/security_assist/helpergroupsrulesphp.php on line 8

Line 8 is this -

$comparisons[0] = array(TRUE, "<?php echo ((isset($_SESSION['SecurityAssist_id']))?$_SESSION['SecurityAssist_id']:""); ?>", 2, "");

(those are all double quotes except for the ones within the square brackets)

Any ideas?

Sign in to reply to this post

Jason ByrnesWebAssist

line 8 should be:

php:
$comparisons[0] = array(TRUE, "". ((isset($_SESSION['SecurityAssist_id']))?$_SESSION['SecurityAssist_id']:"")."", 2, "");




not sure why it;s not being written correctly. What version of Dreamweaver are you using? and what is your OS?

Sign in to reply to this post

msummers194171

That certainly looks better. I'm using CS6 on W7-64bit. All of the lines in that helper file 'switch' block are malformed as I showed for line 8. I guess I'll fix them all.

Sign in to reply to this post

Jason ByrnesWebAssist

I have not been able to reproduce this, I will keep trying to find a cause.

Sign in to reply to this post

msummers194171

Fixing those lines did allow the login page to load and function without error. Pretty odd....

Sign in to reply to this post

Steve

I'm getting this same error.

Here is the source of a test page:

php:
<?php 

error_reporting
(E_ALL);
ini_set('display_errors''1');
 
?>
 
 
 <?php require_once( "webassist/security_assist/helper_php.php" ); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>

<p>some stuff </p>
<p><br />
  <?php if(WA_Auth_RulePasses("UserLoggedIn")){ // Begin Show Region ?>
    some other stuff
    <?php // End Show Region ?>
</p>
</body>
</html>




Error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in E:\Websites\cmhi.org\htdocs\webassist\security_assist\helpergroupsrulesphp.php on line 34

Sign in to reply to this post

Steve

Found part of the problem in that there are legacy directories such as WA_SecurityAssist...

Found the rule that is throwing the error and fixed the noted problem:

php:
case "UserLoggedIn":

            $comparisons[0] = array(TRUE, "".((isset($_SESSION['SecurityAssist_UserID']))?$_SESSION['SecurityAssist_UserID']:"")  ."", 2, "");
            break;



Wrote me own that works:

php:
<?php if (isset($_SESSION['SecurityAssist_UserID'])) { ?>

          Logged In &nbsp; &nbsp;
          <?php } else { ?>
          <a href="../access.php"> Member log in</a>
          <?php ?>



but would be interested in why the other does not work. Basically looking that IF the Session is present, they are logged in and show the content.

Sign in to reply to this post

Jason ByrnesWebAssist

I dont see why that rule would not work, the code looks correct.

can you send a copy of the webassist\security_ass ist\helpergroupsrulesphp.php file so i can see that line in context please.

Sign in to reply to this post

Steve

Please find attached the document you requested.

Attached Files
helpergroupsrulesphp.php.zip
Sign in to reply to this post

Jason ByrnesWebAssist

line 34 is exactly the same as line 28 and line 26, i don't see any issue, i don't see why the error would occur at line 34, but not the other 2 lines.

do you have a link where i can see the problem.

if you have a page that shows the problem, i can start an incident to look at it and find the cause.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...