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? Quote Link to comment Share on other sites More sharing options...
Lumio Posted July 18, 2007 Share Posted July 18, 2007 What doesn't work? Any errors? Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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 Quote Link to comment 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']; ? Quote Link to comment 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... Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
chris_rulez001 Posted July 18, 2007 Share Posted July 18, 2007 no problem Quote Link to comment 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.