decypher Posted July 18, 2007 Share Posted July 18, 2007 Hey again. I finally got that book and begun to learn it. However When I copied an example out of the book it doesn't work :S firstly: <html> <head> <title>Font Choices</title> </head> <body> <center> <h1>Font Choices</h1> <h3>Demonstrates how to read HTML form elements</h3> <form method = "post" action = "bordermaker.php"> <h3>Text to modify</h3> <textarea name= "basictext" rows= "10" cols= "40"> Woohoo I'm acutally making a textarea. I have also been able to make different kind of borders, with diferent fonts and sizes. How good am I? I bet you're really impressed aren't you.So ner ner ner ner! </textarea> <Table border = 2> <tr> <td><h3>Border style</h3></td> <td colspan = 2><h3>Border Size</h3></td> </tr> <tr> <td> <Select name = Borderstyle> <option vale = "ridge">Ridge</option> <option vale = "groove">Groove</option> <option vale = "double">Double</option> <option vale = "inset">Inset</option> <option vale = "outset">Outset</option> </select> </td> <td> <Select size = 5 name = Bordersize> <option vale = "1">1</option> <option vale = "2">2</option> <option vale = "3">3</option> <option vale = "5">5</option> <option vale = "10">10</option> </select> </td> <td> <input type = "radio" name = "sizetype" value = "px">pixels<br> <input type = "radio" name = "sizetype" value = "pt">points<br> <input type = "radio" name = "sizetype" value = "cm">centimeters<br> <input type = "radio" name = "sizetype" value = "in">inches<br> </td> </tr> </table> </table> <input type = "Submit" value = "Show me"> </center> </body> </html> then... <Html> <Head> <Title>Your output</title> </head> <body> <h1>Your Output</h1> <Center> <?php $theStyle = <<<HERE "border-width:$Bordersize$sizetype; border-style:$Borderstyle; border-color:Red" HERE; print "<div style = $theStyle>"; print $basictext; print "</span>"; ?> </center> </body> </html> However, like i said it doesn't work...but past examples do so I know php is workin on my computer...Any suggestions? Link to comment https://forums.phpfreaks.com/topic/60604-solved-kinda-stuck-s/ Share on other sites More sharing options...
Lumio Posted July 18, 2007 Share Posted July 18, 2007 What doesn't work? Any errors? Link to comment https://forums.phpfreaks.com/topic/60604-solved-kinda-stuck-s/#findComment-301477 Share on other sites More sharing options...
decypher Posted July 18, 2007 Author Share Posted July 18, 2007 Nope no errors...The php itself doesn't work and I can't understand why :S Link to comment https://forums.phpfreaks.com/topic/60604-solved-kinda-stuck-s/#findComment-301479 Share on other sites More sharing options...
rlindauer Posted July 18, 2007 Share Posted July 18, 2007 What is not working? What happens when you run it? Are you seeing nothing, or seeing the actual php? Link to comment https://forums.phpfreaks.com/topic/60604-solved-kinda-stuck-s/#findComment-301484 Share on other sites More sharing options...
decypher Posted July 18, 2007 Author Share Posted July 18, 2007 The only thing that appears is the html of 'Your Ouput' shows up but where the php should be it is just blank Link to comment https://forums.phpfreaks.com/topic/60604-solved-kinda-stuck-s/#findComment-301488 Share on other sites More sharing options...
rlindauer Posted July 18, 2007 Share Posted July 18, 2007 You should fix your html too. Where does $basictext come from? Maybe you mean $_POST['basictext']; ? Link to comment https://forums.phpfreaks.com/topic/60604-solved-kinda-stuck-s/#findComment-301491 Share on other sites More sharing options...
decypher Posted July 18, 2007 Author Share Posted July 18, 2007 Anything like $basictext or has a $ sign is in the first part of coding i showed... I'm learning out of a book which tries to make you use a form from an html page, which then changes the options you chose into a php format... Link to comment https://forums.phpfreaks.com/topic/60604-solved-kinda-stuck-s/#findComment-301495 Share on other sites More sharing options...
decypher Posted July 18, 2007 Author Share Posted July 18, 2007 The top one is html and the second is the php Link to comment https://forums.phpfreaks.com/topic/60604-solved-kinda-stuck-s/#findComment-301496 Share on other sites More sharing options...
chris_rulez001 Posted July 18, 2007 Share Posted July 18, 2007 The only thing that appears is the html of 'Your Ouput' shows up but where the php should be it is just blank heres a code that gets the data: <?php $basictext = $_POST['basictext']; $theStyle = <<<HERE "border-width:$Bordersize$sizetype; border-style:$Borderstyle; border-color:Red" HERE; print "<div style = $theStyle>"; print $basictext; print "</span>"; ?> its not working because you are not asking the php to get data from the form. Link to comment https://forums.phpfreaks.com/topic/60604-solved-kinda-stuck-s/#findComment-301498 Share on other sites More sharing options...
decypher Posted July 18, 2007 Author Share Posted July 18, 2007 That's odd the book doesn't tell me to do that :S Cheers anyway Link to comment https://forums.phpfreaks.com/topic/60604-solved-kinda-stuck-s/#findComment-301499 Share on other sites More sharing options...
decypher Posted July 18, 2007 Author Share Posted July 18, 2007 Guessing I would have to do this with each different variable too? Link to comment https://forums.phpfreaks.com/topic/60604-solved-kinda-stuck-s/#findComment-301500 Share on other sites More sharing options...
rlindauer Posted July 18, 2007 Share Posted July 18, 2007 That sucks. Sounds like the book expects register globals to be enabled. I'd suggest a new book. Link to comment https://forums.phpfreaks.com/topic/60604-solved-kinda-stuck-s/#findComment-301501 Share on other sites More sharing options...
decypher Posted July 18, 2007 Author Share Posted July 18, 2007 so anytime I need to do anything like that in the future use that code? btw thanks alot...solved the problem Link to comment https://forums.phpfreaks.com/topic/60604-solved-kinda-stuck-s/#findComment-301503 Share on other sites More sharing options...
chris_rulez001 Posted July 18, 2007 Share Posted July 18, 2007 no problem Link to comment https://forums.phpfreaks.com/topic/60604-solved-kinda-stuck-s/#findComment-301504 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.