Jump to content

What is wrong with this code?


velo1ever

Recommended Posts

I am having trouble with this code.  I am putting it into an Oscommerce store.  The odd thing, it will work on the main page, but once I insert the code into a side box, it will not work and gives me this error, which is in the first line.

 

Parse error: syntax error, unexpected T_STRING, expecting ')'

 

 

 

'<form style="border:1px solid #ccc;padding:3px;text-align:center;"

action="xxxxxx" method="post" target="popupwindow" onsubmit="window.open('xxxxxxxx', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true"><p>Enter your email address:</p><p><input type="text" style="width:140px" name="email"/></p><input type="hidden" value="xxxx://feeds.feedburner.com/~e?ffid=1697582" name="url"/><input type="hidden" value="Girls Know What They Want.com--"Where Our Customers Come First!"" name="title"/><input type="hidden" name="loc" value="en_US"/><input type="submit" value="Subscribe" /><p>Delivered by <a href="xxxxxx" target="_blank">FeedBurner</a></p></form>');

 

Thank you for looking and any advice.

(I inserted some xxxx where the links go, so that the page isn't filled with links, if I should repost, with the true code, please let me know.)

Link to comment
https://forums.phpfreaks.com/topic/93507-what-is-wrong-with-this-code/
Share on other sites

Sounds like where you are inserting it is within another function or some area where a parenthetical needs to be closed before you can place your string. Also, you have the closing parenthetical, but there is no opening or command to output or use the string in any way. Can you give us a little more information as to how you are inserting this into osCommerce?

Read code please...

 

it seems you're putting this into the PHP somewhere (hence your error) and i suspect it's because you're echo'ing what you posted, and because you haven't escaped the single quotes (') in that string...

e.g.

...ow" onsubmit="window.open(\'xxxxxxxx\', \'popup....

 

notice the backslashes in the above. You're probably missing those.

Wow..this board is great! Thank you for all your help. I tried a few things, and of course, no luck... How can I post the code to the board without just cutting and pasting, or is that the best way?  I'll post the whole code on the page. 

Thank you!!!

Try that:

echo'<form style="border:1px solid #ccc;padding:3px;text-align:center;" action="xxxxxx" method="post" target="popupwindow" onsubmit="window.open(\'xxxxxxxx\', \'popupwindow\', \'scrollbars=yes,width=550,height=520\');return true">'.
'<p>Enter your email address:</p>'.
'<p><input type="text" style="width:140px" name="email"/></p>'.
'<input type="hidden" value="xxxx://feeds.feedburner.com/~e?ffid=1697582" name="url"/>'.
'<input type="hidden" value="Girls Know What They Want.com--"Where Our Customers Come First!"" name="title"/>'.
'<input type="hidden" name="loc" value="en_US"/>'.
'<input type="submit" value="Subscribe" />'.
'<p>Delivered by <a href="xxxxxx" target="_blank">FeedBurner</a></p>'.
'</form>';

Didn't work :(

It gave me this error Parse error: syntax error, unexpected T_ECHO in the first line.

If you can let me know how to post the code, as I see you did a pretty cool box to post the code, I'll post the whole code in the page, so people can take a look.

 

Here is the code for the whole page.

 

<?php
/*
  $Id: currencies.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  if (isset($currencies) && is_object($currencies)) {
?>
<!-- currencies //-->
          <tr>
            <td>
<?php
    $info_box_contents = array();
    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CURRENCIES . '</font>');
    new SideinfoBoxHeading($info_box_contents, false, false);

  $info_box_contents = array();
    $info_box_contents = array();
  $info_box_contents[] = array('text' =>
                                         
'<form style="/border:1px solid #ccc;padding:3px;text-align:center;/"
action="http://www.feedburner.com/fb/a/emailverify" method="post" 
target="popupwindow" onsubmit="window.open('http://www.feedburner.com/fb/a/emailverifySubmit?feedId=1697582', 
'popupwindow', 'scrollbars=yes,width=550,height=520');return true"><p>Enter your email address:</p><p><input 
type="text" style="width:140px" name="email"/></p><input type="hidden" value="http://feeds.feedburner.com/~e?ffid=1697582" 
name="url"/><input type="hidden" value="Girls Know What They Want.com--"Where Our Customers Come First!"" name="title"/><input 
type="hidden" name="loc" value="en_US"/><input type="submit" value="Subscribe" /><p>Delivered by <a href="http://www.feedburner.com" 
target="_blank">FeedBurner</a></p></form>');

    new SideinfoBox($info_box_contents);
?>
</td>
            <tr>
    <td align="center" valign="top"><img src="templates/2553/images/infoBox_foot.jpg" width="161" height="17"></td>
  </tr>
<!-- currencies_eof //-->
<?php
  }
?>

 

And I have inserted different set of code into the same box and it would work, but the code below wouldn't, so hopefully it is just within the set of code below...yet again, I just try things through trial and error :)

 

'<form style="/border:1px solid #ccc;padding:3px;text-align:center;/"
action="http://www.feedburner.com/fb/a/emailverify" method="post" 
target="popupwindow" onsubmit="window.open('http://www.feedburner.com/fb/a/emailverifySubmit?feedId=1697582', 
'popupwindow', 'scrollbars=yes,width=550,height=520');return true"><p>Enter your email address:</p><p><input 
type="text" style="width:140px" name="email"/></p><input type="hidden" value="http://feeds.feedburner.com/~e?ffid=1697582" 
name="url"/><input type="hidden" value="Girls Know What They Want.com--"Where Our Customers Come First!"" name="title"/><input 
type="hidden" name="loc" value="en_US"/><input type="submit" value="Subscribe" /><p>Delivered by <a href="http://www.feedburner.com" 
target="_blank">FeedBurner</a></p></form>');

 

Thank you for looking and helping!!!

This board is awesome!

 

 

'<form style="/border:1px solid #ccc;padding:3px;text-align:center;/"
action="http://www.feedburner.com/fb/a/emailverify" method="post" 
target="popupwindow" onsubmit="window.open('http://www.feedburner.com/fb/a/emailverifySubmit?feedId=1697582', 
'popupwindow', 'scrollbars=yes,width=550,height=520');return true"><p>Enter your email address:</p><p><input 
type="text" style="width:140px" name="email"/></p><input type="hidden" value="http://feeds.feedburner.com/~e?ffid=1697582" 
name="url"/><input type="hidden" value="Girls Know What They Want.com--"Where Our Customers Come First!"" name="title"/><input 
type="hidden" name="loc" value="en_US"/><input type="submit" value="Subscribe" /><p>Delivered by <a href="http://www.feedburner.com" 
target="_blank">FeedBurner</a></p></form>');

 

the last ) should not be there.

 

'<form style="/border:1px solid #ccc;padding:3px;text-align:center;/"
action="http://www.feedburner.com/fb/a/emailverify" method="post" 
target="popupwindow" onsubmit="window.open('http://www.feedburner.com/fb/a/emailverifySubmit?feedId=1697582', 
'popupwindow', 'scrollbars=yes,width=550,height=520');return true"><p>Enter your email address:</p><p><input 
type="text" style="width:140px" name="email"/></p><input type="hidden" value="http://feeds.feedburner.com/~e?ffid=1697582" 
name="url"/><input type="hidden" value="Girls Know What They Want.com--"Where Our Customers Come First!"" name="title"/><input 
type="hidden" name="loc" value="en_US"/><input type="submit" value="Subscribe" /><p>Delivered by <a href="http://www.feedburner.com" 
target="_blank">FeedBurner</a></p></form>';

you use your " and ' wrong its echo "<blah=\"blah\">"; and u need a space after echo, you cant have ' " " ', its " \"\" ", ' ' is for js, your code is madness this is like somone stabing me in my eye, i never seen such wrongness you get a F- u fail joke.

Need help with code:

 

Parse error: parse error, expecting `','' or `';'' in /3w/wz.cz/e/egeg/includes/functions.php on line 892

 

The line:(in functions.php)

{

echo "<html>\n<body>\n" . $msg_title . "\n<b r /><b r />\n" . $msg_text . "</body>\n</html>";

}

 

??? This is a phpBB 2.0.0.2 forum ! thanks

Archived

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

×
×
  • Create New...

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.