No more login problem! Now on to problem number two.
Getting this error after a successful login.
Notice: A session had already been started - ignoring session_start() in /Library/Tenon/WebServer/WebSites/admin/rest_site_creation/id.php on line 2
Notice: Undefined variable: row in /Library/Tenon/WebServer/WebSites/www.ABCAdvertising.net/admin/rest_site_creation/id.php on line 4
Notice: Undefined variable: row in /Library/Tenon/WebServer/WebSites/admin/rest_site_creation/id.php on line 5
Notice: Undefined variable: id in /Library/Tenon/WebServer/WebSites/admin/rest_site_creation/home.php on line 43
Notice: Undefined variable: set_style_id in /Library/Tenon/WebServer/WebSites/admin/rest_site_creation/home.php on line 50
Welcome to your administration panel ID:
Notice: Undefined variable: id in /Library/Tenon/WebServer/WebSites/admin/rest_site_creation/home.php on line 110
login page mgmt_index.php:
<?php
session_start();
//INCLUDES
include('id.php');
//BEGIN LOGIN
if($submit || $FrontPage){
include('db_con.php');
$User_Exists = mysql_query("SELECT table_id, rest_username, rest_pass, contact_fname FROM abc_tables WHERE rest_username='$username' AND rest_pass = '$password'", $db_link);
$exists = mysql_num_rows($User_Exists);
$row = mysql_fetch_array($User_Exists);
//if($exists) {
if($exists > 0) {
$row = mysql_fetch_array($User_Exists);
$_SESSION['track_id'] = $row['table_id'];
$_SESSION['track_name'] = $row['contact_fname'];
echo '<script type="text/javascript">
location="home.php"
</script>';
}else{
$login_fail="true";
}
}
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 5">
<title>Admin Page :: Login</title>
</head>
<body bgcolor="#ffffff">
<div align="center">
<font face="Verdana, Arial, Helvetica, sans-serif">Welcome to your administration panel ID: <? echo $id; ?><br>
<br>
<? if ($login_fail=="true"){
echo "<b><font color='#cc0033' face='Verdana, Arial, Helvetica, sans-serif'>Login Incorrect, please try again</font></b>";
}
?><br>
<form name="FormName" action="<?=$PHP_SELF;?>" method="post">
<table border="0" cellpadding="0" cellspacing="2" width="180">
<tr height="19">
<td colspan="2" height="19">
<div align="center">
<font size="3"><b>
Login</b></font></div>
</td>
</tr>
<tr>
<td>Username:</td>
<td><input type="text" name="username" CLASS="formTextbox" size="24"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="password" CLASS="formTextbox" size="24"></td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input type="submit" CLASS="formTextbox" name="submit" value="Login"></div>
</td>
</tr>
</table>
</form>
</font></div>
</body>
</html>
home.php:
<?php
session_start();
error_reporting(E_ALL);
function copyr($source, $dest)
{
// Simple copy for a file
if (is_file($source)) {
return copy($source, $dest);
}
// Make destination directory
if (!is_dir($dest)) {
mkdir($dest);
}
// Loop through the folder
$dir = dir($source);
while (false !== $entry = $dir->read()) {
// Skip pointers
if ($entry == '.' || $entry == '..') {
continue;
}
// Deep copy directories
if ($dest !== "$source/$entry") {
copyr("$source/$entry", "$dest/$entry");
}
}
// Clean up
$dir->close();
return true;
}
//INCLUDES
include('id.php');
include('db_con.php');
//CHECK LOGIN VS ID
if ($id!=$_SESSION['track_id']){
echo '<script type="text/javascript">
location="index.php"
</script>';
}
if ($set_style_id!=""){
//GET SITE PATH
$get_root_folder=mysql_query("SELECT root_folder FROM rest_filesystem WHERE rest_id='$id'",$db_link);
$row=mysql_fetch_array($get_root_folder);
$root_folder=$row['root_folder'];
$root_folder_css=($root_folder."/css");
$root_folder_img=($root_folder."/images");
//GET THEME PATHS
$get_theme_path=mysql_query("SELECT css_doc FROM styles WHERE style_id='$set_style_id'",$db_link);
$row=mysql_fetch_array($get_theme_path);
$theme_path=$row['css_doc'];
$theme_path_css=($theme_path."CSS");
$theme_path_img=($theme_path."IMAGES");
$index_file=($theme_path."live_index.php");
copyr($theme_path_css, $root_folder_css);
copyr($theme_path_img, $root_folder_img);
//CHECK MYSQL FOR ALL PAGES AND NAMES - COPY:
//copy($index_file, $root_folder."/index.php");
//TO ALL FILE NAMES CONTAINED
//AND PUT IN PAGE ID WHERE IT'S SUPPOSED TO GO
$getpages = mysql_query("SELECT cust_id, pg_id, pg_name, pg_addr FROM rest_pages where cust_id=$id", $db_link);
while($row = mysql_fetch_array($getpages)) {
$row['pg_id'] != "";
copy($index_file, $root_folder."/".$row['pg_addr']);
$page_id=$row['pg_id'];
$fh = fopen($root_folder."/".$row['pg_addr'], 'r+') or die("can't open file");
$stringData = '<?php $page_id='. $page_id.';';
fwrite($fh, $stringData);
fclose($fh);
}
}
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 5">
<title>Admin Page :: Home</title>
</head>
<body bgcolor="#ffffff">
<div align="center">
<font face="Verdana, Arial, Helvetica, sans-serif">Welcome to your administration panel ID: <? echo $id; ?><br>
<br>
<br>
<table border="0" cellpadding="0" cellspacing="2" width="180">
<tr height="19">
<td colspan="2" height="19">
<div align="center">
<font size="3"><b>Actions:</b></font></div>
</td>
</tr>
<tr>
<td>Select Theme:</td>
<td><a href="themes.php">Link</a></td>
</tr>
<tr>
<td>Upload Images:</td>
<td><a href="images.php">Link</a></td>
</tr>
<tr>
<td>Manage Pages:</td>
<td><a href="pages.php">Link</a></td>
</tr>
<tr>
<td>Change Content:</td>
<td><a href="content.php">Link</a></td>
</tr>
<tr>
<td>View Page:</td>
<td><a href="../">Link</a></td>
</tr>
<tr>
<td colspan="2">
<div align="center">
</div>
</td>
</tr>
</table>
</font></div>
</body>
</html>
id.php:
<?php
session_start();
include('db_con.php');
$_SESSION['track_id'] = $row['table_id'];
$_SESSION['track_name'] = $row['contact_fname'];
?>
It's not storing the variable in id.php
What am I missing?
ps i can't thank everyone enough for all the help i've already recieved