tags:

views:

26

answers:

3

Hi everybody!I have downloaded a script Reece Calendar from internet,I finally connected it with database but I have some errors in it!

Can you please help me?

The first errore is:

Undefined index: timeout in C:\wamp\www\ReeceCalendar_0.9\cal\gatekeeper.php on line 180

and the code in this line is:

if($d['timeout']!="") $cal_options['timeout'] = $d['timeout'];

A: 

It means that the index 'timeout' does not exist in array $d. More specifically, $d['timeout'] is not set before the if statement attempt to perform its comparison with "".

Evernoob
what can I do?how can I change it?thnx:)
Marin
A: 

Unless $d['timeout'] really should exist, the line ought to be changed to:

if (array_key_exists("timeout", $d) && $d['timeout'] != "")
    $cal_options['timeout'] = $d['timeout'];
Artefacto
thank you:))))It works perfectly:))
Marin
What about this line:Undefined index: skin in C:\wamp\www\ReeceCalendar_0.9\cal\gatekeeper.php on line 183and the code is:if($d['skin']!="") $cal_options['skin'] = $d['skin'];
Marin
same principle applies
Artefacto
can you explain better please?
Marin
Hey I solved it in the same way:)
Marin
Undefined index: show_times in C:\wamp\www\ReeceCalendar_0.9\cal\gatekeeper.php on line 192This is the next error and the code is:if($d['show_times']=='y') $cal_options['show_times'] = TRUE;
Marin
It's exactly the same thing. You should understand what you're doing, otherwise you won't be able to write computer programs.
Artefacto
Ok,I'll try it now;)
Marin
I wrote this:if (array_key_exists("show_times", $d) instead of this:if($d['show_times']=='y') $cal_options['show_times'] = TRUE;and I think it worked:)What do you think?Please tell me!:)ThANK you for the help;)
Marin
Artefacto please can you help me with the next problem?The error is: Notice: Undefined index: user in C:\wamp\www\ReeceCalendar_0.9\cal\index.php on line 61and the code is:if($_POST['user']!="") cal_check_user();
Marin
A: 
Mihai Iorga
if($d['show_times']=='y') $cal_options['show_times'] = TRUE;This is the next error:Undefined index: show_times in C:\wamp\www\ReeceCalendar_0.9\cal\gatekeeper.php on line 192
Marin
-1 That's terrible advice. Disable E_NOTICE and you'll miss bugs you would otherwise be warned about. You ought not to access array indexes that don't exist anyway (hence the warning).
Artefacto
I haven't take this advice in consideration cause the advice you(Artefacto) gave to me solved my problem,but please see the next problem and please give me an advice what to do;( Thnx so much:)
Marin
@Artefacto When you download an application ALREADY made, YOU SHOULD disable your PHP warnings because it could take forever to solve them all.HE didn't said he made that application. Almost 60% of the free scripts on the internet doesn't have any indexes defined. What should a newbie do, enter every class, function and file to solve things out. Actually you gave him a bad idea, because obviously he doesn't know what's that. He will try to solve all the indexes,warning and will come back later. And what do you do when an update comes out and he only has to patch the scripts? Do all over again?
Mihai Iorga
@Mihai Iorga Yes, but this is a programming forum, we're supposed to give good **programming** advice. If he just wants to know how to install the script, he should go over to server fault. Even there, your advice was not good, because display_errors should be on only for development.
Artefacto
YES, for development not deploying an already made script. Like I told you I don't see the question where he said that he is developing that script. Also what will he do when an update comes out?I was advising him what to do IN HIS case.
Mihai Iorga
@Mihai Iorga When an update comes out -- I doubt he'll care or even that an update comes out -- he can merge the changes. "YES, for development not deploying an already made script", yet you told him to turn on `display_errors`.
Artefacto
@Artefacto for errors not warnings! Now you deal with him, he asked this question 3-4 times again and he will ask again and again, because your sollution is NOT OK. and you -1 me ! :)you're funny.
Mihai Iorga
That's good advice because the OP have no clue
Col. Shrapnel
@Mihai Iorga OK, given the behavior of the OP, this would be the best option, so I undid the vote. However, the question may be read by people who're not clueless, and I stand by my comments.
Artefacto