Parse error Help Please
Moderator: General Moderators
-
ralphiedee
- Forum Newbie
- Posts: 8
- Joined: Fri Jul 18, 2008 10:59 pm
Parse error Help Please
I'm at my wits end here as this is puzzling to say the least. If I create or download a premade html / php contact form, edit the email and upload to my server it works fine when I use Dreamweaver CS5 to edit it in.
I recently updated to Dreamweaver CS5.5 and used that to edit and upload and html / php form but when I test it I get the following message in the browser
Parse error: syntax error, unexpected T_VARIABLE in /home/content/r/a/l/ralphiedee/html/contactform_free/free_settings.php on line 1
This only applies to editing any content in Dreamweaver 5.5. I have tried this with at least 5 different php scripts and the same thing all the time. I did a search on the error and it seems it has to do with a semi colon, in this case line 1? But why would this error only show up in Dreamweaver CS5.5.
below is the file in question, can someone explain this to me cause the Adobe forum cannot.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Contact Us</title>
<script src="free_validation.js"></script>
<script>
required.add('Full_Name','NOT_EMPTY','Full Name');
required.add('Email_Address','EMAIL','Email Address');
required.add('Your_Message','NOT_EMPTY','Your Message')
</script>
<link rel="stylesheet" type="text/css" href="free_styles.css">
</head>
<body>
<form name="contactformfree" method="post" action="free_process.php" onsubmit="return validate.check(this)">
<table width="400px" class="cffree">
<tr>
<td colspan="2">
<p style="text-align:center">Fields marked with <span class="required_star"> * </span> are required.</p>
</td>
</tr>
<tr>
<td valign="top" class="cffree_td">
<label for="Full_Name" class="required">Full Name<span class="required_star"> * </span></label>
</td>
<td valign="top" class="cffree_td">
<input type="text" name="Full_Name" id="Full_Name" maxlength="80" style="width:250px">
</td>
</tr>
<tr>
<td valign="top" class="cffree_td">
<label for="Email_Address" class="required">Email Address<span class="required_star"> * </span></label>
</td>
<td valign="top" class="cffree_td">
<input type="text" name="Email_Address" id="Email_Address" maxlength="100" style="width:250px">
</td>
</tr>
<tr>
<td valign="top" class="cffree_td">
<label for="Telephone_Number" class="not-required">Telephone Number</label>
</td>
<td valign="top" class="cffree_td">
<input type="text" name="Telephone_Number" id="Telephone_Number" maxlength="100" style="width:250px">
</td>
</tr>
<tr>
<td valign="top" class="cffree_td">
<label for="Your_Message" class="required">Your Message<span class="required_star"> * </span></label>
</td>
<td valign="top" class="cffree_td">
<textarea style="width:250px;height:120px" name="Your_Message" id="Your_Message" maxlength="2000"></textarea>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:center" class="cffree_td">
<input type="submit" value=" Submit Form ">
<br /><br />
<div style="font-size:0.9em">Form provided by <a href="http://www.freecontactform.com/free.php" target="_blank">Free Contact Form</a></div>
<br /><br />
</td>
</tr>
</table>
</form>
</body>
</html>
I recently updated to Dreamweaver CS5.5 and used that to edit and upload and html / php form but when I test it I get the following message in the browser
Parse error: syntax error, unexpected T_VARIABLE in /home/content/r/a/l/ralphiedee/html/contactform_free/free_settings.php on line 1
This only applies to editing any content in Dreamweaver 5.5. I have tried this with at least 5 different php scripts and the same thing all the time. I did a search on the error and it seems it has to do with a semi colon, in this case line 1? But why would this error only show up in Dreamweaver CS5.5.
below is the file in question, can someone explain this to me cause the Adobe forum cannot.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Contact Us</title>
<script src="free_validation.js"></script>
<script>
required.add('Full_Name','NOT_EMPTY','Full Name');
required.add('Email_Address','EMAIL','Email Address');
required.add('Your_Message','NOT_EMPTY','Your Message')
</script>
<link rel="stylesheet" type="text/css" href="free_styles.css">
</head>
<body>
<form name="contactformfree" method="post" action="free_process.php" onsubmit="return validate.check(this)">
<table width="400px" class="cffree">
<tr>
<td colspan="2">
<p style="text-align:center">Fields marked with <span class="required_star"> * </span> are required.</p>
</td>
</tr>
<tr>
<td valign="top" class="cffree_td">
<label for="Full_Name" class="required">Full Name<span class="required_star"> * </span></label>
</td>
<td valign="top" class="cffree_td">
<input type="text" name="Full_Name" id="Full_Name" maxlength="80" style="width:250px">
</td>
</tr>
<tr>
<td valign="top" class="cffree_td">
<label for="Email_Address" class="required">Email Address<span class="required_star"> * </span></label>
</td>
<td valign="top" class="cffree_td">
<input type="text" name="Email_Address" id="Email_Address" maxlength="100" style="width:250px">
</td>
</tr>
<tr>
<td valign="top" class="cffree_td">
<label for="Telephone_Number" class="not-required">Telephone Number</label>
</td>
<td valign="top" class="cffree_td">
<input type="text" name="Telephone_Number" id="Telephone_Number" maxlength="100" style="width:250px">
</td>
</tr>
<tr>
<td valign="top" class="cffree_td">
<label for="Your_Message" class="required">Your Message<span class="required_star"> * </span></label>
</td>
<td valign="top" class="cffree_td">
<textarea style="width:250px;height:120px" name="Your_Message" id="Your_Message" maxlength="2000"></textarea>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:center" class="cffree_td">
<input type="submit" value=" Submit Form ">
<br /><br />
<div style="font-size:0.9em">Form provided by <a href="http://www.freecontactform.com/free.php" target="_blank">Free Contact Form</a></div>
<br /><br />
</td>
</tr>
</table>
</form>
</body>
</html>
Re: Parse error Help Please
The code you posted doesn't appear to contain any PHP, so it clearly isn't the problem. The error message specifies free_settings.php, so seeing that code would be more helpful.
-
ralphiedee
- Forum Newbie
- Posts: 8
- Joined: Fri Jul 18, 2008 10:59 pm
Re: Parse error Help Please
Sorry,
<?php
$email_to = "vze2btvh@verizon.net"; // your email address
$email_subject = "Contact Form Message"; // email subject line
$thankyou = "thankyou.htm"; // thank you page
?>
<?php
$email_to = "vze2btvh@verizon.net"; // your email address
$email_subject = "Contact Form Message"; // email subject line
$thankyou = "thankyou.htm"; // thank you page
?>
-
Amanda1998
- Forum Newbie
- Posts: 23
- Joined: Tue Dec 13, 2011 10:25 am
Re: Parse error Help Please
You did not close a string or put something in single quotes, here is your issueralphiedee wrote:T_VARIABLE
Code: Select all
required.add('Your_Message','NOT_EMPTY','Your Message')Code: Select all
required.add('Your_Message','NOT_EMPTY','Your Message');I sow that too, but appear to be on his js script, since We now that T_VARIABLE comes from php error (in this case).Celauran wrote:The code you posted doesn't appear to contain any PHP, so it clearly isn't the problem. The error message specifies free_settings.php, so seeing that code would be more helpful.
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Parse error Help Please
PHP code will only be parsed within php tags; anything else is seen as non-php code and thus not parsed.Amanda1998 wrote:You did not close a string or put something in single quotes, here is your issue
@OP are there any other code in the file? The pasted php code looks valid
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
-
Amanda1998
- Forum Newbie
- Posts: 23
- Joined: Tue Dec 13, 2011 10:25 am
Re: Parse error Help Please
Certainly you're right, but as I said before, @ I sow that too, but appear to be on his js script, since We now that T_VARIABLE comes from php error (in this case). Knowing.... AS you mention @PHP code will only be parsed within php tags; anything else is seen as non-php code and thus not parsed.social_experiment wrote:PHP code will only be parsed within php tags; anything else is seen as non-php code and thus not parsed.Amanda1998 wrote:You did not close a string or put something in single quotes, here is your issue
So if there is php code that the user @ralphiedee did not post, we problably asume that there (any-how) whatever he post here, had been parsed by PHP...
BTW did you notice what I did said about in his js code line ?
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Parse error Help Please
This bit? It wouldn't matter to the PHP parser if a ; was missing from here. You have the right idea; the script is most likely missing a ; or " somewhere but it's not on the first code sample (or second) posted by ralphiedeeAmanda1998 wrote: You did not close a string or put something in single quotes, here is your issue
required.add('Your_Message','NOT_EMPTY','Your Message')
Have to be:
required.add('Your_Message','NOT_EMPTY','Your Message');
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
-
Amanda1998
- Forum Newbie
- Posts: 23
- Joined: Tue Dec 13, 2011 10:25 am
Re: Parse error Help Please
Yeah, you are right
... (Ladies have rights to be wrong too) ? .. BTW where is free.php anyway
PD: I did download the file from http://www.freecontactform.com/contactform_free.rar
There is nothing.. just that thing from js line we talk to about it
PD: I did download the file from http://www.freecontactform.com/contactform_free.rar
There is nothing.. just that thing from js line we talk to about it
-
ralphiedee
- Forum Newbie
- Posts: 8
- Joined: Fri Jul 18, 2008 10:59 pm
Re: Parse error Help Please
Wow great, thanks for the replies. I looked into this further and will re post the findings. It seems that the .php code is indeed fine. But there is a difference when downloading the .php page from the server as the DWeaver CS5.0 page comes back EXACTLY the same but the DW CS5.5 code comes back looking different and I get the parsing error ONLY using DW 5.5
?????
RD
?????
RD
- Attachments
-
- See the difference when I downloaded this file from the server?
- cs5.5.jpg (72.39 KiB) Viewed 1621 times
-
- this is the way the code looks like when it was placed on the server , fine
- cs5.0.jpg (73.19 KiB) Viewed 1621 times
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Parse error Help Please
@ralphiedee Try typing the code from the original file as opposed to copying it
Could you explain this bitralphiedee wrote:...I get the parsing error ONLY using DW 5.5
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
-
ralphiedee
- Forum Newbie
- Posts: 8
- Joined: Fri Jul 18, 2008 10:59 pm
Re: Parse error Help Please
Nothing to do with copying or typing the code. This has to do with one thing, Dreamweaver CS5.5 . Why would this php code work fine when using DWeaver 5.0 but if I delete the php code from the server and re upload it in DWeaver CS5.5 That is when I get the parsing error, if you look at the screenshots you can clearly see what the code looks like in each instance. You can also see clearly that the code rendered in CS5.5 is ALL BLUE and the lines are not separated correctly.
Possibly a preference in DW CS5.5?
I even tried using BBEdit for this and had no problems. But I need to use DW CS5.5 because of the HTML5 options in it.
thx for taking the time to look into this.
RD
Possibly a preference in DW CS5.5?
I even tried using BBEdit for this and had no problems. But I need to use DW CS5.5 because of the HTML5 options in it.
thx for taking the time to look into this.
RD
Re: Parse error Help Please
In the FTP settings, try setting the transfer type to binary. Then it will transfer the files as is. In ASCII mode, you can encounter other problems such as the line endings might change.
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Parse error Help Please
I've often seen directly copied code not working and simply typing the code on a new page fixed the issues. Good luck with the problemralphiedee wrote:Nothing to do with copying or typing the code
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering