PHP echo if post equals, help

Posted by user342391 on Stack Overflow See other posts from Stack Overflow or by user342391
Published on 2010-05-20T13:10:29Z Indexed on 2010/05/20 13:30 UTC
Read the original article Hit count: 360

Filed under:
|
|
|

I am trying to echo the action for my form if a post equals 'paypal'

This is what I have:

<?php if $_POST['method'] == 'paypal' echo 'action="paypal/process.php"' else echo 'action="moneybookers/process.php" '?> 

Do i need to print the variable before I do this? what am I doing wrong?

I get this error:

Parse error: syntax error, unexpected T_VARIABLE, expecting '(' in /var/www/account/credits/credit_amount.php on line 27

© Stack Overflow or respective owner

Related posts about php

Related posts about echo