Jump to content

Redirecting after submit button...


BigX

Recommended Posts

Hi guys,

 

I have a hopefully simple question! I have a page with multiple submit (POST) forms. The page name is 'ingelogd_formulier_invullen' en after submitting one of the forms on the page I want to be redirected to another page! For example I have this:

 

// Make an insert transaction instance
$ins_poule_d = new tNG_insert($conn_ekpoule08);
$tNGs->addTransaction($ins_poule_d);
// Register triggers
$ins_poule_d->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert6");
$ins_poule_d->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation5);
$ins_poule_d->registerTrigger("END", "Trigger_Default_Redirect", 99, "invullen_succes_poule_d.php");
// Add columns
$ins_poule_d->setTable("poule_d");
$ins_poule_d->addColumn("user_id", "STRING_TYPE", "POST", "user_id", "{SESSION.kt_login_id}");
$ins_poule_d->addColumn("spa_rus_uitslag", "STRING_TYPE", "POST", "spa_rus_uitslag");
$ins_poule_d->addColumn("spa_rus_toto", "STRING_TYPE", "POST", "spa_rus_toto");
$ins_poule_d->addColumn("gri_zwe_uitslag", "STRING_TYPE", "POST", "gri_zwe_uitslag");
$ins_poule_d->addColumn("gri_zwe_toto", "STRING_TYPE", "POST", "gri_zwe_toto");
$ins_poule_d->addColumn("zwe_spa_uitslag", "STRING_TYPE", "POST", "zwe_spa_uitslag");
$ins_poule_d->addColumn("zwe_spa_toto", "STRING_TYPE", "POST", "zwe_spa_toto");
$ins_poule_d->addColumn("gri_rus_uitslag", "STRING_TYPE", "POST", "gri_rus_uitslag");
$ins_poule_d->addColumn("gri_rus_toto", "STRING_TYPE", "POST", "gri_rus_toto");
$ins_poule_d->addColumn("gri_spa_uitslag", "STRING_TYPE", "POST", "gri_spa_uitslag");
$ins_poule_d->addColumn("gri_spa_toto", "STRING_TYPE", "POST", "gri_spa_toto");
$ins_poule_d->addColumn("rus_zwe_uitslag", "STRING_TYPE", "POST", "rus_zwe_uitslag");
$ins_poule_d->addColumn("rus_zwe_toto", "STRING_TYPE", "POST", "rus_zwe_toto");
$ins_poule_d->addColumn("1e_poule_d", "STRING_TYPE", "POST", "1e_poule_d");
$ins_poule_d->addColumn("2e_poule_d", "STRING_TYPE", "POST", "2e_poule_d");
$ins_poule_d->addColumn("3e_poule_d", "STRING_TYPE", "POST", "3e_poule_d");
$ins_poule_d->addColumn("4e_poule_d", "STRING_TYPE", "POST", "4e_poule_d");
$ins_poule_d->setPrimaryKey("user_id", "NUMERIC_TYPE");

 

In this example I want to be redirected to 'invullen_succes_poule_d.php' and it works fine! But in the next example:

 

// Make an insert transaction instance
$ins_kwartfinales = new tNG_insert($conn_ekpoule08);
$tNGs->addTransaction($ins_kwartfinales);
// Register triggers
$ins_kwartfinales->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert7");
$ins_kwartfinales->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation6);
$ins_kwartfinales->registerTrigger("END", "Trigger_Default_Redirect", 99, "invullen_succes_kwartfinales.php");
// Add columns
$ins_kwartfinales->setTable("kwartfinales");
$ins_kwartfinales->addColumn("user_id", "STRING_TYPE", "POST", "user_id", "{SESSION.kt_login_id}");
$ins_kwartfinales->addColumn("1eA_2eB_uitslag", "STRING_TYPE", "POST", "1eA_2eB_uitslag");
$ins_kwartfinales->addColumn("1eA_2eB_toto", "STRING_TYPE", "POST", "1eA_2eB_toto");
$ins_kwartfinales->addColumn("1eB_2eA_uitslag", "STRING_TYPE", "POST", "1eB_2eA_uitslag");
$ins_kwartfinales->addColumn("1eB_2eA_toto", "STRING_TYPE", "POST", "1eB_2eA_toto");
$ins_kwartfinales->addColumn("1eC_2eD_uitslag", "STRING_TYPE", "POST", "1eC_2eD_uitslag");
$ins_kwartfinales->addColumn("1eC_2eD_toto", "STRING_TYPE", "POST", "1eC_2eD_toto");
$ins_kwartfinales->addColumn("1eD_2eC_uitslag", "STRING_TYPE", "POST", "1eD_2eC_uitslag");
$ins_kwartfinales->addColumn("1eD_2eC_toto", "STRING_TYPE", "POST", "1eD_2eC_toto");
$ins_kwartfinales->addColumn("winnaar_25", "STRING_TYPE", "POST", "winnaar_25");
$ins_kwartfinales->addColumn("winnaar_26", "STRING_TYPE", "POST", "winnaar_26");
$ins_kwartfinales->addColumn("winnaar_27", "STRING_TYPE", "POST", "winnaar_27");
$ins_kwartfinales->addColumn("winnaar_28", "STRING_TYPE", "POST", "winnaar_28");
$ins_kwartfinales->setPrimaryKey("user_id", "NUMERIC_TYPE");

 

In this example I wanted to be redirected to 'invullen_succes_kwartfinales.php' but instead I am redirected to 'ingelogd_formulier_invullen'! In other words the page just refreshes and the data also isn't submitted into the database!! The connection with the database is the same in both cases ($conn_ekpoule08) and the tables the data has to be submitted to are: 'poule_a' and 'kwartfinales' respectively! Anyone has an idea why I am not redirected to the right page in the second example??

 

Thanks for your time!

 

Greetz

Link to comment
Share on other sites

Hmm I see that nobody responded to my previous post! Maybe it wasn't quite clear what I meant?! Can anyone please help me with this? Do I have to post more info (whole code maybe? Is quite big by the way)? Maybe it's more clear when I give the site:

 

http://joost.dvdcollectie.com/ekpoule2008/ingelogd_formulier_invullen.php

 

This is the page it is all about! people that are logged in (you won't be when you click on this link) need to fill out the form! The first 4 forms work perfectly, but the forms after that (starting with 'kwartfinales' won't POST the data and instead of redirecting to the desired page it just refreshes this page!

 

Anyone??

 

Thanks in advance!

Link to comment
Share on other sites

i cant see any lines for redirection  can you us that line where your are attempting to redirect ?

 

// Register triggers

$ins_kwartfinales->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert7");

$ins_kwartfinales->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation6);

$ins_kwartfinales->registerTrigger("END", "Trigger_Default_Redirect", 99, "invullen_succes_kwartfinales.php");

// Add columns

 

You mean this? This was in the piece of code above, but maybe this isn't what you mean?!

Link to comment
Share on other sites

Hmm I searched for that but I couldn't find it! I only found such a combination here:

$logoutGoTo = "index.php";
  if ($logoutGoTo) {
    header("Location: $logoutGoTo");
    exit;

 

But I guess that is for the logout action  ;D

 

I'll paste the whole code above the <body> here, maybe you can find it faster than me... :)

 

<?php require_once('Connections/ekpoule08.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
  session_start();
}

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  //to fully log out a visitor we need to clear the session varialbles
  $_SESSION['MM_Username'] = NULL;
  $_SESSION['MM_UserGroup'] = NULL;
  $_SESSION['PrevUrl'] = NULL;
  unset($_SESSION['MM_Username']);
  unset($_SESSION['MM_UserGroup']);
  unset($_SESSION['PrevUrl']);

  $logoutGoTo = "index.php";
  if ($logoutGoTo) {
    header("Location: $logoutGoTo");
    exit;
  }
}
?>
<?php require_once('Connections/ekpoule08.php'); ?>
<?php
// Load the common classes
require_once('includes/common/KT_common.php');

// Load the tNG classes
require_once('includes/tng/tNG.inc.php');

// Make a transaction dispatcher instance
$tNGs = new tNG_dispatcher("");

// Make unified connection variable
$conn_ekpoule08 = new KT_connection($ekpoule08, $database_ekpoule08);

// Start trigger
$formValidation = new tNG_FormValidation();
$formValidation->addField("user_id", true, "text", "", "", "", "");
$formValidation->addField("ZWI_TSJ_uitslag", true, "text", "", "3", "3", "Vul de eindstand van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld 1-1");
$formValidation->addField("ZWI_TSJ_poule", true, "text", "", "1", "1", "Vul de toto uitslag in en gebruik 1 teken: 1 = winst team A, 2 = winst team B en X = gelijkspel");
$formValidation->addField("POR_TUR_uitslag", true, "text", "", "3", "3", "Vul de eindstand van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld 1-1");
$formValidation->addField("POR_TUR_poule", true, "text", "", "1", "1", "Vul de toto uitslag in en gebruik 1 teken: 1 = winst team A, 2 = winst team B en X = gelijkspel");
$formValidation->addField("TSJ_POR_uitslag", true, "text", "", "3", "3", "Vul de eindstand van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld 1-1");
$formValidation->addField("TSJ_POR_poule", true, "text", "", "1", "1", "Vul de toto uitslag in en gebruik 1 teken: 1 = winst team A, 2 = winst team B en X = gelijkspel");
$formValidation->addField("ZWI_TUR_uitslag", true, "text", "", "3", "3", "Vul de eindstand van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld 1-1");
$formValidation->addField("ZWI_TUR_poule", true, "text", "", "1", "1", "Vul de toto uitslag in en gebruik 1 teken: 1 = winst team A, 2 = winst team B en X = gelijkspel");
$formValidation->addField("ZWI_POR_uitslag", true, "text", "", "3", "3", "Vul de eindstand van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld 1-1");
$formValidation->addField("ZWI_POR_poule", true, "text", "", "1", "1", "Vul de toto uitslag in en gebruik 1 teken: 1 = winst team A, 2 = winst team B en X = gelijkspel");
$formValidation->addField("TUR_TSJ_uitslag", true, "text", "", "3", "3", "Vul de eindstand van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld 1-1");
$formValidation->addField("TUR_TSJ_poule", true, "text", "", "1", "1", "Vul de toto uitslag in en gebruik 1 teken: 1 = winst team A, 2 = winst team B en X = gelijkspel");
$formValidation->addField("1e_poule_a", true, "text", "", "1", "15", "Vul de #1 van deze poule in!");
$formValidation->addField("2e_poule_a", true, "text", "", "1", "15", "Vul de #2 van deze poule in!");
$formValidation->addField("3e_poule_a", true, "text", "", "1", "15", "Vul de #3 van deze poule in!");
$formValidation->addField("4e_poule_a", true, "text", "", "1", "15", "Vul de #4 van deze poule in!");
$tNGs->prepareValidation($formValidation);
// End trigger

// Start trigger
$formValidation1 = new tNG_FormValidation();
$formValidation1->addField("user_id", true, "text", "", "", "", "");
$formValidation1->addField("oos_kro_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-2");
$formValidation1->addField("oos_kro_toto", true, "text", "", "1", "1", "Vul hier de toto uitslag inen gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation1->addField("dui_pol_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-2");
$formValidation1->addField("dui_pol_toto", true, "text", "", "1", "1", "Vul hier de toto uitslag inen gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation1->addField("kro_dui_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-2");
$formValidation1->addField("kro_dui_toto", true, "text", "", "1", "1", "Vul hier de toto uitslag inen gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation1->addField("oos_pol_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-2");
$formValidation1->addField("oos_pol_toto", true, "text", "", "1", "1", "Vul hier de toto uitslag inen gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation1->addField("pol_kro_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-2");
$formValidation1->addField("pol_kro_toto", true, "text", "", "1", "1", "Vul hier de toto uitslag inen gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation1->addField("oos_dui_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-2");
$formValidation1->addField("oos_dui_toto", true, "text", "", "1", "1", "Vul hier de toto uitslag inen gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation1->addField("1e_poule_b", true, "text", "", "1", "15", "Vul hier de #1 van poule B in!");
$formValidation1->addField("2e_poule_b", true, "text", "", "1", "15", "Vul hier de #2 van poule B in!");
$formValidation1->addField("3e_poule_b", true, "text", "", "1", "15", "Vul hier de #3 van poule B in!");
$formValidation1->addField("4e_poule_b", true, "text", "", "1", "15", "Vul hier de #4 van poule B in!");
$tNGs->prepareValidation($formValidation1);
// End trigger

// Start trigger
$formValidation2 = new tNG_FormValidation();
$formValidation2->addField("user_id", true, "text", "", "", "", "");
$formValidation2->addField("ZWI_TSJ_uitslag", true, "text", "", "3", "3", "Vul de eindstand van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld 1-1");
$formValidation2->addField("ZWI_TSJ_poule", true, "text", "", "1", "1", "Vul de toto uitslag in en gebruik 1 teken: 1 = winst team A, 2 = winst team B en X = gelijkspel");
$formValidation2->addField("POR_TUR_uitslag", true, "text", "", "3", "3", "Vul de eindstand van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld 1-1");
$formValidation2->addField("POR_TUR_poule", true, "text", "", "1", "1", "Vul de toto uitslag in en gebruik 1 teken: 1 = winst team A, 2 = winst team B en X = gelijkspel");
$formValidation2->addField("TSJ_POR_uitslag", true, "text", "", "3", "3", "Vul de eindstand van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld 1-1");
$formValidation2->addField("TSJ_POR_poule", true, "text", "", "1", "1", "Vul de toto uitslag in en gebruik 1 teken: 1 = winst team A, 2 = winst team B en X = gelijkspel");
$formValidation2->addField("ZWI_TUR_uitslag", true, "text", "", "3", "3", "Vul de eindstand van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld 1-1");
$formValidation2->addField("ZWI_TUR_poule", true, "text", "", "1", "1", "Vul de toto uitslag in en gebruik 1 teken: 1 = winst team A, 2 = winst team B en X = gelijkspel");
$formValidation2->addField("ZWI_POR_uitslag", true, "text", "", "3", "3", "Vul de eindstand van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld 1-1");
$formValidation2->addField("ZWI_POR_poule", true, "text", "", "1", "1", "Vul de toto uitslag in en gebruik 1 teken: 1 = winst team A, 2 = winst team B en X = gelijkspel");
$formValidation2->addField("TUR_TSJ_uitslag", true, "text", "", "3", "3", "Vul de eindstand van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld 1-1");
$formValidation2->addField("TUR_TSJ_poule", true, "text", "", "1", "1", "Vul de toto uitslag in en gebruik 1 teken: 1 = winst team A, 2 = winst team B en X = gelijkspel");
$formValidation2->addField("1e_poule_a", true, "text", "", "1", "15", "Vul de #1 van deze poule in!");
$formValidation2->addField("2e_poule_a", true, "text", "", "1", "15", "Vul de #2 van deze poule in!");
$formValidation2->addField("3e_poule_a", true, "text", "", "1", "15", "Vul de #3 van deze poule in!");
$formValidation2->addField("4e_poule_a", true, "text", "", "1", "15", "Vul de #4 van deze poule in!");
$tNGs->prepareValidation($formValidation2);
// End trigger

// Start trigger
$formValidation3 = new tNG_FormValidation();
$formValidation3->addField("user_id", true, "text", "", "", "", "");
$formValidation3->addField("oos_kro_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-2");
$formValidation3->addField("oos_kro_toto", true, "text", "", "1", "1", "Vul hier de toto uitslag inen gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation3->addField("dui_pol_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-2");
$formValidation3->addField("dui_pol_toto", true, "text", "", "1", "1", "Vul hier de toto uitslag inen gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation3->addField("kro_dui_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-2");
$formValidation3->addField("kro_dui_toto", true, "text", "", "1", "1", "Vul hier de toto uitslag inen gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation3->addField("oos_pol_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-2");
$formValidation3->addField("oos_pol_toto", true, "text", "", "1", "1", "Vul hier de toto uitslag inen gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation3->addField("pol_kro_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-2");
$formValidation3->addField("pol_kro_toto", true, "text", "", "1", "1", "Vul hier de toto uitslag inen gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation3->addField("oos_dui_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-2");
$formValidation3->addField("oos_dui_toto", true, "text", "", "1", "1", "Vul hier de toto uitslag inen gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation3->addField("1e_poule_b", true, "text", "", "1", "15", "Vul hier de #1 van poule B in!");
$formValidation3->addField("2e_poule_b", true, "text", "", "1", "15", "Vul hier de #2 van poule B in!");
$formValidation3->addField("3e_poule_b", true, "text", "", "1", "15", "Vul hier de #3 van poule B in!");
$formValidation3->addField("4e_poule_b", true, "text", "", "1", "15", "Vul hier de #4 van poule B in!");
$tNGs->prepareValidation($formValidation3);
// End trigger

// Start trigger
$formValidation4 = new tNG_FormValidation();
$formValidation4->addField("user_id", true, "text", "", "", "", "");
$formValidation4->addField("roe_fra_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation4->addField("roe_fra_toto", true, "text", "", "1", "1", "Vul de uitslag van de toto in: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation4->addField("ned_ita_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation4->addField("ned_ita_toto", true, "text", "", "1", "1", "Vul de uitslag van de toto in: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation4->addField("ita_roe_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation4->addField("ita_roe_toto", true, "text", "", "1", "1", "Vul de uitslag van de toto in: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation4->addField("ned_fra_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation4->addField("ned_fra_toto", true, "text", "", "1", "1", "Vul de uitslag van de toto in: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation4->addField("ned_roe_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation4->addField("ned_roe_toto", true, "text", "", "1", "1", "Vul de uitslag van de toto in: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation4->addField("fra_ita_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation4->addField("fra_ita_toto", true, "text", "", "1", "1", "Vul de uitslag van de toto in: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation4->addField("1e_poule_c", true, "text", "", "1", "15", "Vul hier de winnaar in van poule C!");
$formValidation4->addField("2e_poule_c", true, "text", "", "1", "15", "Vul hier de #2 in van poule C!");
$formValidation4->addField("3e_poule_c", true, "text", "", "1", "15", "Vul hier de #3 in van poule C!");
$formValidation4->addField("4e_poule_c", true, "text", "", "1", "15", "Vul hier de #4 in van poule C!");
$tNGs->prepareValidation($formValidation4);
// End trigger

// Start trigger
$formValidation5 = new tNG_FormValidation();
$formValidation5->addField("user_id", true, "text", "", "", "", "");
$formValidation5->addField("spa_rus_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation5->addField("spa_rus_toto", true, "text", "", "1", "1", "Vul hier de uitslag van de toto in en gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation5->addField("gri_zwe_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation5->addField("gri_zwe_toto", true, "text", "", "1", "1", "Vul hier de uitslag van de toto in en gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation5->addField("zwe_spa_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation5->addField("zwe_spa_toto", true, "text", "", "1", "1", "Vul hier de uitslag van de toto in en gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation5->addField("gri_rus_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation5->addField("gri_rus_toto", true, "text", "", "1", "1", "Vul hier de uitslag van de toto in en gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation5->addField("gri_spa_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation5->addField("gri_spa_toto", true, "text", "", "1", "1", "Vul hier de uitslag van de toto in en gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation5->addField("rus_zwe_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation5->addField("rus_zwe_toto", true, "text", "", "1", "1", "Vul hier de uitslag van de toto in en gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation5->addField("1e_poule_d", true, "text", "", "1", "15", "Vul hier de winnaar van poule D in!");
$formValidation5->addField("2e_poule_d", true, "text", "", "1", "15", "Vul hier de #2 van poule D in!");
$formValidation5->addField("3e_poule_d", true, "text", "", "1", "15", "Vul hier de #3 van poule D in!");
$formValidation5->addField("4e_poule_d", true, "text", "", "1", "15", "Vul hier de #4 van poule D in!");
$tNGs->prepareValidation($formValidation5);
// End trigger

// Start trigger
$formValidation6 = new tNG_FormValidation();
$formValidation6->addField("user_id", true, "text", "", "", "", "");
$formValidation6->addField("1eA_2eB_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation6->addField("1eA_2eB_toto", true, "text", "", "1", "1", "Vul hier de uitslag van de toto in en gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation6->addField("1eB_2eA_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation6->addField("1eB_2eA_toto", true, "text", "", "1", "1", "Vul hier de uitslag van de toto in en gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation6->addField("1eC_2eD_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation6->addField("1eC_2eD_toto", true, "text", "", "1", "1", "Vul hier de uitslag van de toto in en gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation6->addField("1eD_2eC_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd in en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation6->addField("1eD_2eC_toto", true, "text", "", "1", "1", "Vul hier de uitslag van de toto in en gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation6->addField("winnaar_25", true, "text", "", "1", "15", "Vul hier de winnaar in van de wedstrijd: 1e poule A - 2e poule B");
$formValidation6->addField("winnaar_26", true, "text", "", "1", "15", "Vul hier de winnaar in van de wedstrijd: 1e poule B - 2e poule A");
$formValidation6->addField("winnaar_27", true, "text", "", "1", "15", "Vul hier de winnaar in van de wedstrijd: 1e poule C - 2e poule D");
$formValidation6->addField("winnaar_28", true, "text", "", "1", "15", "Vul hier de winnaar in van de wedstrijd: 1e poule D - 2e poule C");
$tNGs->prepareValidation($formValidation6);
// End trigger

// Start trigger
$formValidation7 = new tNG_FormValidation();
$formValidation7->addField("user_id", true, "text", "", "", "", "");
$formValidation7->addField("w25_w26_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation7->addField("w25_w26_toto", true, "text", "", "1", "1", "Vul hier de uitslag van de toto in en gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation7->addField("w27_w28_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de wedstrijd en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation7->addField("w27_w28_toto", true, "text", "", "1", "1", "Vul hier de uitslag van de toto in en gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation7->addField("winnaar_29", true, "text", "", "1", "15", "Vul hier de winnaar in van wedstrijd #29!");
$formValidation7->addField("winnaar_30", true, "text", "", "1", "15", "Vul hier de winnaar in van wedstrijd #30!");
$tNGs->prepareValidation($formValidation7);
// End trigger

// Start trigger
$formValidation8 = new tNG_FormValidation();
$formValidation8->addField("user_id", true, "text", "", "", "", "");
$formValidation8->addField("w29_w30_uitslag", true, "text", "", "3", "3", "Vul hier de uitslag van de finale in en gebruik max. 3 tekens, bijvoorbeeld: 1-1");
$formValidation8->addField("w29_w30_toto", true, "text", "", "1", "1", "Vul hier de uitslag van de toto in en gebruik 1 teken: 1 = thuis wint, 2 = uit wint, X = gelijkspel");
$formValidation8->addField("kampioen", true, "text", "", "1", "15", "Vul hier de europees kampioen 2008 in!");
$formValidation8->addField("topscorer_goals", true, "numeric", "", "", "", "Vul hier het aantal doelpunten in dat jij denkt dat de topscorer van het ek gaat maken!");
$formValidation8->addField("topscorer_land", true, "text", "", "1", "15", "Vul jij het land in, waarvan jij verwacht dat de topscorer vandaan komt!");
$formValidation8->addField("topscorer_naam", true, "text", "", "1", "15", "Vul hier de naam in van de topscorer van het EK 2008!");
$tNGs->prepareValidation($formValidation8);
// End trigger

session_start(); 
session_register("kt_login_user");
$kt_login_user = $HTTP_POST_VARS['kt_login_user'];
session_register("kt_login_id");
$kt_login_id = $HTTP_POST_VARS['kt_login_id'];
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$colname_rsUser_info_filtered = "-1";
if (isset($_SESSION['kt_login_id'])) {
  $colname_rsUser_info_filtered = $_SESSION['kt_login_id'];
}
mysql_select_db($database_ekpoule08, $ekpoule08);
$query_rsUser_info_filtered = sprintf("SELECT * FROM ekpoule_users WHERE id_usr = %s", GetSQLValueString($colname_rsUser_info_filtered, "int"));
$rsUser_info_filtered = mysql_query($query_rsUser_info_filtered, $ekpoule08) or die(mysql_error());
$row_rsUser_info_filtered = mysql_fetch_assoc($rsUser_info_filtered);
$totalRows_rsUser_info_filtered = mysql_num_rows($rsUser_info_filtered);

$colname_pouleA_1en2 = "-1";
if (isset($_SESSION['kt_login_id'])) {
  $colname_pouleA_1en2 = $_SESSION['kt_login_id'];
}
mysql_select_db($database_ekpoule08, $ekpoule08);
$query_pouleA_1en2 = sprintf("SELECT * FROM `poule a` WHERE user_id = %s", GetSQLValueString($colname_pouleA_1en2, "text"));
$pouleA_1en2 = mysql_query($query_pouleA_1en2, $ekpoule08) or die(mysql_error());
$row_pouleA_1en2 = mysql_fetch_assoc($pouleA_1en2);
$totalRows_pouleA_1en2 = mysql_num_rows($pouleA_1en2);

$colname_rsPouleB_1en2 = "-1";
if (isset($_SESSION['kt_login_id'])) {
  $colname_rsPouleB_1en2 = $_SESSION['kt_login_id'];
}
mysql_select_db($database_ekpoule08, $ekpoule08);
$query_rsPouleB_1en2 = sprintf("SELECT * FROM poule_b WHERE user_id = %s", GetSQLValueString($colname_rsPouleB_1en2, "int"));
$rsPouleB_1en2 = mysql_query($query_rsPouleB_1en2, $ekpoule08) or die(mysql_error());
$row_rsPouleB_1en2 = mysql_fetch_assoc($rsPouleB_1en2);
$totalRows_rsPouleB_1en2 = mysql_num_rows($rsPouleB_1en2);

$colname_rsPouleC_1en2 = "-1";
if (isset($_SESSION['kt_login_id'])) {
  $colname_rsPouleC_1en2 = $_SESSION['kt_login_id'];
}
mysql_select_db($database_ekpoule08, $ekpoule08);
$query_rsPouleC_1en2 = sprintf("SELECT * FROM poule_c WHERE user_id = %s", GetSQLValueString($colname_rsPouleC_1en2, "int"));
$rsPouleC_1en2 = mysql_query($query_rsPouleC_1en2, $ekpoule08) or die(mysql_error());
$row_rsPouleC_1en2 = mysql_fetch_assoc($rsPouleC_1en2);
$totalRows_rsPouleC_1en2 = mysql_num_rows($rsPouleC_1en2);

$colname_rsPouleD_1en2 = "-1";
if (isset($_SESSION['kt_login_id'])) {
  $colname_rsPouleD_1en2 = $_SESSION['kt_login_id'];
}
mysql_select_db($database_ekpoule08, $ekpoule08);
$query_rsPouleD_1en2 = sprintf("SELECT * FROM poule_d WHERE user_id = %s", GetSQLValueString($colname_rsPouleD_1en2, "int"));
$rsPouleD_1en2 = mysql_query($query_rsPouleD_1en2, $ekpoule08) or die(mysql_error());
$row_rsPouleD_1en2 = mysql_fetch_assoc($rsPouleD_1en2);
$totalRows_rsPouleD_1en2 = mysql_num_rows($rsPouleD_1en2);

$colname_rsKwartfinales = "-1";
if (isset($_SESSION['kt_login_id'])) {
  $colname_rsKwartfinales = $_SESSION['kt_login_id'];
}
mysql_select_db($database_ekpoule08, $ekpoule08);
$query_rsKwartfinales = sprintf("SELECT * FROM kwartfinales WHERE user_id = %s", GetSQLValueString($colname_rsKwartfinales, "int"));
$rsKwartfinales = mysql_query($query_rsKwartfinales, $ekpoule08) or die(mysql_error());
$row_rsKwartfinales = mysql_fetch_assoc($rsKwartfinales);
$totalRows_rsKwartfinales = mysql_num_rows($rsKwartfinales);

$colname_rsHalvefinales = "-1";
if (isset($_SESSION['kt_login_id'])) {
  $colname_rsHalvefinales = $_SESSION['kt_login_id'];
}
mysql_select_db($database_ekpoule08, $ekpoule08);
$query_rsHalvefinales = sprintf("SELECT * FROM halve_finales WHERE user_id = %s", GetSQLValueString($colname_rsHalvefinales, "int"));
$rsHalvefinales = mysql_query($query_rsHalvefinales, $ekpoule08) or die(mysql_error());
$row_rsHalvefinales = mysql_fetch_assoc($rsHalvefinales);
$totalRows_rsHalvefinales = mysql_num_rows($rsHalvefinales);

[DELETED
// Make an insert transaction instance
// Register triggers
// Add columns
FOR ALL THE FORMS DUE TO THE MAXIMUM CHARACTERS AMOUNT]

// Execute all the registered transactions
$tNGs->executeTransactions();

// Get the transaction recordset
$rs_poule_a_ = $tNGs->getRecordset("`poule a`");
$row_rs_poule_a_ = mysql_fetch_assoc($rs_poule_a_);
$totalRows_rs_poule_a_ = mysql_num_rows($rs_poule_a_);

// Get the transaction recordset
$rspoule_b = $tNGs->getRecordset("poule_b");
$row_rspoule_b = mysql_fetch_assoc($rspoule_b);
$totalRows_rspoule_b = mysql_num_rows($rspoule_b);

// Get the transaction recordset
$rspoule_c = $tNGs->getRecordset("poule_c");
$row_rspoule_c = mysql_fetch_assoc($rspoule_c);
$totalRows_rspoule_c = mysql_num_rows($rspoule_c);

// Get the transaction recordset
$rspoule_d = $tNGs->getRecordset("poule_d");
$row_rspoule_d = mysql_fetch_assoc($rspoule_d);
$totalRows_rspoule_d = mysql_num_rows($rspoule_d);

// Get the transaction recordset
$rskwartfinales = $tNGs->getRecordset("kwartfinales");
$row_rskwartfinales = mysql_fetch_assoc($rskwartfinales);
$totalRows_rskwartfinales = mysql_num_rows($rskwartfinales);

// Get the transaction recordset
$rshalve_finales = $tNGs->getRecordset("halve_finales");
$row_rshalve_finales = mysql_fetch_assoc($rshalve_finales);
$totalRows_rshalve_finales = mysql_num_rows($rshalve_finales);

// Get the transaction recordset
$rsfinale_topscorer = $tNGs->getRecordset("finale_topscorer");
$row_rsfinale_topscorer = mysql_fetch_assoc($rsfinale_topscorer);
$totalRows_rsfinale_topscorer = mysql_num_rows($rsfinale_topscorer);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

I know the code isn't always that efficient but that's because I started out with Dreamweaver and later started to work in the code myself (with help of a friend, who is good in PHP but gone for some weeks)!!

 

Thanks for helping me out here!!

 

P.S. maybe it's worth noticing that all the forms did work some time ago but know when the site is finished and I'm testing the site it just won't work from form 'kwartfinales' to the bottom!

 

Link to comment
Share on other sites

well the problem isn't the logout action above since logging out goes well!

The goal of my site is a soccer poule for the upcoming european championships where friends/familie/colleagues of mine can register on the site (joost.dvdcollectie.com/ekpoule2008) and fill in their predictions for the tournament and all point etc will be rewarded automatically! Everything worked fine but know I have a problem on the page where they insert their predictions! The group phase works well, all their entries are stored in the mysql database and the people are perfectly redirected to the 'invullen_succes page' of that form, but when they try to save the form 'kwartfinales' (meaning quarter finales) on this page

http://joost.dvdcollectie.com/ekpoule2008/ingelogd_formulier_invullen.php the trouble begins since thir entries aren't stored in the database (in phpmyadmin i don't see any new data in the specific table) and instead of redirecting the user to the invullen_succes page (fill in was a succes page) it just reloads the page!

 

Any clearer on what I'm trying to accomplish?? If you need to see the whole code maybe I'll have to send the file on msn??

 

Greetz

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.