Jump to content

Unknown error! (I'm new to PHP)


Oilfan

Recommended Posts

Hello! I have a strange error on my PHP script and i dont how to fix it. If someone can help me, please help me then! Here is my error:

logout(); } else { $iq = mysql_query("SELECT * FROM users WHERE username='{$signin_username}' AND password='{$signin_password}' AND suspended='0' LIMIT 1;"); $ir = mysql_fetch_array($iq); $_SESSION['me'] = $ir; } } } } else { die("The configuration did not recieve appropriate variables to accept your request."); } if ($set['next_clearup'] < time ()) { $next_clearup = time () + 60 * 60 * 24; mysql_query ('' . 'UPDATE settings SET set_value=\'' . $next_clearup . '\' WHERE set_name=\'next_clearup\' LIMIT 1;'); mysql_query ('UPDATE users SET ads_clicked=\'\' WHERE ads_clicked!=\'\''); } } ?>
Warning: include(THDIRindex.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\Upload\index.php on line 16

Warning: include() [function.include]: Failed opening 'THDIRindex.php' for inclusion (include_path='.;\xampp\php\PEAR') in C:\xampp\htdocs\Upload\index.php on line 16

 

And here is the PHP file the error is in:

<?php

session_start();
include_once('lib/lib.php');
include_once('lib/configuration.php');

$ddir = THDIR.$do->get_file_url();
include($ddir);

if(file_exists(HEADER)) { include_once(HEADER); }
if($contents) { print $contents; }
if(file_exists(FOOTER)) { include_once(FOOTER); }
?>

 

Help ASAP if you can! :):shy:

Link to comment
Share on other sites

It seems like THDIR isn't a known constant... are you sure you've define()d it?

 

ie:

define("THDIR", "includedir/");

 

I'm sorry but i dont really understand. How do i define that? I mean, where should i put this:

define("THDIR", "includedir/");

and what i should put in that "includedir/" ?

Link to comment
Share on other sites

I was assuming you knew what constants were since you used one. Let's start over. What is THDIR supposed to be?

 

Well, i think it is the index.php. And my friend gave me his website script because he dont use it anymore and i tried to use it but got this error.  :-\

Link to comment
Share on other sites

Ok, when you call $do->get_file_url() it returns 'index.php'. I'm guessing you didn't write this code, so do you know where the 'index.php' file is that it's trying to include?

 

Constants are like strings, but you can't change them and they don't use a  $ before the name. You define them with the define function like this:

define("CONSTANT_NAME", "CONSTANT_VALUE");

 

Constants can be used to specify where all the files you include are, so you could define THDIR to the folder where index.php is (like "./includes/"). Then you just concatenate THDIR to any of the filenames you're including. If you move all your includes to somewhere else you just change the definition of THDIR and everything works like before.

 

Sorry if this is confusing...

Link to comment
Share on other sites

Oh, right. Well.. you might want to get your friend to help you, because that doesn't make any sense. We'd probably need a lot more code to understand what this file's trying to do. You could try deleting those two lines, but I'm sure it's there for a reason... THDIR is supposed to be something, but it's not.

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.