coolcat50 0 Report post Posted November 3, 2007 (edited) Yes, yes. I have another script that I have written and I am distributing. I am not entirely sure if this works. I have not tested it yet, but I will later and post back with a demo and fix it up. Current script: <?php//Save this as something like htmltest.phpfunction CheckForm(){$html_unsafe=$_POST['code'];//Gives us our user input$html_safe=str_replace("<?php","<php>",$html_unsafe);//Starts security measures$html_safe=str_replace("?>","</php>",$html_safe);//User input now secure server side//Still security issues client sideecho $html_safe;//echos our statement}//End function//Main scriptif ($_GET['test']=='true'){//Check submitif (isset($_POST['submit'])){//echo out pageCheckForm();}else{die("Sorry,you shouldn't be viewing this page. Please go back.");}else{//Start form?><form action="htmltest.php?test=true" method="post"><textarea cols=XX rows=XX name="code"><html><head><title></title></head><body></body></html></textarea><input type="submit" name="submit" value="Submit" /><?php} //End script//Made by coolcat50//Please give me credit if you use?> Demo:HTML testerThere you go peeps. So what do you guys think? Edited December 5, 2007 by coolcat50 (see edit history) Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted November 3, 2007 Can you put up a Demo for us, please? Share this post Link to post Share on other sites
Liam_CF 0 Report post Posted November 3, 2007 I still don't understand what to do.Can you explain it a bit better please? Share this post Link to post Share on other sites
mahirharoon 0 Report post Posted December 5, 2007 i excecuted this in www-sharpthis came Parse error: parse error, unexpected T_ELSE in C:\Program Files\Common Files\wwwSharp.Runtime\Admin\htmltester.php on line 32 Share this post Link to post Share on other sites
coolcat50 0 Report post Posted December 5, 2007 My demo I have or had set up worked. It is probably missing a "{" or "}". I'll proofread it. Share this post Link to post Share on other sites
KansukeKojima 0 Report post Posted December 5, 2007 This will be really helpful for me once you fix it. Since I've began using notepad exclusively, if I wan't to see my changes, I have to actually open the file as an internet page... so this will most definately help. Share this post Link to post Share on other sites
galexcd 0 Report post Posted December 6, 2007 (edited) You DO realize that you cant execute php code with echo right? There is no reason to parse that out...much simpler: <?phpif(isset($_POST['code'])) echo $_POST['code'];else{?><form method="post"><textarea cols=XX rows=XX name="code"><html><head><title></title></head><body></body></html></textarea><input type="submit" /></form><?php } ?> Edited December 6, 2007 by alex7h3pr0gr4m3r (see edit history) Share this post Link to post Share on other sites
de4thpr00f 0 Report post Posted December 6, 2007 Can you guys tell me what this do? I can't get it.The topic is not very clear.You use this script in wich situations?Greetz~Jo?o Lopes Share this post Link to post Share on other sites
galexcd 0 Report post Posted December 6, 2007 It basically echos out whatever you type into the text box. Not really that complex. I guess its good if you are working on an html site and want instant results to what it will look like. Share this post Link to post Share on other sites
gogoily 0 Report post Posted December 6, 2007 I think you just wrote a frame scripts, I don't know its usage now.But you surely missed a "}" in line 32 Share this post Link to post Share on other sites
galexcd 0 Report post Posted December 6, 2007 My script does the same thing but it is more simple and runs faster, and is not missing any brackets... If you really have a use for this I suggest you use mine unless you like unnessisarily long code... Share this post Link to post Share on other sites
coolcat50 0 Report post Posted January 10, 2008 (edited) Well Alex, your code is more compact, but it wouldn't produce the same results. Mine has a security feature in it to destroy all attempts to execute PHP code. Therefore my code is more secure and probably easier read and more efficient.EDIT: Well, the way mine works is that it creates the variable and it actually parses PHP. I tested a PHP script on mine myself. Edited January 10, 2008 by coolcat50 (see edit history) Share this post Link to post Share on other sites
galexcd 0 Report post Posted January 10, 2008 Yes but did you pay attention to the first line in my post? You DO realize that you cant execute php code with echo right? There is no reason to parse that out...So yours is no more secure in any way. Share this post Link to post Share on other sites
anachro 0 Report post Posted January 10, 2008 thats pretty cool, alot like the code tester on w3 schools website. but not as secure or with a single page. but thats a good start if you plan to advance it further Share this post Link to post Share on other sites
dave2win 0 Report post Posted April 8, 2008 I think you should add two frames to your window and design one as an IE. Give it a title bar. Use a status bar. Just use text boxes for this. Then when some body clicks submit then the second IE emulated window will refresh. This is just a suggestion. I'm working on your script to help it improve. By the way thanks for making such a great script online & open source.****Thanx****Dave Share this post Link to post Share on other sites