Session Problem
Posted: Thu May 31, 2007 11:10 am
Ok, I have page that carries a session to the next page the problem is that i dont see why this is not carries the the session the next page.
here codr for page1
here is code for page2
here codr for page1
Code: Select all
<?php
session_start();
$_SESSION['BusinessName'];
?>
<body bgcolor="#E5E5E5" topmargin="0">
<?php
$host = "l";
$username = "";
$password = "";
$database = "";
$db = mysql_connect($host, $username, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
if(isset($_GET['BusinessName'])){
$query = "SELECT * FROM business_info WHERE `BusinessName`= '$BusinessName' ";
$result = mysql_query($query) or die (mysql_error());
$row = mysql_fetch_assoc($result);
$BusinessName= ($row['BusinessName']);
$Keyword =($row['Keyword']);
$Picture1 = ($row['Picture1']);
$Headline = ($row['Headline']);
$Slogan2 = ($row['Slogan2']);
$Description1 =($row['Description1']);
$Description2 = ($row['Description2']);
$Description3= ($row['Description3']);
$Contact2 = ($row['Contact2']);
$Picture2 = ($row['Picture2']);
$Picture3 = ($row['Picture3']);
$Business_Address=($row['Business_Address']);
$make=($row['make']);
$type=($row['type']);
$Tel=($row['Tel']);
$Website=($row['Website']);
}
?>
<center>
<table width="200" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td valign="top">
<?php include("includefiles/banner.php"); ?>
<table width="778" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="778" valign="top">
<table width="778" border="0" cellpadding="0" cellspacing="0">
<?php
session_start();
$_SESSION['BusinessName'];
?>
<tr>
<td valign="top" bgcolor="#f90102"> <?php
echo "<h1><font color='ffffff'><marquee>$BusinessName </marquee></font></h1>"; ?>
</td>Code: Select all
<?php
session_start();
$_SESSION['BusinessName'];
?>
<html>
<head>
<title>Untitled Document</title>
</head>
<body bgcolor="#E5E5E5" topmargin="0">
<?php
$host = "localhost";
$username = "";
$password = "";
$database = "";
$db = mysql_connect($host, $username, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
if(isset($_SESSION['$BusinessName'])){
$query = "SELECT * FROM business_info WHERE `BusinessName`='".$_SESSION['$BusinessName']."'";
$result = mysql_query($query) or die (mysql_error());
$row = mysql_fetch_assoc($result);
$BusinessName= ($row['BusinessName']);
$Keyword =($row['Keyword']);
$Picture1 = ($row['Picture1']);
$Headline = ($row['Headline']);
$Slogan2 = ($row['Slogan2']);
$Description1 =($row['Description1']);
$Description2 = ($row['Description2']);
$Description3= ($row['Description3']);
$Contact2 = ($row['Contact2']);
$Picture2 = ($row['Picture2']);
$Picture3 = ($row['Picture3']);
$Business_Address=($row['Business_Address']);
$make=($row['make']);
$type=($row['type']);
$Tel=($row['Tel']);
$Website=($row['Website']);
}
?>
<center>
<?
$_SESSION['BusinessName'];
?>
<pre>_SESSION:<?php print_r($_SESSION); ?></pre>
<table width="200" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td valign="top">
<?php include("includefiles/banner.php"); ?>
<table width="778" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="778" valign="top">
<table width="778" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" bgcolor="#f90102"> <?php
echo "<h1><font color='ffffff'><marquee>$BusinessName </marquee></font></h1>"; ?>
</td>