Advertisement
Guest User

CODE

a guest
May 25th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. HTML
  2. <h1>home</h1><div id='post_1' class='post'><H1 id='title_1' class='title'>Updated website.</H1><H1 id='date_1' class='date'>2015-03-09</H1><p id='content_1' class='content'>Create(+), Edit(E) and Delete(D) buttons are now available and working for most pages. <br> Rewards now supports costs. <br> Currently working on properly handling user inputs and when rewards are acquired. <br><br> sometimes, this site seems to shit itself for no reason, until that's fixed I'd suggest double checking what you submit.<br> I love you princess. <br><b> Double Qoutes make the submission fail and newlines don't transfer properly, but html tags work, for now use a BR tag</b>.</p><H2 id='author_1' class='author'>Daddy</H2>
  3. <img src='img/style/Daddy.jpg'> <button type='button' onclick="openform('home', '1', 'update')">E</button>
  4. <button type='button' onclick="openform('home', '1', 'delete')">D</button>
  5.  
  6. JS
  7. function openform(table, id, action) {
  8. document.getElementById("post_0").innerHTML =
  9. '<H3>title:</H3><textarea id="jtitle" maxlength="5000" cols="64" rows="1"></textarea>' +
  10. '<H3>content:</H3><textarea id="jcontent" maxlength="5000" cols="64" rows="5"></textarea>' +
  11. '<button onclick="submitform(\'' + table + "\', \'" + id + "\', \'" + action + '\')">submit</button>';
  12.  
  13. PHP
  14. $test = $_POST["content"];
  15. echo $test;
  16. echo nl2br($test);
  17.  
  18. outputs aaaa if the input is
  19. a
  20. a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement