ianco Posted September 26, 2009 Share Posted September 26, 2009 I have tome tick boxes that show text when ticked but I want the text to display a number that I enter in the form. I can make the different text appear with the different tick box, but noting happenes where the <php echo $_POST["num"]; > is. It just appears as sometext "" some text. Can any one suggest anything that might make the number appear? Taa <?PHP $ch1 = ' '; $ch2 = ' '; $ch3 = ' '; if (isset($_POST['Submit1'])) { if (isset($_POST['ch1'])) { $ch1 = $_POST['ch1']; if ($ch1 = 'net') { $ch1 = 'Sometext"<php echo $_POST["num"]; >".pdf some text'; } } etc} ?> --------- Output <?PHP print $ch1; ?><br> Quote Link to comment https://forums.phpfreaks.com/topic/175590-solved-form-help/ Share on other sites More sharing options...
monkeytooth Posted September 26, 2009 Share Posted September 26, 2009 By tick box do you mean checkbox? radio button? other.... Also post the tick box code with the last bit, so we can try to gauge a better idea of what your talking about. Quote Link to comment https://forums.phpfreaks.com/topic/175590-solved-form-help/#findComment-925286 Share on other sites More sharing options...
ianco Posted September 26, 2009 Author Share Posted September 26, 2009 the checkbox code is <Input type = 'Checkbox' Name ='ch1' value ="net" <?PHP print $ch1; ?> > The number box is just a text box Number: <br><input type="text" name="num" /> thanks Quote Link to comment https://forums.phpfreaks.com/topic/175590-solved-form-help/#findComment-925287 Share on other sites More sharing options...
monkeytooth Posted September 26, 2009 Share Posted September 26, 2009 Just noticed something i didnt before.. This line: $ch1 = 'Sometext"<php echo $_POST["num"]; >".pdf some text'; Could be the source of your problem. As your putting <?php ?> tags within an already open <?php ?> tag. The proper way to write that line would be.. $ch1 = "Sometext" . $_POST['num'] . ".pdf some text"; try replacing your line with this one and tell me if that changes anything. Quote Link to comment https://forums.phpfreaks.com/topic/175590-solved-form-help/#findComment-925289 Share on other sites More sharing options...
ianco Posted September 26, 2009 Author Share Posted September 26, 2009 Wow, thanks Monkeytooth I had to modify it to $ch1 = 'Sometext' . $_POST['num'] . '.pdf some text'; Cheers Quote Link to comment https://forums.phpfreaks.com/topic/175590-solved-form-help/#findComment-925290 Share on other sites More sharing options...
monkeytooth Posted September 26, 2009 Share Posted September 26, 2009 Good stuff, your welcome.. feel free to add me to your messenger of choice Quote Link to comment https://forums.phpfreaks.com/topic/175590-solved-form-help/#findComment-925293 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.