Jump to content

Unable to transfer variables between two files !


etdsbastar

Recommended Posts

If I am putting this line as first line (line no. 11) in /includes/error.php

 

echo $_CHARSET; exit();

 

It is showing me the following error:

 

Notice: Undefined variable: _CHARSET in /home/abc/server/csm/includes/error.php on line 11 

 

But, $_CHARSET has already been defined in includes/common.php on line 29. Same probem in error.php with BASEPATH constant.

Link to comment
Share on other sites

I had included one more folder TEMPLATE under the ROOT directory having simple contents:

 

<?php
echo "<pre>";
	$test = $_DB->Query("select * from employee");
	print_r ($test);
echo "</pre>";
exit();
?>

 

But, still showing the error:

 

Notice: Undefined variable: _DB in /home/abc/server/csm/template/index.php on line 3

 

Fatal error: Call to a member function Query() on a non-object in /home/abc/server/csm/template/index.php on line 3

 

Note: The class has been already declared earlier in the variable $_DB.

Link to comment
Share on other sites

Are you using a word processor to edit the files?

 

There is something YOU are doing that is causing basic and commonly used php operations to fail.

 

The code you posted is a purchased script. Is there some reason you have not contacted the Author for help? Perhaps he has seen this problem before and could directly help with what is causing the problem.

 

Given that the script is a 3rd party purchased script, moving this thread to that forum section...

Link to comment
Share on other sites

Dear,

 

I am designing this project for a cold-storage and so written the comments on each file. Its being designed by me only. So, please don't get confused. If you want to confirm, please mail me on the email id given on the comments and see whether I am giving you the reply or not.

 

Ok.

 

Secondly, I am using gedit as the editor. So I request you kindly first to mail me, confirm me as the author of the code and then move back this post to PHP CODING section.

Link to comment
Share on other sites

I moved your thread to the 3rd party scripts because the actual attached source code contains comments (that you intentionally omitted in the posted code) indicating it is a copyrighted/paid license script, because of your difficulty with troubleshooting php problems in the script, and reluctance to provide asked for information. It was very likely you were someone attempting to get a poorly written 3rd party script working, rather than the author of the script.

 

Having studied the source code more (based on the error messages posted in Reply #22), I can tell you why you are getting errors concerning the BASEPATH defined constant. The code you posted at the start of the thread, using index.php and core.php is not actually where the problem is. The problem is that you are redirecting to the error.php page and it is only requiring 'common.php'. The code in common.php is dependent on a constant that is defined in index.php.

 

For some of the other errors, I suspect you have been randomly changing the code, but have not provided the actual code that is running that is producing the errors you want help with.

 

If you are going to be redirecting to an 'error' page, that page must be a complete web page that requires everything that it needs. error.php should require core.php, the same as what index.php is doing.

 

As to your last error concerning the $_DB variable. You would need to post the exact and complete code that reproduces that error for anyone in a help forum to have a chance at determining what is causing the problem.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.