Hi,
The following script outputs 12345. It should go to intro_page.php after the
4 session variables have been populated. Can you see what I'm doing wrong?
Many thanks,
Raj (newbie)
start.php
<?php
session_start() ;
session_destroy ();
include("./general_scripts _etc/header1.php");
$s=$_GET['s'];
$query="SELECT * FROM site_data WHERE site_name='$s'" ;
$result=@mysql_ query($query);
print("1");
$num=mysql_num_ rows($result);
print("2");
if ($num==0)
{
print("3");
$query="SELECT * FROM site_data WHERE site_number='1' ";
print("4");
$result=@mysql_ query($query);
print("5");
while ($Row=mysql_fet ch_array($resul t))
{
print("6");
$_SESSION['site_name']=$Row[site_name];
$_SESSION['site_logo_loca tion']=$Row[site_logo_locat ion];
$_SESSION['site_admin_ema il']=$Row[site_admin_emai l];
$_SESSION['site_number']=$Row[site_number];
ob_end_clean();
header("Locatio n: intro_page.php" );
}
}
if ($num>0)
{
print("7");
while ($Row=mysql_fet ch_array($resul t))
{
print("8");
$_SESSION['site_name']=$Row[site_name];
$_SESSION['site_logo_loca tion']=$Row[site_logo_locat ion];
$_SESSION['site_admin_ema il']=$Row[site_admin_emai l];
$_SESSION['site_number']=$Row[site_number];
ob_end_clean();
header("Locatio n: intro_page.php" );
}
}
include("./general_scripts _etc/footer1.php");
?>
header1.php
<?php
ob_start();
session_start() ;
include('../outer/mysql_connect_f dd.php');
//limit is number of users listed per search page
$limit=10;
//live_limit is time to wait till offline
$live_limit=15* 60;
//the limit to the number of pages appearing on the bottom of pages
$menu_max=25;
//log refrsh time
$log_refresh=30 ;
//time to wait till wipe instant message - seconds
$instant_messag e_wipe=15*60;
//time to wait till wipe old other - seconds
$other_points_w ipe=30*24*60*60 ;
//address to send photos for verification
$photo_verify_a ddress="http://www.freedatingd atabase.com/admin777/photo_verifi
cation.php?user _id="
?>
footer1.php
<?php
ob_end_flush();
?>
mysql_connect_f dd.php
<?
define('DB_USER ', 'lkjsdflkdf');
define('DB_PASS WORD', 'lkhjdsflkhj');
define('DB_HOST ', 'localhost');
define ('DB_NAME', 'db1');
$dbc=@mysql_con nect(DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect
to database. Please try later. Error: '.mysql_error() );;
mysql_select_db (DB_NAME);
@mysql_select_d b (DB_NAME) OR die ('Could not select the
database:'.mysq l_error());
?>
The following script outputs 12345. It should go to intro_page.php after the
4 session variables have been populated. Can you see what I'm doing wrong?
Many thanks,
Raj (newbie)
start.php
<?php
session_start() ;
session_destroy ();
include("./general_scripts _etc/header1.php");
$s=$_GET['s'];
$query="SELECT * FROM site_data WHERE site_name='$s'" ;
$result=@mysql_ query($query);
print("1");
$num=mysql_num_ rows($result);
print("2");
if ($num==0)
{
print("3");
$query="SELECT * FROM site_data WHERE site_number='1' ";
print("4");
$result=@mysql_ query($query);
print("5");
while ($Row=mysql_fet ch_array($resul t))
{
print("6");
$_SESSION['site_name']=$Row[site_name];
$_SESSION['site_logo_loca tion']=$Row[site_logo_locat ion];
$_SESSION['site_admin_ema il']=$Row[site_admin_emai l];
$_SESSION['site_number']=$Row[site_number];
ob_end_clean();
header("Locatio n: intro_page.php" );
}
}
if ($num>0)
{
print("7");
while ($Row=mysql_fet ch_array($resul t))
{
print("8");
$_SESSION['site_name']=$Row[site_name];
$_SESSION['site_logo_loca tion']=$Row[site_logo_locat ion];
$_SESSION['site_admin_ema il']=$Row[site_admin_emai l];
$_SESSION['site_number']=$Row[site_number];
ob_end_clean();
header("Locatio n: intro_page.php" );
}
}
include("./general_scripts _etc/footer1.php");
?>
header1.php
<?php
ob_start();
session_start() ;
include('../outer/mysql_connect_f dd.php');
//limit is number of users listed per search page
$limit=10;
//live_limit is time to wait till offline
$live_limit=15* 60;
//the limit to the number of pages appearing on the bottom of pages
$menu_max=25;
//log refrsh time
$log_refresh=30 ;
//time to wait till wipe instant message - seconds
$instant_messag e_wipe=15*60;
//time to wait till wipe old other - seconds
$other_points_w ipe=30*24*60*60 ;
//address to send photos for verification
$photo_verify_a ddress="http://www.freedatingd atabase.com/admin777/photo_verifi
cation.php?user _id="
?>
footer1.php
<?php
ob_end_flush();
?>
mysql_connect_f dd.php
<?
define('DB_USER ', 'lkjsdflkdf');
define('DB_PASS WORD', 'lkhjdsflkhj');
define('DB_HOST ', 'localhost');
define ('DB_NAME', 'db1');
$dbc=@mysql_con nect(DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect
to database. Please try later. Error: '.mysql_error() );;
mysql_select_db (DB_NAME);
@mysql_select_d b (DB_NAME) OR die ('Could not select the
database:'.mysq l_error());
?>
Comment