Web Hosting Talk







View Full Version : php help


epgs
08-15-2002, 10:47 AM
i am getting this error, and i have no clue what it is Warning: Uninitialized string offset: 0 in /home/sites/site19/users/foxserv/web/www/include/nav.php on line 30

Warning: Uninitialized string offset: 0 in /home/sites/site19/users/foxserv/web/www/include/nav.php on line 40

Warning: Uninitialized string offset: 0 in /home/sites/site19/users/foxserv/web/www/include/nav.php on line 42

Warning: Uninitialized string offset: 0 in /home/sites/site19/users/foxserv/web/www/include/nav.php on line 44

Warning: Uninitialized string offset: 0 in /home/sites/site19/users/foxserv/web/www/include/nav.php on line 46

Warning: Uninitialized string offset: 0 in /home/sites/site19/users/foxserv/web/www/include/nav.php on line 48

Warning: Uninitialized string offset: 0 in /home/sites/site19/users/foxserv/web/www/include/nav.php on line 50
nav:projectname

I have a few others and it is on the page with this code


<?php
# Validate and store the input of the previous form (project's language and
# the purpose), then show a form to enter the project name (full/unix).
# $Id: projectname.php,v 1.5 2001/11/10 15:55:54 sf Exp $

include '../include/pre.php';

authenticate('register:projectname');

// reg_state:
// 0 .. invalid - reject
// 1 .. first visit: store settings from previous form
// 2 .. revisit: maybe update settings from previous form
// 3 .. revisit from later, my settings are already available.


# Validate new settings entered into the previous form (if any)
$lang_name = '';
if(isset($form_language)) {
$lang_name = lang_get_name($form_language);
if( !$lang_name )
exit_error('Invalid','The language specified doesn\'t exist.');
$reg_lang = $form_language;
}

if(isset($form_purpose)) {
if($form_purpose == "")
exit_error('Required input', 'Please fill out the purpose text field.');
$reg_purpose = $form_purpose;
}

if($reg_state < 2)
$reg_state = 2;

site_header('projectname');

if($lang_name == '')
$lang_name = lang_get_name($reg_lang);

print gm('regprojectname:maintext');
?>
<FORM action="category.php" method="post">

<P> Full Name (<?php print $lang_name; ?>):<BR>
<INPUT size=40 maxlength=40 type=text name="form_full_name" value="<?php print $reg_name; ?>"></P>

<P>Unix Name:<BR>
<INPUT type=text maxlength=20 name="form_unix_name" value="<?php print $reg_unixname; ?>"></P>

<INPUT type=submit name="Submit" value="Categories">
</FORM>

<?php site_footer(); ?>

michaeln
08-15-2002, 10:54 AM
This line is causing the problem:
exit_error('Invalid','The language specified doesn't exist.');

You are using single quotes ['] for your strings. So when it hits the doesn't it thinks that is the end of the string. Thus the ['] after exist. is starting a new string on that line when it should be the end..

Redo the line like this:
exit_error('Invalid',"The language specified doesn't exist.");

EDIT:
That is line 22 BTW

Regards,
Michael

filburt1
08-15-2002, 11:02 AM
You can also do this:


// Before:
exit_error('Invalid','The language specified doesn't exist.');

// After:
exit_error('Invalid','The language specified doesn\\'t exist.');

epgs
08-15-2002, 11:07 AM
For some reason that isn't working, you both seem very helpful. Could I send either one of you the complete set of code and look at one or two files?
This is for an open source resource center we are opening and want to get the software repository center open soon.

michaeln
08-15-2002, 11:10 AM
you can send it to me if you like....

Regards,
Michael

epgs
08-15-2002, 11:14 AM
ok thanks i have sent it

michaeln
08-15-2002, 11:19 AM
I got it and will look at it in a couple of minutes.

epgs
08-15-2002, 11:21 AM
ok thank you

filburt1
08-15-2002, 11:22 AM
Originally posted by epgs
For some reason that isn't working, you both seem very helpful. Could I send either one of you the complete set of code and look at one or two files?
This is for an open source resource center we are opening and want to get the software repository center open soon.

Try it again, I edited the post. There's a backslash before the ' in doesn't.

epgs
08-15-2002, 11:24 AM
i did try that

michaeln
08-15-2002, 11:31 AM
Can you email me the link to where it is on your server so I don't have to install it on mine... I want to see what error it is giving you now...

Regards.
Michael

michaeln
08-15-2002, 12:07 PM
The problem is with the $env variable in the nav.php file...

epgs
08-15-2002, 12:14 PM
where is that i don't see it

michaeln
08-15-2002, 12:16 PM
See your first post and it gives you the line numbers. I still haven't figure out what the exact problem is...