Re: [PHP] unknown problem of script
me estais mandando mensajes vuestros, - Original Message - From: erich [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 21, 2002 4:22 PM Subject: [PHP] unknown problem of script i run a install.php, the server says the following statement, Warning: Undefined index: install in d:\wwwroot\program_files\install.php on line 14 the strange things is when i install the php program, it does not have outputted this warning, but this warning occurs when i put all the files to a remote server the install.php source is as follows: ?php // include config, functions, common and header include (./include/config.php); include (./include/functions.php); include (./include/common.php); include (./include/header_admin.php); // variables: // GET // POST // $install from install.php (set to 1 when user click on install) $install = $HTTP_POST_VARS[install]; if ($table_name != and $table_internal_name != ) { if ($install == 1) { $unique_field_name = get_unique_field($conn, $db_name, $table_name); // get the array containing the names of the fields $fields_names_ar = build_fields_names_array($conn, $db_name, $table_name); // drop (if present) the old internal table and create the new one. create_internal_table($conn, $table_internal_name); echo pInternal table b$table_internal_name/b correctly created..; for ($i=0; $icount($fields_names_ar); $i++){ // insert a new record in the internal table with the name of the field as name and label $sql = insert into $table_internal_name (name_field, label_field, order_form_field) values ('$fields_names_ar[$i]', '$fields_names_ar[$i]', '.($i+1).'); $res_insert = execute_db($sql, $conn); } // end for echo p..The system is correctly installed!!; echo pYou can now manage your table b$table_name/b, starting from a href=\index.php\index.php/a; echo pIn order to customize the internal db you have to use the a href=\admin.php\administration page/a.; if ($unique_field_name == ){ echo pYour table b$table_name/b hasn't any primary keys set, if you don't set a primary key won't show the edit/delete/details buttons.; } // end if } // end if ($install == 1) else{ echo form name=\install_form\ action=\install.php\ method=\post\; echo input type=\hidden\ name=\install\ value=\1\; echo input type=\submit\ value=\Click this button to install\; echo /form; } // end else } // end if ($table_name != and $table_internal_name != ) else{ echo pPlease specify table_name and table_internal_name in config.php; } // end else // include footer include (./include/footer_admin.php); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] unknown problem of script
i run a install.php, the server says the following statement, Warning: Undefined index: install in d:\wwwroot\program_files\install.php on line 14 the strange things is when i install the php program, it does not have outputted this warning, but this warning occurs when i put all the files to a remote server the install.php source is as follows: ?php // include config, functions, common and header include (./include/config.php); include (./include/functions.php); include (./include/common.php); include (./include/header_admin.php); // variables: // GET // POST // $install from install.php (set to 1 when user click on install) $install = $HTTP_POST_VARS[install]; if ($table_name != and $table_internal_name != ) { if ($install == 1) { $unique_field_name = get_unique_field($conn, $db_name, $table_name); // get the array containing the names of the fields $fields_names_ar = build_fields_names_array($conn, $db_name, $table_name); // drop (if present) the old internal table and create the new one. create_internal_table($conn, $table_internal_name); echo pInternal table b$table_internal_name/b correctly created..; for ($i=0; $icount($fields_names_ar); $i++){ // insert a new record in the internal table with the name of the field as name and label $sql = insert into $table_internal_name (name_field, label_field, order_form_field) values ('$fields_names_ar[$i]', '$fields_names_ar[$i]', '.($i+1).'); $res_insert = execute_db($sql, $conn); } // end for echo p..The system is correctly installed!!; echo pYou can now manage your table b$table_name/b, starting from a href=\index.php\index.php/a; echo pIn order to customize the internal db you have to use the a href=\admin.php\administration page/a.; if ($unique_field_name == ){ echo pYour table b$table_name/b hasn't any primary keys set, if you don't set a primary key won't show the edit/delete/details buttons.; } // end if } // end if ($install == 1) else{ echo form name=\install_form\ action=\install.php\ method=\post\; echo input type=\hidden\ name=\install\ value=\1\; echo input type=\submit\ value=\Click this button to install\; echo /form; } // end else } // end if ($table_name != and $table_internal_name != ) else{ echo pPlease specify table_name and table_internal_name in config.php; } // end else // include footer include (./include/footer_admin.php); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unknown problem of script
Erich: On Tue, May 21, 2002 at 10:22:10PM +0800, erich wrote: Warning: Undefined index: install in d:\wwwroot\program_files\install.php on line 14 Undefined index means that the index you requested from an array doesn't exist. ?php $install = $HTTP_POST_VARS[install]; That's line 14. So, install isn't set, but you're using it as if it was. the strange things is when i install the php program, it does not have outputted this warning, but this warning occurs when i put all the files to a remote server You have different error reporting levels on the different servers. One option to solve the problem is change error reporting. The more preferable thing to do is this: if ( empty($_POST['install']) ) { $install = ''; } else { $install = $_POST['install']; } Enjoy, --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php