Link Problem

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Link Problem

Postby mightymouse3062 » 11. January 2008 02:55

Good Evening,
I just installed XAMPP so I can work on php coding without having a server on the internet and I am having a problem with how it is recognizing "subdirectories":
Here is the code that I am using from a config.php file:
$root_1 = "C:/xampp/htdocs/system/"; // Directory
$root_2 = "http://localhost/system"; // Http

when I try to go to a page using code like this, <a href='" . $root_2 . "/admin/matches/generate_all.php?result=4&confirm=1'>Confirm Generation</a>

It takes me to http://localhost/admin/matches/generate_all.php and removes the system directory. What could be the problem and how can I fix it?

Thanks,
Mightmouse3062
mightymouse3062
 
Posts: 9
Joined: 11. January 2008 02:49

Postby Wiedmann » 11. January 2008 03:07

when I try to go to a page using code like this, <a href='" . $root_2 . "/admin/matches/generate_all.php?result=4&confirm=1'>Confirm Generation</a>

You have a real and complete (line of) code to verify? This piece of code don't look correct.

It takes me to http://localhost/admin/matches/generate_all.php and removes the system directory. What could be the problem

I guess the variable $root_2 is empty.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby mightymouse3062 » 11. January 2008 03:41

I dont know what you mean by real and complete line of code.
As for $root_2, it has the value of http://localhost/system.

Here is some code that I have for another page:
PHP Code:
echo "<a href='" . $root_2 . "/admin/admin.php'>Home</a> <a href='" . $root_2 . "/admin/matches/generate_all.php'>Back</a>";

Source Code:
<a href='http://localhost/system/admin/admin.php'>Home</a> <a href='http://localhost/system/admin/matches/generate_all.php'>Back</a>

What exactly happens:
http://localhost/admin/security/login.php

The reason that it goes to the login.php is because of the cookie not being set yet: here is the code of that function:

function logged_in(){
global $logged_in;
if($logged_in == 1){
} else {
die(header("Location:" . $root_2 . "/admin/security/login.php"));
}
}
mightymouse3062
 
Posts: 9
Joined: 11. January 2008 02:49

Postby Wiedmann » 11. January 2008 03:58

Code: Select all
echo "<a href='" . $root_2 . "/admin/admin.php'>Home</a> <a href='" . $root_2 . "/admin/matches/generate_all.php'>Back</a>";

With this code, in front of the above line, you can see, if the variable have really a value:
Code: Select all
var_dump($root_2);
exit;


The reason that it goes to the login.php is because of the cookie not being set yet: here is the code of that function:

I don't see a cookie in this code...
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 52 guests