Jump to content

gorkongroove

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

gorkongroove's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi! I have a problem I can't solve. I've been "googling" a lot, but without success at all. It seems to be the typical problem with the session_vars in IE, that are blocked with the default browser configuration (as cookies). But it only takes place when I access to the site by the URL (my registed domain, its redirected to my host): http://www.example_site.com but not when I access the site via http://my_host/my_directory The problem occurs only with IE, not with Netscape-based browsers. I´ve looking for a solution and I've tried several Apache configurations, trying to patch this IE problem. I've tried virtual hosts, aliases... I've tried to use absolute URLs so the browser has the same behaviour as the one it has when accessing the URL "http://my_host/my_directory" directly ... Has anyone had any similar experience? Thanks in advance!
  2. Hi to All! I am developing a Course Catalog in PHP. In the form for Editing/Inserting Courses I have to work with several tables. The problem to me comes when I have to modify the languages of the course, because the table "courses" is related with the table "languages" by a many-to-many relation ("courses_languages_map" table). This kind of relation occurs several times in the form with other tables (institutions, study areas, ...). I could make another "page" to edit the "courses_languages_map" table, but maybe this way could be confusing for final users, don't you think so? So I am looking for a solution in order to edit the courses' languages in the same page I edit the courses. I've been trying to put a "select" object with all the languages and a "add language button", and another "select" (this one with fixed height) with a "remove language button". When the button "add language" is pressed the highlighted language in the first "select" is inserted in the second "select". This works properlly. My problem is to pass ALL the languages in the second "select" to PHP, so I can update the "courses_languages_map" table at the same time I update the courses table and all related tables. Any ideas, please? Or maybe someone knows a better way? Thanks in advance and excuse if I have not expressed myself correctly... P.D: I am working with PHP 4.3.10 and Smarty.
  3. I don´t know why, but it is solved. Like it appeared it disappeared .... I realized some changes in the php files. I didn´t liked the results so I commented the new lines typed, and after that all was working in the desired way. Thanks Craygo and HeyRay2. I am working know trying to make some server-side validation, and it works. The main problem now is, after showing the error message (with a new Smarty .tpl file), how to redirect the user to the form and keep the filled fields with the information, so he or she doesn't need to fill ALL the fields another time. I am now reading some literature to do it. Bye!
  4. This is the last part of my sliced reply. This is the .tpl Smarty file. Is compressed in rar format because I could not post the code in the message (got timeout ...). Thanks! [attachment deleted by admin]
  5. I get a timeout error so I have to post the code separately... Sorry ... ******************************************************************* ##### forms.js ##### ******************************************************************* /* form functions */ function submit_add_content_form () { var funcion = new function () {} alert_message=""; first_unfilled_field = "";         campo = document.forma.learning_resource_type; if ( campo.value == 0 ){     alert_message += "* Learning Resource Type \n"; } campo = document.forma.title; if ( campo.value == "" ) {   alert_message += "* Title\n";   x = first_unfilled_field;   first_unfilled_field = (x ? x : campo ); } campo = document.forma.id_language1; if ( campo.value == 0 ){     alert_message += "* Language\n"; } campo = document.forma.lom_description; if ( campo.value == "" ) {   alert_message += "* Description\n";   x = first_unfilled_field;   first_unfilled_field = (x ? x : campo ); }         campo = document.forma.copyrightcom; //gor if ( campo.value == "")     {     alert_message += "* Copyright Comments\n";     } campo = document.forma.life_entity; //gor if ( campo.value == "")     {     alert_message += "* Entity\n";     }     campo = document.forma.interactivity_type_id; if ( campo.value == 0 ){     alert_message += "* Interactivity Type\n"; }     campo = document.forma.intended_end_user_id; if ( campo.value == 0 ){     alert_message += "* Intended end user\n"; } campo = document.forma.context_id; if ( campo.value == 0 ){     alert_message += "* Context\n"; } campo = document.forma.difficulty_id; if ( campo.value == 0 ) {     alert_message += "* Difficulty\n"; } campo = document.forma.typical_learning_time; if ( campo.value == "" ) {   alert_message += "* Typical Learning Time\n";   x = first_unfilled_field;   first_unfilled_field = (x ? x : campo ); } campo = document.forma.learning_outcomes; if ( campo.value == "" ) {   alert_message += "* Learning Outcomes\n";   x = first_unfilled_field;   first_unfilled_field = (x ? x : campo ); } campo = document.forma.id_language; if ( campo.value == 0 ) {     alert_message += "* Language\n"; } campo = document.forma.aggregation_level_id; if ( campo.value == 0 ){     alert_message += "* Aggregation Level\n"; } campo = document.forma.id_structure; if ( campo.value == 0 ){     alert_message += "* Structure\n"; }                  if ( alert_message ) {   alert ( "Sorry, you must fill in the mandatory fields (*):\n" + alert_message );   return false; } else {   return true; } } ******************************************************************
  6. Thanks for your replies!   The problem, in my opinion, is not a JS problem because I have not modified the jScript code. And I have been doing some changes in the form.js file so it only checks one field and the result was the same! Also thanks for the link, it is a very interesting thread and will help me a lot. I am starting now to make some php error checking. The code is here, maybe it is a bit extense ... The previous developer coded most parts. Smarty is used. ******************************************************************* ####### editar.php ####### ******************************************************************* <?   session_start();   $__usuario = $_SESSION["__usuario"];   require_once("Smarty.class.php");   include_once("alioli.ini");   include_once("ez_sql.php");   include_once("pagina.inc.php");   $id_lom    = $HTTP_GET_VARS["id_lom"];   $pantalla  = $HTTP_GET_VARS["pantalla"];     $smarty = new Smarty;   $p = new pagina();   $p->menu();   if (!isset($__usuario)) { $p->Redireccionar(); exit;}      $sql6 = "select * from lom_educational_learning_resource_types";   if ($datos_lom_educational_learning_resource_types = $db->get_results($sql6)){     foreach ($datos_lom_educational_learning_resource_types  as  $fila6  ){         $smarty->append('edu_learn_id', $fila6->id);         $smarty->append('edu_learn_description', $fila6->description);     }   }         $sql2 = "select * from avl_languages";     if ($datos_avl_languages = $db->get_results($sql2)){       foreach ($datos_avl_languages as  $fila2  ){         $smarty->append('id_language', $fila2->id_language);         $smarty->append('caption', $fila2->caption); $smarty->append('code', $fila2->code);       }     }     $sql2 = "select * from  lom_rights_types ";     if ($datos_rights_types = $db->get_results($sql2)){       foreach ($datos_rights_types as  $fila2  ){         $smarty->append('id_rights', $fila2->id);         $smarty->append('caption_rights', $fila2->caption); $smarty->append('default_rights', $fila2->Iddefault);       }     }         $sql1 = "select * from lom_educational_interactivity_type";     if ($datos_lom_educational_interactivity_type= $db->get_results($sql1)){       foreach ($datos_lom_educational_interactivity_type  as  $fila1  ){         $smarty->append('interactivity_type_id', $fila1->id);         $smarty->append('interactivity_type_description', $fila1->description);       }     }           $sql2 = "select * from lom_educational_intended_end_user_role";     if ($datos_lom_educational_intended_end_user_role = $db->get_results($sql2)){       foreach ($datos_lom_educational_intended_end_user_role as  $fila2  ){         $smarty->append('intended_end_user_id', $fila2->id);         $smarty->append('intended_end_user_description', $fila2->description);       }     }           $sql3 = "select * from lom_educational_context";     if ($datos_lom_educational_context = $db->get_results($sql3)){       foreach ($datos_lom_educational_context as  $fila3  ){         $smarty->append('context_id', $fila3->id);         $smarty->append('context_description', $fila3->description);       }     }         $sql4 = "select * from lom_educational_difficulty";     if ($datos_lom_educational_difficulty = $db->get_results($sql4)){       foreach ($datos_lom_educational_difficulty as  $fila4  ){         $smarty->append('difficulty_id', $fila4->id);         $smarty->append('difficulty_description', $fila4->description);       }     }           $sql4 = "select * from lom_general_structure";     if ($datos_lom_general_structure = $db->get_results($sql4)){       foreach ($datos_lom_general_structure as  $fila4  ){         $smarty->append('general_structure_id', $fila4->id_structure); $smarty->append('general_structure_description', $fila4->description);       }     }       $sql5 = "select * from lom_general_aggregation_level";     if ($datos_lom_general_aggregation_level= $db->get_results($sql5)){       foreach ($datos_lom_general_aggregation_level as  $fila5  ){         $smarty->append('aggregation_level_id', $fila5->id_aggregation_level);         $smarty->append('aggregation_level_description', $fila5->description);       }     }         $sql5 = "select id, extension, mime, ltf_order from lom_technical_format ORDER BY ltf_order";     if ($datos_lom_technical_format = $db->get_results($sql5)){       foreach ($datos_lom_technical_format as  $fila5){ $smarty->append('technical_id', $fila5->id);         $smarty->append('technical_datos', $fila5->mime."  (".$fila5->extension.") ");       }     }     if ($pantalla=='Modify'){   $sqlg3 = "SELECT g.loID, g.title, g.description, g.catalog, g.entity, g.keyword, g.coverage, g.id_structure, g.id_aggregation_level, g.id_language, g.copyrightcom     FROM lom_general g       WHERE g.loID='$id_lom'";     if ($datos_lom_general = $db->get_results($sqlg3)){       foreach ($datos_lom_general as  $fila  ){     $smarty->assign('id_lom', $fila->loID);     $smarty->assign('title', $fila->title);     $smarty->assign('description', $fila->description); $smarty->assign('entity', $fila->entity); $smarty->assign('keyword', $fila->keyword); $smarty->assign('coverage', $fila->coverage);     $smarty->assign('catalog', $fila->catalog); $smarty->assign('id_structure1', $fila->id_structure); $smarty->assign('id_aggregation_levell', $fila->id_aggregation_level); $smarty->assign('id_language11', $fila->id_language); $smarty->assign('copyrightcom', $fila->copyrightcom);       }     }   $sqlg1 = "SELECT id, interactivity_type, learning_resource_type, interactivity_level,                     semantic_density, intended_end_user_role, context, typical_age_range, difficulty, typical_learning_time,     description, language     FROM lom_educational             WHERE loID='$id_lom'";       if ($datos_lom_educational = $db->get_results($sqlg1)){     foreach ($datos_lom_educational as  $fila  ){       $smarty->assign('id_educational', $fila->id);       $smarty->assign('id_interactivity_type1', $fila->interactivity_type);       $smarty->assign('id_learning_resource_type1', $fila->learning_resource_type);       $smarty->assign('id_interactivity_level1', $fila->interactivity_level);       $smarty->assign('id_intended_end_user_role1', $fila->intended_end_user_role);       $smarty->assign('id_context1', $fila->context);       $smarty->assign('id_semantic_density1', $fila->semantic_density);       $smarty->assign('id_difficulty1', $fila->difficulty);       $smarty->assign('typical_learning_time',$fila->typical_learning_time);       $smarty->assign('typical_age_range',$fila->typical_age_range);       $smarty->assign('educational_description',$fila->description);       $smarty->assign('id_language21',$fila->language);       $smarty->assign('id_edu',$fila->id);       }     }     $sqlg2 = "SELECT distinct id_technical, id_format, size, location, requirement          FROM lom_technical WHERE loID='$id_lom'";     if ($datos_lom_general = $db->get_results($sqlg2)){       foreach ($datos_lom_general as  $fila  ){         $smarty->assign('id_tec', $fila->id_technical);         $smarty->assign('id_format1', $fila->id_format);         $smarty->assign('size', $fila->size);         $smarty->assign('location', $fila->location);         $smarty->assign('requirement', $fila->requirement);       }     }      }   $smarty->assign('app_dir', $app_dir);   $smarty->assign('pantalla', $pantalla);   $smarty->assign('id_lom', $id_lom);   $smarty->display('editar.tpl');   $p->pie(); ?>
  7. Hi! I have a problem! The system I work with is a Fedora with MySql and Php 4. In the application there is a FORM to introduce data in the DDBB, and there are some obligatory fields, so there is a typical JS function that, on submit and before saving the information with other php script, it checks if there are any blank fields and shows a typical error message. This was working correctly until some collateral effects appeared after changing some SQL querys. The problem now is that anyone can save the information with all the mandatory fields left blank. And this is not the expected behaviour... I've been checking all the code and making some changes during the last month but I can´t get the solution. It is not neccesary to say that I am not an experienced developer ... So I am asking for some help please, because I am desperated for a solution... Maybe this has happened to someone before? ... or is  a typical error? Or maybe someone know other solutions or debuging methods to focus the problem? Thanks in advance!
×
×
  • 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.