close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Security Assist ==syntax error unexpected T_CONSTANT_ENCAPSED_STRING

Thread began 6/18/2010 4:25 pm by wschaepe397797 | Last modified 6/23/2010 8:43 pm by Eric Mittman | 1390 views | 10 replies |

wschaepe397797

Security Assist ==syntax error unexpected T_CONSTANT_ENCAPSED_STRING

I get this message when I try to run the members_LogIn.php file:


Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ']' in /home3/columbj7/public_html/members_LogIn.php on line 40

Thanks in advance for your help.

Regards,
Bill Schaepe
wschaepe@earthlink.net

Attached Files
members_LogInZIP.zip
Sign in to reply to this post

Eric Mittman

To resolve this issue you should update lines 39 & 40 to be like this:

php:
<form  action="<?php echo ($_SERVER["PHP_SELF"].(isset($_SERVER["QUERY_STRING"])?"?".htmlentities($_SERVER["QUERY_STRING"]):""));?>" method="post" name="WAATKLogInForm" id="WAATKLogInForm">



Was the page created like this from the wizard or were there any modifications that were made to the pages after the fact. Please post back with as much detail as you can about the steps you took that got to this result.

Sign in to reply to this post

wschaepe397797

Here are the details

In the ZIP attachment, I created members_LigIn2.php. The file members_LogIn2.php has some errors at the top of the file. Some of the <?php and ?> tags are missing as well lines 3-4 -5 being messed up.

I believe that I fixed it in members_LogIn3.php.

But when I make the code on line 40 (actullay Line 34 now) into one line, I still get errors

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ']' in /home3/columbj7/public_html/members_LogIn3.php on line 34

When I look at the file in the webserver file manager, it looks like is is all on one line:

LINE 33:<div id="LogInContainer" class="WAATK">
LINE 34: <form action="<?php echo ($_SERVER["PHP_SELF"].(isset($_SERVER["QUERY_STRING"])?"?".htmlentities($_SERVER["]):""));?>" method="post" name="WAATKLogInForm" id="WAATKLogInForm">
LINE 35: <h1>Log In</h1>

Attached Files
members_LogIn2.zip
Sign in to reply to this post

Eric Mittman

The problem looks similar to the first one, you are missing a sever variable that should be referenced in this line of code.

this code:

php:
<form  action="<?php echo ($_SERVER["PHP_SELF"].(isset($_SERVER["QUERY_STRING"])?"?".htmlentities($_SERVER["]):""));?>" method="post" name="WAATKLogInForm" id="WAATKLogInForm">



should be like this:

php:
<form  action="<?php echo ($_SERVER["PHP_SELF"].(isset($_SERVER["QUERY_STRING"])?"?".htmlentities($_SERVER["QUERY_STRING"]):""));?>" method="post" name="WAATKLogInForm" id="WAATKLogInForm">



I'm not sure why the second reference to the $_SERVER['query_string'] is not correct for you, this is why I was asking about any modifications that you have done to the code after the fact.

Sign in to reply to this post

wschaepe397797

that helped but now have errors in Helper_PHP.php

The login form now runs fine but I get two errors now in the Helper_PHP.php file:

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home3/columbj7/public_html/WA_SecurityAssist/Helper_PHP.php on line 14

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home3/columbj7/public_html/WA_SecurityAssist/Helper_PHP.php on line 20

I have attached the Help file along with the members_LogIn3.php which now runs without error.

Thanks for your help!

Regards,
Bill

Attached Files
helper_PHP.zip
Sign in to reply to this post

Eric Mittman

This error is telling you that there is a problem with the connection file to the db that you are using. It is saying that the variables referenced are not valid resources. This usually happens if you have names for these values that do not match up. What are the names of the variables in your connection file that is included on the login page?

If you can please post back with a copy of this page minus the login details so we can take a look. Also, when you try to edit the Authenticate User server behavior what is the result that you get? When you set this up were you using a different connection file?

Sign in to reply to this post

wschaepe397797

reply

To use the wizard to connect to the DB, I needed a DB on my local host. The DB connection file I used is called "conn_local_members" and the details are:
MYSQL Server: localhost
User name: root
Password: orange
Database: columbj7_members

But of course I need this on the remote server so I had to change the DB Connection info to the following conn file so that it would connect to the remote DB on the server: "conn_columbj7_members" with the following details:
MySQL server: localhost
Username: columbj7_neri
Password: 1754club
Database: columbj7_members

So I changed the name of the connection file in members_LogIn3.php to agree to "conn_columbj7_members" and change the password and username to 1754club and columbj7_neri

I have attached a ZIP file of the two connection files.

Where do I do this? "you try to edit the Authenticate User server behavior" I don't see any authenticate server behavior that I can edit. Am I not looking in the right places?

Regards,
Bill

Attached Files
Connection_FIles.zip
Sign in to reply to this post

wschaepe397797

reply - I got it!! The problem is solved

You were correct. It had to do with the connections file. What I had to do is make the username and password for the DB on the server exactly like it is on my local server. Then it worked fine.

BUT-- the problem is the user name and password on my local server is very weak. I would like to make the username and password like I had it on the server. But if I do that, then I can't connect locally to the DB to set up the login page using the wizard because unless I can connect locally, I can't tell it what tables and Columns to use.

Can I set up the connection with the local DB and the weak username and password and then edit the file so that it will now use the username and password for the remote server (they would be different and stronger)? And if so what do I have to edit?


Also when I run the wizard, it messes up the top php and leaves stuff out. I uploaded a ZIP of the bad file but here are the first few lines of the code. You can see the missing stuff like <?PHP>and ?> tags and a couple of lines missing.

php require_once('Connections/local_columbj7_members.php');php require_once( "WA_SecurityAssist/Helper_PHP.php" ); $local_columbj7_members,
"database" => $database_local_columbj7_members,
"tableName" => "members",


Do you have any thoughts on why the code is messed up from the wizard? Also do you have any clue as to why Dreamweaver makes the Form action line into two lines (lines 30 and 31)? If I make it one line as you said, it works?

At least I know how to fix the output of the wizard so that the code is correct.

Thanks a lot for your help!!

Regards,
Bill

Attached Files
members_LogIn30.ZIP
Sign in to reply to this post

Eric Mittman

What I normally do when I need different connection information is to duplicate the connection file, then just update the values in it for the live server. When you upload all of the files make sure to upload the connection file that has the same name but with the server address, username, password, and db mentioned. As far as the code is concerned it does not matter what these values are set to, just that the connection file has the same name, is in the same spot, and the variables inside of it are named the same. The only thing that should be different is the values that the variables are set to.

As for the code I'm not sure why it would be written incorrectly for you. What is the OS and DW version that you are working with? Does it do this all the time for every site or is it specific to the site you are currently working with? Have you tried completely uninstalling and removing the extension then installing it again? There might be a problem with the current install.

Let us know how this goes for you.

Sign in to reply to this post

wschaepe397797

reply

I am using Win XP and DW CS4 and CS3. I downloaded the Security assist and reloaded it but I don't remember if I uninstalled it first. I'll do an uninstall and then reinstall it and see what happens.

I have only used it for this site so I don't know if it is site specific or not. I'll try it on my site to see what happens (www.lenoxweb.net).

Regards,
Bill

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...