itsureboy Posted January 11, 2007 Share Posted January 11, 2007 Ok what im trying to do is similair to the example below:HTML Page With A Form[code] <html><head><title>Test Page</title></head><body><h2>Data Collection</h2><p><form action="process.php" method="post"><table><tr><td>Name:</td><td><input type="text" name="Name" /></td></tr><tr><td>Age:</td><td><input type="text" name="Age" /></td></tr><tr><td colspan="2" align="center"><input type="submit" /></td></tr></table></form></body></html>[/code]PHP Page With Function Which Proccesses Form Data:[code] <?phpprint "Your name is ". $Name;print "<br />";print "You are ". $Age . " years old";print "<br />";$old = 25 + $Age;print "In 25 years you will be " . $old . " years old";?>[/code] However What i want to do is Instead of using input attribute use the textarea attribute to transfer html code to a file that contains a HTML body which will be used multiple times to Preview Layouts. My reason for this is so i dont have to make individual previews for each layouts. Link to comment https://forums.phpfreaks.com/topic/33670-php-help-w-textarea/ Share on other sites More sharing options...
fert Posted January 11, 2007 Share Posted January 11, 2007 then put text areas in your html code and name how you want Link to comment https://forums.phpfreaks.com/topic/33670-php-help-w-textarea/#findComment-157830 Share on other sites More sharing options...
SharkBait Posted January 11, 2007 Share Posted January 11, 2007 So you want to use textareas like this?[code]<textarea name="Name"></textarea><textarea name="Age"></textarea>[/code]Kind of thing? Link to comment https://forums.phpfreaks.com/topic/33670-php-help-w-textarea/#findComment-158003 Share on other sites More sharing options...
itsureboy Posted January 11, 2007 Author Share Posted January 11, 2007 Yes. But whats in the text area i want PHP to distribute it as code rather than text. Link to comment https://forums.phpfreaks.com/topic/33670-php-help-w-textarea/#findComment-158436 Share on other sites More sharing options...
itsureboy Posted January 12, 2007 Author Share Posted January 12, 2007 Any Help? Link to comment https://forums.phpfreaks.com/topic/33670-php-help-w-textarea/#findComment-159524 Share on other sites More sharing options...
fert Posted January 12, 2007 Share Posted January 12, 2007 what do you mean "distribute it as code" Link to comment https://forums.phpfreaks.com/topic/33670-php-help-w-textarea/#findComment-159577 Share on other sites More sharing options...
itsureboy Posted January 12, 2007 Author Share Posted January 12, 2007 Like display whats in the text area as a code which will display the page with the code inside for example:<textarea><img src="fdf"></textarea>thens php takes that and displays that picture. Link to comment https://forums.phpfreaks.com/topic/33670-php-help-w-textarea/#findComment-159592 Share on other sites More sharing options...
redbullmarky Posted January 13, 2007 Share Posted January 13, 2007 you dont need to do anything special. if you accept HTML in a textarea, then just picking it up from $_POST and echoing it is enough:[code]<?phpecho $_POST['mytextarea'];?><form name="myform" action="" method="post"><textarea name="mytextarea><img src="fdf"></textarea><input type="submit value="submit!" /></form>[/code] Link to comment https://forums.phpfreaks.com/topic/33670-php-help-w-textarea/#findComment-159603 Share on other sites More sharing options...
itsureboy Posted January 13, 2007 Author Share Posted January 13, 2007 Thanks You So Much!!.........Highly Appreciated........ Link to comment https://forums.phpfreaks.com/topic/33670-php-help-w-textarea/#findComment-159607 Share on other sites More sharing options...
itsureboy Posted January 13, 2007 Author Share Posted January 13, 2007 How do i turn off magic quotes?Thanks.... Link to comment https://forums.phpfreaks.com/topic/33670-php-help-w-textarea/#findComment-160066 Share on other sites More sharing options...
Jessica Posted January 13, 2007 Share Posted January 13, 2007 Go to your php.ini or use ini_set() - I think ini_set will work. Link to comment https://forums.phpfreaks.com/topic/33670-php-help-w-textarea/#findComment-160072 Share on other sites More sharing options...
itsureboy Posted January 13, 2007 Author Share Posted January 13, 2007 I need help with one more thing.When php use form data it puts a / (backslash) before every " (quote) and ' . What can i do to avoid this?Thanks..... Link to comment https://forums.phpfreaks.com/topic/33670-php-help-w-textarea/#findComment-160100 Share on other sites More sharing options...
redbullmarky Posted January 13, 2007 Share Posted January 13, 2007 dude, if you've got further questions, then it'd make everyone's life easier if you opened a new topic.locked. Link to comment https://forums.phpfreaks.com/topic/33670-php-help-w-textarea/#findComment-160101 Share on other sites More sharing options...
Recommended Posts