/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php //mysql database connection $dbhost='Database Host'; $dbuser='Your Username'; $dbpass='Your Password'; $dbtable='Your Table Name'; //Submit Form { $yourpost=$_POST['yourpost']; { print "You did not enter a message."; //no post entered }else{ //SQL Queries $insertpost="INSERT INTO kyproject_blog(message, date) values('$yourpost','$displaytime')"; print "Blog entry added. Return to the <a href='index.php'>index page</a>."; } }else{ print "<fieldset> <form action='' method='post' id='ticketform'> <p><label>Blog Entry:</label> <textarea cols='50' rows='11' name='yourpost' id='message' class='bbeditor'></textarea></p> <p><input name='submit' class='formbutton' value='Submit' type='submit' /></p> </form>"; } print "</td></tr></tbody></table> </fieldset>"; ?>