Jump to content

zeusthegreat

Member
  • Posts

    86
  • Joined

  • Last visited

Everything posted by zeusthegreat

  1. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Web Form Design and Development :: Lesson 8</title> <meta name="description" content="A Tuts+ Course"> <meta name="author" content="Adi Purdila"> <!-- Stylesheets --> <link rel="stylesheet" href="css/normalize.css" /> <link rel="stylesheet" href="css/styles.css" /> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <header class="demo-header"> <hgroup> <h1>Web Form Design and Development</h1> <h3>Lesson 8: Server-side validation (the classic method)</h3> </hgroup> </header> <div class="demo-lesson-nav"> <a href="lesson7.html" class="demo-lesson-nav-prev">← Previous Lesson</a> <a href="lesson9.html" class="demo-lesson-nav-next">Next Lesson →</a> </div> <!-- end demo-lesson-nav --> <div class="demo-container"> <form action="scripts/lesson 8/validate.php" method="POST" id="form-new-account" novalidate> <fieldset> <legend>Create a New Account</legend> <p> <label for="name">Name:</label><br /> <input type="text" name="name" id="name" maxlength="25" class="validate-locally" /> <span class="demo-input-info">E.g. John Smith, must be between 3 and 25 characters, letters and spaces only</span> <span class="demo-errors"></span> </p> <p> <label for="username">Username:</label><br /> <input type="text" name="username" id="username" maxlength="15" class="validate-locally" /> <span class="demo-input-info">E.g. johnsmith, must be between 3 and 15 alphanumeric characters</span> <span class="demo-errors"></span> </p> <p> <label for="username">Gender:</label><br /> <select name="gender" id="gender"> <option value="0">- Select a Value -</option> <option value="1">Male</option> <option value="2">Female</option> </select> <span class="demo-errors"></span> </p> <p> <label for="email">Email Address:</label><br /> <input type="email" name="email" id="email" class="validate-locally" /> <span class="demo-input-info">E.g. john@company.com</span> <span class="demo-errors"></span> </p> <p> <label for="password">Password:</label><br /> <input type="password" name="password" id="password" class="validate-locally" /> <span class="demo-input-info">Must be 6 characters minimum, alphanumeric</span> <span class="demo-errors"></span> </p> <p> <label for="confirm-password">Confirm Password:</label><br /> <input type="password" name="confirm-password" id="confirm-password" class="validate-locally" /> <span class="demo-errors"></span> </p> <p> <input type="checkbox" id="subscribe" name="subscribe" value="on"/> <label for="subscribe">Subscribe to newsletter</label> </p> <p> <input type="submit" value="Create Account" name="submit" /> </p> <p><small><em>Note: All fields are required!</em></small></p> </fieldset> </form> </div> <!-- end demo-container --> <footer class="demo-footer"> <p><small>a <a href="#">FORM</a> course by Ant brom</small></p> </footer> <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> <script src="scripts/lesson 8/validate.js"></script> </body> </html> tryed messing with from aswell as the php validate page ************************************************************************************************************************************** <?php ini_set('error_reporting', E_ALL); ini_set('display_errors', '1'); /***********************************************************************************************/ /* If nothing is posted then we exit */ /***********************************************************************************************/ if (!$_POST) { die("This file cannot be accessed directly!"); }else{ if($_POST['$subscribe'] == 'subscribe') { // The Cheque checkbox was checked. } else { // The Cheque checkbox was NOT checked. } } /***********************************************************************************************/ /* Define regular expression patterns */ /***********************************************************************************************/ $expEmail = '/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/'; $expLettersOnly = '/^[a-zA-Z ]+$/'; $expLettersNumbers = '/^[a-zA-Z0-9]*$/'; /***********************************************************************************************/ /* Define the function for checking the field length */ /***********************************************************************************************/ function validateLength($fieldValue, $minLength) { return (strlen(trim($fieldValue)) > $minLength); } /***********************************************************************************************/ /* Get the posted field values and validate each field */ /***********************************************************************************************/ $name = $_POST["name"]; $username = $_POST["username"]; $gender = $_POST["gender"]; $email = $_POST["email"]; $password = $_POST["password"]; $confirmPassword = $_POST["confirm-password"]; $subscribe = $_POST["subscribe"]; $errorExists = false; $errors = "Errors: <ul>"; // Name if (!validateLength($name, 2)) { $errorExists = true; $errors .= "<li>The name is too short!</li>"; } if (preg_match($expLettersOnly, $name) !== 1) { $errorExists = true; $errors .= "<li>The name can only contain letters and spaces!</li>"; } // Username if (!validateLength($username, 2)) { $errorExists = true; $errors .= "<li>The username is too short!</li>"; } if (preg_match($expLettersNumbers, $username) !== 1) { $errorExists = true; $errors .= "<li>The username can only contain alphanumeric characters!</li>"; } // Gender if ($gender === "1") { $gender = "Male"; } else if ($gender === "2") { $gender = "Female"; } else { $errorExists = true; $errors .= "<li>Please select a gender!</li>"; } // Email if (preg_match($expEmail, $email) !== 1) { $errorExists = true; $errors .= "<li>The email address format is invalid!</li>"; } // Password if (!validateLength($password, 5)) { $errorExists = true; $errors .= "<li>The password is too short!</li>"; } if (preg_match($expLettersNumbers, $password) !== 1) { $errorExists = true; $errors .= "<li>The password can only contain alphanumeric characters!</li>"; } // Confirm Password if ($confirmPassword !== $password) { $errorExists = true; $errors .= "<li>The passwords don't match!</li>"; } // If no errors, echo the results if (!$errorExists) { echo "<h3>Success! The form has been submitted!</h3>" . "<p>Details:</p>" . "<ul>" . "<li>Name: $name</li>" . "<li>Usernname: $username</li>" . "<li>Gender: $gender</li>" . "<li>Email: $email</li>" . "<li>Subscribe to newsletter: $subscribe</li>" . "</ul>"; } else { echo "<h3>Error! Please address the following issues:</h3>" . $errors; } ?> and now i do not know what i am or what i am doing been on it all day and think i have made it alot worse than it was at first
  2. I have done some checking and London is GMT +1 I thought it was 0 getlang "eng" ,"ISO-8859-1" , "+1" still cannot get it to work though weird I have done this before with no probs any detailed accounts please
  3. time.php <?php include("conf.php"); function getlang($language, $charset) { global $lang; global $diff; global $char; if (!isset($lang) || empty($lang) || $lang == "false") { $found_lang[0] = strtolower(substr($language,0,3)) . '_' . strtoupper(substr($language,0,3)); $found_lang[1] = strtolower(substr($language,0,3)) . '-' . strtoupper(substr($language,0,3)); $found_lang[2] = strtolower(substr($language,0,2)) . '_' . strtoupper(substr($language,0,2)); $found_lang[3] = strtolower(substr($language,0,2)) . '-' . strtoupper(substr($language,0,2)); } else { $found_lang[0] = strtolower(substr($lang,0,3)) . '_' . strtoupper(substr($lang,0,3)); $found_lang[1] = strtolower(substr($lang,0,3)) . '-' . strtoupper(substr($lang,0,3)); $found_lang[2] = strtolower(substr($lang,0,2)) . '_' . strtoupper(substr($lang,0,2)); $found_lang[3] = strtolower(substr($lang,0,2)) . '-' . strtoupper(substr($lang,0,2)); } if (!isset($char) || empty($char) || $char == "false") { $char = $charset; } $lang = array($found_lang[0],$found_lang[1],$found_lang[2],$found_lang[3]); if (function_exists('mb_convert_encoding')) { setlocale(LC_ALL, $lang); $date = ucwords(strftime("%A, %d %B %Y")) . " " . gmdate("H:i:s", time() + $diff); $time = mb_convert_encoding($date, "$char"); } else { setlocale(LC_ALL, $lang); $time = ucwords(strftime("%A, %d %B %Y")) . " " . gmdate("H:i:s", time() + $diff); } echo $time; } ?> conf.php <?php $lang = "eng"; // Put your language or put false // For example: "eng" or "ita" or "deu" or "fra"... or "false" $char = "ISO-8859-1"; // Put your charset or put false // For example: "UTF-8" or "ISO-8859-1"... or "false" $diff = "0"; // Change this with your different GMT time ?> It is an hour out I thought I had set it to GMT I am in the uk by the way! but it is 1 hour behind pls help anyone thanks
  4. I have two pages an index page and a product page on the index page the id and all the other parts i wish to echo out return to the page I just wondered if i did this right I had my first image and i saved it to a folder called inventory_images and i saved is as 1 (did i do this right ) I can get this image out to the page when i view it through localhost and all the other data i wish to return on the index page when i try to return my data and picy on the product page i get No product in the database with thatID ( now this indicates that there is no item with that id ) On the product page the only thing i can think of that i have done differently is to render out my product Id dynamically i think anyway please could someone take a look and tell me what they think. index.php //error reporting error_reporting(E_ALL); ini_set('display_errors', '1'); ?> <?php //run a select query to get my latest 6 items //Connect to the MySQL database if they do have a session variable set yp you do not exit the script you allow the script to keep running include "storescripts/connect_to_mysql.php"; // include the database connection file so you link to your database $dynamicList = ""; $sql = mysql_query("SELECT * FROM products Order BY date_added DESC LIMIT 6"); $productCount = mysql_num_rows($sql);//count the the output ammount if ($productCount > 0){ while($row = mysql_fetch_array($sql)){ $id = $row["id"]; $price = $row["price"]; $details = $row["details"]; $category = $row["category"]; $product_name = $row["product_name"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_added"])); // Notice here how we changed it from _added to _Added $dynamicList .= ' <table width="98%" cellpadding="3"> <tr> <td width="32%" valign="top"><a href="product.php?"><img style="border:#666 2px solid" src="inventory_images/1.jpg" alt="$dynamicTitle" width="50" height="50" border="1"></a></td> <td width="68%" valign="top"><h5><b>ID</b></h5>' . $id . '<br> <h5><b>NAME</b></h5> ' . $product_name . ' <h6>*Category* ' . $category . '</h6> PRICE: £' . $price . '<br> <a href="product.php?">View Product <br> </a><br></td> </tr> </table>'; } }else{ $dynamicList = "We have no products listed in our store Yet"; } mysql_close(); ?> <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> <link href="my_carousel/includes/shop.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="my_carousel/includes/jquery-1.7.2 (2).js"></script> <script type="text/javascript" src="my_carousel/includes/jquery.roundabout.min.js"></script> <script type="text/javascript" src="my_carousel/includes/carousel.js"></script><!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>'>http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <script type="text/javascript"> function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } </script> </head> <body onLoad="MM_preloadImages('style/home-reg.png','style/web-designred2a-final.png','style/web-development-final.png','style/e-coomerceneworange.png','style/pricingtNew-final.png')"> <div id="mainWrapper"> <div class="mainWrapper"> <header><div><table align="right" style="margin-right:16px" width="72%" cellpadding="1"> <tr> <td width="16%" height="41"><a href="index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Index/Home page ','','style/home-reg.png',1)"><img src="style/home-grey-final.png" alt="Web Design, Graphic Design, Logo Design, Web development, E-Commerce, scripting, Apps, Portia Solutions we will design the exact website for your business" name="Index/Home page " width="79" height="29" border="0"></a></td> <td width="15%"><a href="web-design.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Web Design','','style/web-designred2a-final.png',1)"><img src="style/web-designnew2.png" alt="Web Design here at portia solutions, we will give you exactly what you want to sell your business" name="Web Design" width="79" height="29" border="0"></a></td> <td width="15%"><a href="web-development.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Web Development','','style/web-development-final.png',1)"><img src="style/web-development-green.png" alt="Portia solutions Web Development, web design, branding, advertising packages" name="Web Development" width="79" height="29" border="0"></a></td> <td width="15%"><a href="e-commerce.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('E-Commerce','','style/e-coomerceneworange.png',1)"><img src="style/e-coomercenewgreen-final.png" alt="E-Commerce portia solutions will design you an online shop for five hundred pounds starting fee." name="E-Commerce" width="79" height="29" border="0"></a></td> <td width="15%"><a href="pricing.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Pricing','','style/pricingtNew-final.png',1)"><img src="style/pricing-final.png" alt="Pricing at portia soltions , we will customise a package to suit your needs" name="Pricing" width="79" height="29" border="0"></a></td> <td width="24%"><img src="style/phone.png" alt="phone" width="100" height="78" border="0"></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td height="195" colspan="6"> <div class="my_carousel"> <div class="carousel_container"> <div id="carousel"></div> <img src="my_carousel/images/arrow_left_new.png" alt="left" width="25" height="50" class="nextItem"> <img src="my_carousel/images/arrow_right_new.png" alt="right" width="25" height="50" class="prevItem"> </div> <div class="caption_container"> <div id="captions"></div> </div> <img src="my_carousel/images/BALLOONS-psd65115new.png" alt="balloons" width="75" height="65" class="balloons"> <div class="carousel_data"> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/1_page.png" alt="1-page" /> </div> <div class="caption"> <h2>1 Page</h2> <p>A 1-page website can be enough to advertise your business and get it noticed or it can improve the interest in your product or business. From £50</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/2ormore_pages.png" alt="2ormorepage" /> </div> <div class="caption"> <h2>2 or more page</h2> <p>Two or more page website design that can be as unique as you want it to be. It ca also be be totally interactive.</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/brand.png.png" alt="branding" /> </div> <div class="caption"> <h2>Branding and Internet marketing</h2> <p>Branding is extremely important as it can be the difference between your business running month to month or growing and one of the ways that you pull visitors onto your website is through Internet marketing.</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/eCommerce.png" alt="ecommerce" /> </div> <div class="caption"> <h2>E Commerce</h2> <p>E commerce or online shopping. avertise your product in all its glory and emphasize all its attributes</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/graphics_templates.png" alt="graphics" /> </div> <div class="caption"> <h2>Graphic design and logos, templates </h2> <p>Graphic design and manipulation, with all files and elements, we will design you a bespoke logo, one that your are confident with and suits your company shop etc we will design you flyers from a template if wished.</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/hosting_SEO.png" alt="hosting" /> </div> <div class="caption"> <h2>Hosting packages and SEO services</h2> <p>A hosting package that suits everybody, i you wish SEO services can help your website to be easily reached</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/improvement_train.png" alt="improvement" /> </div> <div class="caption"> <h2>Improvement Plan Continual Training</h2> <p>Continual learning to achieve your websites maximum goal and improve visitor numbers to your website and hopefully interest inyour product.</p> </div> </div> <!-- end items --> </div> </div></td> <!-- Carousel --></tr> </table> <div align="left"> <div><a href="#"><img src="" alt="Insert Logo Here" width="85" height="85" id="Insert_logo" style="background: #C6D580; display:block;" /></a></div> </div> </div> <a href="#"></a> </header> <div class="sidebar1"> <nav> <ul> <li><a href="#">graphic Design</a></li> <li><a href="#">Pay monthly</a></li> <li><a href="#">pricing</a></li> <li><a href="#">templates</a></li> <li><a href="#">**Contact Us**</a></li> </ul> </nav> <div> <aside> <div><section> <p><img src="style/portia_price (2).gif" width="120" height="291" alt="portia_price"></p> </section></div> <p> </p> <p> </p> <section> <p>starting point and modify the properties to produce your own unique look. If you require flyout menus, create your own using a Spry menu, a menu widget from Adobe's Exchange or a variety of other javascript or CSS solutions.</p> <p>If you would like the navigation along the top, simply move the ul to the top of the page and recreate the styling.</p> </section> </aside> </div> <!-- end .sidebar1 --></div> <article class="content"> <h1>Portia Solutions</h1> <section> <h2>Bespoke</h2> <p>Bespoke is an English word meaning made to a buyers specification. (personalised or tailored) Portia will design you a completely unique website that will advertise your business or product precisely.</p> </section> <section> <h2>Web Development</h2> <p><B>Web development</B> is a broad term for the work involved in developing a <A title="Web site" href="/wiki/Web_site">web site</A> for the Internet (<A title="World Wide Web" href="/wiki/World_Wide_Web">World Wide Web</A>) or an <A title="Intranet" href="/wiki/Intranet">intranet</A> (a private network). This can include <A title="Web design" href="/wiki/Web_design">web design</A>, <A title="Web content development" href="/wiki/Web_content_development">web content development</A>, client liaison, <A title="Client-side scripting" href="/wiki/Client-side_scripting">client-side</A>/<A title="Server-side scripting" href="/wiki/Server-side_scripting">server-side</A> <A title="Programming" href="/wiki/Programming">scripting</A>, <A title="Web server" href="/wiki/Web_server">web server</A> and <A title="Network security" href="/wiki/Network_security">network security</A> configuration, and <A title="E-commerce" href="/wiki/E-commerce">e-commerce</A> development. However, among web professionals, "web development" usually refers to the main non-design aspects of building web sites: writing <A title="Markup language" href="/wiki/Markup_language">markup</A> and <A title="Computer programming" href="/wiki/Computer_programming">coding</A>. Web development can range from developing the simplest static single page of <A title="Plain text" href="/wiki/Plain_text">plain text</A> to the most complex web-based <A title="Internet application" href="/wiki/Internet_application">internet applications</A>, <A title="Electronic business" href="/wiki/Electronic_business">electronic businesses</A>, or <A title="Social network service" href="/wiki/Social_network_service">social network services</A>.</p> <p>For larger organizations and businesses, web development teams can consist of hundreds of people (<A title="Web developer" href="/wiki/Web_developer">web developers</A>). Smaller organizations may only require a single permanent or contracting <A title="Webmaster" href="/wiki/Webmaster">webmaster</A>, or secondary assignment to related job positions such as a <A title="Graphic designer" href="/wiki/Graphic_designer">graphic designer</A> and/or <A title="Information systems" href="/wiki/Information_systems">information systems</A> technician. Web development may be a collaborative effort between departments rather than the domain of a designated department.</p> <p> </p> <p>Numerous technologies and languages used to suit your aesthetics of your business/product.</p> </section> <section> <h2>E-Commerce</h2> <p><B>Electronic commerce</B>, commonly known as <B>e-commerce</B> or <B>e-comm</B>, is the buying and selling of <A title="Product (business)" >products</A> or <A title="Service (economics)>services</A> over electronic systems such as the <A title="Internet" >Internet</A> and other <A title="Computer network" >computer networks</A>. Electronic commerce draws on such technologies as <A title="Electronic funds transfer">electronic funds transfer</A>, <A title="Supply chain management" >supply chain management</A>, <A title="Internet marketing">Internet marketing</A>, <A title="Online transaction processing" >online transaction processing</A>, <A title="Electronic data interchange">electronic data interchange</A> (EDI), <A title="Inventory management">inventory management</A> systems, and automated data collection systems. Modern electronic commerce typically uses the <A title="World Wide Web" >World Wide Web</A> at least at one point in the transaction's life-cycle, although it may encompass a wider range of technologies such as <A title="E-mail" href="/wiki/E-mail">e-mail</A>, mobile devices and telephones as well.</p> <UL> <LI>Electronic commerce is generally considered to be the sales aspect of <A title="E-business" href="/wiki/E-business">e-business</A>. It also consists of the exchange of data to facilitate the financing and payment aspects of business transactions.</LI> </UL> <p>Starting at only £500 data driven websites, an increase in sales, large full advertising campaign or customise your advertising. Full Build and Marketing Service.</p> </section> <section> <h2>Html5 and Css3</h2> <p>HTML5 is a markup language for structuring and presenting content for the World Wide Web, and is a core technology of the Internet originally proposed by Opera Software.[2] It is the fifth revision of the HTML zsstandard. Html5 is still in its early stages yet so we will continue to learn new code-writing technologies to make sure that your website does not fall behind your competitors.</p> <p align="center"><img src="style/webdevelopment.finished.png" width="250" height="90" alt="html5"></p> <div align="center"> <table style width="92%" cellpadding="1"> <tr> <td width="24%" valign="top"><h6>Details<br> <?php echo $details ?> </h6> <h6><br> </h6></td> <td width="59%" valign="top"><h6>Newest Items added to the store </h6> <p><?php echo $dynamicList; ?><br> <!--<table width="98%" cellpadding="3"> <tr> <td width="32%" valign="top"> <td width="68%" valign="top">Product Title<br> Product Details Product Price<br> <a href="product.php?">View Product <br> </a><br></td> </tr> </table>--> <br> <br> </p></td> <p><br> <br> <br> <br> <br> <br> <br> </p> <p><br> </p></td> <td width="17%" valign="top"><h6>Price<br> £<?php echo $price ?> </h6> <p> </p> <p> </p></td> </tr> </table> </div> </section> </article> <section> <!-- end .content --> <aside class="aside-right"> <h4>Backgrounds</h4> <section> <p>By nature, the background color on any block element will only</p> </section> <section> <p>show for the length of the content. If you'd like a dividing line instead of a color, place a border on the side of the .content block (but only if it will always contain more content).</p> <article> </article> </section> </aside> <footer> <section> <div align="center"><a href="How_long.php">:How long will it Take?:</a> </div> </section> <section> <div align="center"><a href="#">:Do we Outsource?:</a></div> </section> <div align="center"><a href="#">:How long will it take to get recognized?: </a></div> <a href="#"> <section> </section> </a> <section> <p align="center"> </p></section> <section> <div align="right"> <table align="left" width="55%%" cellpadding="1"> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> <address class="copyright"> ©Copyrighted by Portia Solutions </address></td> </tr> </table> <img style="margin-right:5px" src="style/portia.png" alt="portia" width="160" height="85"></div> </section> </footer> <!-- end .container --></div> </body> </html> product.php <?php //error reporting error_reporting(E_ALL); ini_set('display_errors', '1'); ?> <?php // Check to see URL Variable is set and that it exists in the database if (isset($_GET['id'])){ //connect to the database include "storescripts/connect_to_mysql.php"; $id = preg_replace('#[^0-9]#i', '', $_GET['id']); //use this var to check to see if this ID Exists, if yes then get the product //details, if no then exit this script and give message why. $sql = mysql_query("SELECT * FROM products WHERE id='$id' LIMIT 1"); $productCount = mysql_num_rows($sql);//count the the output ammount if ($productCount > 0){ // get all the product details while($row = mysql_fetch_array($sql)){ $id = $row["id"]; $details = $row["details"]; $product_name = $row["product_name"]; $category = $row["category"]; $subcategory = $row["subcategory"]; $price = $row["price"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_added"])); // Notice here how we changed it from _added to _Added //product_name,price,details,category,subcategory,date_added } }else{ echo "That item does not exist"; exit(); } }else{ echo "No product in the database with thatID"; exit(); } mysql_close(); ?> <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title><?php echo $product_name; ?></title> <link href="my_carousel/includes/shop.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="my_carousel/includes/jquery-1.7.2 (2).js"></script> <script type="text/javascript" src="my_carousel/includes/jquery.roundabout.min.js"></script> <script type="text/javascript" src="my_carousel/includes/carousel.js"></script><!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <script type="text/javascript"> function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } </script> </head> <body onLoad="MM_preloadImages('style/home-reg.png','style/web-designred2a-final.png','style/web-development-final.png','style/e-coomerceneworange.png','style/pricingtNew-final.png')"> <div id="mainWrapper"> <div class="mainWrapper"> <header><div><table align="right" style="margin-right:16px" width="72%" cellpadding="1"> <tr> <td width="16%" height="41"><a href="index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Index/Home page ','','style/home-reg.png',1)"><img src="style/home-grey-final.png" alt="Web Design, Graphic Design, Logo Design, Web development, E-Commerce, scripting, Apps, Portia Solutions we will design the exact website for your business" name="Index/Home page " width="79" height="29" border="0"></a></td> <td width="15%"><a href="web-design.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Web Design','','style/web-designred2a-final.png',1)"><img src="style/web-designnew2.png" alt="Web Design here at portia solutions, we will give you exactly what you want to sell your business" name="Web Design" width="79" height="29" border="0"></a></td> <td width="15%"><a href="web-development.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Web Development','','style/web-development-final.png',1)"><img src="style/web-development-green.png" alt="Portia solutions Web Development, web design, branding, advertising packages" name="Web Development" width="79" height="29" border="0"></a></td> <td width="15%"><a href="e-commerce.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('E-Commerce','','style/e-coomerceneworange.png',1)"><img src="style/e-coomercenewgreen-final.png" alt="E-Commerce portia solutions will design you an online shop for five hundred pounds starting fee." name="E-Commerce" width="79" height="29" border="0"></a></td> <td width="15%"><a href="pricing.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Pricing','','style/pricingtNew-final.png',1)"><img src="style/pricing-final.png" alt="Pricing at portia soltions , we will customise a package to suit your needs" name="Pricing" width="79" height="29" border="0"></a></td> <td width="24%"><img src="style/phone.png" alt="phone" width="100" height="78" border="0"></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td height="196" colspan="6"> <div class="my_carousel"> <div class="carousel_container"> <div id="carousel"></div> <img src="my_carousel/images/arrow_left_new.png" alt="left" width="25" height="50" class="nextItem"> <img src="my_carousel/images/arrow_right_new.png" alt="right" width="25" height="50" class="prevItem"> </div> <div class="caption_container"> <div id="captions"></div> </div> <img src="my_carousel/images/BALLOONS-psd65115new.png" alt="balloons" width="75" height="65" class="balloons"> <div class="carousel_data"> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/1_page.png" alt="1-page" /> </div> <div class="caption"> <h2>1 Page</h2> <p>A 1-page website can be enough to advertise your business and get it noticed or it can improve the interest in your product or business. From £50</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/2ormore_pages.png" alt="2ormorepage" /> </div> <div class="caption"> <h2>2 or more page</h2> <p>Two or more page website design that can be as unique as you want it to be. It ca also be be totally interactive.</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/brand.png.png" alt="branding" /> </div> <div class="caption"> <h2>Branding and Internet marketing</h2> <p>Branding is extremely important as it can be the difference between your business running month to month or growing and one of the ways that you pull visitors onto your website is through Internet marketing.</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/eCommerce.png" alt="ecommerce" /> </div> <div class="caption"> <h2>E Commerce</h2> <p>E commerce or online shopping. avertise your product in all its glory and emphasize all its attributes</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/graphics_templates.png" alt="graphics" /> </div> <div class="caption"> <h2>Graphic design and logos, templates </h2> <p>Graphic design and manipulation, with all files and elements, we will design you a bespoke logo, one that your are confident with and suits your company shop etc we will design you flyers from a template if wished.</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/hosting_SEO.png" alt="hosting" /> </div> <div class="caption"> <h2>Hosting packages and SEO services</h2> <p>A hosting package that suits everybody, i you wish SEO services can help your website to be easily reached</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/improvement_train.png" alt="improvement" /> </div> <div class="caption"> <h2>Improvement Plan Continual Training</h2> <p>Continual learning to achieve your websites maximum goal and improve visitor numbers to your website and hopefully interest inyour product.</p> </div> </div> <!-- end items --> </div> </div></td> <!-- Carousel --></tr> </table> <div align="left"> <div><a href="#"><img src="" alt="Insert Logo Here" width="85" height="85" id="Insert_logo" style="background: #C6D580; display:block;" /></a></div> </div> </div> <a href="#"></a> </header> <article style="width:96%; margin-left:auto; margin-right:auto" class="content"> <h1>Portia Solutions</h1> <section> <h2>Hold</h2> <p> </p> </section> <section> <h2>Hold2</h2> <p> </p> </section> <section> <h2>Hold3</h2> <p> </p> </section> <section> <h2>Hold4</h2> <p> </p> <p align="center"><img src="style/webdevelopment.finished.png" width="250" height="90" alt="html5"></p> <div align="center"> <table width="96%" border="0" cellspacing="0" cellpadding="1"> <tr> <td width="25%" valign="top"><h5><?php echo $id; ?></h5> <hr> <div align="center"><img src="inventory_images/<?php echo $id; ?>.jpg" alt="<?php echo $product_name; ?>" width="41" height="34" border="1" valign="top" style="border:#666 2px solid"></div> </a> <p align="center" ><a href="inventory_images/<?php echo $id; ?>.jpg">VIEW FULL SIZE IMAGE</a></p></td> This website is very temporarily being used as an online live showcase area for an E - Commerce tutorial script set Adam is creating which can be seen on his channel here:<br /> <td width="1%"></p> <p>It is not an actual store and it will change directly after the tutorial series. <br /> <br /> This tutorial series is for educational purposes only. Use the scripts at your own risk.</p><td width="4%"></td> <td width="70%" valign="top"><h6><?php echo $product_name; ?><br> <?php echo $price; ?><br> <?php echo "$subcategory $category"; ?> <br> <?php echo $details; ?></h6> <h5> ADD TO CART</h5> <p> </p> <p><br /> </p> <p><br /> </p></td> </tr> </table> </div> </section> </article> <section> <!-- end .content --> <footer> <section> <div align="center"><a href="How_long.php">:How long will it Take?:</a> </div> </section> <section> <div align="center"><a href="#">:Do we Outsource?:</a></div> </section> <div align="center"><a href="#">:How long will it take to get recognized?: </a></div> <a href="#"> <section> </section> </a> <section> <p align="center"> </p></section> <section> <div align="right"> <table align="left" width="55%%" cellpadding="1"> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> <address class="copyright"> ©Copyrighted by Portia Solutions </address></td> </tr> </table> <img style="margin-right:5px" src="style/portia.png" alt="portia" width="160" height="85"></div> </section> </footer> <!-- end .container --></div> </body> </html> I have started this product page from scratch four times now so i am definately doing something wrong!
  5. No product in the database with that ID but i have a product in my database with the id of 1 (only 1 product so far). so i thought i had not echoed my product id out at all.
  6. index.php first of all with this page been over four times my head hurts! <?php //error reporting error_reporting(E_ALL); ini_set('display_errors', '1'); ?> <?php //run a select query to get my latest six items //Connect to the MySQL database if they do have a session variable set yp you do not exit the script you allow the script to keep running include "storescripts/connect_to_mysql.php"; // include the database connection file so you link to your database $dynamicList = ""; $sql = mysql_query("SELECT * FROM products Order By date_added Desc LIMIT 6"); $productCount = mysql_num_rows($sql);//count the the output ammount if ($productCount > 0){ while($row = mysql_fetch_array($sql)){ $id = $row["id"]; $price = $row["price"]; $details = $row["details"]; $product_name = $row["product_name"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_added"])); // Notice here how we changed it from _added to _Added $dynamicList .= ' <table align="center" width="98%" cellpadding="2"> <tr> <td width="30%" valign="top"><a href="product.php?id=' . $id . '"><img style="border:#666 2px solid" src="inventory_images/' . $id . '.jpg" alt="$product_name" width="41" height="43" border="1"></a></td> <td width="70%" valign="top">'. $product_name . '<br> $' . $price . '<br> <a href="product.php?id=' . $id . '">View Product Details</a><br> <br></td> </tr> </table>';//--"<h4>Product id =$id</h4> - <h6>The name of the Product is: <br> $product_name</h6>- <h6>The price of this product is: <br><b>* £$price *</h6> <h6>The product details are as follows: $details</h6>- <h6>The date this product was added to the system is :<br> $date_added</h6> <a href='inventory_edit.php? pid=$id'>edit</a> • •<a href='inventory_list.php?deleteid=$id'> delete</a><br/>";// } }else{ $dynamicList = "We have no products listed in Our store Yet"; } mysql_close(); ?> <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> <link href="my_carousel/includes/shop.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="my_carousel/includes/jquery-1.7.2 (2).js"></script> <script type="text/javascript" src="my_carousel/includes/jquery.roundabout.min.js"></script> <script type="text/javascript" src="my_carousel/includes/carousel.js"></script><!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>'>http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <script type="text/javascript"> function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } </script> </head> <body onLoad="MM_preloadImages('style/home-reg.png','style/web-designred2a-final.png','style/web-development-final.png','style/e-coomerceneworange.png','style/pricingtNew-final.png')"> <div id="mainWrapper"> <div class="mainWrapper"> <header><div><table align="right" style="margin-right:16px" width="72%" cellpadding="1"> <tr> <td width="16%" height="41"><a href="index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Index/Home page ','','style/home-reg.png',1)"><img src="style/home-grey-final.png" alt="Web Design, Graphic Design, Logo Design, Web development, E-Commerce, scripting, Apps, Portia Solutions we will design the exact website for your business" name="Index/Home page " width="79" height="29" border="0"></a></td> <td width="15%"><a href="web-design.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Web Design','','style/web-designred2a-final.png',1)"><img src="style/web-designnew2.png" alt="Web Design here at portia solutions, we will give you exactly what you want to sell your business" name="Web Design" width="79" height="29" border="0"></a></td> <td width="15%"><a href="web-development.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Web Development','','style/web-development-final.png',1)"><img src="style/web-development-green.png" alt="Portia solutions Web Development, web design, branding, advertising packages" name="Web Development" width="79" height="29" border="0"></a></td> <td width="15%"><a href="e-commerce.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('E-Commerce','','style/e-coomerceneworange.png',1)"><img src="style/e-coomercenewgreen-final.png" alt="E-Commerce portia solutions will design you an online shop for five hundred pounds starting fee." name="E-Commerce" width="79" height="29" border="0"></a></td> <td width="15%"><a href="pricing.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Pricing','','style/pricingtNew-final.png',1)"><img src="style/pricing-final.png" alt="Pricing at portia soltions , we will customise a package to suit your needs" name="Pricing" width="79" height="29" border="0"></a></td> <td width="24%"><img src="style/phone.png" alt="phone" width="100" height="78" border="0"></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td height="195" colspan="6"> <div class="my_carousel"> <div class="carousel_container"> <div id="carousel"></div> <img src="my_carousel/images/arrow_left_new.png" alt="left" width="25" height="50" class="nextItem"> <img src="my_carousel/images/arrow_right_new.png" alt="right" width="25" height="50" class="prevItem"> </div> <div class="caption_container"> <div id="captions"></div> </div> <img src="my_carousel/images/BALLOONS-psd65115new.png" alt="balloons" width="75" height="65" class="balloons"> <div class="carousel_data"> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/1_page.png" alt="1-page" /> </div> <div class="caption"> <h2>1 Page</h2> <p>A 1-page website can be enough to advertise your business and get it noticed or it can improve the interest in your product or business. From £50</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/2ormore_pages.png" alt="2ormorepage" /> </div> <div class="caption"> <h2>2 or more page</h2> <p>Two or more page website design that can be as unique as you want it to be. It ca also be be totally interactive.</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/brand.png.png" alt="branding" /> </div> <div class="caption"> <h2>Branding and Internet marketing</h2> <p>Branding is extremely important as it can be the difference between your business running month to month or growing and one of the ways that you pull visitors onto your website is through Internet marketing.</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/eCommerce.png" alt="ecommerce" /> </div> <div class="caption"> <h2>E Commerce</h2> <p>E commerce or online shopping. avertise your product in all its glory and emphasize all its attributes</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/graphics_templates.png" alt="graphics" /> </div> <div class="caption"> <h2>Graphic design and logos, templates </h2> <p>Graphic design and manipulation, with all files and elements, we will design you a bespoke logo, one that your are confident with and suits your company shop etc we will design you flyers from a template if wished.</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/hosting_SEO.png" alt="hosting" /> </div> <div class="caption"> <h2>Hosting packages and SEO services</h2> <p>A hosting package that suits everybody, i you wish SEO services can help your website to be easily reached</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/improvement_train.png" alt="improvement" /> </div> <div class="caption"> <h2>Improvement Plan Continual Training</h2> <p>Continual learning to achieve your websites maximum goal and improve visitor numbers to your website and hopefully interest inyour product.</p> </div> </div> <!-- end items --> </div> </div></td> <!-- Carousel --></tr> </table> <div align="left"> <div><a href="#"><img src="" alt="Insert Logo Here" width="85" height="85" id="Insert_logo" style="background: #C6D580; display:block;" /></a></div> </div> </div> <a href="#"></a> </header> <div class="sidebar1"> <nav> <p><a href="#">graphic Design</a></p> <p><a href="#">Pay monthly</a></p> <p><a href="#">pricing</a></p> <p><a href="#">templates</a></p> <p><a href="#">**Contact Us**</a></p> </nav> <div> <aside> <div><section> <p><img src="style/portia_price (2).gif" width="120" height="291" alt="portia_price"></p> </section></div> <p> </p> <p> </p> <section> <p>starting point and modify the properties to produce your own unique look. If you require flyout menus, create your own using a Spry menu, a menu widget from Adobe's Exchange or a variety of other javascript or CSS solutions.</p> <p>If you would like the navigation along the top, simply move the ul to the top of the page and recreate the styling.</p> </section> </aside> </div> <!-- end .sidebar1 --></div> <article class="content"> <h1>Portia Solutions</h1> <section> <h2>Bespoke</h2> <p>Bespoke is an English word meaning made to a buyers specification. (personalised or tailored) Portia will design you a completely unique website that will advertise your business or product precisely.</p> </section> <section> <h2>paraWeb Development</h2> <p><B>Web development</B> is a broad term for the work involved in developing a <A title="Web site" href="/wiki/Web_site">web site</A> for the Internet (<A title="World Wide Web" href="/wiki/World_Wide_Web">World Wide Web</A>) or an <A title="Intranet" href="/wiki/Intranet">intranet</A> (a private network). This can include <A title="Web design" href="/wiki/Web_design">web design</A>, <A title="Web content development" href="/wiki/Web_content_development">web content development</A>, client liaison, <A title="Client-side scripting" href="/wiki/Client-side_scripting">client-side</A>/<A title="Server-side scripting" href="/wiki/Server-side_scripting">server-side</A> <A title="Programming" href="/wiki/Programming">scripting</A>, <A title="Web server" href="/wiki/Web_server">web server</A> and <A title="Network security" href="/wiki/Network_security">network security</A> configuration, and <A title="E-commerce" href="/wiki/E-commerce">e-commerce</A> development. However, among web professionals, "web development" usually refers to the main non-design aspects of building web sites: writing <A title="Markup language" href="/wiki/Markup_language">markup</A> and <A title="Computer programming" href="/wiki/Computer_programming">coding</A>. Web development can range from developing the simplest static single page of <A title="Plain text" href="/wiki/Plain_text">plain text</A> to the most complex web-based <A title="Internet application" href="/wiki/Internet_application">internet applications</A>, <A title="Electronic business" href="/wiki/Electronic_business">electronic businesses</A>, or <A title="Social network service" href="/wiki/Social_network_service">social network services</A>.</p> <p>For larger organizations and businesses, web development teams can consist of hundreds of people (<A title="Web developer" href="/wiki/Web_developer">web developers</A>). Smaller organizations may only require a single permanent or contracting <A title="Webmaster" href="/wiki/Webmaster">webmaster</A>, or secondary assignment to related job positions such as a <A title="Graphic designer" href="/wiki/Graphic_designer">graphic designer</A> and/or <A title="Information systems" href="/wiki/Information_systems">information systems</A> technician. Web development may be a collaborative effort between departments rather than the domain of a designated department.</p> <p> </p> <p>Numerous technologies and languages used to suit your aesthetics of your business/product.</p> </section> <section> <h2>E-Commerce</h2> <p><B>Electronic commerce</B>, commonly known as <B>e-commerce</B> or <B>e-comm</B>, is the buying and selling of <A title="Product (business)" >products</A> or <A title="Service (economics)>services</A> over electronic systems such as the <A title="Internet" >Internet</A> and other <A title="Computer network" >computer networks</A>. Electronic commerce draws on such technologies as <A title="Electronic funds transfer">electronic funds transfer</A>, <A title="Supply chain management" >supply chain management</A>, <A title="Internet marketing">Internet marketing</A>, <A title="Online transaction processing" >online transaction processing</A>, <A title="Electronic data interchange">electronic data interchange</A> (EDI), <A title="Inventory management">inventory management</A> systems, and automated data collection systems. Modern electronic commerce typically uses the <A title="World Wide Web" >World Wide Web</A> at least at one point in the transaction's life-cycle, although it may encompass a wider range of technologies such as <A title="E-mail" href="/wiki/E-mail">e-mail</A>, mobile devices and telephones as well.</p> <UL> <LI>Electronic commerce is generally considered to be the sales aspect of <A title="E-business" href="/wiki/E-business">e-business</A>. It also consists of the exchange of data to facilitate the financing and payment aspects of business transactions.</LI> </UL> <p>Starting at only £500 data driven websites, an increase in sales, large full advertising campaign or customise your advertising. Full Build and Marketing Service.</p> </section> <section> <h2>Html5 and Css3</h2> <p>HTML5 is a markup language for structuring and presenting content for the World Wide Web, and is a core technology of the Internet originally proposed by Opera Software.[2] It is the fifth revision of the HTML zsstandard. Html5 is still in its early stages yet so we will continue to learn new code-writing technologies to make sure that your website does not fall behind your competitors.</p> <p align="center"><img src="style/webdevelopment.finished.png" width="250" height="90" alt="html5"></p> <div align="center"> <table style width="92%" cellpadding="1"> <tr> <td width="24%" valign="top"><h6>Details</h6></td> <td width="59%" valign="top"><h6>Newest Items added to the store </h6> <p><?php echo $dynamicList; ?></p> <!-- <table align="center" width="98%" cellpadding="2"> <tr> <td width="30%" valign="top"><a href="product.php?"><img style="border:#666 2px solid" src="style/flowers/1pagesmall.jpg" alt="$dynamicTitle" width="41" height="43" border="1"></a></td> <td width="70%" valign="top">Product Title<br> Product Price<br> <a href="product.php?">View Product</a><br> <br></td> </tr> </table>--> <p><br> <br> <br> <br> <br> <br> <br> </p> <p><br> </p></td> <td width="17%" valign="top"><h6>Price</h6> <p> </p> <p> </p></td> </tr> </table> </div> </section> </article> <section> <!-- end .content --> <aside class="aside-right"> <h4>Backgrounds</h4> <section> <p>By nature, the background color on any block element will only</p> </section> <section> <p>show for the length of the content. If you'd like a dividing line instead of a color, place a border on the side of the .content block (but only if it will always contain more content).</p> <article> </article> </section> </aside> <footer> <section> <div align="center"><a href="How_long.php">:How long will it Take?:</a> </div> </section> <section> <div align="center"><a href="#">:Do we Outsource?:</a></div> </section> <div align="center"><a href="#">:How long will it take to get recognized?: </a></div> <a href="#"> <section> </section> </a> <section> <p align="center"> </p></section> <section> <div align="right"> <table align="left" width="55%%" cellpadding="1"> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> <address class="copyright"> ©Copyrighted by Portia Solutions </address></td> </tr> </table> <img style="margin-right:5px" src="style/portia.png" alt="portia" width="160" height="85"></div> </section> </footer> <!-- end .container --></div> </body> </html> then secondly with this page product.php <?php //error reporting error_reporting(E_ALL); ini_set('display_errors', '1'); ?> <?php // Check to see URL Variable is set and that it exists in the database if (isset($_GET['id'])){ $id = preg_replace('#[^0-9]#i', '', $_GET['id']); //use this var to check to see if this ID Exists, if yes then get the product //details, if no then exit this script and give message why. $sql = mysql_query("SELECT * FROM products WHERE id='$id' LIMIT 1"); $productCount = mysql_num_rows($sql);//count the the output ammount if ($productCount > 0){ // get all the product details while($row = mysql_fetch_array($sql)){ $product_name = $row["product_name"]; $price = $row["price"]; $details = $row["details"]; $category = $row["category"]; $subcategory = $row["subcategory"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_added"])); // Notice here how we changed it from _added to _Added //product_name,price,details,category,subcategory,date_added } }else{ echo "That item does not exist."; exit(); } }else{ echo "No product in the database with that ID"; exit(); } mysql_close(); ?> <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title><?php echo $product_name; ?></title> <link href="my_carousel/includes/shop.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="my_carousel/includes/jquery-1.7.2 (2).js"></script> <script type="text/javascript" src="my_carousel/includes/jquery.roundabout.min.js"></script> <script type="text/javascript" src="my_carousel/includes/carousel.js"></script><!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <script type="text/javascript"> function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } </script> </head> <body onLoad="MM_preloadImages('style/home-reg.png','style/web-designred2a-final.png','style/web-development-final.png','style/e-coomerceneworange.png','style/pricingtNew-final.png')"> <div id="mainWrapper"> <div class="mainWrapper"> <header><div><table align="right" style="margin-right:16px" width="72%" cellpadding="1"> <tr> <td width="16%" height="41"><a href="index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Index/Home page ','','style/home-reg.png',1)"><img src="style/home-grey-final.png" alt="Web Design, Graphic Design, Logo Design, Web development, E-Commerce, scripting, Apps, Portia Solutions we will design the exact website for your business" name="Index/Home page " width="79" height="29" border="0"></a></td> <td width="15%"><a href="web-design.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Web Design','','style/web-designred2a-final.png',1)"><img src="style/web-designnew2.png" alt="Web Design here at portia solutions, we will give you exactly what you want to sell your business" name="Web Design" width="79" height="29" border="0"></a></td> <td width="15%"><a href="web-development.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Web Development','','style/web-development-final.png',1)"><img src="style/web-development-green.png" alt="Portia solutions Web Development, web design, branding, advertising packages" name="Web Development" width="79" height="29" border="0"></a></td> <td width="15%"><a href="e-commerce.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('E-Commerce','','style/e-coomerceneworange.png',1)"><img src="style/e-coomercenewgreen-final.png" alt="E-Commerce portia solutions will design you an online shop for five hundred pounds starting fee." name="E-Commerce" width="79" height="29" border="0"></a></td> <td width="15%"><a href="pricing.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Pricing','','style/pricingtNew-final.png',1)"><img src="style/pricing-final.png" alt="Pricing at portia soltions , we will customise a package to suit your needs" name="Pricing" width="79" height="29" border="0"></a></td> <td width="24%"><img src="style/phone.png" alt="phone" width="100" height="78" border="0"></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td height="195" colspan="6"> <div class="my_carousel"> <div class="carousel_container"> <div id="carousel"></div> <img src="my_carousel/images/arrow_left_new.png" alt="left" width="25" height="50" class="nextItem"> <img src="my_carousel/images/arrow_right_new.png" alt="right" width="25" height="50" class="prevItem"> </div> <div class="caption_container"> <div id="captions"></div> </div> <img src="my_carousel/images/BALLOONS-psd65115new.png" alt="balloons" width="75" height="65" class="balloons"> <div class="carousel_data"> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/1_page.png" alt="1-page" /> </div> <div class="caption"> <h2>1 Page</h2> <p>A 1-page website can be enough to advertise your business and get it noticed or it can improve the interest in your product or business. From £50</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/2ormore_pages.png" alt="2ormorepage" /> </div> <div class="caption"> <h2>2 or more page</h2> <p>Two or more page website design that can be as unique as you want it to be. It ca also be be totally interactive.</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/brand.png.png" alt="branding" /> </div> <div class="caption"> <h2>Branding and Internet marketing</h2> <p>Branding is extremely important as it can be the difference between your business running month to month or growing and one of the ways that you pull visitors onto your website is through Internet marketing.</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/eCommerce.png" alt="ecommerce" /> </div> <div class="caption"> <h2>E Commerce</h2> <p>E commerce or online shopping. avertise your product in all its glory and emphasize all its attributes</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/graphics_templates.png" alt="graphics" /> </div> <div class="caption"> <h2>Graphic design and logos, templates </h2> <p>Graphic design and manipulation, with all files and elements, we will design you a bespoke logo, one that your are confident with and suits your company shop etc we will design you flyers from a template if wished.</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/hosting_SEO.png" alt="hosting" /> </div> <div class="caption"> <h2>Hosting packages and SEO services</h2> <p>A hosting package that suits everybody, i you wish SEO services can help your website to be easily reached</p> </div> </div> <!-- Item --> <div class="carousel_item"> <div class="image"> <img src="my_carousel/images/improvement_train.png" alt="improvement" /> </div> <div class="caption"> <h2>Improvement Plan Continual Training</h2> <p>Continual learning to achieve your websites maximum goal and improve visitor numbers to your website and hopefully interest inyour product.</p> </div> </div> <!-- end items --> </div> </div></td> <!-- Carousel --></tr> </table> <div align="left"> <div><a href="#"><img src="" alt="Insert Logo Here" width="85" height="85" id="Insert_logo" style="background: #C6D580; display:block;" /></a></div> </div> </div> <a href="#"></a> </header> <div class="sidebar1"> <nav> <ul> <li><a href="#">graphic Design</a></li> <li><a href="#">Pay monthly</a></li> <li><a href="#">pricing</a></li> <li><a href="#">templates</a></li> <li><a href="#">**Contact Us**</a></li> </ul> </nav> <div> <aside> <div><section> <p><img src="style/portia_price (2).gif" width="120" height="291" alt="portia_price"></p> </section></div> <p> </p> <p> </p> <section> <p>starting point and modify the properties to produce your own unique look. If you require flyout menus, create your own using a Spry menu, a menu widget from Adobe's Exchange or a variety of other javascript or CSS solutions.</p> <p>If you would like the navigation along the top, simply move the ul to the top of the page and recreate the styling.</p> </section> </aside> </div> <!-- end .sidebar1 --></div> <article class="content"> <h1>Portia Solutions</h1> <section> <h2>Hold</h2> </section> <section> <h2>hold</h2> </section> <section> <h2>Holdagain</h2> </section> <section> <h2>Holdb</h2> <p align="center"><img src="style/webdevelopment.finished.png" width="250" height="90" alt="html5"></p> <div align="center"> <table style width="92%" cellpadding="1"> <tr> <td width="24%" valign="top"><h6>Details</h6></td> <td width="59%" valign="top"><h6>Newest Items added to the store </h6> <table align="center" width="98%" cellpadding="2"> <tr> <td width="30%" valign="top"><a href="product.php?"><img style="border:#666 2px solid" src="inventory_images/<?php echo $id; ?>.jpg" alt="<?php echo $product_name; ?>" width="41" height="43" border="1"></a></td> <a href="#"View Full Size</a></td> <td width="70%" valign="top"><h3><?php echo $Product_name; ?></h3><br> <p><?php echo $Price; ?><br> <br> <?php echo "$subcategory $category"; ?><br> <br> <?php echo $details; ?> <br> </p> <p>ADD TO CART<br> </p></td> <a href="product.php?">View Product</a><br> <br></td> </tr> </table> <p><br> <br> <br> <br> <br> <br> <br> </p> <p><br> </p></td> <td width="17%" valign="top"><h6>Price</h6> <p> </p> <p> </p></td> </tr> </table> </div> </section> </article> <section> <!-- end .content --> <aside class="aside-right"> <h4>Backgrounds</h4> <section> <p>By nature, the background color on any block element will only</p> </section> <section> <p>show for the length of the content. If you'd like a dividing line instead of a color, place a border on the side of the .content block (but only if it will always contain more content).</p> <article> </article> </section> </aside> <footer> <section> <div align="center"><a href="How_long.php">:How long will it Take?:</a> </div> </section> <section> <div align="center"><a href="#">:Do we Outsource?:</a></div> </section> <div align="center"><a href="#">:How long will it take to get recognized?: </a></div> <a href="#"> <section> </section> </a> <section> <p align="center"> </p></section> <section> <div align="right"> <table align="left" width="55%%" cellpadding="1"> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> <address class="copyright"> ©Copyrighted by Portia Solutions </address></td> </tr> </table> <img style="margin-right:5px" src="style/portia.png" alt="portia" width="160" height="85"></div> </section> </footer> <!-- end .container --></div> </body> </html> then secondly with this page product.php
  7. hello have a page called inventory_list.php i am not happy as i think the prob is to do with the date added part of my code <?php session_start(); /* this starts a session and is necssary if you want to work with session cookies they help you have pessitent data*/ if(!isset($_SESSION["manager"])){ /* if is not set session manger, in other words if they come to the admin index and they are not logged in they will be ushered to the admin login page*/ header("location: admin_login.php"); /*if you happen not be logged in then uou will be sent to the admin login section*/ exit(); /* if they are already logged in then they will go straight to the index page of the admin area*/ } /* it creates the variables that you log in with as the manager session and compares them to the credentials that you placed into the mysql database */ //BE sure to check that this manager SESSION value is in fact in the database $managerID = preg_replace('#[^0-9]#i','', $_SESSION["id"]); //filter everyhting but numbers any numbers always auto incremeted this is the session id created when you first login all that can go into this field are numbers 0 through to 9 $manager = preg_replace('#[^A-Za-z0-9]#i','', $_SESSION["manager"]); //filter everything but numbers and letters after it gets cleansed $password = preg_replace('#[^A-Za-z0-9]#i','', $_SESSION["password"]); //filter everything but numbers and letters //Run mySQL query to be sure that this person is an admin and that their password session varequals the database information //Connect to the MySQL database if they do have a session variable set yp you do not exit the script you allow the script to keep running include "../storescripts/connect_to_mysql.php"; // include the database connection file so you link to your database $sql= mysql_query("SELECT * FROM admin WHERE id= '$managerID' AND username= '$manager' AND password= '$password' LIMIT 1"); //query the person --make sure person exists in database----by using the three pieces of data *$managerID *$manager*$password $existCount= mysql_num_rows($sql); //count the row nums after making a varible called existcount run mysql_num_rows($sql); and we can can a count value on the variable if($existCount == 0){ //evaluate the count and if the person equals zero then they do not exist in the database header("location: ../index.php"); exit(); } ?> <?php $product_list = ""; ?> <?php //error reporting error_reporting(E_ALL); ?> <?php //parse the form data and add inventory item to the system if (isset($_POST['product_name'])) { $product_name = mysql_real_escape_string($_POST['product_name']); $price = mysql_real_escape_string($_POST['price']); $category = mysql_real_escape_string($_POST['category']); $subcategory = mysql_real_escape_string($_POST['subcategory']); $details = mysql_real_escape_string($_POST['details']); //see if that product name is an identical match to another product in the system $sql = mysql_query("SELECT id FROM products WHERE product_name='$product_name' LIMIT 1"); $productMatch = mysql_num_rows ($sql); //count the output ammount if ($productMatch > 0){ echo 'Sorry you tried to place a duplicate "Product Name" into the system, <a href="inventory_list.php">click here</a>'; exit(); //Add this product into the database now } $sql = mysql_query("INSERT INTO products(product_name, price, details, category, subcategory, date_added) VALUES('$product_name','$price','$details','$category','$subcategory',now())")or die (mysql_error()); //now adds todays date $pid = mysql_insert_id(); //place image in the folder $newname = "$pid.jpg"; move_uploaded_file( $_FILES['fileField']['tmp_name'], "../inventory_images/$newname"); header("location: inventory_list.php"); exit(); } ?> <?php //This block grabs the whole list for viewing $product_list = ""; $sql = mysql_query("SELECT * FROM products"); $productCount = mysql_num_rows($sql);//count the the output ammount if ($productCount > 0){ while($row = mysql_fetch_array($sql)){ $id = $row["id"]; $price = $row["price"]; $product_name = $row["product_name"]; i think this is the problem but mind block!!! $date_added = strftime("%b %d, %Y", strtotime($row["date_Added"])); // Notice here how we changed it from _added to _Added $product_list .= "$id - $product_name - £$price - $date_added <a href='inventory_edit.phppid=$id'>edit</a>••<a href='inventory_list.php?deleteid=$id'> delete</a><br/>"; } }else{ $product_list = "You have no products listed in your store Yet"; } ?> <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>Inventory List</title> <link href="../my_carousel/includes/shop.css" rel="stylesheet" type="text/css"> <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <div id="mainWrapper"> <div class="container"> <?php include_once("../admin_head_template.php") ?> <div class="sidebar1"> <nav> <ul> <li><a href="#">graphic Design</a></li> <li><a href="#">Pay monthly</a></li> <li><a href="#">pricing</a></li> <li><a href="#">templates</a></li> <li><a href="#">**Contact Us**</a></li> </ul> </nav> <div> <aside> <div><section> <p><img src="../style/portia_price (2).gif" width="150" height="291" alt="portia_price"></p> </section></div> <p> </p> <p> </p> <section> <p>starting point and modify the properties to produce your own unique look. If you require flyout menus, create your own using a Spry menu, a menu widget from Adobe's Exchange or a variety of other javascript or CSS solutions.</p> <p>If you would like the navigation along the top, simply move the ul to the top of the page and recreate the styling.</p> </section> </aside> </div> <!-- end .sidebar1 --></div> <article class="content"> <h1>Portia Solutions</h1> <section> <h1>Admin</h1> <div align="right"style="margin-right:22px"><a href="inventory_list.php#inventoryForm">+Add New Inventory Item</a></div> <div align="left" style="margin-left:24px"> <h3>Inventory list</h3> <?php echo $product_list; ?> <p> </p> <p> </p> </div> <p> </p> </section> <section> <hr /> <div> <a name="inventoryForm" id="inventoryForm"></a> <h3 align="center"> ↓ Add New Inventory Item Form ↓ </h3> </div> <form action="inventory_list.php" enctype="multipart/form-data" name="myForm" id="myForm" method="post"> <table width="90%" border="0" cellspacing="0" cellpadding="6"> <tr> <td width="20%" align="right">Product Name</td> <td width="80%"><label> <input name="product_name" style="margin-left:6px" "type="text" id="product_name" size="64" /> </label></td> </tr> <tr> <td align="right">Product Price</td> <td><label> £ <input name="price" style="margin-left:4px" type="text" id="price" size="12" /> </label></td> </tr> <tr> <td align="right">Category</td> <td><label> <select name="category" id="category" style="margin-left:18px" > <option value=1PageSite" > 1PageSite</option> <option value=ECommerce" > E-Commerce</option> <option value=adPackageBasic" > adPackageBasic</option> <option value=adPackageFull" > adPackageFull</option> <option value=Branding" > Branding</option> <option value=UpdatePackage" > Updatepackage</option> </select> </label></td> </tr> <tr> <td align="right">Subcategory</td> <td><select name="subcategory" id="subcategory" style="margin-left:18px" > <option value=""></option> <option value="Logo">Logo</option> <option value="Flash">Flash</option> <option value="Scripts">Scripts</option> <option value="Leaflets">Leaflets</option> <option value="BusinessCards">Businesscards</option> </select></td> </tr> <tr> <td align="right">Product Details</td> <td><label> <textarea style="margin-left:4px" name="details" id="details" cols="48" rows="5"></textarea> </label></td> </tr> <tr> <td align="right">Product Image</td> <td><label> <input type="file" name="fileField" id="fileField" /> </label></td> </tr> <tr> <td> </td> <td><label> <input type="submit" name="button" id="button" value="Add This Item Now" /> </label></td> </tr> </table> </form> </p> <div align="center"><img align="center" src="../style/webdevelopment.finished.png" width="250" height="90" alt="html5"></div> <p> </p> </section> <!-- end .content --></article> <aside class="aside-right"> <h4>Backgrounds</h4> <section> </section> </aside> <table width="32%" cellpadding="1"> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table> <footer> <section> <div align="center"><a href="How_long.php">:How long will it Take?:</a> </div> </section> <section> <p align="center"><a href="#">:Do we Outsource?:</a></p> </section> <div align="center"><a href="#">:How long will it take to get recognized?: </a></div> <a href="#"> <section> </section> </a> <section> <p align="center"> </p></section> <section> <div align="right"> <table align="left" width="55%%" cellpadding="1"> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> <address class="copyright"> ©Copyrighted by Portia Solutions </address></td> </tr> </table> <img style="margin-right:5px" src="../style/portia.png" alt="portia" width="160" height="85"></div> </section> </footer> <!-- end .container --></div> </body> </html> when i add a produst to the databse it says Notice: Undefined index: date_Added in C:\xampp\htdocs\myNewweb\storeadmin\inventory_list.php on line 68
  8. sorry for being a pain all i did to resolve was i created another db with a username and password and it worked but thanks anyway everyone
  9. I am using dreamweaver installation help « on: Today at 10:10:08 AM » Quote Modify all i am doing is producing a database on my local machine i have named my database in phpmyadmin and linked (created) a user for it in the privaleges section also highlighting a password for the user then i have a connect_to_mysql.php script <?php /* 1: "die()" will exit the script and show an error statement if something goes wrong with the "connect" or "select" functions. 2: A "mysql_connect()" error usually means your username/password are wrong 3: A "mysql_select_db()" error usually means the database does not exist. */ // Place db host name. Sometimes "localhost" but // sometimes looks like this: >> ???mysql??.someserver.net $db_host = "localhost"; // Place the username for the MySQL database here $db_username = "talos342c"; // Place the password for the MySQL database here $db_pass = "dollybrom1"; // Place the name for the MySQL database here $db_name = "mydbstore"; // Run the actual connection here mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql"); mysql_select_db("$db_name") or die ("no database"); ?> then i have a mysql_quicktest.php please help! <?php // Connect to the file above here require "connect_to_mysql.php"; echo "<h1>Success in database connection! Happy Coding!</h1>"; // if no success the script would have died before this success message ?> and they are saved in a file called storescripts both of the above files so i then proceed to try to seeif i can get a connection http//localhost/myNewweb/storescripts/mysql_quicktest.php ! ) Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'talos342c'@'localhost' (using password: YES) in C:\wamp\www\myNewweb\storescripts\connect_to_mysql.php on line 19 Call Stack # Time Memory Function Location 1 0.0021 666856 {main}( ) ..\mysql_quicktest.php:0 2 0.0037 672280 require( 'C:\wamp\www\myNewweb\storescripts\connect_to_mysql.php' ) ..\mysql_quicktest.php:3 3 0.0038 673248 mysql_connect ( ) ..\connect_to_mysql.php:19 could not connect to mysql what i think is happening is that access is being denied due to the password well i have typed the password in time after time into phpmyadmin in the privaleges section, but something is wrong .. I have had this working but reformatted my pc then went back and did it again and it does not work now, it is almost as if mysql remebers and how many mysql db can you run for free, do not know the inns and outs
  10. I am using dreamweaver installation help « on: Today at 10:10:08 AM » Quote Modify all i am doing is producing a database on my local machine i have named my database in phpmyadmin and linked (created) a user for it in the privaleges section also highlighting a password for the user then i have a connect_to_mysql.php script <?php /* 1: "die()" will exit the script and show an error statement if something goes wrong with the "connect" or "select" functions. 2: A "mysql_connect()" error usually means your username/password are wrong 3: A "mysql_select_db()" error usually means the database does not exist. */ // Place db host name. Sometimes "localhost" but // sometimes looks like this: >> ???mysql??.someserver.net $db_host = "localhost"; // Place the username for the MySQL database here $db_username = "talos342c"; // Place the password for the MySQL database here $db_pass = "dollybrom1"; // Place the name for the MySQL database here $db_name = "mydbstore"; // Run the actual connection here mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql"); mysql_select_db("$db_name") or die ("no database"); ?> then i have a mysqlquicktest.php <?php // Connect to the file above here require "connect_to_mysql.php"; echo "<h1>Success in database connection! Happy Coding!</h1>"; // if no success the script would have died before this success message ?> and they are saved in a file called storescripts both of the above files so i then proceed to try to seeif i can get a connection http//localhost/myNewweb/storescripts/mysql_quicktest.php ! ) Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'talos342c'@'localhost' (using password: YES) in C:\wamp\www\myNewweb\storescripts\connect_to_mysql.php on line 19 Call Stack # Time Memory Function Location 1 0.0021 666856 {main}( ) ..\mysql_quicktest.php:0 2 0.0037 672280 require( 'C:\wamp\www\myNewweb\storescripts\connect_to_mysql.php' ) ..\mysql_quicktest.php:3 3 0.0038 673248 mysql_connect ( ) ..\connect_to_mysql.php:19 could not connect to mysql what i think is happening is that access is being denied due to the password well i have typed the password in time after time into phpmyadmin in the privaleges section, but something is wrong ..
  11. index.php ?php error_reporting(E_ALL); ini_set('display_errors', '1'); ?> <?php // Run a select query to get my latest 6 items //Connect to the MySQL database include "storescripts/connect_to_mysql.php"; $dynamicList = ""; $sql = mysql_query("SELECT * FROM products ORDER BY date_added DESC LIMIT 6"); $productCount = mysql_num_rows($sql);//count the the output ammount if ($productCount > 0){ while($row = mysql_fetch_array($sql)){ $id = $row["id"]; $price = $row["price"]; $details = $row["details"]; $product_name = $row["product_name"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_Added"])); // Notice here how we changed it from _added to _Added $dynamicList .= '<table width="100%" cellpadding="6"> <tr> <td width="34%" valign="top"><a href="product.php?"><img style="border: #666 1px solid;" src="inventory_images/' . $id . '.jpg" alt="$product_name" width="1//Connect to the MySQL database include "storescripts/connect_to_mysql.php";20" height="113" border="1" /></a></td> <td width="66%" valign="top"><p> ' . $product_name . '<br /> £ ' . $price . '<br /> ' . $details . '<br /> <a href="product.php?id="inventory_images/' . $id . '.jpg">View product</a></p></td> </tr> </table>'; } }else{ $dynamicList = "We have no products listed in our store Yet"; } mysql_close(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">'>http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Store </title> <link rel="stylesheet" href="style/style.css" type="text/css" media="screen" /> <script type="text/javascript"> function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } </script> </head> <body onload="MM_preloadImages('style/home-grey.gif','style/web-design-grey.gif','style/web-development-grey.gif','style/e-commerce-grey.gif','style/pricing-grey.gif')"> <div align="center" id="outerMainWrapper"> <div align="center" id="mainWrapper"> <?php include_once("template_Header.php");?> <div id="headerNav"><table width="100%"> <tr> </tr> <tr> <td><a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('HOME','','style/home-grey.gif',1)"><img src="style/home.gif" alt="HOME" name="HOME" width="170" height="34" border="0" id="HOME" /></a></td> <td><a href="web-design.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('WEB DESIGN','','style/web-design-grey.gif',1)"><img src="style/web-design.gif" alt="WEB DESIGN" name="WEB DESIGN" width="170" height="34" border="0" id="WEB DESIGN" /></a></td> <td><a href="web-development.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('WEB DEVELOPMENT','','style/web-development-grey.gif',1)"><img src="style/web-development.gif" alt="WEB DEVELOPMENT" name="WEB DEVELOPMENT" width="170" height="34" border="0" id="WEB DEVELOPMENT" /></a></td> <td><a href="e-commerce.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('E COMMERCE','','style/e-commerce-grey.gif',1)"><img src="style/e-commerce.gif" alt="E COMMERCE" name="E COMMERCE" width="170" height="34" border="0" id="E COMMERCE" /></a></td> <td><a href="pricing.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('PRICING','','style/pricing-grey.gif',1)"><img src="style/pricing.gif" alt="PRICING" name="PRICING" width="170" height="34" border="0" id="PRICING" /></a></td> </tr> <tr> </tr> </table> </div> <?php include_once("template_Sidebar.php");?> </div> <div align="left" id="pageContent"><table width="98%"> <tr> <td width="25%" valign="top">Template</td> <td width="49%" valign="top"><p>Newest Items added to the store</p> <p><?php echo $dynamicList; ?></p> <!--<table width="100%" cellpadding="6"> <tr> <td width="34%" valign="top"><a href="product.php?"><img style="border: #666 1px solid;" src="inventory_images/21.jpg" alt="$dynamicTitle" width="120" height="113" border="1" /></a></td> <td width="66%" valign="top"><p>product Title<br /> product price<br /> product details<br /> <a href="product.php?">View product</a></p></td> </tr> </table> --> <p> </p> <!--<table width="92%" height="106" cellpadding="4"> <tr valign="top"> <td width="23%"><img src="../Picture1.gif" width="1" height="1" /><img src="../Picture1.gif" width="1" height="1" alt="$dynamicTitle" /><a href="product.php?"><img style="border-color: #999" src="inventory_images/21.jpg" alt="$dynamicTitle" width="70" height="70" border="1" /></a></td> <td width="77%"><p>product title<br /> product price<br /> product details <br /> <a href="Product.php">View product</a></p></td> </tr> </table> --> <p> </p> <p> </p> <p> </p> <p> </p></td> <td width="26%" valign="top">Large templates</td> </tr> </table> </div> <?php include_once("template_Footer.php");?> </div> </div> </body> </html> this page seems to work ok just wondering if links ok though product.php <?php error_reporting(E_ALL); ini_set('display_errors', '1'); ?> <?php //check to see the URL variable is set and that it exists in the database if(isset($_GET['id'])){ //Connect to the MySQL database include "storescripts/connect_to_mysql.php"; $id = preg_replace('#[^0-9]#i','', $_GET['id']); //use this var to check to see if this ID exists, if yes then get the product //details, if no then exit this script and give message why $sql = mysql_query("SELECT * FROM products WHERE id='$id' LIMIT 1"); $productCount = mysql_num_rows($sql);//count the the output ammount if ($productCount > 0){ //get all the product details while($row = mysql_fetch_array($sql)){ $product_name = $row["product_name"]; $price = $row["price"]; $details = $row["details"]; $category = $row["category"]; $subcategory = $row["subcategory"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_added"])); // Notice here how we changed it from _added to _Added //product_name,price,details,category,subcategory,date_Added } }else{ echo "That item does not exist"; exit(); } }else{ echo "Data to render this page is missing"; exit(); } mysql_close(); ?> <!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><?php echo $product_name; ?> </title> <link rel="stylesheet" href="style/style.css" type="text/css" media="screen" /> <script type="text/javascript"> function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } </script> </head> <body onload="MM_preloadImages('style/home-grey.gif','style/web-design-grey.gif','style/web-development-grey.gif','style/e-commerce-grey.gif','style/pricing-grey.gif')"> <div align="center" id="outerMainWrapper"> <div align="center" id="mainWrapper"> <?php include_once("template_Header.php");?> <div id="headerNav"><table width="100%"> <tr> </tr> <tr> <td><a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('HOME','','style/home-grey.gif',1)"><img src="style/home.gif" alt="HOME" name="HOME" width="170" height="34" border="0" id="HOME" /></a></td> <td><a href="web-design.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('WEB DESIGN','','style/web-design-grey.gif',1)"><img src="style/web-design.gif" alt="WEB DESIGN" name="WEB DESIGN" width="170" height="34" border="0" id="WEB DESIGN" /></a></td> <td><a href="web-development.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('WEB DEVELOPMENT','','style/web-development-grey.gif',1)"><img src="style/web-development.gif" alt="WEB DEVELOPMENT" name="WEB DEVELOPMENT" width="170" height="34" border="0" id="WEB DEVELOPMENT" /></a></td> <td><a href="e-commerce.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('E COMMERCE','','style/e-commerce-grey.gif',1)"><img src="style/e-commerce.gif" alt="E COMMERCE" name="E COMMERCE" width="170" height="34" border="0" id="E COMMERCE" /></a></td> <td><a href="pricing.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('PRICING','','style/pricing-grey.gif',1)"><img src="style/pricing.gif" alt="PRICING" name="PRICING" width="170" height="34" border="0" id="PRICING" /></a></td> </tr> <tr> </tr> </table> </div> <?php include_once("template_Sidebar.php");?> </div> <div align="left" id="pageContent"><table width="84%"> <tr> <td valign="top"><table width="100%" cellpadding="6"> <tr> <td width="33%" valign="top"><p><img src="inventory_images/<?php echo $id; ?>.jpg" alt="<?php echo $product_name; ?>" width="84" height="140" border="1" /></p> <p><a href="inventory_images/<?php echo $id; ?>.jpg">View full size image</a></p></td> <td width="67%" valign="top"><?php echo $product_name; ?><br /> <?php echo $price; ?><br /> <?php echo "$subcategory $category"; ?><br /> <?php echo $details; ?><br /> <br /> <br /> ADD TO CART</td> </tr> </table> <p> </p> <!-- <p><?php echo $dynamicList; ?></p> --> <!--<table width="100%" cellpadding="6"> <tr> <td width="34%" valign="top"><a href="product.php?"><img style="border: #666 1px solid;" src="inventory_images/21.jpg" alt="$dynamicTitle" width="120" height="113" border="1" /></a></td> <td width="66%" valign="top"><p>product Title<br /> product price<br /> product details<br /> <a href="product.php?">View product</a></p></td> </tr> </table> --> <p> </p> <!--<table width="92%" height="106" cellpadding="4"> <tr valign="top"> <td width="23%"><img src="../Picture1.gif" width="1" height="1" /><img src="../Picture1.gif" width="1" height="1" alt="$dynamicTitle" /><a href="product.php?"><img style="border-color: #999" src="inventory_images/21.jpg" alt="$dynamicTitle" width="70" height="70" border="1" /></a></td> <td width="77%"><p>product title<br /> product price<br /> product details <br /> <a href="Product.php">View product</a></p></td> </tr> </table> --> <p> </p> <p> </p> <p> </p> <p> </p></td> </tr> </table> </div> <?php include_once("template_Footer.php");?> </div> </div> </body> </html> i try to open this page through a browser and keep getting this error at top of the page Data to render this page is missing then when i try to view it on the indexpage though a link i get this message That item does not exist and when i try to click the link on the picture i get Data to render this page is missing it is almost as if $_GET is not working what really maddens me is at 4 oclock yesterday i had it working perfectly, but i messed up tinkering around with it please help as i just want to return to yesterdays glory.
  12. I have a index page <?php // Run a select query to get my latest 6 items //Connect to the MySQL database include "storescripts/connect_to_mysql.php"; $dynamicList = ""; $sql = mysql_query("SELECT * FROM products ORDER BY date_added DESC LIMIT 6"); $productCount = mysql_num_rows($sql);//count the the output ammount if ($productCount > 0){ while($row = mysql_fetch_array($sql)){ $id = $row["id"]; $price = $row["price"]; $details = $row["details"]; $product_name = $row["product_name"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_Added"])); // Notice here how we changed it from _added to _Added $dynamicList .= '<table width="100%" cellpadding="6"> <tr> <td width="34%" valign="top"><a href="product.php?"><img style="border: #666 1px solid;" src="inventory_images/' . $id . '.jpg" alt="$product_name" width="120" height="113" border="1" /></a></td> <td width="66%" valign="top"><p> ' . $product_name . '<br /> £ ' . $price . '<br /> ' . $details . '<br /> <a href="product.php?id=">View product</a></p></td> </tr> </table>'; } }else{ $dynamicList = "We have no products listed in our store Yet"; } mysql_close(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">'>http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Store </title> <link rel="stylesheet" href="style/style.css" type="text/css" media="screen" /> <script type="text/javascript"> function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } </script> </head> <body onload="MM_preloadImages('style/home-grey.gif','style/web-design-grey.gif','style/web-development-grey.gif','style/e-commerce-grey.gif','style/pricing-grey.gif')"> <div align="center" id="outerMainWrapper"> <div align="center" id="mainWrapper"> <?php include_once("template_Header.php");?> <div id="headerNav"><table width="100%"> <tr> </tr> <tr> <td><a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('HOME','','style/home-grey.gif',1)"><img src="style/home.gif" alt="HOME" name="HOME" width="170" height="34" border="0" id="HOME" /></a></td> <td><a href="web-design.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('WEB DESIGN','','style/web-design-grey.gif',1)"><img src="style/web-design.gif" alt="WEB DESIGN" name="WEB DESIGN" width="170" height="34" border="0" id="WEB DESIGN" /></a></td> <td><a href="web-development.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('WEB DEVELOPMENT','','style/web-development-grey.gif',1)"><img src="style/web-development.gif" alt="WEB DEVELOPMENT" name="WEB DEVELOPMENT" width="170" height="34" border="0" id="WEB DEVELOPMENT" /></a></td> <td><a href="e-commerce.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('E COMMERCE','','style/e-commerce-grey.gif',1)"><img src="style/e-commerce.gif" alt="E COMMERCE" name="E COMMERCE" width="170" height="34" border="0" id="E COMMERCE" /></a></td> <td><a href="pricing.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('PRICING','','style/pricing-grey.gif',1)"><img src="style/pricing.gif" alt="PRICING" name="PRICING" width="170" height="34" border="0" id="PRICING" /></a></td> </tr> <tr> </tr> </table> </div> <?php include_once("template_Sidebar.php");?> </div> <div align="left" id="pageContent"><table width="98%"> <tr> <td width="25%" valign="top">Template</td> <td width="49%" valign="top"><p>Newest Items added to the store</p> <p><?php echo $dynamicList; ?></p> <!--<table width="100%" cellpadding="6"> <tr> <td width="34%" valign="top"><a href="product.php?"><img style="border: #666 1px solid;" src="inventory_images/21.jpg" alt="$dynamicTitle" width="120" height="113" border="1" /></a></td> <td width="66%" valign="top"><p>product Title<br /> product price<br /> product details<br /> <a href="product.php?">View product</a></p></td> </tr> </table> --> <p> </p> <!--<table width="92%" height="106" cellpadding="4"> <tr valign="top"> <td width="23%"><img src="../Picture1.gif" width="1" height="1" /><img src="../Picture1.gif" width="1" height="1" alt="$dynamicTitle" /><a href="product.php?"><img style="border-color: #999" src="inventory_images/21.jpg" alt="$dynamicTitle" width="70" height="70" border="1" /></a></td> <td width="77%"><p>product title<br /> product price<br /> product details <br /> <a href="Product.php">View product</a></p></td> </tr> </table> --> <p> </p> <p> </p> <p> </p> <p> </p></td> <td width="26%" valign="top">Large templates</td> </tr> </table> </div> <?php include_once("template_Footer.php");?> </div> </div> </body> </html> which shows the items in my db bo problem then i also have a product page which supposed to show a bigger version of the image product.php <?php error_reporting(E_ALL); ini_set('display_errors', '1'); ?> <?php // Check to see the URL variable is set and that it exists in the database if (isset($_GET['id'])) { // Connect to the MySQL database include "storescripts/connect_to_mysql.php"; $id = preg_replace('#[^0-9]#i','', $_GET['id']); // Use this var to check to see if this ID exists, if yes then get the product // details, if no then exit this script and give message why $sql = mysql_query("SELECT * FROM products WHERE id='$id' LIMIT 1"); $productCount = mysql_num_rows($sql); // count the output amount if ($productCount > 0) { // get all the product details while($row = mysql_fetch_array($sql)){ $id = $row["id"]; $product_name = $row["product_name"]; $price = $row["price"]; $details = $row["details"]; $category = $row["category"]; $subcategory = $row["subcategory"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_Added"])); } } else { echo "That item does not exist."; exit(); } } else { echo "Data to render this page is missing."; exit(); } ?> !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><?php echo $product_name; ?></title> <link rel="stylesheet" href="style/style.css" type="text/css" media="screen" /> </head> <body> <div align="center"></div> <div align="center" id="mainWrapper"> <?php include_once("template_header.php"); ?> <?php include_once("template_sidebar.php"); ?> <<div id="pageContent"> <table width="100%" border="0" cellspacing="0" cellpadding="15"> <tr> <td width="19%" valign="top"><img src="inventory_images/<?php echo $id; ?>.jpg" width="142" height="188" alt="<?php echo $product_name; ?>" /><br /> <a href="inventory_images/<?php echo $id; ?>.jpg">View Full Size Image</a></td> <td width="81%" valign="top"><h3><?php echo $product_name; ?></h3> <?php echo "$subcategory $category"; ?> <br /> <p><?php echo "$".$price; ?><br /> <br /> <br /> <?php echo $details; ?> <br /> </p> <form id="form1" name="form1" method="post" action="cart.php"> <input type="hidden" name="pid" id="pid" value="<?php echo $id; ?>" /> <input type="submit" name="button" id="button" value="Add to Shopping Cart" /> </form> </td> </tr> </table> </div> <?php include_once("template_footer.php");?> </div> </body> </html> i have even called the bigger image the exact product name of the item but when i try to view product.php it says data to render this page is missing and when i click the link for the item that appears on the index page it says that item does not exist thanks in advance
  13. i have been trying for a while now to set up a database system with a few products in it while trialing my pages i have been editing deleting items just to check that my admin system works fine now i have deleted so many items in my database that the first item showing although i had deleted the other items, shows item 24 as really being my first item in my database can i reset something in my database as it still thinks i have 24 items in my database where i have only 1 item thanks in advance
  14. sorted it but thanks antway!
  15. http://localhost/myNewweb/storeadmin/inventory_edit.phppid=20 this is the only help i can offer as there is no page error every time i try to edit my inventory it returns a blank page <?php session_start(); if (!isset($_SESSION["manager"])) { header("location: admin_login.php"); exit(); } // Be sure to check that this manager SESSION value is in fact in the database $managerID = preg_replace('#[^0-9]#i', '', $_SESSION["id"]); // filter everything but numbers and letters $manager = preg_replace('#[^A-Za-z0-9]#i', '', $_SESSION["manager"]); // filter everything but numbers and letters $password = preg_replace('#[^A-Za-z0-9]#i', '', $_SESSION["password"]); // filter everything but numbers and letters // Run mySQL query to be sure that this person is an admin and that their password session var equals the database information // Connect to the MySQL database include "../storescripts/connect_to_mysql.php"; $sql = mysql_query("SELECT * FROM admin WHERE id='$managerID' AND username='$manager' AND password='$password' LIMIT 1"); // query the person // ------- MAKE SURE PERSON EXISTS IN DATABASE --------- $existCount = mysql_num_rows($sql); // count the row nums if ($existCount == 0) { // evaluate the count echo "Your login session data is not on record in the database."; exit(); } ?> <?php // Script Error Reporting error_reporting(E_ALL); ini_set('display_errors', '1'); ?> <?php // Parse the form data and add inventory item to the system if (isset($_POST['product_name'])) { $pid = mysql_real_escape_string($_POST['thisID']); $product_name = mysql_real_escape_string($_POST['product_name']); $price = mysql_real_escape_string($_POST['price']); $category = mysql_real_escape_string($_POST['category']); $subcategory = mysql_real_escape_string($_POST['subcategory']); $details = mysql_real_escape_string($_POST['details']); // See if that product name is an identical match to another product in the system $sql = mysql_query("UPDATE products SET product_name='$product_name', price='$price', details='$details', category='$category', subcategory='$subcategory' WHERE id='$pid'"); if ($_FILES['fileField']['tmp_name'] != "") { // Place image in the folder $newname = "$pid.jpg"; move_uploaded_file($_FILES['fileField']['tmp_name'], "../inventory_images/$newname"); } header("location: inventory_list.php"); exit(); } ?> <?php // Gather this product's full information for inserting automatically into the edit form below on page if (isset($_GET['pid'])) { $targetID = $_GET['pid']; $sql = mysql_query("SELECT * FROM products WHERE id='$targetID' LIMIT 1"); $productCount = mysql_num_rows($sql); // count the output amount if ($productCount > 0) { while($row = mysql_fetch_array($sql)){ $product_name = $row["product_name"]; $price = $row["price"]; $category = $row["category"]; $subcategory = $row["subcategory"]; $details = $row["details"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_Added"])); } } else { echo "Sorry dude that crap dont exist."; exit(); } } ?> <!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>Inventory list</title> <link rel="stylesheet" href="../style/style.css" type="text/css" media="screen" /> <style type="text/css"> body { background-color: #FFF; } </style> </head> <body> <div align="center"></div> <div align="center" id="mainWrapper"> <?php include_once("../template_header.php"); ?> <?php include_once("../template_sidebar.php"); ?> <div align="left" id="pageContent"> <div align="right"style="margin-right:32px"><a href="inventory_list.php#inventoryForm">+Add New Inventory Item</a></div> <div align="left" style="margin-left:24px;"> <h2>Inventory edit</h2> </div> <hr /> <div> <a name="inventoryForm" id="inventoryForm"></a> <h3 align="center"> ↓ Add New Inventory Item Form ↓ </h3> </div> <form action="inventory_edit.php" enctype="multipart/form-data" name="myForm" id="myForm" method="post"> <table width="90%" border="0" cellspacing="0" cellpadding="6"> <tr> <td width="20%" align="right">Product Name</td> <td width="80%"><label> <input name="product_name" type="text" id="product_name" size="64" value="<?php echo $product_name; ?>" /> </label></td> </tr> <tr> <td align="right">Product Price</td> <td><label> £ <input name="price" type="text" id="price" size="12" value="<?php echo $price; ?>" /> </label></td> </tr> <tr> <td align="right">Category</td> <td><label> <select name="category" id="category"> <option value="Clothing">Clothing</option> </select> </label></td> </tr> <tr> <td align="right">Subcategory</td> <td><select name="subcategory" id="subcategory"> <option value="<?php echo $subcategory; ?>"><?php echo $subcategory; ?></option> <option value="Hats">Hats</option> <option value="Pants">Pants</option> <option value="Shirts">Shirts</option> </select></td> </tr> <tr> <td align="right">Product Details</td> <td><label> <textarea name="details" id="details" cols="64" rows="5"><?php echo $details; ?></textarea> </label></td> </tr> <tr> <td align="right">Product Image</td> <td> </td> </tr> <tr> <td> </td> <td><label> <input name="thisID" type="hidden" value="<?php echo $targetID; ?>" /> <input type="submit" name="button" id="button" value="Make Changes" /> <input type="file" name="fileField" id="fileField" /> </label></td> </tr> </table> </form> <br/> <br/> </div> <?php include_once("../template_footer.php"); ?> </div> </body> </html>
  16. I have resolved this guys and tryed to find a delete button but no joy!
  17. when i place a product in my db with all its details and click upload the item loads to the database and arrives a a http 404 page not found. but the page does not deliever back to the inventory form but instead goes to a http 404 not found, does this mean i have not linked my inventory page when item uploaded,to arrive back at my inventory page to see that the details are there. here is the code <?php session_start(); if(!isset($_SESSION["manager"])){ header("location: admin_login.php"); exit(); } // Be sure to check that this manager SESSION value is in fact in the database $managerID = preg_replace('#[^0-9]#i','', $_SESSION["id"]); //filter everyhting but numbers and letters $manager = preg_replace('#[^A-Za-z0-9]#i','', $_SESSION["manager"]); //filter everything but numbers and letters $password = preg_replace('#[^A-Za-z0-9]#i','', $_SESSION["password"]); //filter everything but numbers and letters //Run mySQL query to be sure that this person is an admin and that their password session varequals the database information //Connect to the MySQL database include "../storescripts/connect_to_mysql.php"; $sql= mysql_query("SELECT * FROM admin WHERE id= '$managerID' AND username= '$manager' AND password= '$password' LIMIT 1"); //query the person --make sure person exists in database---- $existCount= mysql_num_rows($sql); //count the row nums if($existCount == 0){ //evaluate the count header("location: ../index.php"); exit(); } ?> <?php //error reporting error_reporting(E_ALL); ini_set('display_errors', '1'); ?> <?php // Delete Item Question to admin, and Delete product if (isset($_GET['deleteid'])){ echo 'Do you really want to delete produst with ID of'.$_GET['deleteid'] .'? <a href="inventory_list.php?yesdelete=' .$_GET['deleteid'] .'">Yes</a>/<a href="inventory_list.php">No</a>'; exit(); } if (isset($_GET['yesdelete'])){ //remove item from system and delete its picture if they choose //delete from database $id_to_delete=$_GET['yesdelete']; $sql=mysql_query("DELETE FROM products WHERE id='$id_to_delete' LIMIT 1")or die (mysql_error()); //unlink the image from server // Remove The Pic------------------------------------ $pictodelete=("../inventory_images/$id_to_delete.jpg"); if (file_exists($pictodelete)){ unlink($pictodelete); } header("location:inventory_list.php"); exit(); } ?> <?php //parse the form data and add inventory item to the system if (isset($_POST['product_name'])) { $product_name = mysql_real_escape_string($_POST['product_name']); $price = mysql_real_escape_string($_POST['price']); $category = mysql_real_escape_string($_POST['category']); $subcategory = mysql_real_escape_string($_POST['subcategory']); $details = mysql_real_escape_string($_POST['details']); //see if that product name is an identical match to another product in the system $sql = mysql_query("SELECT id FROM products WHERE product_name='$product_name' LIMIT 1"); $productMatch = mysql_num_rows ($sql); //count the output ammount if ($productMatch > 0){ echo 'Sorry you tried to place a duplicate "Product Name" into the system, <a href="inventory_list.php">click here</a>'; exit(); //Add this product into the database now } $sql = mysql_query("INSERT INTO products(product_name, price, details, category, subcategory, date_added) VALUES('$product_name','$price','$details','$category','$subcategory',now())") or die (mysql_error()); //now adds todays date $pid = mysql_insert_id(); //place image in the folder $newname = "$pid.jpg"; move_uploaded_file( $_FILES['fileField']['tmp_name'], "../inventory_images/$newname"); header("location: admin_login_list.php"); exit(); } ?> <?php //This block grabs the whole list for viewing $product_list = ""; $sql = mysql_query("SELECT * FROM products"); $productCount = mysql_num_rows($sql);//count the the output ammount if ($productCount > 0){ while($row = mysql_fetch_array($sql)){ $id = $row["id"]; $price = $row["price"]; $product_name = $row["product_name"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_Added"])); // Notice here how we changed it from _added to _Added $product_list .= "$id - $product_name - £$price - $date_added <a href='inventory_edit.phppid=$id'>edit</a>••<a href='inventory_list.php?deleteid=$id'> delete</a><br/>"; } }else{ $product_list = "You have no products listed in your store Yet"; } ?> <!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>Inventory list</title> <link rel="stylesheet" href="../style/style.css" type="text/css" media="screen" /> <style type="text/css"> body { background-color: #FFF; } </style> </head> <body> <div align="center"></div> <div align="center" id="mainWrapper"> <?php include_once("../template_header.php"); ?> <?php include_once("../template_sidebar.php"); ?> <div align="left" id="pageContent"> <div align="right"style="margin-right:32px"><a href="inventory_list.php#inventoryForm">+Add New Inventory Item</a></div> <div align="left" style="margin-left:24px;"> <h2>Inventory List</h2> <?php echo $product_list; ?> </div> <hr /> <div> <a name="inventoryForm" id="inventoryForm"></a> <h3 align="center"> ↓ Add New Inventory Item Form ↓ </h3> </div> <form action="inventory_list.php" enctype="multipart/form-data" name="myForm" id="myForm" method="post"> <table width="90%" border="0" cellspacing="0" cellpadding="6"> <tr> <td width="20%" align="right">Product Name</td> <td width="80%"><label> <input name="product_name" style="margin-left:6px" "type="text" id="product_name" size="64" /> </label></td> </tr> <tr> <td align="right">Product Price</td> <td><label> $ <input name="price" style=" margin-left:4px"type="text" id="price" size="12" /> </label></td> </tr> <tr> <td align="right">Category</td> <td><label> <select name="category" id="category" style="margin-left:18px" > <option value=Clothing" > Clothing</option> </select> </label></td> </tr> <tr> <td align="right">Subcategory</td> <td><select name="subcategory" id="subcategory" style="margin-left:18px" > <option value=""></option> <option value="Hats">Hats</option> <option value="Pants">Pants</option> <option value="Shirts">Shirts</option> </select></td> </tr> <tr> <td align="right">Product Details</td> <td><label> <textarea name="details" id="details" cols="48" rows="5"></textarea> </label></td> </tr> <tr> <td align="right">Product Image</td> <td><label> <input type="file" name="fileField" id="fileField" /> </label></td> </tr> <tr> <td> </td> <td><label> <input type="submit" name="button" id="button" value="Add This Item Now" /> </label></td> </tr> </table> </form> <br/> <br/> </div> <?php include_once("../template_footer.php"); ?> </div> </body> </html>
  18. can somebody just give me there knowledge please thanks in advance!
  19. have too pages an inventory_list <?php session_start(); if(!isset($_SESSION["manager"])){ header("location: admin_login.php"); exit(); } // Be sure to check that this manager SESSION value is in fact in the database $managerID = preg_replace('#[^0-9]#i','', $_SESSION["id"]); //filter everyhting but numbers and letters $manager = preg_replace('#[^A-Za-z0-9]#i','', $_SESSION["manager"]); //filter everything but numbers and letters $password = preg_replace('#[^A-Za-z0-9]#i','', $_SESSION["password"]); //filter everything but numbers and letters //Run mySQL query to be sure that this person is an admin and that their password session varequals the database information //Connect to the MySQL database include "../storescripts/connect_to_mysql.php"; $sql= mysql_query("SELECT * FROM admin WHERE id= '$managerID' AND username= '$manager' AND password= '$password' LIMIT 1"); //query the person --make sure person exists in database---- $existCount= mysql_num_rows($sql); //count the row nums if($existCount == 0){ //evaluate the count header("location: ../index.php"); exit(); } ?> <?php //error reporting error_reporting(E_ALL); ini_set('display_errors', '1'); ?> <?php // Delete Item Question to admin, and Delete product if (isset($_GET['deleteid'])){ echo 'Do you really want to delete produst with ID of'.$_GET['deleteid'] .'? <a href="inventory_list.php?yesdelete=' .$_GET['deleteid'] .'">Yes</a>/<a href="inventory_list.php">No</a>'; exit(); } if (isset($_GET['yesdelete'])){ //remove item from system and delete its picture if they choose //delete from database $id_to_delete=$_GET['yesdelete']; $sql=mysql_query("DELETE FROM products WHERE id='$id_to_delete' LIMIT 1")or die (mysql_error()); //unlink the image from server // Remove The Pic------------------------------------ $pictodelete=("../inventory_images/$id_to_delete.jpg"); if (file_exists($pictodelete)){ unlink($pictodelete); } header("location:inventory_list.php"); exit(); } ?> <?php //parse the form data and add inventory item to the system if (isset($_POST['product_name'])) { $product_name = mysql_real_escape_string($_POST['product_name']); $price = mysql_real_escape_string($_POST['price']); $category = mysql_real_escape_string($_POST['category']); $subcategory = mysql_real_escape_string($_POST['subcategory']); $details = mysql_real_escape_string($_POST['details']); //see if that product name is an identical match to another product in the system $sql = mysql_query("SELECT id FROM products WHERE product_name='$product_name' LIMIT 1"); $productMatch = mysql_num_rows ($sql); //count the output ammount if ($productMatch > 0){ echo 'Sorry you tried to place a duplicate "Product Name" into the system, <a href="inventory_list.php">click here</a>'; exit(); //Add this product into the database now } $sql = mysql_query("INSERT INTO products(product_name, price, details, category, subcategory, date_added) VALUES('$product_name','$price','$details','$category','$subcategory',now())") or die (mysql_error()); //now adds todays date $pid = mysql_insert_id(); //place image in the folder $newname = "$pid.jpg"; move_uploaded_file( $_FILES['fileField']['tmp_name'], "../inventory_images/$newname"); header("location: admin_login_list.php"); exit(); } ?> <?php //This block grabs the whole list for viewing $product_list = ""; $sql = mysql_query("SELECT * FROM products"); $productCount = mysql_num_rows($sql);//count the the output ammount if ($productCount > 0){ while($row = mysql_fetch_array($sql)){ $id = $row["id"]; $price = $row["price"]; $product_name = $row["product_name"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_Added"])); // Notice here how we changed it from _added to _Added $product_list .= "$id - $product_name - £$price - $date_added <a href='inventory_edit.phppid=$id'>edit</a>••<a href='inventory_list.php?deleteid=$id'> delete</a><br/>"; } }else{ $product_list = "You have no products listed in your store Yet"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">'>http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Inventory list</title> <link rel="stylesheet" href="../style/style.css" type="text/css" media="screen" /> <style type="text/css"> body { background-color: #FFF; } </style> </head> <body> <div align="center"></div> <div align="center" id="mainWrapper"> <?php include_once("../template_header.php"); ?> <?php include_once("../template_sidebar.php"); ?> <div align="left" id="pageContent"> <div align="right"style="margin-right:32px"><a href="inventory_list.php#inventoryForm">+Add New Inventory Item</a></div> <div align="left" style="margin-left:24px;"> <h2>Inventory List</h2> <?php echo $product_list; ?> </div> <hr /> <div> <a name="inventoryForm" id="inventoryForm"></a> <h3 align="center"> ↓ Add New Inventory Item Form ↓ </h3> </div> <form action="inventory_list.php" enctype="multipart/form-data" name="myForm" id="myForm" method="post"> <table width="90%" border="0" cellspacing="0" cellpadding="6"> <tr> <td width="20%" align="right">Product Name</td> <td width="80%"><label> <input name="product_name" type="text" id="product_name" size="64" /> </label></td> </tr> <tr> <td align="right">Product Price</td> <td><label> £ <input name="price" type="text" id="price" size="12" /> </label></td> </tr> <tr> <td align="right">Category</td> <td><label> <select name="category" id="category"> <option value="Clothing">Clothing</option> </select> </label></td> </tr> <tr> <td align="right">Subcategory</td> <td><select name="subcategory" id="subcategory"> <option value=""></option> <option value="Hats">Hats</option> <option value="Pants">Pants</option> <option value="Shirts">Shirts</option> </select></td> </tr> <tr> <td align="right">Product Details</td> <td><label> <textarea name="details" id="details" cols="64" rows="5"></textarea> </label></td> </tr> <tr> <td align="right">Product Image</td> <td> </td> </tr> <tr> <td> </td> <td><label> <input type="submit" name="button" id="button" value="Add This Item Now" /> <input type="file" name="fileField" id="fileField" /> </label></td> </tr> </table> </form> <br/> <br/> </div> <?php include_once("../template_footer.php"); ?> </div> </body> </html> i use this page too add records and to delete them then this page inventory_edit.php <?php session_start(); if(!isset($_SESSION["manager"])){ header("location: admin_login.php"); exit(); } // Be sure to check that this manager SESSION value is in fact in the database $managerID = preg_replace('#[^0-9]#i','', $_SESSION["id"]); //filter everyhting but numbers and letters $manager = preg_replace('#[^A-Za-z0-9]#i','', $_SESSION["manager"]); //filter everything but numbers and letters $password = preg_replace('#[^A-Za-z0-9]#i','', $_SESSION["password"]); //filter everything but numbers and letters //Run mySQL query to be sure that this person is an admin and that their password session varequals the database information //Connect to the MySQL database include "../storescripts/connect_to_mysql.php"; $sql= mysql_query("SELECT * FROM admin WHERE id= '$managerID' AND username= '$manager' AND password= '$password' LIMIT 1"); //query the person --make sure person exists in database---- $existCount= mysql_num_rows($sql); //count the row nums if($existCount == 0){ //evaluate the count header("location: ../index.php"); exit(); } ?> <?php //error reporting error_reporting(E_ALL); ini_set('display_errors', '1'); ?> <?php //parse the form data and add inventory item to the system if (isset($_POST['product_name'])) { $pid = mysql_real_escape_string($_POST['thisID']); $product_name = mysql_real_escape_string($_POST['product_name']); $price = mysql_real_escape_string($_POST['price']); $category = mysql_real_escape_string($_POST['category']); $subcategory = mysql_real_escape_string($_POST['subcategory']); $details = mysql_real_escape_string($_POST['details']); //see if that product name is an identical match to another product in the system $sql = mysql_query("UPDATE products SET product_name='$product_name', price='$price', details='$details', category='$category', subcategory='$subcategory' WHERE id='$pid'"); //Add this product into the database now if ($_FILES['fileField']['tmp_name'] != "") { //place image in the folder $newname = "$pid.jpg"; move_uploaded_file($_FILES['fileField']['tmp_name'], "../inventory_images/$newname"); } header("location: inventory_list.php"); exit(); } ?> <?php // Gather this products full information for in serting automatically into the edit form below on page if (isset($_GET['pid'])){ //This block grabs the whole list for viewing $targetID= $_GET['pid']; $sql = mysql_query("SELECT * FROM products WHERE id='$targetID' LIMIT 1"); $productCount = mysql_num_rows($sql);//count the the output ammount if ($productCount > 0){ while($row = mysql_fetch_array($sql)){ $product_name = $row["product_name"]; $price = $row["price"]; $category = $row["category"]; $subcategory = $row["subcategory"]; $details = $row["details"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_Added"])); // Notice here how we changed it from _added to _Added } }else{ echo "Does not exist!"; exit(); } } ?> <!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>Inventory list</title> <link rel="stylesheet" href="../style/style.css" type="text/css" media="screen" /> <style type="text/css"> body { background-color: #FFF; } </style> </head> <body> <div align="center"></div> <div align="center" id="mainWrapper"> <?php include_once("../template_header.php"); ?> <?php include_once("../template_sidebar.php"); ?> <div align="left" id="pageContent"> <div align="right"style="margin-right:32px"><a href="inventory_list.php#inventoryForm">+Add New Inventory Item</a></div> <div align="left" style="margin-left:24px;"> <h2>Inventory List</h2> <?php echo $product_list; ?> </div> <hr /> <div> <a name="inventoryForm" id="inventoryForm"></a> <h3 align="center"> ↓ Add New Inventory Item Form ↓ </h3> </div> <form action="inventory_edit.php" enctype="multipart/form-data" name="myForm" id="myForm" method="post"> <table width="90%" border="0" cellspacing="0" cellpadding="6"> <tr> <td width="20%" align="right">Product Name</td> <td width="80%"><label> <input name="product_name" type="text" id="product_name" size="64" value="<?php echo $product_name; ?>" /> </label></td> </tr> <tr> <td align="right">Product Price</td> <td><label> £ <input name="price" type="text" id="price" size="12" value="<?php echo $price; ?>" /> </label></td> </tr> <tr> <td align="right">Category</td> <td><label> <select name="category" id="category"> <option value="Clothing">Clothing</option> </select> </label></td> </tr> <tr> <td align="right">Subcategory</td> <td><select name="subcategory" id="subcategory"> <option value="<?php echo $subcategory; ?>"><?php echo $subcategory; ?></option> <option value="Pants">Pants</option> <option value="Shirts">Shirts</option> </select></td> </tr> <tr> <td align="right">Product Details</td> <td><label> <textarea name="details" id="details" cols="64" rows="5"><?php echo $details; ?></textarea> </label></td> </tr> <tr> <td align="right">Product Image</td> <td> </td> </tr> <tr> <td> </td> <td><label> <input name="thisID" type="hidden" value="<?php echo $targetID; ?>" /> <input type="submit" name="button" id="button" value="Make Changes" /> <input type="file" name="fileField" id="fileField" /> </label></td> </tr> </table> </form> <br/> <br/> </div> <?php include_once("../template_footer.php"); ?> </div> </body> </html> now i use dreamweaver cs5 and it says no syntax errors, when i type the exact link into page it come up with two errors firstly Notice: Undefined variable: product_list in C:\wamp\www\myNewweb\storeadmin\inventory_edit.php on line 125 but i defined it quite clearly. so on the inventory_edit page i deleted the line <?php echo $product_list; ?> and it worked! have i done this right, because i do not want it to hit me later in this database.
  20. <?php session_start(); if(!isset($_SESSION["manager"])){ header("location: admin_login.php"); exit(); } // Be sure to check that this manager SESSION value is in fact in the database $managerID = preg_replace('#[^0-9]#i','', $_SESSION["id"]); //filter everyhting but numbers and letters $manager = preg_replace('#[^A-Za-z0-9]#i','', $_SESSION["manager"]); //filter everything but numbers and letters $password = preg_replace('#[^A-Za-z0-9]#i','', $_SESSION["password"]); //filter everything but numbers and letters //Run mySQL query to be sure that this person is an admin and that their password session varequals the database information //Connect to the MySQL database include "../storescripts/connect_to_mysql.php"; $sql= mysql_query("SELECT * FROM admin WHERE id= '$managerID' AND username= '$manager' AND password= '$password' LIMIT 1"); //query the person --make sure person exists in database---- $existCount= mysql_num_rows($sql); //count the row nums if($existCount == 0){ //evaluate the count header("location: ../index.php"); exit(); } ?> <?php //error reporting error_reporting(E_ALL); ini_set('Display_errors', '1'); ?> <?php //parse the form data and add inventory item to the system if (isset($_POST['Product_name'])){ $product_name = mysql_real_escape_string($_POST['product_name']); $price = mysql_real_escape_string($_POST['price']); $category = mysql_real_escape_string($_POST['category']); $subcategory = mysql_real_escape_string($_POST['subcategory']); $details = mysql_real_escape_string($_POST['details']); //see if that product name is an identical match to another product in the system $sql = mysql_query("SELECT id FROM Products WHERE product_name='$product_name' LIMIT 1"); $productMatch = mysql_num_rows ($sql); //count the output ammount if ($productMatch > 0){ echo 'Sorry you tried to place a duplicate "Product Name" into the system, <a href="inventory_list.php">click here</a>'; exit(); } //Add this product into the database now $sql = mysql_query("INSERT INTO products (product_name, Price, details, category, subcategory, date_added) VALUES('$product_name','$price','$details','$category','$subcategory',now())") or die (mysql_error()); //now adds todays date $id = mysql_insert_id(); //place image in the folder $newname = "$pid.jpg"; move_uploaded_file($_FILES['filefield']['tmp_name'], "../inventory_images/$newname"); } ?> <?php //This block grabs the whole list for viewing $product_list = ""; $sql = mysql_query("SELECT * FROM products"); $productCount = mysql_num_rows($sql);//count the the output ammount if ($productCount > 0){ while($row = mysql_fetch_array($sql)){ $id = $row["id"]; $product_name = $row["product_name"]; $date_added = strftime("%b %d, %Y", strtotime($date_Added)); $product_list .= "$id-$product_name <a href='#'>edit</a> •<a href='#'> delete</a><br/>"; } }else{ $product_list = "You have no products listed in your store Yet"; } ?> <!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>Inventory list</title> <link rel="stylesheet" href="../style/style.css" type="text/css" media="screen" /> <style type="text/css"> body { background-color: #FFF; } </style> </head> <body> <div align="center"></div> <div align="center" id="mainWrapper"> <?php include_once("../template_header.php"); ?> <?php include_once("../template_sidebar.php"); ?> <div align="left" id="pageContent"> <div align="right" style="margin-right:32px"><a href="inventory_list.php#inventoryForm">+Add New Inventory Item</a></div> <div align="left" style="margin-left:24px;"> <h2>Inventory List</h2> <?php echo $product_list; ?> </div> <hr /> <div> <a name="inventoryForm" id="inventoryForm"></a> <h3 align="center"> ↓ Add New Inventory Item Form ↓ </h3> </div> <form action="inventory_list.php" enctype="multipart/form-data" name="myForm" id="myform" method="post"> <table width="90%" border="0" cellspacing="0" cellpadding="6"> <tr> <td width="20%" align="right">Product Name</td> <td width="80%"><label> <input name="product_name" type="text" id="product_name" size="64" /> </label></td> </tr> <tr> <td align="right">Product Price</td> <td><label> £ <input name="price" type="text" id="price" size="12" /> </label></td> </tr> <tr> <td align="right">Category</td> <td><label> <select name="category" id="category"> <option value="Clothing">Clothing</option> </select> </label></td> </tr> <tr> <td align="right">Subcategory</td> <td><select name="subcategory" id="subcategory"> <option value=""></option> <option value="Hats">Hats</option> <option value="Pants">Pants</option> <option value="Shirts">Shirts</option> </select></td> </tr> <tr> <td align="right">Product Details</td> <td><label> <textarea name="details" id="details" cols="64" rows="5"></textarea> </label></td> </tr> <tr> <td align="right">Product Image</td> <td><label> <input type="file" name="fileField" id="fileField" /> </label></td> </tr> <tr> <td> </td> <td><label> <input type="submit" name="button" id="button" value="Add This Item Now" /> </label></td> </tr> </table> </form> <br/> <br/> </div> <?php include_once("../template_footer.php"); ?> </div> </body> </html>
  21. it gets rid of the code at the top of page but it also gets rid of the date that usually shows in the inventory list section for the product list (if that makes sense). can not seem to win at the moment! sorry
  22. there is no returned error just this appears at the top of the page when viewed through browser array 0 => string '9' (length=1) 'id' => string '9' (length=1) 1 => string 'hat' (length=3) 'product_name' => string 'hat' (length=3) 2 => string '10' (length=2) 'price' => string '10' (length=2) 3 => string 'brill' (length=5) 'details' => string 'brill' (length=5) 4 => string 'Clothing' (length=8) 'category' => string 'Clothing' (length=8) 5 => string 'Hats' (length=4) 'subcategory' => string 'Hats' (length=4) 6 => string '2011-09-28' (length=10) 'date_Added' => string '2011-09-28' (length=10)
  23. ia m unsure how to or where to with this code while($row = mysql_fetch_array($sql)){ echo '<pre>'; var_dump($row); echo '</pre>'; }
×
×
  • Create New...