Data passing not making sence.

Ok I have been trying, but I can’t make sence of the output of these few pages. There is much code here, but it should be simple to follow.

I’ll just dig right in to the code, then explain my problem.
Config.php - called at the top of every page.
[php]
session_start();

$Path = “***”;
$ScriptPath = “***”;
$Image = “$Path/images”;

$dbhost = “localhost”;
$dbuser = “";
$dbpass = "
”;
$dbname = “****”;

if ($NoAuth != 1)
{
if (empty($EDEmail))
{
header (“Location: $Path/Function/NoEmail.php”);
} else {
if ($_SESSION[Recorded] != “Yes”)
{
require("$Path/Function/Auth2.php");
}
}
}

if ($Skip != 1)
{

echo "

MAP Program "; }

unset ($Skip,$NoAuth);
[/php]

index.php
[php]
require_once(“Include/Config.php”);

echo " bunch of stuff …
[/php]

NoEmail.php - Form that from config is redirected by header() in cofig if $EDEmail is empty.
[php]

<?php $NoAuth = 1; require_once("../Include/Config.php"); echo "...."; //Form that posts to Auth.php ?>

[/php]

Auth.php - Takes email address from NoEmail.php and pulls the email ID from the database, such as “0000000007” and redirects back to index.php
[php]
$Skip = 1;
$NoAuth = 1;

$FEmailID = $DID;

$_SESSION[‘Recorded’] = “Yes”;

header(“Location: $Path/index.php?EDEmail=$FEmailID”);
[/php]

Auth2.php - required by Config.php if the EDEmail is already set by the url without using the form.
[php]
$Skip = 1;
$NoAuth = 1;

require_once("…/Include/Config.php");


Just stuff to add a record to the database to note that the user has visited the site.

$_SESSION[‘Recorded’] = “Yes”;
[/php]

OK, sorry about the long post, but down to the problem. When I just go to the URL directly everything works as planned. The form shows up. I put my email address in and it returns me to index as planned with the correct EDEmail. Even when I go from pages to pages after that all using url?EDEmail=$EDEmail and it all works fine. Every one of those pages include the config.php and browse as normal.

The problem lies when I type URL?EDEmail=0000000007. It echos the NoEmail form and shows the content of index.php. It should only show index.php.

Any help is greatly appreceated.

Bobby

I changed the if statment in the Config.php for testing to:
[php]
if ($NoAuth != 1)
{
if (empty($EDEmail))
{
echo “EmailID = $EDEmail
”;
// header (“Location: $Path/Function/NoEmail.php”);
} else {
if ($_SESSION[Recorded] != “Yes”)
{
echo “EmailID = $EDEmail
”;
require("$Path/Function/Auth2.php");
}
}
}
[/php]

The output is:

EmailID = 0000000007
EmailID =

OK Narrowed it down. Added
[php]
echo “EDEmail = $EDEmail - Auth2.php”;
[/php]
to the top of Auth2.php.

output:
EDEmail = - Auth2.php

SO … EDEmail is not getting past to Auth.php.

Anyone know why?

Sponsor our Newsletter | Privacy Policy | Terms of Service