473,388 Members | 1,322 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Include error

ok i have added a include as i do to all over pages playing around with some date manipulation

[PHP]
<?php
ini_set("display_errors", 1);
include('dateadd.php');


$temptime = time();
echo strftime('%Hh%M %A %d %b',$temptime);
echo "<br />";
echo $temptime;
$temptime = DateAdd('n',50,$temptime);
echo "<br />";
echo strftime('%Hh%M %A %d %b',$temptime);
echo "<br />";
echo $temptime;

?>
[/PHP]

and in the included file
[PHP]<?php

function DateAdd($interval, $number, $date) {



$date_time_array = getdate($date);

$hours = $date_time_array['hours'];

$minutes = $date_time_array['minutes'];

$seconds = $date_time_array['seconds'];

$month = $date_time_array['mon'];

$day = $date_time_array['mday'];

$year = $date_time_array['year'];



switch ($interval) {



case 'yyyy':

$year+=$number;

break;

case 'q':

$year+=($number*3);

break;

case 'm':

$month+=$number;

break;

case 'y':

case 'd':

case 'w':

$day+=$number;

break;

case 'ww':

$day+=($number*7);

break;

case 'h':

$hours+=$number;

break;

case 'n':

$minutes+=$number;

break;

case 's':

$seconds+=$number;

break;

}

$timestamp= mktime($hours,$minutes,$seconds,$month,$day,$year) ;

return $timestamp;

}

?>[/PHP]

my link is http://hash-dict.com/test/atest.php any ideas?
Jan 20 '08 #1
6 1221
stepterr
157 100+
Is the actual include file called dateadd.php and in the same exact case? PHP is case sensitive and if it doesn't match it will cause you problems. I'm thinking it has to be something along those lines since it can't find your function at all. Either that or it's not in the same directory.
Jan 21 '08 #2
Actually it is there case wise you can see it when you visit the page it loads it with the question mark squares.

Also they are copy past from there files and the file names are all in lower case . both of the files are in the directory called /test/ in my web server
Jan 21 '08 #3
Markus
6,050 Expert 4TB
Have you tried copying the contents of the include file and pasting it into the time manipulation page to see if that works?
Jan 21 '08 #4
Markus
6,050 Expert 4TB
http://hash-dict.com/test/dateadd.php

Take a look... the page isn't being parsed as PHP.
Jan 21 '08 #5
yes that does work and i have even stored it as a .inc and a text file to include and adjusted the scripts accordingly.
Jan 21 '08 #6
hmm it seems to work on other Lamp systems..

im going to redo my install and see if that will work.
Jan 21 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
9
by: Sarath | last post by:
I am working with an application using ASP, getting below error when i am trying to include new asp include file. _____________________________________________________________________ Microsoft...
10
by: Toke H?iland-J?rgensen | last post by:
Hello. I am quite new to the c++ language, and am still trying to learn it. I recently discovered how using include files would allow me to split up my code into smaller segments, instead of having...
6
by: wukexin | last post by:
Help me, good men. I find mang books that introduce bit "mang header files",they talk too bit,in fact it is my too fool, I don't learn it, I have do a test program, but I have no correct doing...
60
by: Derrick Coetzee | last post by:
It seems like, in every C source file I've ever seen, there has been a very definite include order, as follows: - include system headers - include application headers - include the header...
9
by: zolli | last post by:
Hi, I've been banging my head against this for a while now. Hoping someone here can shed some light on what's going on. On including stdlib.h in a file, I'm seeing the following errors: ...
5
by: David Mathog | last post by:
One thing that can make porting C code from one platform to another miserable is #include. In particular, the need to either place the path to an included file within the #include statement or to...
1
by: Minh | last post by:
I've just installed VS.NET 2003 on my Athlon XP 1800+. However I couldn't get any project with STL includes to compile even if I create a new empty project (and added #include <string>). It gave me...
1
by: ya man | last post by:
when i use #include <iostream.h> in some files i get lots of error messages of the kind 'ambiguous symbol this is solved when i use #include <iostream why is that ? and can i use #include...
6
by: Jordi | last post by:
I'm having a problem which I think has to do with the circular use of inlcuding header files. The short version of my code would look a bit like this, I think: GameEngine.h: #ifndef GAME_ENGINE...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.