Jump to content

Archived

This topic is now archived and is closed to further replies.

emailhosting

Parse Error?

Recommended Posts

Hello! I'm a newbie and I wanted to make a change to the text on one of my php pages. After I changed the text, I am gettting parse errors. Why? I have not changed anything else. I simply went into file manager in my ipower account and made the simple text change. Now, my page does not work.

I would greatly appreciate any help. Here is the code:

<?php
//=========================== include site_function file =================
include("site_functions.php");
//=========================== end of site_function file ==================
create_session("userid");
//=========================== calling functions for connection ============
connection();
page_header();
include("left.php");
//===========================End of functions for connection =============

echo"<script language='JavaScript'>function vali() { if(document.form_ex.user_name.value == '') { alert('Please mention your site name'); document.form_ex.user_name.focus(); return; } if ((document.form_ex.site_url.value == 'http://') || (document.form_ex.site_url.value == '')) { alert('Please mention your site url'); document.form_ex.site_url.focus(); return; } if (document.form_ex.master_email.value == '') { alert('Please mention Webmaster Email Address'); document.form_ex.master_email.focus(); return; } if(document.form_ex.master_email.value!=''){ var AtSym = document.form_ex.master_email.value.indexOf(<A href="mailto:'@'">'@'</A>) var period1 = document.form_ex.master_email.value.indexOf('.') var Period = document.form_ex.master_email.value.lastIndexOf('.'); var Space = document.form_ex.master_email.value.indexOf(' '); var Length = document.form_ex.master_email.length - 1 // Array is from 0 to length-1 if ((AtSym &lt; 1) || // '@' cannot be in first position (Period &lt;= AtSym+1) || // Must be atleast one valid char btwn '@' and '.' (period1 &lt; 1) || (Period == Length ) || // Must be atleast one valid char after '.' (Space != -1)) // No empty spaces permitted { alert('Please enter a valid e-mail address!'); document.form_ex.master_email.focus(); return; } } document.form_ex.submit(); } </SCRIPT><BR>
<TABLE cellSpacing=0 borderColorDark=#ffffff cellPadding=2 width="100%" align=center bgColor=#ffffff borderColorLight=#004d84 border=1>
<TBODY>
<TR>
<TD bgColor=#0065ad><STRONG><FONT color=#ffffff>&nbsp;Exchange Links</FONT></STRONG> </TD></TR>
<TR>
<TD>
<FORM name=form22 method=post>
<TABLE height="100%" width="100%" border=0>
<TBODY>
<TR>
<TD>
<P>In order to exchange links with our site, please include our link or logo on your site and make sure it is operational. You may choose to use the code below or you may come up with your own. Then, use the form below to enter in your site information so that we can include your link on our site. Please note that not all links will be accepted and it is the discretion of our management team as to whether or not your link will be posted.</P></TD></TR>
<TR>
<TD>&nbsp; </TD></TR>
<TR>
<TD align=middle><A href="www.ratejokes.com"><IMG alt=Ratejokes.com src="http://www.ratejokes.com/images/s_logo2.jpg" border=0></A> <BR>Jokes Services at <A href="www.ratejokes.com">Ratejokes.com</A> </TD></TR>
<TR>
<TD align=middle><TEXTAREA name=MyTextBox1 rows=6 cols=47>&lt;A HREF='www.ratejokes.com'&gt;&lt;img src='http://www.ratejokes.com/images/s_logo2.jpg' ALT='Ratejokes.com' border='0'&gt;&lt;/A&gt;&lt;br&gt;Joke Services at &lt;A HREF='www.ratejokes.com'&gt;Ratejokes.com&lt;/A&gt;</TEXTAREA> </TD></TR>
<TR>
<TD align=middle><INPUT class=formbutton onclick=javascript:document.form22.MyTextBox1.select(); type=button value="Highlight All >>"> </TD></TR>
<TR>
<TD><BR></TD></TR>
<TR>
<TD align=middle><A href="www.ratejokes.com"><STRONG>Ratejokes.com</STRONG></A> </TD></TR>
<TR>
<TD align=middle><TEXTAREA name=MyTextBox rows=4 cols=47>&lt;A HREF='www.ratejokes.com'&gt;&lt;strong&gt;Ratejokes.com&lt;/strong&gt;&lt;/A&gt;</TEXTAREA> </TD></TR>
<TR>
<TD align=middle><INPUT class=formbutton onclick=javascript:document.form22.MyTextBox.select(); type=button value="Highlight All >>"><BR><BR></TD></TR></TBODY></TABLE></FORM></TD></TR>
<TR>
<TD bgColor=#0065ad><STRONG><FONT color=#ffffff>&nbsp;Submission Form</FONT></STRONG> </TD></TR>
<TR>
<TD><BR>
<FORM name=form_ex action=ex_links_final.php method=post>
<TABLE width="100%" align=center border=0>
<TBODY>
<TR>
<TD colSpan=2>When entering the web address (URL) of your site, please check your URL carefully. If we can not access your web site, you will not be listed. </TD></TR>
<TR>
<TD>Your Site Name: </TD>
<TD><INPUT title="Your Google Toolbar can fill this in for you. Select AutoFill" style="BACKGROUND-COLOR: #ffffa0" size=40 name=user_name> </TD></TR>
<TR>
<TD>Your Site URL: </TD>
<TD><INPUT size=40 value=http:// name=site_url> </TD></TR>
<TR>
<TD>Your Site Description: </TD>
<TD><TEXTAREA name=description rows=4 cols=30></TEXTAREA> </TD></TR>
<TR>
<TD>Reciprocal URL: </TD>
<TD><INPUT size=40 value=http:// name=rec_url> </TD></TR>
<TR>
<TD>Webmaster Name: </TD>
<TD><INPUT size=40 name=master_name> </TD></TR>
<TR>
<TD>Webmaster Email: </TD>
<TD><INPUT title="Your Google Toolbar can fill this in for you. Select AutoFill" style="BACKGROUND-COLOR: #ffffa0" size=40 name=master_email> </TD></TR>
<TR>
<TD>Comment and Suggestions: </TD>
<TD><TEXTAREA name=comments rows=4 cols=30></TEXTAREA> </TD></TR>
<TR>
<TD colSpan=2>&nbsp; </TD></TR>
<TR>
<TD align=middle colSpan=2><INPUT class=formbutton onclick=javascript:vali(); type=button value="Submit Form >>"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT class=formbutton onclick=javascript:document.form_ex.reset(); type=button value="Clear Form >>"> </TD></TR></TBODY></TABLE></FORM></TD></TR></TBODY></TABLE><BR>"; //=========================== calling functions for connection ============ page_right(); page_footer(); //=========================== end of functions for connection ============= ?&gt;

That is the end of the code. Here is the error: Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/ratejoke/public_html/ex_links.php on line 12

Why? Why? Why?

Any help would be immensely appreciated!

Share this post


Link to post
Share on other sites
Give this a try :)


[code]
<?php
//=========================== include site_function file =================
include("site_functions.php");
//=========================== end of site_function file ==================
create_session("userid");
//=========================== calling functions for connection ============
connection();
page_header();
include("left.php");
//===========================End of functions for connection =============

echo"function vali() { if(document.form_ex.user_name.value == '') { alert('Please mention your site name'); document.form_ex.user_name.focus(); return; } if ((document.form_ex.site_url.value == 'http://') || (document.form_ex.site_url.value == '')) { alert('Please mention your site url'); document.form_ex.site_url.focus(); return; } if (document.form_ex.master_email.value == '') { alert('Please mention Webmaster Email Address'); document.form_ex.master_email.focus(); return; } if(document.form_ex.master_email.value!=''){ var AtSym = document.form_ex.master_email.value.indexOf(<A href='mailto:'@''>'@'</A>) var period1 = document.form_ex.master_email.value.indexOf('.') var Period = document.form_ex.master_email.value.lastIndexOf('.'); var Space = document.form_ex.master_email.value.indexOf(' '); var Length = document.form_ex.master_email.length - 1 // Array is from 0 to length-1 if ((AtSym &lt; 1) || // '@' cannot be in first position (Period &lt;= AtSym+1) || // Must be atleast one valid char btwn '@' and '.' (period1 &lt; 1) || (Period == Length ) || // Must be atleast one valid char after '.' (Space != -1)) // No empty spaces permitted { alert('Please enter a valid e-mail address!'); document.form_ex.master_email.focus(); return; } } document.form_ex.submit(); } </SCRIPT><BR>
<TABLE cellSpacing=0 borderColorDark=#ffffff cellPadding=2 width='100%' align=center bgColor=#ffffff borderColorLight=#004d84 border=1>
<TBODY>
<TR>
<TD bgColor=#0065ad><STRONG><FONT color=#ffffff>&nbsp;Exchange Links</FONT></STRONG> </TD></TR>
<TR>
<TD>
<FORM name=form22 method=post>
<TABLE height='100%' width='100%' border=0>
<TBODY>
<TR>
<TD>
<P>In order to exchange links with our site, please include our link or logo on your site and make sure it is operational. You may choose to use the code below or you may come up with your own. Then, use the form below to enter in your site information so that we can include your link on our site. Please note that not all links will be accepted and it is the discretion of our management team as to whether or not your link will be posted.</P></TD></TR>
<TR>
<TD>&nbsp; </TD></TR>
<TR>
<TD align=middle><A href='www.ratejokes.com'><IMG alt=Ratejokes.com src='http://www.ratejokes.com/images/s_logo2.jpg' border=0></A> <BR>Jokes Services at <A href='www.ratejokes.com'>Ratejokes.com</A> </TD></TR>
<TR>
<TD align=middle><TEXTAREA name=MyTextBox1 rows=6 cols=47>&lt;A HREF='www.ratejokes.com'&gt;&lt;img src='http://www.ratejokes.com/images/s_logo2.jpg' ALT='Ratejokes.com' border='0'&gt;&lt;/A&gt;&lt;br&gt;Joke Services at &lt;A HREF='www.ratejokes.com'&gt;Ratejokes.com&lt;/A&gt;</TEXTAREA> </TD></TR>
<TR>
<TD align=middle><INPUT class=formbutton onclick=javascript:document.form22.MyTextBox1.select(); type=button value='Highlight All >>'> </TD></TR>
<TR>
<TD><BR></TD></TR>
<TR>
<TD align=middle><A href='www.ratejokes.com'><STRONG>Ratejokes.com</STRONG></A> </TD></TR>
<TR>
<TD align=middle><TEXTAREA name=MyTextBox rows=4 cols=47>&lt;A HREF='www.ratejokes.com'&gt;&lt;strong&gt;Ratejokes.com&lt;/strong&gt;&lt;/A&gt;</TEXTAREA> </TD></TR>
<TR>
<TD align=middle><INPUT class=formbutton onclick=javascript:document.form22.MyTextBox.select(); type=button value='Highlight All >>'><BR><BR></TD></TR></TBODY></TABLE></FORM></TD></TR>
<TR>
<TD bgColor=#0065ad><STRONG><FONT color=#ffffff>&nbsp;Submission Form</FONT></STRONG> </TD></TR>
<TR>
<TD><BR>
<FORM name=form_ex action=ex_links_final.php method=post>
<TABLE width='100%' align=center border=0>
<TBODY>
<TR>
When entering the web address (URL) of your site, please check your URL carefully. If we can not access your web site, you will not be listed.
<TR>
<TD>Your Site Name: </TD>
Toolbar can fill this in for you. Select AutoFill' style='BACKGROUND-COLOR: #ffffa0' size=40 name=user_name>
<TR>
<TD>Your Site URL: </TD>
<TD><INPUT size=40 value=http:// name=site_url> </TD></TR>
<TR>
<TD>Your Site Description: </TD>
<TD><TEXTAREA name=description rows=4 cols=30></TEXTAREA> </TD></TR>
<TR>
<TD>Reciprocal URL: </TD>
<TD><INPUT size=40 value=http:// name=rec_url> </TD></TR>
<TR>
<TD>Webmaster Name: </TD>
<TD><INPUT size=40 name=master_name> </TD></TR>
<TR>
<TD>Webmaster Email: </TD>
<TD><INPUT title='Your Google Toolbar can fill this in for you. Select AutoFill' style='BACKGROUND-COLOR: #ffffa0' size=40 name=master_email> </TD></TR>
<TR>
<TD>Comment and Suggestions: </TD>
<TD><TEXTAREA name=comments rows=4 cols=30></TEXTAREA> </TD></TR>
<TR>
<TD colSpan=2>&nbsp; </TD></TR>
<TR>
<TD align=middle colSpan=2><INPUT class=formbutton onclick=javascript:vali(); type=button value='Submit Form >>'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT class=formbutton onclick=javascript:document.form_ex.reset(); type=button value='Clear Form >>'> </TD></TR></TBODY></TABLE></FORM></TD></TR></TBODY></TABLE><BR>";
//=========================== calling functions for connection ============ page_right(); page_footer(); //=========================== end of functions for connection ============= ?&gt;
[/code]

Share this post


Link to post
Share on other sites
Wow! That was close. However, I'm still getting the following at the top of the page:

function vali() { if(document.form_ex.user_name.value == '') { alert('Please mention your site name'); document.form_ex.user_name.focus(); return; } if ((document.form_ex.site_url.value == 'http://') || (document.form_ex.site_url.value == '')) { alert('Please mention your site url'); document.form_ex.site_url.focus(); return; } if (document.form_ex.master_email.value == '') { alert('Please mention Webmaster Email Address'); document.form_ex.master_email.focus(); return; } if(document.form_ex.master_email.value!=''){ var AtSym = document.form_ex.master_email.value.indexOf('@') var period1 = document.form_ex.master_email.value.indexOf('.') var Period = document.form_ex.master_email.value.lastIndexOf('.'); var Space = document.form_ex.master_email.value.indexOf(' '); var Length = document.form_ex.master_email.length - 1 // Array is from 0 to length-1 if ((AtSym < 1) || // '@' cannot be in first position (Period <= AtSym+1) || // Must be atleast one valid char btwn '@' and '.' (period1 < 1) || (Period == Length ) || // Must be atleast one valid char after '.' (Space != -1)) // No empty spaces permitted { alert('Please enter a valid e-mail address!'); document.form_ex.master_email.focus(); return; } } document.form_ex.submit(); }

This language should be hidden. Thank you so much for trying to help me. I appreciate it greatly. If you know how to handle this problem, I would appreciate any feedback. Thanks again!


[!--quoteo(post=357823:date=Mar 23 2006, 08:47 PM:name=Prismatic)--][div class=\'quotetop\']QUOTE(Prismatic @ Mar 23 2006, 08:47 PM) [snapback]357823[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Give this a try :)
[code]
<?php
//=========================== include site_function file =================
include("site_functions.php");
//=========================== end of site_function file ==================
create_session("userid");
//=========================== calling functions for connection ============
connection();
page_header();
include("left.php");
//===========================End of functions for connection =============

echo"function vali() { if(document.form_ex.user_name.value == '') { alert('Please mention your site name'); document.form_ex.user_name.focus(); return; } if ((document.form_ex.site_url.value == 'http://') || (document.form_ex.site_url.value == '')) { alert('Please mention your site url'); document.form_ex.site_url.focus(); return; } if (document.form_ex.master_email.value == '') { alert('Please mention Webmaster Email Address'); document.form_ex.master_email.focus(); return; } if(document.form_ex.master_email.value!=''){ var AtSym = document.form_ex.master_email.value.indexOf(<A href='mailto:'@''>'@'</A>) var period1 = document.form_ex.master_email.value.indexOf('.') var Period = document.form_ex.master_email.value.lastIndexOf('.'); var Space = document.form_ex.master_email.value.indexOf(' '); var Length = document.form_ex.master_email.length - 1 // Array is from 0 to length-1 if ((AtSym &lt; 1) || // '@' cannot be in first position (Period &lt;= AtSym+1) || // Must be atleast one valid char btwn '@' and '.' (period1 &lt; 1) || (Period == Length ) || // Must be atleast one valid char after '.' (Space != -1)) // No empty spaces permitted { alert('Please enter a valid e-mail address!'); document.form_ex.master_email.focus(); return; } } document.form_ex.submit(); } </SCRIPT><BR>
<TABLE cellSpacing=0 borderColorDark=#ffffff cellPadding=2 width='100%' align=center bgColor=#ffffff borderColorLight=#004d84 border=1>
<TBODY>
<TR>
<TD bgColor=#0065ad><STRONG><FONT color=#ffffff>&nbsp;Exchange Links</FONT></STRONG> </TD></TR>
<TR>
<TD>
<FORM name=form22 method=post>
<TABLE height='100%' width='100%' border=0>
<TBODY>
<TR>
<TD>
<P>In order to exchange links with our site, please include our link or logo on your site and make sure it is operational. You may choose to use the code below or you may come up with your own. Then, use the form below to enter in your site information so that we can include your link on our site. Please note that not all links will be accepted and it is the discretion of our management team as to whether or not your link will be posted.</P></TD></TR>
<TR>
<TD>&nbsp; </TD></TR>
<TR>
<TD align=middle><A href='www.ratejokes.com'><IMG alt=Ratejokes.com src='http://www.ratejokes.com/images/s_logo2.jpg' border=0></A> <BR>Jokes Services at <A href='www.ratejokes.com'>Ratejokes.com</A> </TD></TR>
<TR>
<TD align=middle><TEXTAREA name=MyTextBox1 rows=6 cols=47>&lt;A HREF='www.ratejokes.com'&gt;&lt;img src='http://www.ratejokes.com/images/s_logo2.jpg' ALT='Ratejokes.com' border='0'&gt;&lt;/A&gt;&lt;br&gt;Joke Services at &lt;A HREF='www.ratejokes.com'&gt;Ratejokes.com&lt;/A&gt;</TEXTAREA> </TD></TR>
<TR>
<TD align=middle><INPUT class=formbutton onclick=javascript:document.form22.MyTextBox1.select(); type=button value='Highlight All >>'> </TD></TR>
<TR>
<TD><BR></TD></TR>
<TR>
<TD align=middle><A href='www.ratejokes.com'><STRONG>Ratejokes.com</STRONG></A> </TD></TR>
<TR>
<TD align=middle><TEXTAREA name=MyTextBox rows=4 cols=47>&lt;A HREF='www.ratejokes.com'&gt;&lt;strong&gt;Ratejokes.com&lt;/strong&gt;&lt;/A&gt;</TEXTAREA> </TD></TR>
<TR>
<TD align=middle><INPUT class=formbutton onclick=javascript:document.form22.MyTextBox.select(); type=button value='Highlight All >>'><BR><BR></TD></TR></TBODY></TABLE></FORM></TD></TR>
<TR>
<TD bgColor=#0065ad><STRONG><FONT color=#ffffff>&nbsp;Submission Form</FONT></STRONG> </TD></TR>
<TR>
<TD><BR>
<FORM name=form_ex action=ex_links_final.php method=post>
<TABLE width='100%' align=center border=0>
<TBODY>
<TR>
When entering the web address (URL) of your site, please check your URL carefully. If we can not access your web site, you will not be listed.
<TR>
<TD>Your Site Name: </TD>
Toolbar can fill this in for you. Select AutoFill' style='BACKGROUND-COLOR: #ffffa0' size=40 name=user_name>
<TR>
<TD>Your Site URL: </TD>
<TD><INPUT size=40 value=http:// name=site_url> </TD></TR>
<TR>
<TD>Your Site Description: </TD>
<TD><TEXTAREA name=description rows=4 cols=30></TEXTAREA> </TD></TR>
<TR>
<TD>Reciprocal URL: </TD>
<TD><INPUT size=40 value=http:// name=rec_url> </TD></TR>
<TR>
<TD>Webmaster Name: </TD>
<TD><INPUT size=40 name=master_name> </TD></TR>
<TR>
<TD>Webmaster Email: </TD>
<TD><INPUT title='Your Google Toolbar can fill this in for you. Select AutoFill' style='BACKGROUND-COLOR: #ffffa0' size=40 name=master_email> </TD></TR>
<TR>
<TD>Comment and Suggestions: </TD>
<TD><TEXTAREA name=comments rows=4 cols=30></TEXTAREA> </TD></TR>
<TR>
<TD colSpan=2>&nbsp; </TD></TR>
<TR>
<TD align=middle colSpan=2><INPUT class=formbutton onclick=javascript:vali(); type=button value='Submit Form >>'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT class=formbutton onclick=javascript:document.form_ex.reset(); type=button value='Clear Form >>'> </TD></TR></TBODY></TABLE></FORM></TD></TR></TBODY></TABLE><BR>";
//=========================== calling functions for connection ============ page_right(); page_footer(); //=========================== end of functions for connection ============= ?&gt;
[/code]
[/quote]

Share this post


Link to post
Share on other sites
Add this right after the echo

[code]<script language='javascript' type='text/javascript'>[/code]

So insted of

[code]echo"function vali()[/code]

it should read

[code]echo"<script language='javascript' type='text/javascript'>function vali()[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.