Jump to content

BoarderLine

Members
  • Posts

    140
  • Joined

  • Last visited

    Never

Everything posted by BoarderLine

  1. Thanks - Yeah they are with MySQL unfortunately
  2. Thanks mmarif4u i will look into that, how about alternating the random image with a set one?
  3. Hi All, I am not entirely familiar with php and am trying to display an image on my site from a recordset which will reload every several seconds with a fixed(set) image. Example: Random image from rs (time delay) set image (time delay) Random image from rs etc.. Currently I have the following code that is working well for displaying a random image however I want to change 2 things with it 1) as it is it only alternates on page refresh, so how would i make it alternate every several seconds? 2) How would I make it reload to a set image and alternate with an image from the database? SELECT ImageFile rand() as random_number FROM clublistingpics ORDER BY random_number DESC LIMIT 1 Thanks to anyone that can offer advise with this.
  4. Yes it does redirect to the second page (with no error messages). Both files are in the same folder. I have changed the Form 'Address' name to "Address1" and changed the code for setting the Address SESSION accordingly to: if (isset($_POST['Address1'])) $_SESSION['Address'] = $_POST['Address1']; But this has not fixed the problem:-( I have tried setting the SESSION with a trigger so that i can be sure the SESSION is created before the redirect occurs using: //start SESSION_SET_ADDRESS trigger function SESSION_SET_ADDRESS(&$tNG) { if (isset($_POST['Address'])) $_SESSION['Address'] = $_POST['Address']; } $ins_clubs->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1"); $ins_clubs->registerTrigger("END", "Trigger_Default_Redirect", 99, "Reg_Attract_Pics.php"); $ins_clubs->registerTrigger("BEFORE", "SESSION_SET_ADDRESS", 50); But this does not work either. BIG??? and :-( :-(
  5. Ok I have it working now without the error message Notice: Undefined index: Address in C:\xampp\htdocs\Reg_Club_Pics.php on line 102, however the variable is still not being displayed. So I assume if there is no error it is getting it's value ok but it's empty??? Here are my updated pages. Page 1 <?php if (!isset($_SESSION)) session_start(); ?> <?php require_once('Connections/Stuff2do.php'); ?> <?php //MX Widgets3 include require_once('includes/wdg/WDG.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_Stuff2do = new KT_connection($Stuff2do, $database_Stuff2do); 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; } } mysql_select_db($database_Stuff2do, $Stuff2do); $query_Cities = "SELECT City FROM cities ORDER BY City ASC"; $Cities = mysql_query($query_Cities, $Stuff2do) or die(mysql_error()); $row_Cities = mysql_fetch_assoc($Cities); $totalRows_Cities = mysql_num_rows($Cities); mysql_select_db($database_Stuff2do, $Stuff2do); $query_Recordset1 = "SELECT CatID, EventCat FROM event_categories ORDER BY EventCat ASC"; $Recordset1 = mysql_query($query_Recordset1, $Stuff2do) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); mysql_select_db($database_Stuff2do, $Stuff2do); $query_Recordset2 = "SELECT * FROM event_subcats ORDER BY subcat_name ASC"; $Recordset2 = mysql_query($query_Recordset2, $Stuff2do) or die(mysql_error()); $row_Recordset2 = mysql_fetch_assoc($Recordset2); $totalRows_Recordset2 = mysql_num_rows($Recordset2); // Make an insert transaction instance $ins_clubs = new tNG_insert($conn_Stuff2do); $tNGs->addTransaction($ins_clubs); // Register triggers $ins_clubs->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1"); $ins_clubs->registerTrigger("END", "Trigger_Default_Redirect", 99, "Reg_Attract_Pics.php"); // Add columns $ins_clubs->setTable("clubs"); $ins_clubs->addColumn("ListingCat", "STRING_TYPE", "POST", "select"); $ins_clubs->addColumn("ListSubCat", "STRING_TYPE", "POST", "select1"); $ins_clubs->addColumn("ClubName", "STRING_TYPE", "POST", "Club_Name"); $ins_clubs->addColumn("ClubContact", "STRING_TYPE", "POST", "Email1", "{SESSION.kt_login_user}"); $ins_clubs->addColumn("UserID", "NUMERIC_TYPE", "SESSION", "kt_login_id", "{SESSION.kt_login_id}"); $ins_clubs->addColumn("Discription", "STRING_TYPE", "POST", "Description"); $ins_clubs->addColumn("City", "STRING_TYPE", "POST", "city1", "{SESSION.kt_City}"); $ins_clubs->addColumn("Address", "STRING_TYPE", "POST", "Address"); $ins_clubs->setPrimaryKey("ClubID", "NUMERIC_TYPE"); // Execute all the registered transactions $tNGs->executeTransactions(); // Get the transaction recordset $rsclubs = $tNGs->getRecordset("clubs"); $row_rsclubs = mysql_fetch_assoc($rsclubs); $totalRows_rsclubs = mysql_num_rows($rsclubs); if (isset($_POST['KT_Insert1'])) { $add = $_POST['Address']; $_SESSION['Address'] = $add;} ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wdg="http://ns.adobe.com/addt"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Stuff2do - Club Registration</title> <link href="css/screen.css" rel="stylesheet" type="text/css" media="all" /> <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationCheckbox.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/validation.css" rel="stylesheet" type="text/css" media="all" /> <script type="text/javascript" src="SpryAssets/SpryValidationTextField.js"></script> <script type="text/javascript" src="SpryAssets/SpryValidationSelect.js"></script> <script type="text/javascript" src="SpryAssets/SpryValidationTextarea.js"></script> <script type="text/javascript" src="SpryAssets/SpryValidationCheckbox.js"></script> <script src="includes/skins/style.js" type="text/javascript"></script> <script src="includes/common/js/base.js" type="text/javascript"></script> <script src="includes/common/js/utility.js" type="text/javascript"></script> <script type="text/javascript" src="includes/common/js/sigslot_core.js"></script> <script type="text/javascript" src="includes/wdg/classes/MXWidgets.js"></script> <script type="text/javascript" src="includes/wdg/classes/MXWidgets.js.php"></script> <script type="text/javascript" src="includes/wdg/classes/JSRecordset.js"></script> <script type="text/javascript" src="includes/wdg/classes/DependentDropdown.js"></script> <?php //begin JSRecordset $jsObject_Recordset2 = new WDG_JsRecordset("Recordset2"); echo $jsObject_Recordset2->getOutput(); //end JSRecordset ?> <link href="includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" /> </head> <body class="oneColFixCtr"> <div id="container"> <div id="mainContent"> <noscript><h1>This page requires JavaScript. Please enable JavaScript in your browser and reload this page.</h1></noscript> <div id="CentralColumn"> <form id="formReg" name="formReg" method="post"> <div id="formregion"> <div id="Club_Name"> <div class="formLabel">Club Name:</div> <input name="Club_Name" type="text" class="input" id="Club_Name" value="" /> <span class="textfieldRequiredMsg">Please enter your Clubs Name.</span> <img src="images/ok.gif" title="Valid" alt="Valid" class="validMsg" border="0"/></div> <div id="City"> <div class="formLabel">City:</div> <select name="city1" id="city1"> <option value="" selected><?php echo $_SESSION['kt_City']; ?></option> <?php do { ?> <option value="<?php echo $row_Cities['City']?>"><?php echo $row_Cities['City']?></option> <?php } while ($row_Cities = mysql_fetch_assoc($Cities)); $rows = mysql_num_rows($Cities); if($rows > 0) { mysql_data_seek($rsCities, 0); $row_Cities = mysql_fetch_assoc($Cities); } ?> </select> <img src="images/ok.gif" title="Valid" alt="Valid" class="validMsg" border="0"/> <span class="selectRequiredMsg">Please select a city.</span> </div> <div id="Address"> <div class="formLabel">Club Address:</div> <input name="Address" type="text" class="input" id="Address" value="" /> <span class="textfieldRequiredMsg">Please enter your Clubs Address</span> <img src="images/ok.gif" title="Valid" alt="Valid" class="validMsg" border="0"/></div> <div id="Cat"> <div class="formLabel">Select a category for your club listing:</div> <select name="select" id="select"> <option value="" <?php if (!(strcmp("", $row_Recordset1['EventCat']))) {echo "selected=\"selected\"";} ?>>Please Select...</option> <?php do { ?><option value="<?php echo $row_Recordset1['CatID']?>"<?php if (!(strcmp($row_Recordset1['CatID'], $row_Recordset1['EventCat']))) {echo "selected=\"selected\"";} ?>><?php echo $row_Recordset1['EventCat']?></option> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); $rows = mysql_num_rows($Recordset1); if($rows > 0) { mysql_data_seek($Recordset1, 0); $row_Recordset1 = mysql_fetch_assoc($Recordset1); } ?> </select> <select name="select1" id="select1" wdg:subtype="DependentDropdown" wdg:type="widget" wdg:recordset="Recordset2" wdg:displayfield="subcat_name" wdg:valuefield="SubCatID" wdg:fkey="CatID" wdg:triggerobject="select" wdg:selected="<?php echo $row_Recordset2['subcat_name']; ?>"> </select> </div> <div id="Description"> <div class="formLabel">Enter your Club Description:</div> <textarea name="Description" id="Description" cols="45" rows="5"></textarea> <img src="images/ok.gif" title="Valid" alt="Valid" class="validMsg" border="0"/> <span class="textareaRequiredMsg">Please enter a description.</span> <span class="textareaMinCharsMsg">Please enter at least 100 characters.</span> <span id="Countvalidta1"> </span> / 2000 </div> <div id="ContactNum"> <div class="formLabel">Club Contact Phone Number:</div> <input name="ContactNum" type="text" class="input" id="ContactNum" value="<?php echo $_SESSION['kt_MobileNum']; ?>" /> <img src="images/ok.gif" title="Valid" alt="Valid" class="validMsg" border="0"/> <span class="textfieldRequiredMsg">Please enter a contact number</span> <span class="textfieldInvalidFormatMsg">Number format required ###-#######</span> </div> <div id="Email"> <div class="formLabelEmail">Club Contact Email Address: <em>(This will not be displayed to the public)</em></div> <input name="Email1" type="text" class="input" id="Email1" value="<?php echo $_SESSION['kt_login_user']; ?>" /> <span class="textfieldRequiredMsg">Please enter a Valid Email Address.</span> <span class="textfieldInvalidFormatMsg">Invalid format</span></div> <img src="images/ok.gif" title="Valid" alt="Valid" class="validMsg" border="0"/> </div> <input name="KT_Insert1" id="KT_Insert1" type="submit" class="submit" value="Next" /> <?php echo $tNGs->getErrorMsg(); ?> <input type="hidden" name="ClubID" id="ClubID" /> </form> </div> <!-- end #mainContent --></div> <!-- end #container --></div> <script type="text/javascript"> var Description = new Spry.Widget.ValidationTextarea("Description", {useCharacterMasking:true, minChars:100, maxChars:2000, counterType:"chars_count", counterId:"Countvalidta1", validateOn:["change"]}); var Club_Name = new Spry.Widget.ValidationTextField("Club_Name", "none", {useCharacterMasking:true, validateOn:["change"]}); var City = new Spry.Widget.ValidationSelect("City", {validateOn:["change"]}); var Address = new Spry.Widget.ValidationTextField("Address", "none", {useCharacterMasking:true, validateOn:["change"]}); var Email = new Spry.Widget.ValidationTextField("Email", "email", {useCharacterMasking:true, validateOn:["blur"]}); var ContactNum = new Spry.Widget.ValidationTextField("ContactNum", "none", {useCharacterMasking:true, format:"\d\d\d-\d\d\d-\d\d\d\d", hint:"###-#######", validateOn:["change"]}); </script> </body> </html> <?php mysql_free_result($Cities); mysql_free_result($Recordset1); mysql_free_result($Recordset2); ?> Page 2 <?php session_start(); ?> <?php require_once('Connections/Stuff2do.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_Stuff2do = new KT_connection($Stuff2do, $database_Stuff2do); // Start trigger $formValidation = new tNG_FormValidation(); $tNGs->prepareValidation($formValidation); // End trigger //start Trigger_ImageUpload trigger //remove this line if you want to edit the code by hand function Trigger_ImageUpload(&$tNG) { $uploadObj = new tNG_ImageUpload($tNG); $uploadObj->setFormFieldName("Filedata"); $uploadObj->setDbFieldName("ImageFile"); $uploadObj->setFolder("images/ClubListing_Pics/"); $uploadObj->setResize("true", 200, 200); $uploadObj->setMaxSize(4000); $uploadObj->setAllowedExtensions("gif, jpg, jpe, jpeg, png"); $uploadObj->setRename("auto"); return $uploadObj->Execute(); } //end Trigger_ImageUpload trigger //start Trigger_Redirect trigger //remove this line if you want to edit the code by hand function Trigger_Redirect(&$tNG) { $redObj = new tNG_Redirect($tNG); $redObj->setURL(KT_getFullUri()); $redObj->setKeepURLParams(false); return $redObj->Execute(); } //end Trigger_Redirect trigger // Make an insert transaction instance $ins_clublistingpics = new tNG_insert($conn_Stuff2do); $tNGs->addTransaction($ins_clublistingpics); // Register triggers $ins_clublistingpics->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1"); $ins_clublistingpics->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation); $ins_clublistingpics->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "FILES", "Filedata"); $ins_clublistingpics->registerConditionalTrigger("{GET.isFlash} != 1", "END", "Trigger_Redirect", 90); $ins_clublistingpics->registerTrigger("AFTER", "Trigger_ImageUpload", 97); $ins_clublistingpics->registerConditionalTrigger("{GET.isFlash} == 1", "ERROR", "Trigger_Default_MUploadError", 10); // Add columns $ins_clublistingpics->setTable("clublistingpics"); $ins_clublistingpics->addColumn("UploadDate", "DATE_TYPE", "VALUE", "{now}"); $ins_clublistingpics->addColumn("ClubID", "NUMERIC_TYPE", "SESSION", "ClubID", "[sESSION.ClubID]"); $ins_clublistingpics->addColumn("DefaultPic", "STRING_TYPE", "VALUE", "Yes"); $ins_clublistingpics->addColumn("ImageFile", "FILE_TYPE", "FILES", "Filedata"); $ins_clublistingpics->setPrimaryKey("PicsID", "NUMERIC_TYPE"); // Execute all the registered transactions $tNGs->executeTransactions(); // Get the transaction recordset $rsclublistingpics = $tNGs->getRecordset("clublistingpics"); $row_rsclublistingpics = mysql_fetch_assoc($rsclublistingpics); $totalRows_rsclublistingpics = mysql_num_rows($rsclublistingpics); // Multiple Upload Helper Object $muploadHelper = new tNG_MuploadHelper("", 32); $muploadHelper->setMaxSize(4000); $muploadHelper->setMaxNumber(0); $muploadHelper->setExistentNumber(0); $muploadHelper->setAllowedExtensions("gif, jpg, jpe, jpeg, png"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Stuff2do - Club Registration</title> <link href="css/screen.css" rel="stylesheet" type="text/css" /> <link href="includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" /> <script src="includes/common/js/base.js" type="text/javascript"></script> <script src="includes/common/js/utility.js" type="text/javascript"></script> <script src="includes/skins/style.js" type="text/javascript"></script> <?php echo $tNGs->displayValidationRules();?><?php echo $muploadHelper->getScripts(); ?> </head> <body class="oneColFixCtr"> <div id="container"> <div id="mainContent"> <div id="CentralColumn"> <h2>UPLOAD CLUB IMAGES </h2> <p><?php if(isset($_SESSION['Address'])) echo $_SESSION['Address']; ?></p> <div id="PrimaryPic"> <?php echo $tNGs->getErrorMsg(); ?> <?php // Multiple Upload Helper echo $tNGs->getSavedErrorMsg(); echo $muploadHelper->Execute(); ?> </div> <div id="Pic1"></div> </div> <!-- end #mainContent --></div> <!-- end #container --></div> </body> </html>
  6. Just an update on the form action value, I have removed this so its now as it was previously (still no joy). The line $ins_clubs->registerTrigger("END", "Trigger_Default_Redirect", 99, "Reg_Club_Pics.php"); Is part of the Form processing transaction, beginning with the Insert into DB of the Form values and this one being the END trigger which redirects the user once all page transactions have been processed. With it's priority set at 99 it will be the final transaction on the page that is processed. (well thats how i see it anyway, but im very new to this).
  7. Ok so I changed the wrong php.ini file before and have now changed the correct one in the Apache folder. I now have the setting error_reporting = 6143 showing in the phpinfo() report, and am receiving the error, which is: Notice: Undefined index: Address in C:\xampp\htdocs\Reg_Club_Pics.php on line 102 Line 102 of Reg_Club_Pics.php <p><?php echo $_SESSION['Address']; ?></p> But why when it was set on the previous page???
  8. Hey thanks PFMaBiSmAd, I finally got a hold on my over enthusiastic nature to run ahead of myself and to go back over what your telling me here. Very good advise thanks. I have managed to get the php report using a phpinfo() statement and it's good to be pointed in the right direction not only with this but everything from here out. Regards.
  9. I have added a form action but still no luck, have tried lots for hours but can't understand why this is not functioning. <input name="KT_Insert1" id="KT_Insert1" type="submit" class="submit" value="Next" action="Reg_Club_Pics.php"/>
  10. Thanks. php.ini settings error_reporting = E_ALL & ~E_NOTICE display_errors = On All Code from first page: <?php session_start(); ?> <?php require_once('Connections/Stuff2do.php'); ?> <?php //MX Widgets3 include require_once('includes/wdg/WDG.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_Stuff2do = new KT_connection($Stuff2do, $database_Stuff2do); 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; } } mysql_select_db($database_Stuff2do, $Stuff2do); $query_Cities = "SELECT City FROM cities ORDER BY City ASC"; $Cities = mysql_query($query_Cities, $Stuff2do) or die(mysql_error()); $row_Cities = mysql_fetch_assoc($Cities); $totalRows_Cities = mysql_num_rows($Cities); mysql_select_db($database_Stuff2do, $Stuff2do); $query_Recordset1 = "SELECT CatID, EventCat FROM event_categories ORDER BY EventCat ASC"; $Recordset1 = mysql_query($query_Recordset1, $Stuff2do) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); mysql_select_db($database_Stuff2do, $Stuff2do); $query_Recordset2 = "SELECT * FROM event_subcats ORDER BY subcat_name ASC"; $Recordset2 = mysql_query($query_Recordset2, $Stuff2do) or die(mysql_error()); $row_Recordset2 = mysql_fetch_assoc($Recordset2); $totalRows_Recordset2 = mysql_num_rows($Recordset2); // Make an insert transaction instance $ins_clubs = new tNG_insert($conn_Stuff2do); $tNGs->addTransaction($ins_clubs); // Register triggers $ins_clubs->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1"); $ins_clubs->registerTrigger("END", "Trigger_Default_Redirect", 99, "Reg_Club_Pics.php"); // Add columns $ins_clubs->setTable("clubs"); $ins_clubs->addColumn("ListingCat", "STRING_TYPE", "POST", "select"); $ins_clubs->addColumn("UserID", "NUMERIC_TYPE", "SESSION", "kt_login_id", "{SESSION.kt_login_id}"); $ins_clubs->addColumn("ListSubCat", "STRING_TYPE", "POST", "select1"); $ins_clubs->addColumn("ClubName", "STRING_TYPE", "POST", "Club_Name"); $ins_clubs->addColumn("Discription", "STRING_TYPE", "POST", "Description"); $ins_clubs->addColumn("City", "STRING_TYPE", "POST", "city1"); $ins_clubs->addColumn("Address", "STRING_TYPE", "POST", "Address"); $ins_clubs->addColumn("ClubContact", "STRING_TYPE", "POST", "Email1"); $ins_clubs->setPrimaryKey("ClubID", "NUMERIC_TYPE", "POST", "ClubID"); // Execute all the registered transactions $tNGs->executeTransactions(); // Get the transaction recordset $rsclubs = $tNGs->getRecordset("clubs"); $row_rsclubs = mysql_fetch_assoc($rsclubs); $totalRows_rsclubs = mysql_num_rows($rsclubs); if (isset($_POST['KT_Insert1'])) { $add = $_POST['Address']; $_SESSION['Address'] = $add;} ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wdg="http://ns.adobe.com/addt"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Stuff2do - Club Registration</title> <link href="css/screen.css" rel="stylesheet" type="text/css" media="all" /> <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationCheckbox.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/validation.css" rel="stylesheet" type="text/css" media="all" /> <script type="text/javascript" src="SpryAssets/SpryValidationTextField.js"></script> <script type="text/javascript" src="SpryAssets/SpryValidationSelect.js"></script> <script type="text/javascript" src="SpryAssets/SpryValidationTextarea.js"></script> <script type="text/javascript" src="SpryAssets/SpryValidationCheckbox.js"></script> <script src="includes/skins/style.js" type="text/javascript"></script> <script src="includes/common/js/base.js" type="text/javascript"></script> <script src="includes/common/js/utility.js" type="text/javascript"></script> <script type="text/javascript" src="includes/common/js/sigslot_core.js"></script> <script type="text/javascript" src="includes/wdg/classes/MXWidgets.js"></script> <script type="text/javascript" src="includes/wdg/classes/MXWidgets.js.php"></script> <script type="text/javascript" src="includes/wdg/classes/JSRecordset.js"></script> <script type="text/javascript" src="includes/wdg/classes/DependentDropdown.js"></script> <?php //begin JSRecordset $jsObject_Recordset2 = new WDG_JsRecordset("Recordset2"); echo $jsObject_Recordset2->getOutput(); //end JSRecordset ?> <link href="includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" /> </head> <body class="oneColFixCtr"> <div id="container"> <div id="mainContent"> <noscript><h1>This page requires JavaScript. Please enable JavaScript in your browser and reload this page.</h1></noscript> <div id="CentralColumn"> <form id="formReg" name="formReg" method="post"> <div id="formregion"> <div id="Club_Name"> <div class="formLabel">Club Name:</div> <input name="Club_Name" type="text" class="input" id="Club_Name" value="" /> <span class="textfieldRequiredMsg">Please enter your Clubs Name.</span> <img src="images/ok.gif" title="Valid" alt="Valid" class="validMsg" border="0"/></div> <div id="City"> <div class="formLabel">City:</div> <select name="city1" id="city1"> <option value="" selected><?php echo $_SESSION['kt_City']; ?></option> <?php do { ?> <option value="<?php echo $row_Cities['City']?>"><?php echo $row_Cities['City']?></option> <?php } while ($row_Cities = mysql_fetch_assoc($Cities)); $rows = mysql_num_rows($Cities); if($rows > 0) { mysql_data_seek($rsCities, 0); $row_Cities = mysql_fetch_assoc($Cities); } ?> </select> <img src="images/ok.gif" title="Valid" alt="Valid" class="validMsg" border="0"/> <span class="selectRequiredMsg">Please select a city.</span> </div> <div id="Address"> <div class="formLabel">Club Address:</div> <input name="Address" type="text" class="input" id="Address" value="" /> <span class="textfieldRequiredMsg">Please enter your Clubs Address</span> <img src="images/ok.gif" title="Valid" alt="Valid" class="validMsg" border="0"/></div> <div id="Cat"> <div class="formLabel">Select a category for your club listing:</div> <select name="select" id="select"> <option value="" <?php if (!(strcmp("", $row_Recordset1['EventCat']))) {echo "selected=\"selected\"";} ?>>Please Select...</option> <?php do { ?><option value="<?php echo $row_Recordset1['CatID']?>"<?php if (!(strcmp($row_Recordset1['CatID'], $row_Recordset1['EventCat']))) {echo "selected=\"selected\"";} ?>><?php echo $row_Recordset1['EventCat']?></option> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); $rows = mysql_num_rows($Recordset1); if($rows > 0) { mysql_data_seek($Recordset1, 0); $row_Recordset1 = mysql_fetch_assoc($Recordset1); } ?> </select> <select name="select1" id="select1" wdg:subtype="DependentDropdown" wdg:type="widget" wdg:recordset="Recordset2" wdg:displayfield="subcat_name" wdg:valuefield="SubCatID" wdg:fkey="CatID" wdg:triggerobject="select" wdg:selected="<?php echo $row_Recordset2['subcat_name']; ?>"> </select> </div> <div id="Description"> <div class="formLabel">Enter your Club Description:</div> <textarea name="Description" id="Description" cols="45" rows="5"></textarea> <img src="images/ok.gif" title="Valid" alt="Valid" class="validMsg" border="0"/> <span class="textareaRequiredMsg">Please enter a description.</span> <span class="textareaMinCharsMsg">Please enter at least 100 characters.</span> <span id="Countvalidta1"> </span> / 2000 </div> <div id="ContactNum"> <div class="formLabel">Club Contact Phone Number:</div> <input name="ContactNum" type="text" class="input" id="ContactNum" value="<?php echo $_SESSION['kt_MobileNum']; ?>" /> <img src="images/ok.gif" title="Valid" alt="Valid" class="validMsg" border="0"/> <span class="textfieldRequiredMsg">Please enter a contact number</span> <span class="textfieldInvalidFormatMsg">Number format required ###-#######</span> </div> <div id="Email"> <div class="formLabelEmail">Club Contact Email Address: <em>(This will not be displayed to the public)</em></div> <input name="Email1" type="text" class="input" id="Email1" value="<?php echo $_SESSION['kt_login_user']; ?>" /> <span class="textfieldRequiredMsg">Please enter a Valid Email Address.</span> <span class="textfieldInvalidFormatMsg">Invalid format</span></div> <img src="images/ok.gif" title="Valid" alt="Valid" class="validMsg" border="0"/> </div> <input name="KT_Insert1" id="KT_Insert1" type="submit" class="submit" value="Next" /> <?php echo $tNGs->getErrorMsg(); ?> <input type="hidden" name="ClubID" id="ClubID" /> </form> </div> <!-- end #mainContent --></div> <!-- end #container --></div> <script type="text/javascript"> var Description = new Spry.Widget.ValidationTextarea("Description", {useCharacterMasking:true, minChars:100, maxChars:2000, counterType:"chars_count", counterId:"Countvalidta1", validateOn:["change"]}); var Club_Name = new Spry.Widget.ValidationTextField("Club_Name", "none", {useCharacterMasking:true, validateOn:["change"]}); var City = new Spry.Widget.ValidationSelect("City", {validateOn:["change"]}); var Address = new Spry.Widget.ValidationTextField("Address", "none", {useCharacterMasking:true, validateOn:["change"]}); var Email = new Spry.Widget.ValidationTextField("Email", "email", {useCharacterMasking:true, validateOn:["blur"]}); var ContactNum = new Spry.Widget.ValidationTextField("ContactNum", "none", {useCharacterMasking:true, format:"\d\d\d-\d\d\d-\d\d\d\d", hint:"###-#######", validateOn:["change"]}); </script> </body> </html> <?php mysql_free_result($Cities); mysql_free_result($Recordset1); mysql_free_result($Recordset2); ?> All Code from second page: <?php session_start(); ?> <?php require_once('Connections/Stuff2do.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_Stuff2do = new KT_connection($Stuff2do, $database_Stuff2do); // Start trigger $formValidation = new tNG_FormValidation(); $tNGs->prepareValidation($formValidation); // End trigger //start Trigger_ImageUpload trigger //remove this line if you want to edit the code by hand function Trigger_ImageUpload(&$tNG) { $uploadObj = new tNG_ImageUpload($tNG); $uploadObj->setFormFieldName("Filedata"); $uploadObj->setDbFieldName("ImageFile"); $uploadObj->setFolder("images/ClubListing_Pics/"); $uploadObj->setResize("true", 200, 200); $uploadObj->setMaxSize(4000); $uploadObj->setAllowedExtensions("gif, jpg, jpe, jpeg, png"); $uploadObj->setRename("auto"); return $uploadObj->Execute(); } //end Trigger_ImageUpload trigger //start Trigger_Redirect trigger //remove this line if you want to edit the code by hand function Trigger_Redirect(&$tNG) { $redObj = new tNG_Redirect($tNG); $redObj->setURL(KT_getFullUri()); $redObj->setKeepURLParams(false); return $redObj->Execute(); } //end Trigger_Redirect trigger // Make an insert transaction instance $ins_clublistingpics = new tNG_insert($conn_Stuff2do); $tNGs->addTransaction($ins_clublistingpics); // Register triggers $ins_clublistingpics->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1"); $ins_clublistingpics->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation); $ins_clublistingpics->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "FILES", "Filedata"); $ins_clublistingpics->registerConditionalTrigger("{GET.isFlash} != 1", "END", "Trigger_Redirect", 90); $ins_clublistingpics->registerTrigger("AFTER", "Trigger_ImageUpload", 97); $ins_clublistingpics->registerConditionalTrigger("{GET.isFlash} == 1", "ERROR", "Trigger_Default_MUploadError", 10); // Add columns $ins_clublistingpics->setTable("clublistingpics"); $ins_clublistingpics->addColumn("UploadDate", "DATE_TYPE", "VALUE", "{now}"); $ins_clublistingpics->addColumn("ClubID", "NUMERIC_TYPE", "SESSION", "ClubID", "[sESSION.ClubID]"); $ins_clublistingpics->addColumn("DefaultPic", "STRING_TYPE", "VALUE", "Yes"); $ins_clublistingpics->addColumn("ImageFile", "FILE_TYPE", "FILES", "Filedata"); $ins_clublistingpics->setPrimaryKey("PicsID", "NUMERIC_TYPE"); // Execute all the registered transactions $tNGs->executeTransactions(); // Get the transaction recordset $rsclublistingpics = $tNGs->getRecordset("clublistingpics"); $row_rsclublistingpics = mysql_fetch_assoc($rsclublistingpics); $totalRows_rsclublistingpics = mysql_num_rows($rsclublistingpics); // Multiple Upload Helper Object $muploadHelper = new tNG_MuploadHelper("", 32); $muploadHelper->setMaxSize(4000); $muploadHelper->setMaxNumber(0); $muploadHelper->setExistentNumber(0); $muploadHelper->setAllowedExtensions("gif, jpg, jpe, jpeg, png"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Stuff2do - Club Registration</title> <link href="css/screen.css" rel="stylesheet" type="text/css" /> <link href="includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" /> <script src="includes/common/js/base.js" type="text/javascript"></script> <script src="includes/common/js/utility.js" type="text/javascript"></script> <script src="includes/skins/style.js" type="text/javascript"></script> <?php echo $tNGs->displayValidationRules();?><?php echo $muploadHelper->getScripts(); ?> </head> <body class="oneColFixCtr"> <div id="container"> <div id="mainContent"> <div id="CentralColumn"> <h2>UPLOAD CLUB IMAGES </h2> <p><?php echo $_SESSION['Address']; ?></p> <div id="PrimaryPic"> <?php echo $tNGs->getErrorMsg(); ?> <?php // Multiple Upload Helper echo $tNGs->getSavedErrorMsg(); echo $muploadHelper->Execute(); ?> </div> <div id="Pic1"></div> </div> <!-- end #mainContent --></div> <!-- end #container --></div> </body> </html>
  11. Still no joy, Haku, is it covered by this? $ins_clubs->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1"); $ins_clubs->registerTrigger("END", "Trigger_Default_Redirect", 99, "Reg_Club_Pics.php");
  12. Thanks Ted, The first php code is on the page with the form, the second php code is on the page the user is redirected to after form submission. I am trying to get the value entered in the form field "Address" echo'd on the second page and figured this would be best set as a session variable with the session value set as the form field "Address" value. What you think?
  13. Heres my form: <form id="formReg" name="formReg" method="post"> <div id="formregion"> <div id="Club_Name"> <div class="formLabel">Club Name:</div> <input name="Club_Name" type="text" class="input" id="Club_Name" value="" /> <span class="textfieldRequiredMsg">Please enter your Clubs Name.</span> <img src="images/ok.gif" title="Valid" alt="Valid" class="validMsg" border="0"/></div> <div id="City"> <div class="formLabel">City:</div> <select name="city1" id="city1"> <option value="" selected><?php echo $_SESSION['kt_City']; ?></option> <?php do { ?> <option value="<?php echo $row_Cities['City']?>"><?php echo $row_Cities['City']?></option> <?php } while ($row_Cities = mysql_fetch_assoc($Cities)); $rows = mysql_num_rows($Cities); if($rows > 0) { mysql_data_seek($rsCities, 0); $row_Cities = mysql_fetch_assoc($Cities); } ?> </select> <img src="images/ok.gif" title="Valid" alt="Valid" class="validMsg" border="0"/> <span class="selectRequiredMsg">Please select a city.</span> </div> <div id="Address"> <div class="formLabel">Club Address:</div> <input name="Address" type="text" class="input" id="Address" value="" /> <span class="textfieldRequiredMsg">Please enter your Clubs Address</span> <img src="images/ok.gif" title="Valid" alt="Valid" class="validMsg" border="0"/></div> <div id="Cat"> <div class="formLabel">Select a category for your club listing:</div> <select name="select" id="select"> <option value="" <?php if (!(strcmp("", $row_Recordset1['EventCat']))) {echo "selected=\"selected\"";} ?>>Please Select...</option> <?php do { ?><option value="<?php echo $row_Recordset1['CatID']?>"<?php if (!(strcmp($row_Recordset1['CatID'], $row_Recordset1['EventCat']))) {echo "selected=\"selected\"";} ?>><?php echo $row_Recordset1['EventCat']?></option> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); $rows = mysql_num_rows($Recordset1); if($rows > 0) { mysql_data_seek($Recordset1, 0); $row_Recordset1 = mysql_fetch_assoc($Recordset1); } ?> </select> <select name="select1" id="select1" wdg:subtype="DependentDropdown" wdg:type="widget" wdg:recordset="Recordset2" wdg:displayfield="subcat_name" wdg:valuefield="SubCatID" wdg:fkey="CatID" wdg:triggerobject="select" wdg:selected="<?php echo $row_Recordset2['subcat_name']; ?>"> </select> </div> <div id="Description"> <div class="formLabel">Enter your Club Description:</div> <textarea name="Description" id="Description" cols="45" rows="5"></textarea> <img src="images/ok.gif" title="Valid" alt="Valid" class="validMsg" border="0"/> <span class="textareaRequiredMsg">Please enter a description.</span> <span class="textareaMinCharsMsg">Please enter at least 100 characters.</span> <span id="Countvalidta1"> </span> / 2000 </div> <div id="ContactNum"> <div class="formLabel">Club Contact Phone Number:</div> <input name="ContactNum" type="text" class="input" id="ContactNum" value="<?php echo $_SESSION['kt_MobileNum']; ?>" /> <img src="images/ok.gif" title="Valid" alt="Valid" class="validMsg" border="0"/> <span class="textfieldRequiredMsg">Please enter a contact number</span> <span class="textfieldInvalidFormatMsg">Number format required ###-#######</span> </div> <div id="Email"> <div class="formLabelEmail">Club Contact Email Address: <em>(This will not be displayed to the public)</em></div> <input name="Email1" type="text" class="input" id="Email1" value="<?php echo $_SESSION['kt_login_user']; ?>" /> <span class="textfieldRequiredMsg">Please enter a Valid Email Address.</span> <span class="textfieldInvalidFormatMsg">Invalid format</span></div> <img src="images/ok.gif" title="Valid" alt="Valid" class="validMsg" border="0"/> </div> <input name="KT_Insert1" id="KT_Insert1" type="submit" class="submit" value="Next" /> <?php echo $tNGs->getErrorMsg(); ?> <input type="hidden" name="ClubID" id="ClubID" /> </form>
  14. PHP 5.2 Pulling teeth over this one as just can't get it work although should be very simple. I am trying to pass a form input value from one page to the next using a session variable- I have the following code on the first page which contains the from: session_start(); if (isset($HTTP_POST_VARS['Address'])) {$Address = $HTTP_POST_VARS['Address']; session_register("Address"); } And am simply trying to echo the variable on the second with: <p><?php echo $_SESSION['Address']; ?></p> The page runs without error although the 'Address' value from the form on page one is not being passed (or is empty). Any ideas and on what could be going wrong here? Thanks in advance
  15. Mchl- Wouldn't the RSS feed content be lost to search engines using Javascript???
  16. AWesome pbs you rule - Thats perfect, thanks for your HELP
  17. im bringing them back - anyone else???
  18. Hi all, I am displaying the marquee below on my site which is operating fine however as it is currently the marquee only displays a single feed item in the marquee (when set to display 10 at once as indicated the first displays ok and the remaining 9 are scrolling below), does anyone have any clue how I would change this code to link the feed items into a single marquee/line/string. Thanks. <marquee> <?PHP $MAXLINKCOUNT = 10; // (* 2) if =10, 5 news items will show $MAX_DESC_CHARS = 120; $insideitem = false; $tag = ""; $title = ""; $description = ""; $link = ""; $linkcount = 0; function startElement($parser, $name, $attrs) { global $insideitem, $tag, $title, $description, $link; if ($insideitem) { $tag = $name; } elseif ($name == "ITEM") { $insideitem = true; } } function endElement($parser, $name) { global $insideitem, $tag, $title, $description, $link, $linkcount, $MAXLINKCOUNT, $MAX_DESC_CHARS; if ($name == "ITEM" && $linkcount <= $MAXLINKCOUNT) { if (strlen($description) > $MAX_DESC_CHARS) { $description = wordwrap($description, $MAX_DESC_CHARS, "-=CUT OFF HERE=-"); $pos = strpos($description, "-=CUT OFF HERE=-"); $description = trim(substr($description, 0, $pos)) . "..."; } $description = htmlspecialchars(trim($description)); $description = str_replace("&quot;", """, $description); printf("<dt><b><a href='%s'>%s</a></b></dt>", trim($link),htmlspecialchars(trim($title))); printf("<dt>%s</dt><br>",$description); $title = ""; $description = ""; $link = ""; $insideitem = false; } } function characterData($parser, $data) { global $insideitem, $tag, $title, $description, $link, $linkcount; if ($insideitem) { switch ($tag) { case "TITLE": $title .= $data; break; case "DESCRIPTIon": $description .= $data; break; case "LINK": $link .= $data; $linkcount++; break; } } } $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); $fp = fopen("http://tvnz.co.nz/content/455321/rss_20_skin.xml", "r") or die("Error reading rss data."); while ($data = fread($fp, 2048)) { xml_parse($xml_parser, $data, feof($fp)); } fclose($fp); xml_parser_free($xml_parser); ?></marquee>
  19. ok but how do i give it a value as the value not known until after the form has been posted??? Sorry bit new to this game....
  20. Hi, I am creating a multi page registration form, the first page contains standard registration information and the second page is for image uploading. On the first form page the users 'UserID' is not known until the database uses auto_increment to create it. How can I then set this UserID as a variable to use to assign to the uploaded images on the second page (as it is not known until AFTER the form post transaction is processed on page one) aragrgahrhg??
  21. any ideas on how this can be used to display more than one feed?
  22. Hi all, Please help. I am using the following code in the attempt to display an RSS Feed on my site that will scroll text (left to right) along the top of the page. The code works in displaying the feed however I am unsure how to get this to scroll a single line of text??? Any ideas cause im null :-( <? $MAXLINKCOUNT = 10; // (* 2) if =10, 5 news items will show $MAX_DESC_CHARS = 120; $insideitem = false; $tag = ""; $title = ""; $description = ""; $link = ""; $linkcount = 0; function startElement($parser, $name, $attrs) { global $insideitem, $tag, $title, $description, $link; if ($insideitem) { $tag = $name; } elseif ($name == "ITEM") { $insideitem = true; } } function endElement($parser, $name) { global $insideitem, $tag, $title, $description, $link, $linkcount, $MAXLINKCOUNT, $MAX_DESC_CHARS; if ($name == "ITEM" && $linkcount <= $MAXLINKCOUNT) { if (strlen($description) > $MAX_DESC_CHARS) { $description = wordwrap($description, $MAX_DESC_CHARS, "-=CUT OFF HERE=-"); $pos = strpos($description, "-=CUT OFF HERE=-"); $description = trim(substr($description, 0, $pos)) . "..."; } $description = htmlspecialchars(trim($description)); $description = str_replace("&quot;", """, $description); printf("<dt><b><a href='%s'>%s</a></b></dt>", trim($link),htmlspecialchars(trim($title))); printf("<dt>%s</dt><br>",$description); $title = ""; $description = ""; $link = ""; $insideitem = false; } } function characterData($parser, $data) { global $insideitem, $tag, $title, $description, $link, $linkcount; if ($insideitem) { switch ($tag) { case "TITLE": $title .= $data; break; case "DESCRIPTIon": $description .= $data; break; case "LINK": $link .= $data; $linkcount++; break; } } } $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); $fp = fopen("--enter url for news feed here--","r") or die("Error reading rss data."); while ($data = fread($fp, 2048)) { xml_parse($xml_parser, $data, feof($fp)); } fclose($fp); xml_parser_free($xml_parser); ?>
×
×
  • 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.