liamloveslearning Posted November 6, 2008 Share Posted November 6, 2008 hey everyone, im just wondering how to display images people have uploaded to my host; when a user uploads there image the image goes to a file and the directory is stored in my table; atm im using echo "<img scr='$row_rsfolio1['file']'>"; im not sure why tho ??? doesnt an echo tage call a variable and not images? sorry to sound so "noob'ish" any helps great thanks Quote Link to comment Share on other sites More sharing options...
liamloveslearning Posted November 6, 2008 Author Share Posted November 6, 2008 or does anybody know the correct terminology so i could try and fid it in google? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted November 6, 2008 Share Posted November 6, 2008 is the column 'file' in your table a VARCHAR with the filename or a BLOB with the actual image contents? Quote Link to comment Share on other sites More sharing options...
liamloveslearning Posted November 6, 2008 Author Share Posted November 6, 2008 ive got it set to BLOB yet its still storing the filename and not showing an image Quote Link to comment Share on other sites More sharing options...
champoi Posted November 6, 2008 Share Posted November 6, 2008 are you sure that the $row_rsfolio1['file'] is showing the proper img src? try to echo the variable and compare it to the directory of the img, Quote Link to comment Share on other sites More sharing options...
liamloveslearning Posted November 6, 2008 Author Share Posted November 6, 2008 yeah its outputting it on my browser, only its outputting the directory and not the image ie "folio/picture1.jpg" Quote Link to comment Share on other sites More sharing options...
liamloveslearning Posted November 6, 2008 Author Share Posted November 6, 2008 this is so hard! i thought i can just put an image placeholder and the source would be my echo function? Quote Link to comment Share on other sites More sharing options...
champoi Posted November 6, 2008 Share Posted November 6, 2008 yeah its outputting it on my browser, only its outputting the directory and not the image ie "folio/picture1.jpg" try doing it like this: echo "<img scr='".$row_rsfolio1['file']."'>"; the quotes after the scr= might be confusing but it's like this: ' " then the one after the variable is: " ' Quote Link to comment Share on other sites More sharing options...
champoi Posted November 6, 2008 Share Posted November 6, 2008 i haven't tried it but i think there should be no spaces in between the quotes, try it Quote Link to comment Share on other sites More sharing options...
liamloveslearning Posted November 6, 2008 Author Share Posted November 6, 2008 im storing my images in a folder on my server btw, and my tables just say picture.jpg and not the actual directory, could this be something to do with it? Quote Link to comment Share on other sites More sharing options...
champoi Posted November 6, 2008 Share Posted November 6, 2008 maybe, when storing the directory in the table, what you were actually storing was only the file name. try adding the actual directory of the file then the filename, something like this: $imgdir = "http://www.something.com/imagefolder/" . filename['file']; Quote Link to comment Share on other sites More sharing options...
liamloveslearning Posted November 6, 2008 Author Share Posted November 6, 2008 no luck, heres my pages if anyone can see where im going wrong this is my output page where it just shows the filename <?php require_once('Connections/neiladmin.php'); ?> <?php // Load the common classes require_once('includes/common/KT_common.php'); // Load the required classes require_once('includes/tfi/TFI.php'); require_once('includes/tso/TSO.php'); require_once('includes/nav/NAV.php'); // Make unified connection variable $conn_neiladmin = new KT_connection($neiladmin, $database_neiladmin); 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; } } // Filter $tfi_listfolio4 = new TFI_TableFilter($conn_neiladmin, "tfi_listfolio4"); $tfi_listfolio4->addColumn("folio.file", "STRING_TYPE", "file", "%"); $tfi_listfolio4->addColumn("folio.title", "STRING_TYPE", "title", "%"); $tfi_listfolio4->addColumn("folio.Description", "STRING_TYPE", "Description", "%"); $tfi_listfolio4->addColumn("folio.category", "STRING_TYPE", "category", "%"); $tfi_listfolio4->Execute(); // Sorter $tso_listfolio4 = new TSO_TableSorter("rsfolio1", "tso_listfolio4"); $tso_listfolio4->addColumn("folio.file"); $tso_listfolio4->addColumn("folio.title"); $tso_listfolio4->addColumn("folio.Description"); $tso_listfolio4->addColumn("folio.category"); $tso_listfolio4->setDefault("folio.file"); $tso_listfolio4->Execute(); // Navigation $nav_listfolio4 = new NAV_Regular("nav_listfolio4", "rsfolio1", "", $_SERVER['PHP_SELF'], 10); //NeXTenesio3 Special List Recordset $maxRows_rsfolio1 = $_SESSION['max_rows_nav_listfolio4']; $pageNum_rsfolio1 = 0; if (isset($_GET['pageNum_rsfolio1'])) { $pageNum_rsfolio1 = $_GET['pageNum_rsfolio1']; } $startRow_rsfolio1 = $pageNum_rsfolio1 * $maxRows_rsfolio1; // Defining List Recordset variable $NXTFilter_rsfolio1 = "1=1"; if (isset($_SESSION['filter_tfi_listfolio4'])) { $NXTFilter_rsfolio1 = $_SESSION['filter_tfi_listfolio4']; } // Defining List Recordset variable $NXTSort_rsfolio1 = "folio.file"; if (isset($_SESSION['sorter_tso_listfolio4'])) { $NXTSort_rsfolio1 = $_SESSION['sorter_tso_listfolio4']; } mysql_select_db($database_neiladmin, $neiladmin); $query_rsfolio1 = "SELECT * FROM folio ORDER BY id ASC"; $query_limit_rsfolio1 = sprintf("%s LIMIT %d, %d", $query_rsfolio1, $startRow_rsfolio1, $maxRows_rsfolio1); $rsfolio1 = mysql_query($query_limit_rsfolio1, $neiladmin) or die(mysql_error()); $row_rsfolio1 = mysql_fetch_assoc($rsfolio1); if (isset($_GET['totalRows_rsfolio1'])) { $totalRows_rsfolio1 = $_GET['totalRows_rsfolio1']; } else { $all_rsfolio1 = mysql_query($query_rsfolio1); $totalRows_rsfolio1 = mysql_num_rows($all_rsfolio1); } $totalPages_rsfolio1 = ceil($totalRows_rsfolio1/$maxRows_rsfolio1)-1; //End NeXTenesio3 Special List Recordset $nav_listfolio4->checkBoundries(); ?><!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>The Work Of Neil Martin</title> <style type="text/css"> <!-- body { font: 100% Verdana, Arial, Helvetica, sans-serif; background: #666666; margin: 0; padding: 0; text-align: center; color: #000000; background-color: #FFFFFF; } #header { width: 100%; height: 105px; background: #000000; margin: 0 auto; border: 0px; text-align: center; } html, body { height: 100%; } #contactinfo { position: relative; width: 175px; top: -110px; left: 385px; margin: 0 auto; border: 0px; text-align: right; background: #000000; color: #CCCCCC; } #artworkcontainer { width: 100%; margin: 0 auto; border: 0px; text-align: left; } #artworkthumbnail { width: 950px; margin: 0 auto; } .artworkborder { border: 1px solid #CCCCCC; } #artworkdescription { position: relative; top: 15px; width: 948px; border: 1px solid #CCCCCC; overflow: hidden; background: #f2f2f2; background-image: url(descriptionbg.gif); background-repeat: repeat-y; } * html #artworkdescription { height: 1%; overflow: visible; } #artworkwho, #artworkwhat, #artworkwhere { margin-left: 1.2%; width: 14%; border: 0px; float: left; } #artworkwhy { margin-left: 2%; margin-right: 2%; width: 46.5%; border: 0px; float: right; margin-top: -3px; } .whowhatwheretext { font-size: 12px; } #divider { position: relative; width: 950px; top: 0px; margin: 0 auto; border: 0px; height: 31px; padding-top: 30px; padding-bottom: 15px; } .oneColFixCtr #container { width: 100%; background: #FFFFFF; margin: 0 auto; border: 0px; text-align: left; } .oneColFixCtr #mainContent { width: 950px; padding: 0 0px; margin: 0 auto; } body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 11px; color: #333333; line-height: 18px; } h1 { font-size: 24px; color: #00416a; font-weight: normal; } h2 { font-size: 24px; color: #b20000; font-weight: normal; } #navcontainer { position: relative; left: 626px; top: -10px; width: 314px; height: 26px; padding: 0; margin: 0px 0 0px 0; } #nav { position: absolute; top: 10px; left: 10px; list-style: none; margin: 0; padding: 0; height: 314px; display: inline; overflow: hidden; width: 314px; } #nav li { margin: 0; padding: 0; display: inline; list-style-type: none; } #nav a { float: left; padding: 26px 0 0 0; overflow: hidden; height: 0px !important; height /**/:26px; /* for IE5/Win */ } #nav a:hover { background-position: 0 -26px; } #nav a:active, #nav a.selected { background-position: 0 -40px; } #navtheworkof a { width: 90px; background: url(theworkof.gif) top left no-repeat; } #navthewordsof a { width: 97px; background: url(thewordsof.gif) top left no-repeat; } #navwhoisnm a { width: 127px; background: url(whoisnm.gif) top left no-repeat; } #footer { position: relative; width: 100%; height: 50% !important; background: #000000; margin: 0 auto; border: 0px; text-align: center; } #footercontainer { width: 950px; padding: 0 0px; padding-top: 40px; padding-bottom: 40px; margin: 0 auto; } #footerresources { width: 300px; float: left; text-align: left; padding-right: 24px; } #footerperiodicals { width: 300px; float: left; text-align: left; } #footerpersonals { width: 300px; float: right; text-align: left; } #footer a { color: #999999; } #footer a:hover { color: #FFFFFF; text-decoration: none; } #footer a:link { color: #999999; text-decoration: none; } #footer a:active { color: #999999; text-decoration: none; } #footer a:visited { text-decoration: none; } --> </style> <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> <script src="includes/nxt/scripts/list.js" type="text/javascript"></script> <script src="includes/nxt/scripts/list.js.php" type="text/javascript"></script> <script type="text/javascript"> $NXT_LIST_SETTINGS = { duplicate_buttons: false, duplicate_navigation: false, row_effects: false, show_as_buttons: false, record_counter: false } </script> <style type="text/css"> /* Dynamic List row settings */ .KT_col_file {width:140px; overflow:hidden;} .KT_col_title {width:140px; overflow:hidden;} .KT_col_Description {width:140px; overflow:hidden;} .KT_col_category {width:140px; overflow:hidden;} </style> </head> <body class="oneColFixCtr"> <div id="container"> <div id="header"><img src="logo.gif" alt="Logo" width="300" height="104" /></div> <div id="mainContent"> <div id="navcontainer"> <ul id="nav"> <li id="navtheworkof"><a href="http://www.theworkof.co.uk">The Work Of</a></li> <li id="navthewordsof"><a href="/blog">The Words Of</a></li> <li id="navwhoisnm"><a href="/bio/bio.html">Who Is Neil Martin?</a></li> </ul> </div> <div id="contactinfo">email: neil@theworkof.co.uk</div> <!-- being artwork --><div id="artworkcontainer"> <div id="artworkthumbnail"><img src="thumbnail.gif" alt="Thumbnail" width="948" height="298" class="artworkborder" /></div> <div id="artworkdescription"> <div id="artworkwho"><h1>Who</h1> <p class="whowhatwheretext">Mind</p> </div> <div id="artworkwhat"><h1>What</h1> <p class="whowhatwheretext">Annual Report</p> </div> <div id="artworkwhere"><h1>Where</h1> <p class="whowhatwheretext">No website</p> </div> <div id="artworkwhy"><h2>Why</h2> <p>LLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</p></div> </div> <div id="divider"><img src="divider.gif" alt="Divider" width="950" height="31" /></div> <!-- end #artworkdescription --></div> <!-- being artwork --><div id="artworkcontainer"> <div id="artworkthumbnail"><img src="thumbnail.gif" alt="Thumbnail" width="948" height="298" class="artworkborder" /></div> <div id="artworkdescription"> <div id="artworkwho"><h1>Who</h1> <p class="whowhatwheretext">Mind</p> </div> <div id="artworkwhat"><h1>What</h1> <p class="whowhatwheretext">Annual Report</p> </div> <div id="artworkwhere"><h1>Where</h1> <p class="whowhatwheretext">No website</p> </div> <div id="artworkwhy"><h2>Why</h2> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</p></div> </div> <div id="divider"><img src="divider.gif" alt="Divider" width="950" height="31" /></div> <!-- end #artworkdescription --></div> <!-- being artwork --><div id="artworkcontainer"> <div id="artworkthumbnail"><img src="thumbnail.gif" alt="Thumbnail" width="948" height="298" class="artworkborder" /></div> <div id="artworkdescription"> <div id="artworkwho"><h1>Who</h1> <p class="whowhatwheretext">Mind</p> </div> <div id="artworkwhat"><h1>What</h1> <p class="whowhatwheretext">Annual Report</p> </div> <div id="artworkwhere"><h1>Where</h1> <p class="whowhatwheretext">No website</p> </div> <div id="artworkwhy"><h2>Why</h2> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</p></div> </div> <div id="divider"><img src="divider.gif" alt="Divider" width="950" height="31" /></div> <!-- end #artworkdescription --></div> <!-- being artwork --><div id="artworkcontainer"> <div id="artworkthumbnail"><img src="thumbnail.gif" alt="Thumbnail" width="948" height="298" class="artworkborder" /></div> <div id="artworkdescription"> <div id="artworkwho"><h1>Who</h1> <p class="whowhatwheretext">Mind</p> </div> <div id="artworkwhat"><h1>What</h1> <p class="whowhatwheretext">Annual Report</p> </div> <div id="artworkwhere"><h1>Where</h1> <p class="whowhatwheretext">No website</p> </div> <div id="artworkwhy"><h2>Why</h2> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</p></div> </div> <div id="divider"><img src="divider.gif" alt="Divider" width="950" height="31" /></div> <!-- end #artworkdescription --></div> <!-- end #mainContent --></div> <!-- end #container --></div> <br /> <br /> <div class="KT_tng" id="listfolio4"> <h1> Folio <?php $nav_listfolio4->Prepare(); require("includes/nav/NAV_Text_Statistics.inc.php"); ?> </h1> <div class="KT_tnglist"> <form action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>" method="post" id="form1"> <div class="KT_options"> <a href="<?php echo $nav_listfolio4->getShowAllLink(); ?>"><?php echo NXT_getResource("Show"); ?> <?php // Show IF Conditional region1 if (@$_GET['show_all_nav_listfolio4'] == 1) { ?> <?php echo $_SESSION['default_max_rows_nav_listfolio4']; ?> <?php // else Conditional region1 } else { ?> <?php echo NXT_getResource("all"); ?> <?php } // endif Conditional region1 ?> <?php echo NXT_getResource("records"); ?></a> </div> <table cellpadding="2" cellspacing="0" class="KT_tngtable"> <thead> <tr class="KT_row_order"> <th> <input type="checkbox" name="KT_selAll" id="KT_selAll"/> </th> <th id="file" class="KT_sorter KT_col_file <?php echo $tso_listfolio4->getSortIcon('folio.file'); ?>"> <a href="<?php echo $tso_listfolio4->getSortLink('folio.file'); ?>">File</a> </th> <th id="title" class="KT_sorter KT_col_title <?php echo $tso_listfolio4->getSortIcon('folio.title'); ?>"> <a href="<?php echo $tso_listfolio4->getSortLink('folio.title'); ?>">Title</a> </th> <th id="Description" class="KT_sorter KT_col_Description <?php echo $tso_listfolio4->getSortIcon('folio.Description'); ?>"> <a href="<?php echo $tso_listfolio4->getSortLink('folio.Description'); ?>">Description</a> </th> <th id="category" class="KT_sorter KT_col_category <?php echo $tso_listfolio4->getSortIcon('folio.category'); ?>"> <a href="<?php echo $tso_listfolio4->getSortLink('folio.category'); ?>">Category</a> </th> <th> </th> </tr> </thead> <tbody> <?php if ($totalRows_rsfolio1 == 0) { // Show if recordset empty ?> <tr> <td colspan="6"><?php echo NXT_getResource("The table is empty or the filter you've selected is too restrictive."); ?></td> </tr> <?php } // Show if recordset empty ?> <?php if ($totalRows_rsfolio1 > 0) { // Show if recordset not empty ?> <?php do { ?> <tr class="<?php echo @$cnt1++%2==0 ? "" : "KT_even"; ?>"> <td><input type="checkbox" name="kt_pk_folio" class="id_checkbox" value="<?php echo $row_rsfolio1['id']; ?>" /> <input type="hidden" name="id" class="id_field" value="<?php echo $row_rsfolio1['id']; ?>" /> </td> <td><div class="KT_col_file"><?php echo KT_FormatForList($row_rsfolio1['file'], 20); ?><br /> <br /> <br /> </div></td> <td><div class="KT_col_title"><?php echo KT_FormatForList($row_rsfolio1['title'], 20); ?></div></td> <td><div class="KT_col_Description"><?php echo KT_FormatForList($row_rsfolio1['Description'], 20); ?></div></td> <td><div class="KT_col_category"><?php echo KT_FormatForList($row_rsfolio1['category'], 20); ?></div></td> <td><a class="KT_edit_link" href="index2.php?id=<?php echo $row_rsfolio1['id']; ?>&KT_back=1"><?php echo NXT_getResource("edit_one"); ?></a> <a class="KT_delete_link" href="#delete"><?php echo NXT_getResource("delete_one"); ?></a> </td> </tr> <?php } while ($row_rsfolio1 = mysql_fetch_assoc($rsfolio1)); ?> <?php } // Show if recordset not empty ?> </tbody> </table> <div class="KT_bottomnav"> <div> <?php $nav_listfolio4->Prepare(); require("includes/nav/NAV_Text_Navigation.inc.php"); ?> </div> </div> <div class="KT_bottombuttons"> <div class="KT_operations"> <a class="KT_edit_op_link" href="#" onClick="nxt_list_edit_link_form(this); return false;"><?php echo NXT_getResource("edit_all"); ?></a> <a class="KT_delete_op_link" href="#" onClick="nxt_list_delete_link_form(this); return false;"><?php echo NXT_getResource("delete_all"); ?></a> </div> <span> </span> <select name="no_new" id="no_new"> <option value="1">1</option> <option value="3">3</option> <option value="6">6</option> </select> <a class="KT_additem_op_link" href="index2.php?KT_back=1" onClick="return nxt_list_additem(this)"><?php echo NXT_getResource("add new"); ?></a> </div> </form> </div> <br class="clearfixplain" /> </div> <p> </p> <br /> <br /> </div> <div id="footer" class="hover"> <div id="footercontainer"> <div id="footerresources"> <img src="footerresources.gif" alt="Resources" width="300" height="7" /> <p><a href="http://www.cl.cam.ac.uk/~mgk25/iso-paper.html">Paper Sizes</a><br /> Gives an explanation of the ISO standard paper size system, with a range of paper sizes.</p> <p><a href="http://www.gapingvoid.com/Moveable_Type/archives/000876.html">How to be Creative</a><br /> A list of useful tips on how to get your creative juices flowing.</p> <p><a href="http://www.dafont.com">DaFont</a><br /> The best database of freeware fonts.</p> <p><a href="http://www.bluevertigo.com.ar/bluevertigo.htm">Blue Vertigo</a><br /> A resource for resources!</p> <p><a href="http://psdtuts.com/">PSD Tuts</a><br /> Thoroughly explained tutorials that always come in handy.</p> <p><a href="http://www.sxc.hu/index.phtml">Stock.xchng</a><br /> The best site for royalty free stock photography</p> </div> <div id="footerperiodicals"> <img src="footerperiodicals.gif" alt="Periodicals" width="300" height="7" /> <p><a href="http://www.alistapart.com">A List Apart</a><br /> An excellent resource with well written articles on web design.</p> <p><a href="http://www.designobserver.com">Design Observer</a><br /> One of the best web magazines/blogs on graphic design, amongst other things.</p> <p><a href="http://ilovetypography.com">I Love Typography</a><br /> If typography is your thing, so is this great blog.</p> </div> <div id="footerpersonals"> <img src="footerpersonals.gif" alt="Personals" width="300" height="7" /> <p><a href="http://alanlbw.wordpress.com">Alan Leatherbarrow</a><br /> A photographer from my home city of Liverpool.</p> <p><a href="http://draw.vox.com/">Marc Johns</a><br /> A subtly amusing illustrator from Canada.</p> <p><a href="http://www.davidairey.com/">David Airey</a><br /> A very popular logo designer, with a very popular website.</p> <p><a href="http://jefffisherlogomotives.blogspot.com/">Jeff Fisher</a><br /> A logo designer who often goes into detail about the design process.</p> <p><a href="http://kkwu.wordpress.com/">K3n</a><br /> Keeps people updated on various design-related news.</p> <p><a href="http://blog.signalnoise.com/">Jeff White</a><br /> A great blog on general design and his own work.</p> </div> </div> </div> </body> </html> <?php mysql_free_result($rsfolio1); ?> and this is my upload page <?php require_once('Connections/neiladmin.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_neiladmin = new KT_connection($neiladmin, $database_neiladmin); //Start Restrict Access To Page $restrict = new tNG_RestrictAccess($conn_neiladmin, ""); //Grand Levels: Any $restrict->Execute(); //End Restrict Access To Page // Start trigger $formValidation = new tNG_FormValidation(); $tNGs->prepareValidation($formValidation); // End trigger //start Trigger_FileUpload trigger //remove this line if you want to edit the code by hand function Trigger_FileUpload(&$tNG) { $uploadObj = new tNG_FileUpload($tNG); $uploadObj->setFormFieldName("file"); $uploadObj->setDbFieldName("file"); $uploadObj->setFolder("folio/"); $uploadObj->setMaxSize(4000); $uploadObj->setAllowedExtensions("pdf, txt, jpg, jpeg, png, gif"); $uploadObj->setRename("auto"); return $uploadObj->Execute(); } //end Trigger_FileUpload trigger // Make a logout transaction instance $logoutTransaction = new tNG_logoutTransaction($conn_neiladmin); $tNGs->addTransaction($logoutTransaction); // Register triggers $logoutTransaction->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "GET", "KT_logout_now"); $logoutTransaction->registerTrigger("END", "Trigger_Default_Redirect", 99, "login.php?message=Message saved successfully!"); // Add columns // End of logout transaction instance // Make an insert transaction instance $ins_folio = new tNG_insert($conn_neiladmin); $tNGs->addTransaction($ins_folio); // Register triggers $ins_folio->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1"); $ins_folio->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation); $ins_folio->registerTrigger("END", "Trigger_Default_Redirect", 99, "index.php?message=Message saved successfully!"); $ins_folio->registerTrigger("AFTER", "Trigger_FileUpload", 97); // Add columns $ins_folio->setTable("folio"); $ins_folio->addColumn("file", "FILE_TYPE", "FILES", "file"); $ins_folio->addColumn("title", "STRING_TYPE", "POST", "title"); $ins_folio->addColumn("Description", "STRING_TYPE", "POST", "Description"); $ins_folio->addColumn("category", "STRING_TYPE", "POST", "category"); $ins_folio->setPrimaryKey("id", "NUMERIC_TYPE"); // Execute all the registered transactions $tNGs->executeTransactions(); // Get the transaction recordset $rscustom = $tNGs->getRecordset("custom"); $row_rscustom = mysql_fetch_assoc($rscustom); $totalRows_rscustom = mysql_num_rows($rscustom); // Get the transaction recordset $rsfolio = $tNGs->getRecordset("folio"); $row_rsfolio = mysql_fetch_assoc($rsfolio); $totalRows_rsfolio = mysql_num_rows($rsfolio); ?> <!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>Untitled Document</title> <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();?> <style type="text/css"> <!-- .style1 { color: #FF00FF; font-weight: bold; } .style2 { color: #0000CC; font-style: italic; font-size: 36px; } --> </style> </head> <body> <form method="post" id="form1" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>" enctype="multipart/form-data"> <table cellpadding="2" cellspacing="0" class="KT_tngtable"> <tr> <td class="KT_th"><label for="file">File:</label></td> <td><input type="file" name="file" id="file" size="32" /> <?php echo $tNGs->displayFieldError("folio", "file"); ?> </td> </tr> <tr> <td class="KT_th"><label for="title">Title:</label></td> <td><input type="text" name="title" id="title" value="<?php echo KT_escapeAttribute($row_rsfolio['title']); ?>" size="32" /> <?php echo $tNGs->displayFieldHint("title");?> <?php echo $tNGs->displayFieldError("folio", "title"); ?> </td> </tr> <tr> <td class="KT_th"><label for="Description">Description:</label></td> <td><input type="text" name="Description" id="Description" value="<?php echo KT_escapeAttribute($row_rsfolio['Description']); ?>" size="32" /> <?php echo $tNGs->displayFieldHint("Description");?> <?php echo $tNGs->displayFieldError("folio", "Description"); ?> </td> </tr> <tr> <td class="KT_th"><label for="category">Category:</label></td> <td><input type="text" name="category" id="category" value="<?php echo KT_escapeAttribute($row_rsfolio['category']); ?>" size="32" /> <?php echo $tNGs->displayFieldHint("category");?> <?php echo $tNGs->displayFieldError("folio", "category"); ?> </td> </tr> <tr class="KT_buttons"> <td colspan="2"><input type="submit" name="KT_Insert1" id="KT_Insert1" value="Insert record" /> </td> </tr> </table> </form> <p class="style1"><span class="style2"><a href="index.php">CLICK HERE</a></span> IF YOU WANT TO SEE YOUR HOMEPAGE NEIL, DONT FORGET I HAVE TO PUT ALL THE STYLES ON AND MAKE THE IMAGE SHOW UP RATHER THAN THE DIRECTORY BUT THEN ITS ALL CSS FROM NOW ON IN! WELL BE FINISHED BY TOMORROW NIGHT ! </p> <p><br> <br> <?php echo $tNGs->getErrorMsg(); ?> <a href="<?php echo $logoutTransaction->getLogoutLink(); ?>">Logout</a></p> <p> </p> <p> </p> <p> </p> </body> </html> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.