I've been reading some of the other posts on the forum but am still not clear on how to integrate a simple PHP script I had working on my site prior to using Oxwall. It contains some PHP on the top of the page then a little bit in the body too. From reading other posts, it's clear I must make a separate PHP file and then a separate content file.
This is a simple script that adds an exercise time to the DB. Any pointing in the right direction (even to another similar question) would be greatly appreciated. I want the page to be listed as a menu on the top of the page (next to groups etc).
Thanks,
D
<?php
@session_start();
// Connecting to the databaserequire_once('../config.php');// Checking if the Submit button is pressedif ( isset($_POST["Clicked"]) ){// Getting the values securely$Details = strip_tags(mysql_real_escape_string($_POST["textarea"]));
if ( isset($_SESSION["uid"]) ){$User_ID = $_SESSION["uid"];mysql_query("INSERT INTO journal_table (uid,entry_text) VALUES ('$User_ID','$Details') ");?><script type = "text/javascript">alert('Journal Added!');window.location = "http://www.clearthemirror.com/www/index.php";</script><?php}else{mysql_query("INSERT INTO journal_table (uid,entry_text) VALUES ('GUEST','$Details') ");?><script type = "text/javascript">alert('Journal Added!');window.location = "http://www.clearthemirror.com/www/index.php";</script><?php}}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title></head>
<body><p><?phpif ( isset($_SESSION["uid"]) ){echo "Welcome < " . $_SESSION["uid"] . " >" . " -- " . date('F j, Y') . "<br><br>";}else{?>Welcome Guest! <br><br><?php}?></p><p>Log Your Meditation </p><form id="form1" name="form1" method="post" action = "http://www.clearmirror.com/journal/new_entry.php"> Journal Entry <textarea name="textarea" cols="80" rows="8" style = "background-image: url('http://clearmirror.com/www/back.jpg');"></textarea> <br /> <br /> </label> <p> <label> <input type="submit" name="Clicked" value="Log Now" /> </label> </p></form><p> </p></body></html>