This is my main page.
<?php
define('PHP_FIREWALL_REQUEST_URI', strip_tags( $_SERVER['REQUEST_URI'] ) );
define('PHP_FIREWALL_ACTIVATION', true );
if ( is_file( @dirname(__FILE__).'/php-firewall/firewall.php' ) )
include_once( @dirname(__FILE__).'/php-firewall/firewall.php' )
?>
<?php
error_reporting(E_ALL);
$ip = $_SERVER['REMOTE_ADDR'];
if (!$ip) {
echo "You must be behind a proxy.";
sleep(10);
header ("Location: /home/wakefie3/public_html/Topten/users/profile.php");
}
/**
* Tuatara User Authentication
*
* Copyright (c) 2008, Mark Waterous
* All rights reserved.
*
* @package Tuatara Frontend
* @author Mark Waterous
* @copyright Copyright (c) 2008, Mark Waterous
* @license http://tuatara.syeke.com/license.php
*
*/
define('IN_TUATARA', TRUE);
set_include_path('/home/wakefie3/public_html/Topten/bin/lib');
// Include necessary files
require('tuatara.config.php');
require('tuatara.class.php');
// Initiate Session
$pSession = tuatara::load('core', 'session');
// Page Specific * --
// ------------------------------------------------------------------------------------------------------
/**
* @todo eventually this should allow for non-members to view a members list of some sort here
*/
if ( ! $pSession->isLoggedIn())
{
functions::echoLocate('You must be logged in to do that.', SITE_USERS.URL_LOGIN);
}
$pProfile = tuatara::load('user', 'profile');
$pProfile->populateUserProfile($pSession->whoAmI('username'));
$pUser=$pSession->whoAmI('username')
// ------------------------------------------------------------------------------------------------------
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<META name="ROBOTS" content="index,follow,all">
<META name="OWNER" content="Wakefield.tk">
<META name="AUTHOR" content="Wakefield.tk">
<META name="RATING" content="General">
<script>
$(document).ready(function(){
$("#logForm").validate();
});
</script>
<script type="text/javascript">
/* showClock() function extracts the current time hours, minutes and seconds and then displays them in the div with showText id from the BODY section */
function showClock()
{
var clock=new Date();
var hours=clock.getHours();
var minutes=clock.getMinutes();
var seconds=clock.getSeconds();
// for a nice disply we'll add a zero before the numbers between 0 and 9
if (hours<10){
hours="0" + hours;
}
if (minutes<10){
minutes="0" + minutes;
}
if (seconds<10){
seconds="0" + seconds;
}
document.getElementById('showText').innerHTML=hours+":"+minutes+":"+seconds;
t=setTimeout('showClock()',500);
/* setTimeout() JavaScript method is used to call showClock() every 1000 milliseconds (that means exactly 1 second) */
}
</script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body onLoad="showClock()">
<table bgcolor="#66CCFF" width="100%" border="0">
<tr></tr>
<tr>
<th align="right" colspan="4" scope="col" bgcolor="#9999CC">Topten</th>
</tr>
<tr>
<td colspan="1"> </td>
<td colspan="2" rowspan="2"><img src="Topten.jpg" width="435" height="67" align="middle" bgcolor="#66CCFF"></td>
<td colspan="1">US Central time:<div id="showText"></div>
</tr>
<tr>
<td colspan="1">Where your opinion may or may not matter.</td>
<td colspan="1"><script>
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
document.write("<small><font color='000000' face='Arial'><b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"</b></font></small>")
</script>
</td>
</tr>
<tr>
<td valign="middle" bgcolor="#CCCC66" > Hi, <p><?php echo $pUser ?></p>
<td colspan="3" align="center" bgcolor="#CCCC66" class="Navigation">Navigation <br>
<a href="http://wakefield.tk" target="_blank">My Homepage</a> | <a href="previoustopics.html">Previous Topics</a> | <a href="http:/
/justhost.com" title="Just host" target="_blank">Just Host</a> | <a href="<?php echo SITE_USERS.URL_REGISTER; ?>" target="_blank">Register</a> |</td></td>
</tr>
<tr>
<td width="125" rowspan="2" valign="top" align="left"><table width="125" border="1">
<tr>
<td><a href="<?php echo SITE_USERS.URL_PROFILE; ?>" target="_blank">Profile Settings</a> </td>
</tr>
<tr>
<td><a href="logout.php" target="_blank"> Logout!</a>
</td>
</tr>
<tr>
<td>
<br>
</td>
</tr>
</table>
<br><br>
<table width="100%">
<tr>
<td height="125"><script type="text/javascript"><!--
google_ad_client = "pub-5983350561562659";
/* 125x125, created 9/24/09 */
google_ad_slot = "1450364450";
google_ad_width = 125;
google_ad_height = 125;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></td>
</tr>
</table>
Future</td>
<td valign="top">[CODE]<?php
include 'db.php';
$con or die(mysql_error());
$dbname;
$mydb or die(mysql_error());
$result=mysql_query("SELECT date,user FROM users");
//see if any row was found
if(mysql_num_rows($result) > 0 ) {
$allrows = array();// to put all result rows in
//$i=0; // no counter is really needed will work without
while($row = mysql_fetch_array( $result, MYSQL_BOTH )){
$allrows[] = $row; //add this row into $allrows
}
if ($pUser = $row['user']) {
echo "Hi, there";
include 'results.php';
}
else {
$close;
include 'Pollform.php';
}
}
?>
</td>
<td valign="top" align="right"><object width="200" height="400" id="obj_1264609995594">
<param name="movie" value="http://toptenmembers.chatango.com/group"/><param name="AllowScriptAccess" VALUE="false"/><param name="AllowNetworking" VALUE="all"/><param name="AllowFullScreen" VALUE="false"/><param name="flashvars" value="cid=1264609995594&a=0099FF&b=100&c=FFFFFF&d=FFFFFF&k=3300CC&l=999999&p=9&s=1&w=0"/>
<embed id="emb_1264609995594" src="http://toptenmembers.chatango.com/group" width="200" height="400" allowScriptAccess="false" allowNetworking="all" type="application/x-shockwave-flash" allowFullScreen="false" flashvars="cid=1264609995594&a=0099FF&b=100&c=FFFFFF&d=FFFFFF&k=3300CC&l=999999&p=9&s=1&w=0"></embed>
</object>
<br>[ <a href="http://toptenmembers.chatango.com/clonegroup?ts=1264609995594">Copy this</a> | <a href="http://chatango.com/creategroup?ts=1264609995594">Start New</a> | </td>
</form>
<td width="160" height="600"><script type="text/javascript"><!--
google_ad_client = "pub-5983350561562659";
/ 160x600, created 1/25/10 /
google_ad_slot = "6342330345";
google_ad_width = 160;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></td>
<td rowspan="2"> </td>
</tr>
<tr>
<td height="50"> </td>
</tr>
<tr>
<td colspan="3" width="73%" valign="bottom" align="center">© Wakefield.tk 2010</td>
<td width="100%"> </td>
</tr>
</table>
</body>
</html>
[/code]
If I put the actual strings where I have CODE at, it works.
Here is my db.php.
<?php
$con=mysql_connect('localhost', 'myusername', 'my password') or die( mysql_error());
$dbname = 'my_poll';
$mydb= mysql_select_db($dbname,$con) or die(mysql_error());
$sql = mysql_query("SELECT * FROM results");
$sql2 = mysql_query("SELECT date,user FROM users");
$myinsert2=mysql_query("INSERT INTO users (date,user) VALUE (CURDATE(),'$pUser')")or die (mysql_error());
$myinsert=mysql_query("INSERT INTO results (fc,sec,tc,foc,fic,sic,sevc,ec,nc,tec,alt,fcount,secount,tcount,focount,ficount,sicount,sevcount,ecount,ncount,tecount,altcount)
VALUES ('$data(fc)','$sec','$tc','$foc','$fic','$sic','$sevc','$ec','$nc','$tec','$alt','$fcount',
'$secount','$tcount','$focount','$ficount','$sicount','$sevcount','$ecount','$ncount','$tecount','$altcount')" )or die (mysql_error());
?>
If you need the rest I can email it to you.