Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HTML
- <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>
- <img src='img/style/Daddy.jpg'> <button type='button' onclick="openform('home', '1', 'update')">E</button>
- <button type='button' onclick="openform('home', '1', 'delete')">D</button>
- JS
- function openform(table, id, action) {
- document.getElementById("post_0").innerHTML =
- '<H3>title:</H3><textarea id="jtitle" maxlength="5000" cols="64" rows="1"></textarea>' +
- '<H3>content:</H3><textarea id="jcontent" maxlength="5000" cols="64" rows="5"></textarea>' +
- '<button onclick="submitform(\'' + table + "\', \'" + id + "\', \'" + action + '\')">submit</button>';
- PHP
- $test = $_POST["content"];
- echo $test;
- echo nl2br($test);
- outputs aaaa if the input is
- a
- a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement