Jump to content

Error log : PHP Notice: Undefined offset


a1amattyj

Recommended Posts

Hello,

 

In my error log, its just plastered with:

 

[30-May-2008 06:14:25] PHP Notice:  Undefined offset:  2 in /home/smfnew/public_html/multi_operations/forum_functions.php on line 31

[30-May-2008 06:14:25] PHP Notice:  Undefined offset:  2 in /home/smfnew/public_html/multi_operations/forum_functions.php on line 31

[30-May-2008 06:14:25] PHP Notice:  Undefined offset:  2 in /home/smfnew/public_html/multi_operations/forum_functions.php on line 37

[30-May-2008 06:14:25] PHP Notice:  Undefined offset:  2 in /home/smfnew/public_html/multi_operations/forum_functions.php on line 37

 

Line 31:

if($serverhost[2] == 'smfnew' || $serverhost[2] == 'com'){
$forum_name = $forum_name1;
}else{
$forum_name = ''.$forum_name1.'_2';
}

Line 37:
if($serverhost[2] == 'smfnew' || $serverhost[2] == 'com'){
$domain1 = 'smfnew.com';
}else{
$domain1 = 'smffree.net';
}

 

Thanks!

Link to comment
Share on other sites

Ok...well the offset is in reference to the "2" that you are using in your array ($serverhost[2]).

 

So this error is telling you that there is no element 2 in the serverhost array.

 

Try printing the array using print_r() to see what is in it.

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.