close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Parse error: syntax error

Thread began 12/03/2009 2:13 pm by dean248377 | Last modified 12/15/2009 12:06 pm by Eric Mittman | 2657 views | 8 replies |

dean248377

Parse error: syntax error

<div class="fieldPair">
<div class="fieldGroup"> <span id="state_Spry">
<select class="formMenufield_Medium" name="state" id="state" tabindex="12" onblur="hideServerError('state_ServerError');">
<option value="value" <?php if (!(strcmp("value", (isset($_GET["invalid"])?ValidatedField("custregistration","state"):"")))) {echo "selected=\"selected\"";} ?>>-Select State-</option>
This is the error i am getting. any ideas?

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\Website\Apache2\htdocs\puravidadivers\wwwroot\admin\cart\customers\cust_registration.php on line 387

here is the code around those lines:

<option value="<?php echo $row_Rs_States['StateID']?>" <?php if (!(strcmp("<?php echo $row_Rs_States['StateID']?>", (isset($_GET["invalid"])?ValidatedField("custregistration","state"):"")))) {echo "selected=\"selected\"";} ?>><?php echo $row_Rs_States['StateAbbrev']?></option>
</select>
<span class="selectRequiredMsg">Please select a value</span> </span>
<?php
if (ValidatedField('custregistration','custregistration')) {
if ((strpos((",".ValidatedField("custregistration","custregistration").","), "," . "10" . ",") !== false || "10" == "")) {
if (!(false)) {
?>
<span class="serverInvalidState" id="state_ServerError">Please select a value</span>




to me it seems this is the line with the problem it is right after 387:

]?>" <?php if (!(strcmp("<?php echo $row_Rs_States['StateID']?>", (isset($_GET["invalid"])?



Dean

Sign in to reply to this post

dean248377

ok

if i remove the following code the page will display properly:



<option value="<?php echo $row_Rs_States['StateID']?>" <?php if (!(strcmp("<?php echo $row_Rs_States['StateID']?>", (isset($_GET["invalid"])?ValidatedField("custregistration","state"):"")))) {echo "selected=\"selected\"";} ?>><?php echo $row_Rs_States['StateAbbrev']?></option>




<option value="<?php echo $row_RsCountry['CountryID']?>" <?php if (!(strcmp("<?php echo $row_RsCountry['CountryID']?>", (isset($_GET["invalid"])?ValidatedField("custregistration","country"):"")))) {echo "selected=\"selected\"";} ?>><?php echo $row_RsCountry['CountryAbbrev']?></option>

Sign in to reply to this post

Eric Mittman

I think the problem may be in your strcmp, you have it like this:

php:
<option value="<?php echo $row_RsCountry['CountryID']?><?php if (!(strcmp("<?php echo $row_RsCountry['CountryID']?>", (isset($_GET["invalid"])?ValidatedField("custregistration","country"):"") ))) {echo "selected=\"selected\"";} ?>><?php echo $row_RsCountry['CountryAbbrev']?></option>



I think this should be like this instead:

php:
<option value="<?php echo $row_RsCountry['CountryID']?><?php if (!(strcmp("" $row_RsCountry['CountryID'] ."", (isset($_GET['invalid'])?ValidatedField("custregistration","country"):"") ))) {echo "selected=\"selected\"";} ?>><?php echo $row_RsCountry['CountryAbbrev']?></option>



I removed the php block around the value in the strcmp and also add in some double quotes to concatenate the value. I also changes a couple of the double quotes around values to be single quotes. In php if you have a value that needs to be referenced in quotes that is not a string literal then you can using single quotes.

Sign in to reply to this post

dean248377

Hmmm

Eric,

You guys have been a great help but this is where people are getting frustrated. This is code the form builder wrote, I have not touched it. So far since buying form builder I have tried creating and modifing 6 forms. None of them have worked at all. Is there something that is a common user error that you think I could be doing to cause this?

Dean

Sign in to reply to this post

dean248377

your fix allows for the form to function but the dynamic menus for state and country will only dispaly 1 place not the whole list.

Sign in to reply to this post

DarylBeta Tester

Originally Said By: dean248377
  Eric,

You guys have been a great help but this is where people are getting frustrated. This is code the form builder wrote, I have not touched it. So far since buying form builder I have tried creating and modifing 6 forms. None of them have worked at all. Is there something that is a common user error that you think I could be doing to cause this?

Dean  



Sorry to jump in, but I have got the same error on multiple forms all because of code created by CSS Form Builder

Sign in to reply to this post

Eric Mittman

Based on the code that you posted originally I would say that your form had the dynamic values specified for the select list before you applied CSS Form Builder to the form. If this is not the case please let me know.

I'm thinking that this is the case because this select list should have the dynamic attributes written out differently if it were applied after the fact. If you can confirm this for me I will do some testing here to try and determine some more specifics about this type of scenario and how the CSS Form Builder should handle these values compared to what it is doing now.

What it looks like to me is that the dynamic attributes were in place and when the form was recreated with form builder just the values were left. These values would have been correct on a page that had a dynamic list but there would also be a loop around the values so that you get them from all the records.

Please post back and confirm the details or let me know if the circumstances are different and I will investigate this further.

Sign in to reply to this post

dean248377

Sorry for the delay eric,

This is the case. I have benn going through my site and using form builder to update the look of the forms. This situation happens everytime there is dynamic data already there.

Dean

Sign in to reply to this post

Eric Mittman

Thanks for confirming the details for me. I have logged a bug for this behavior so that it can be investigated further.

In the mean time as a workaround you should make sure to remove the dynamic properties of a select list in a form before applying form builder. Then after you apply form builder you can re-apply the dynamic values to the select lists.

Sign in to reply to this post

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