Hello guys, Please help me on this, I want a code that copy a code from a input text that the user put, and paste it into another fixed text field wombined with a JS code, check out the example: User text or code : xxxxxxxxxxxxxxx After button press action, Static text area Result show : JS Code xxxxxxxxxxxxxxx JS Code Thanks in advance
Quick and dirty.... lol <?php if (isset($_POST['s'])){ $outputcode = $_POST['JSCODE1']."\n"; $outputcode .= $_POST['USERCODE']."\n"; $outputcode .= $_POST['JSCODE3']."\n"; ?> <html> <head> <title>Output</title> </head> <body> <textarea><?=$outputcode;?></textarea> </body> </html> <? } else { ?> <html> <head> <title>Output</title> </head> <body> <form method="post" action=""> <input type="hidden" name="JSCODE1" value="JSCODE" /> <input type="hidden" name="JSCODE3" value="JSCODE" /> <textarea name="USERCODE">XXXXXXXXXX</textarea> <input type="submit" name="s" value="MERGE CODE" /> </form> </body> </html> <? } ?> Code (markup):
When I put a JS code into value="" it merge that code with the page code, I just want to show the result on the text box, can you help me on this check the link : http://www.eaglestats.com/test1.php
I found the solution , just turn the special characters < > ' " & into their HTML entities < > and so on .
you don't need to go back to the server for this ... implied by the PHP code which only runs server-side. Instead you should use jquery. Doing this in jquery "on the client/browser" is a piece of [enter favorite] cake, and saves your server a bit of traffic and CPU cycles...