Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

adding a php form


zpupster

Recommended Posts

Posted

hello,

 

if someone could help with this php problem.

 

hello,

 

 

i have this code to test for login on my new page, if logged in then customer can fill out a form . so i am changing things like this

 

<?php echo $messageStack->output('contact'); ?>

 

to

 

 

'.php echo $messageStack->output('contact').'

 

 

i am stuck on this one getting this

<?php

if ($messageStack->size('contact') > 0) {

?>

 

when changed to

'.

if ($messageStack->size('contact') > 0) {

.'

 

 

 

error:

 

Parse error: syntax error, unexpected T_IF, expecting ',' or ';' in /home/mysite/public_html/store/buybacks.php on line 124

 

 

here is my login test.

 

<?php

if ( !tep_session_is_registered('customer_id') )

{

// code for NON-LOGGED-IN goes here

echo 'to use the buyback form you must be loggedin!';

}

else

{

// code for LOGGED-IN goes here

 

echo '

 

';

}

 

?>

 

 

 

 

if there is an easier way to handle this any suggestions welcome, becasue there are like 30 of these that need to be changed,

 

 

 

thanks

craig

Posted

You are trying to use the string concatenation operator with an if statement which is syntactically incorrect which is why you get a parse error.

Posted

Yes there are some great tutorials on php.net detailing use of the concatenation operator, syntax etc.

 

You really need to understand at least the basic syntax before attempting to modify files.

Archived

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

×
×
  • Create New...