Jump to content

Connect Script doesnt continue into an include


EchoFool

Recommended Posts

Hey,

 

Okay this is complicated to get your head around at first, and not sure if its Javscript or php so wasn't sure where to post this question... but i have this problem where my main php script has an include for the connect.php which works fine, but a included script later on says connection is needed.

 

Now the complex parts prior to php structure, have this as my center content:

 

<div id="contentarea">
<A href="javascript:turnpage('login.php','contentarea');">View Login</a>
</div>

 

 

The idea is simple - only the div named "content area" loads based on the php script you click in ahref.

 

Now the PHP part.

 

Say i clicked the link above and it loads in login.php (so now at this point login.php is showing in that div "content area".

 

But now it says it cannot connect. Which makes no sense when you look at the structure of the site which is below:

 

 

index.php - this is the fixed page.

<html>
<head>
//include js && css stuff
</head>
<body>
<?php
include("css/layouta.php");  //contains header image and functions and validation stuff also include("connect.php"); // connection is made
?>

<div id="contentarea">
<A ahref="javascript:turnpage('login.php','contentarea');">View Login</a>
</div>

<?php
include("css/layoutb.php"); // has site menu and copyright statement n some non related php features.
?>
</body>
</html>

 

Note: the fist include is where connection is made.

 

Now if i click View Login and i load login php into that div for some reason the connect script in the first include is not counted - can any one explain why this :S ?

 

Error:

Access denied for user 'nobody'@'localhost' (using password: NO)

 

But if i put include("connect.php") in login.php aswell it works - but then i have 2 connect scripts which is more work for the website. Is there any way to  have it not do this?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.