aronjeney Posted September 24, 2009 Report Share Posted September 24, 2009 I am a designer and ultimate newbie to php so all help is VERY appreciated. I am slowly teaching myself fundamentals.I have a client who is accepting donations through paypal and would like to have a radio button appear on the Thank You page IF a user donates more than $30. I have gotten so far as to ECHO a set of text if they donate more than $30, but am having troubles ECHOing a form for a clickable radio button. Can I echo a form or do I incorporate the php into a form?Here is the code that I am attempting: # <?php # if ($_POST['amt'] >= 30) {# echo '<Form name ="form1" Method ="Post" ACTION ="radioButton.php"># <Input type = 'Radio' Name ='sendreport' value= 'true'># <span>Check this box if you would like to receive email forecasts directly from the Colorado Avalanche Information Center.</span># <Input type = "Submit" Name = "Submit1" Value = "Get weather reports"># </FORM> ';# } else {# echo 'Thank you.';# }# ?> Thank you so much in advance for any help/suggestions! Link to comment Share on other sites More sharing options...
chibineku Posted September 25, 2009 Report Share Posted September 25, 2009 That will work fine, but you have a couple of instances of mismatched parentheses. you need to watch what you use: <?php if ($_POST['amt'] >= 30) { echo '<form name ="form1" method ="post" action="radiobutton.php"> <input type = "radio" name ="sendreport" value= "true"> <span>Check this box if you would like to receive email forecasts directly from the Colorado Avalanche Information Center.</span> <Input type = "submit" name = "Submit1" Value = "Get weather reports"> </form> '; } else { echo 'Thank you.'; }?> That should work fine. Link to comment Share on other sites More sharing options...
Synook Posted September 25, 2009 Report Share Posted September 25, 2009 Also, not that # is a comment character so you have to remove them first too. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now