Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Having Problem With a PHP file, Please help
Old 09-30-2009, 04:03 AM Having Problem With a PHP file, Please help
Experienced Talker

Posts: 40
Name: Jeffrey
Trades: 0
I have been trying to upload an optin box to my site, the sign up form is from iContact, they have two different kind of form, one that is automatic and one that is manual which people can edit, everytime I upload the manual one here is the error that is display on the live page:
Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/mandela1/public_html/templates/default/boxes/custom.php on line 94

Here is the PHP file with line being underlined starting with var.

<?php
/*
Card Infobox, v 1.0 2002/12/04 by Kevin Park

osCommerce
http://www.oscommerce.com/

Copyright (c) 2000,2001 osCommerce

Released under the GNU General Public License


CRE Loaded , Open Source E-Commerce Solutions
http://www.creloaded.com

Chain Reaction Works, Inc
Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.

Last Modified by $Author$
Last Modifed on : $Date$
Latest Revision : $Revision:$

*/
?>
<!-- d Card Info Box //-->
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left',
'text' => '<font color="' . $font_color . '">' . BOX_HEADING_EMAIL . '</font>'
);
new infoBoxHeading($info_box_contents);

$info_box_contents = array();
$info_box_contents[] = array('align' => 'center',
// 'text' => tep_image(DIR_WS_IMAGES . '/cards/cards.gif') .
//elari chanegd to provide a link to your payment acount
'text' => '<style>
.link,
.signupframe {
color: #EDF505;
font-family: Arial, Helvetica, sans-serif;
}
.link {
text-decoration: none;
}
.signupframe {
border: 1px solid #FFFFFF;
background: #5B5B97;
}
</style>
<form method=post action="https://app.icontact.com/icp/signup.php" name="icpsignup" id="icpsignup1116" accept-charset="UTF-8" onsubmit="return verifyRequired1116();" >
<input type=hidden name=redirect value="http://www.icontact.com/www/signup/thanks.html" />
<input type=hidden name=errorredirect value="http://www.icontact.com/www/signup/error.html" />

<div id="SignUp">
<table width="260" class="signupframe" border="0" cellspacing="0" cellpadding="5">
<tr>
<td valign=top align=right>
<font size="1" face="Arial,Helvetica, sans-serif">*</font> <font size="2">Email</font>
</td>
<td align=left>
<input type=text name="fields_email">
</td>
</tr>
<td valign=top align=right>
<font size="1" face="Arial,Helvetica, sans-serif">*</font> <font size="2">Name</font>
</td>
<td align=left>
<input type=text name="fields_fname">
</td>
</tr>
<input type=hidden name="listid" value="15786">
<input type=hidden name="specialid:15786" value="2KF6">

<input type=hidden name=clientid value="569119">
<input type=hidden name=formid value="1116">
<input type=hidden name=reallistid value="1">
<input type=hidden name=doubleopt value="0">
<TR>
<TD> </TD>
<TD><font size="1">*</font><font size="2"> = Required Field</FONT></TD>
</TR>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Submit"></td>
</tr>
</table>
</div>
</form>
<script type="text/javascript">

var icpForm1116 = document.getElementById('icpsignup1116');

if (document.location.protocol === "https:")

icpForm1116.action = "https://app.icontact.com/icp/signup.php";
function verifyRequired1116() {
if (icpForm1116["fields_email"].value == "") {
icpForm1116["fields_email"].focus();
alert("The Email field is required.");
return false;
}
if (icpForm1116["fields_fname"].value == "") {
icpForm1116["fields_fname"].focus();
alert("The Name field is required.");
return false;
}


return true;
}
</script>
<a class="link" href="http://www.icontact.com"><font size="2">Email Marketing You Can Trust</font></a>

'
);

new infoBox($info_box_contents);
if (TEMPLATE_INCLUDE_FOOTER =='true'){
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left',
'text' => tep_draw_separator('pixel_trans.gif', '100%', '1')
);
new infoboxFooter($info_box_contents, '' );
}
?>


I have not made any modification to the sign up form code but still this error keeps coming up.
Does anyone know how I can fix that?
Your help is appreciated.
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
mandela10 is offline
Reply With Quote
View Public Profile Visit mandela10's homepage!
 
 
Register now for full access!
Old 09-30-2009, 05:53 AM Re: Having Problem With a PHP file, Please help
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
The problem is in the text you are assigning to your array, you used single quote delimiters, but there are single quotes in the content of the array too.

This make PHP think that it reached the end of the variable value, when it's not the case.
You have to replace every single quotes of the HTML you put in the array with a prepending backslash.
Making " ' " look like " \' ".

To be more specific, your problem lies in the javascript line
Code:
var icpForm1116 = document.getElementById('icpsignup1116');
which should be
Code:
var icpForm1116 = document.getElementById(\'icpsignup1116\');
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 09-30-2009, 06:04 AM Re: Having Problem With a PHP file, Please help
Experienced Talker

Posts: 40
Name: Jeffrey
Trades: 0
Quote:
Originally Posted by tripy View Post
The problem is in the text you are assigning to your array, you used single quote delimiters, but there are single quotes in the content of the array too.

This make PHP think that it reached the end of the variable value, when it's not the case.
You have to replace every single quotes of the HTML you put in the array with a prepending backslash.
Making " ' " look like " \' ".

To be more specific, your problem lies in the javascript line
Code:
var icpForm1116 = document.getElementById('icpsignup1116');
which should be
Code:
var icpForm1116 = document.getElementById(\'icpsignup1116\');
Thanks Tripy, you were absolutely right, once I made the changes that you pointed out, everything works out perfectly, you really know what's best for me.
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
mandela10 is offline
Reply With Quote
View Public Profile Visit mandela10's homepage!
 
Reply     « Reply to Having Problem With a PHP file, Please help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18986 seconds with 12 queries