Jump to content

jigsawsoul

Members
  • Posts

    137
  • Joined

  • Last visited

Everything posted by jigsawsoul

  1. Using the above code give me these errors; Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/jigsaws2/public_html/tape/add2.php on line 33 Parse error: syntax error, unexpected T_STRING in /home/jigsaws2/public_html/tape/add2.php on line 33 <?php session_start(); $message .= $_SESSION["message"]; include('_resources/opendb.php'); $_SESSION['message'] = ""; if (empty($_POST['use'])) $_SESSION['message'] .= "<font color=red><li>You must submit in an idea.<br /></li></font>"; if (!empty($_SESSION['message'])) { $_SESSION['message'] .= "<br />"; header("Location: add.php"); exit(); } $use = mysql_real_escape_string($_POST['use']); $use = ucwords($use); $query = "INSERT INTO uses (uses) VALUES ('$use')"; if (mysql_query ($query)) { $id = mysql_insert_id(); } else { $_SESSION['message'] = "<font color=red><li>Couldnt Add 1</li><br /></font>"; header('Location: add.php'); } $js = '$(\'#' . $id . ').tipsy({gravity: '\n\'});'; $query = "INSERT INTO `uses` (`js`) VALUES ('$js') WHERE `id` = '$id'"; if (mysql_query ($query)) { $_SESSION['message'] = "<font color=green><li>Your idea was added below</li><br /></font>"; header('Location: index.php'); } else { $_SESSION['message'] = "<font color=red><li>Couldnt Add 2</li><br /></font>"; header('Location: add.php'); } include('_resources/closedb.php'); ?>
  2. How would i write this, as the var has ' ' ' so its not working right $js = "$('#$id').tipsy({gravity: 'n'});"; $query = "INSERT INTO uses (js) VALUES ('$js') WHERE id = '$id'";
  3. How can i get the while loop to display six rows then create a new column and six etc and so on... i can't seem to get this to work any help would be great? $result = "SELECT * FROM uses"; $result = mysql_query ($result) or die (mysql_error()); while($row = mysql_fetch_assoc($result)) { $js .= ''.$row['js'].''; $table .= ' <td> <a id="'.$row['id'].'" href="#" title="'.$row['uses'].'">Usage</a> </td> '; } <table id='gravity' cellspacing='5'> <tr> <?php echo $table ?> </tr> </table>
  4. $Now = time(); $SixDays = 1 * 60 * 60 * 24 * 2; $Wanted = $Now + $SixDays; $Wanted = date("d/m/Y", $Wanted); is the above correct if i only want to add two days?
  5. I'm having problems knowing where to start, the delivery date on my website will be, 6 days from the current date.. How would i get todays date, the add six day's to that date and display the new date..??? If you understand at all what i mean.. thanks for any help..!
  6. na the css is not the problem its something within the html thats the problem here, just can't see it, as it was fine then without editing the css file it jumped
  7. @Mchl, why does it work this way and not the other way around...
  8. @Mchl, this seems to work... <?php session_start(); include('../resources/config.php'); include($config["paths"]["resources"] . 'opendb.php'); include($config["paths"]["resources"] . '_library/login.php'); $email = mysql_real_escape_string($_POST['email']); $password = mysql_real_escape_string($_POST['password']); $password2 = mysql_real_escape_string($_POST['password2']); if(!$result = mysql_query("SELECT email FROM projectlogin WHERE email = '$email'")) { die(mysql_error()); } $emailcheck = mysql_num_rows($result); echo $email; echo $password; echo $password2; include($config["paths"]["resources"] . 'closedb.php'); ?>
  9. view source, shows a blank page... included files, have nothing wrong with them, ill check through them, but there also in other pages, and they have no problem running..
  10. I just have hosting on Justhosting.com, not sure how to set on these errors.. never displays after the line $emailcheck = mysql_num_rows($result) or die(mysql_error()); but its display the echo from above this line just fine
  11. It will not echo "Registration was successful", and i can't see why at all.. .i've been looking for ages.. anyone??? <?php ini_set ("display_errors", "1"); error_reporting(E_ALL); session_start(); ob_start(); include('../resources/config.php'); include($config["paths"]["resources"] . 'opendb.php'); include($config["paths"]["resources"] . '_library/login.php'); $email = mysql_real_escape_string($_POST['email']); $password = mysql_real_escape_string($_POST['password']); $result = mysql_query("SELECT email FROM projectlogin WHERE email = '$email'"); $emailcheck = mysql_num_rows($result) or die(mysql_error()); echo 'Registration was successful'; include($config["paths"]["resources"] . 'closedb.php'); ?>
  12. Hey, my navigation menu on my website was sitting sweet and in the right place, I refreshed the page today and it seems to have jumped down a little but i can't seem to find out why at all. Can anyone spot the problem?? http://www.jigsawsoulmedia.com/project/public/index.php Source Code <!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" /> <link rel="stylesheet" type="text/css" href="_css/stylesheet.css"/> <!--[if lte IE 6]> <script type="text/javascript" src="_js/supersleight-min.js"></script> <![endif]--> <title>DigitalSoul</title> </head> <body> <div id="header"> <div class="innerwaraper"> <div class="logo"><a href="#"><img src="_img/layout/LOGO.png" alt="" width="277" height="56" /></a></div> <div class="topblock"> <div class="fdetails"> Currencies: <a href="#">change currency</a> <span>|</span> Languages: <a href="#">change language</a> </div> <div class="itemholder"> <div class="item"> Shopping Cart: <span><a href="#">( items)</a></span> </div> <div> Sub-Total: £0.00 </div> </div> </div> <div id="menu"> <ul> <li><a href="index.php">Home Page </a></li> <li><a href="newproducts.php">New Products </a></li> <li><a href="specials.php"> Specials </a></li> <li><a href="faq.php"> FAQ</a></li> <li><a href="contact.php"> Contact Us</a></li> <li class="last"><a href="login.php"> Login In </a> </li> </ul> </div> </div> </div> <div class="bodybg"> <div id="containner"> <div id="leftbar"> <div class="CommHolder"> <h1>Search</h1> <div class="inputbg"><a href="#"><img src="_img/layout/searchicon.gif" alt="" width="23" height="19" /></a> <input type="text" name="textfield" id="textfield" /> </div> </div> <div class="CommHolder"> <h1>Categories</h1> <div class="categories"> <ul> <li><a href="categorie.php?id=1">Mac Laptops (3)</a></li> <li><a href="categorie.php?id=2">Mac Desktops (2)</a></li> <li><a href="categorie.php?id=3">PC laptops (1)</a></li> <li><a href="categorie.php?id=4">PC Desktops (2)</a></li> <li><a href="categorie.php?id=5">MP3 Players (2)</a></li> </ul> </div> </div><div class="CommHolder"> <h1>Manufacturers</h1> <select name="aa" class="dropme"> <option>Please select</option> <option>Item - 1</option> <option>Item - 2</option> <option>Item - 3</option> <option>Item - 4</option> <option>Item - 5</option> <option>Item - 6</option> <option>Item - 7</option> </select> </div> <div class="CommHolder"> <div class="Boxholder"> <div class="sBottom"> <div class="sTop"> <div class="girl"> <h2>Support-line</h2> <p class="num"> 0844 5616263</p> </div> </div> </div> </div> </div> <div class="CommHolder"> <div class="Boxholder"> <div class="bBottom"> <div class="bTop"> <h2>ipsum lorem </h2> <p> dolor sit amet vitaes</p> <span>from £ 49.99</span> </div> </div> </div> </div> <div class="CommHolder"> <div class="Boxholder"> <div class="bBottom"> <div class="bTop"> <h2>ipsum lorem </h2> <p> dolor sit amet vitaes</p> <span>from £ 49.99</span> </div> </div> </div> </div> </div> <div id="midcontain"> <div class="slidShow"> <div class="btnread"> <a href="#">Read more</a></div> </div> <div class="divider"></div> <div class="postHoplder"> <div class="productName">Apple MacBook Pro</div> <div class="productDetailsPH"> <div class="fltlft"><img src="_img/products/macbookpro1.jpg" alt="" width="122" height="81" /></div> <div class="PicDetailsPH"> <p>The Apple MacBook Pro is powered by a fast and efficient 2.26 GHz Intel Core 2 Duo Processor and runs Apple's award-winning Mac OS X v10.6 Snow Leopard operating system. This model is both the first 13-inch MacBook Pro ever and th... <a href="product.php?id=1">read more</a></p> </div> <div class="payholderPH"> <a href="addtocart.php?id=1">Add to Cart</a> <p>£ 918.00</p> </div> </div> </div> <div class="postHoplder"> <div class="productName">Apple iMac</div> <div class="productDetailsPH-1"> <div class="fltlft"><img src="_img/products/imac1.jpg" alt="" width="122" height="81" /></div> <div class="PicDetailsPH"> <p>The Apple iMac is powered by the Intel Core 2 Duo Processor E7600 and comes with the advanced Mac OS X v10.6 Snow Leopard operating system. This all-in-one desktop computer also boasts a 500GB hard drive and 4GB of high-speed DDR3... <a href="product.php?id=2">read more</a></p> </div> <div class="payholderPH"> <a href="addtocart.php?id=2">Add to Cart</a> <p>£ 949.00</p> </div> </div> </div> <div class="postHoplder"> <div class="productName">Apple Mac Pro</div> <div class="productDetailsPH"> <div class="fltlft"><img src="_img/products/macpro1.jpg" alt="" width="122" height="81" /></div> <div class="PicDetailsPH"> <p>The Apple Mac Pro is powered by an Intel Xeon Processor W3520 and comes with Apple's Mac OS X 10.5 Leopard operating system. This high-performance workstation comes with a 640GB hard drive and 3GB of DDR3 EEC RAM, both greatly exp... <a href="product.php?id=3">read more</a></p> </div> <div class="payholderPH"> <a href="addtocart.php?id=3">Add to Cart</a> <p>£ 1669.00</p> </div> </div> </div> </div> <div id="rightbar"> <div class="CommHolder"> <h1>Register</h1> <div class="categories"> <ul> <li><a href="login.php">Login</a> | <a href="register.php">Create Account</a></li> </ul> </div> </div> <div class="CommHolder"> <h1>Specials</h1> <div class="categories"> <ul> <li><a href="categorie.php?id=1">Mac Laptops (3)</a></li> <li><a href="categorie.php?id=2">Mac Desktops (2)</a></li> <li><a href="categorie.php?id=3">PC laptops (1)</a></li> <li><a href="categorie.php?id=4">PC Desktops (2)</a></li> <li><a href="categorie.php?id=5">MP3 Players (2)</a></li> </ul> </div> </div><div class="CommHolder"> <h1>Reviews</h1> <select name="a" class="dropme"> <option>Please select</option> <option>Item - 1</option> <option>Item - 2</option> <option>Item - 3</option> <option>Item - 4</option> <option>Item - 5</option> <option>Item - 6</option> <option>Item - 7</option> </select> </div> <div class="CommHolder"> <h1>Popular tags</h1> <div class="categories"> <span><a href="#">Printers</a></span> <span class="style3"><a href="#">MP3</a></span> <span><a href="#">Players</a></span> <span class="style2"><a href="#">Scanners</a></span> <span><a href="#">PDAs</a></span> <span><a href="#">Mice and <span class="style1">Trackballs</span></a></span> <span class="style2"><a href="#">Tablet PCs Mac</a></span> <span><a href="#">Laptops</a></span> <span><a href="#">PC</a></span> <span><a href="#">Laptops</a></span> <span><a href="#">Monitors</a></span> <span><a href="#">Mac</a></span> <span><a href="#">Desktops</a></span> <span class="style2"><a href="#">PC Desktops </a></span> </div> </div> <div class="CommHolder"> <div class="Boxholder"> <div class="bBottom"> <div class="bTop"> <h2>ipsum lorem </h2> <p> dolor sit amet vitaes</p> <span>from £ 49.99</span> </div> </div> </div> </div> <div class="CommHolder"> <div class="Boxholder"> <div class="bBottom"> <div class="bTop"> <h2>ipsum lorem </h2> <p> dolor sit amet vitaes</p> <span>from £ 49.99</span> </div> </div> </div> </div> <div class="CommHolder"> <div class="Boxholder"> <div class="bBottom"> <div class="bTop imgSpac"> <a href="#"><img src="_img/layout/v1.gif" alt="" width="27" height="17" /></a> <a href="#"><img src="_img/layout/v2.gif" alt="" width="24" height="17" /></a> <a href="#"><img src="_img/layout/v3.gif" alt="" width="26" height="17" /></a> <a href="#"><img src="_img/layout/v4.gif" alt="" width="26" height="17" /></a> <div class="clear"></div> </div> </div> </div> </div> </div> <div class="clear"> </div> </div> <div id="footer"> <div class="fltlft"> Copyright © 2010 DigitalSoul <a href="#">Privacy Notice</a> | <a href="#">Conditions of Use</a> | <a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0</a> </div> <div class="fltrt"><a href="mailto:contact@digitalsoul.com">contact@digitalsoul.com</a></div> </div> </div> </body> </html>
  13. @teamatomic, what do you mean i've always written my sessions like this?, i'm new is there a problem with them? @GetPutDelete, i tried what you said i have this error message though now Error Message: Parse error: syntax error, unexpected ';' in /home/jigsaws2/public_html/project/public/checkout.php on line 14 Checkout.php <?php session_start(); include('../resources/config.php'); include($config["paths"]["resources"] . 'opendb.php'); include($config["paths"]["resources"] . '_library/login.php'); include($config["paths"]["resources"] . '_library/cart.php'); $content = ' <h2>Checkout</h2> '.; if(isset($_SESSION['cart'])) { .' <form action="index.php?view=update_cart" method="post"> <table id="items"> <thead> <tr> <th>Item</th> <th>Item Price</th> <th>Qty</th> <th>Subtotal</th> </tr> </thead> <tbody> '. foreach($_SESSION['cart'] as $id => $qty): $product = find_product($id); .' <tr> <td>'. $product['title']; .'</td> <td>$'. number_format($product['price'],2); .'</td> <td><input type="text" size="2" name="'. $id .'" maxlength="2" value="'. $qty .'" /></td> <td>$'. number_format($product['price'] * $qty, 2); .'</td> </tr> '. endforeach; .' </tbody> </table> <p><input type="submit" name="update" value="update" /></p> </form> '. } else { echo '<p>your cart is empty... <a href="index.php">continue shopping</a></p>'; } .' '; include($config["paths"]["resources"] . 'closedb.php'); ?>
  14. Hey guy's i keep getting this error message below when running this script can any one tell me where i'm going wrong, what i should change please. thanks... Error Message Parse error: syntax error, unexpected T_IF in /home/jigsaws2/public_html/project/public/checkout.php on line 14 Checkout.php <?php session_start(); include('../resources/config.php'); include($config["paths"]["resources"] . 'opendb.php'); include($config["paths"]["resources"] . '_library/login.php'); include($config["paths"]["resources"] . '_library/cart.php'); $content = ' <h2>Checkout</h2> '. if(isset($_SESSION['cart'])) { .' <form action="index.php?view=update_cart" method="post"> <table id="items"> <thead> <tr> <th>Item</th> <th>Item Price</th> <th>Qty</th> <th>Subtotal</th> </tr> </thead> <tbody> '. foreach($_SESSION['cart'] as $id => $qty): $product = find_product($id); .' <tr> <td>'. echo $product['title']; .'</td> <td>$'. echo number_format($product['price'],2); .'</td> <td><input type="text" size="2" name="'. echo $id .'" maxlength="2" value="'. echo $qty .'" /></td> <td>$'. echo number_format($product['price'] * $qty, 2); .'</td> </tr> '. endforeach; .' </tbody> </table> <p><input type="submit" name="update" value="update" /></p> </form> '. } else { echo '<p>your cart is empty... <a href="index.php">continue shopping</a></p>'; } .' '; include($config["paths"]["resources"] . 'closedb.php'); ?>
  15. look above at the code and your see i have set that peace of code, but it doesn't show up anything at all ???
  16. Adding this code doesn't do anything or display a problem anywhere? anyone have a better idea??? i really stuck ini_set ("display_errors", "1"); error_reporting(E_ALL); <?php ini_set ("display_errors", "1"); error_reporting(E_ALL); session_start(); ob_start(); include('../resources/config.php'); include($config["paths"]["resources"] . 'opendb.php'); include($config["paths"]["resources"] . '_library/login.php'); $_SESSION['message'] = ""; if (empty($_POST['email'])) $_SESSION['message'] .= "<li>A email address is required.<br /></li>"; if (empty($_POST['password'])) $_SESSION['message'] .= "<li>A password is required.<br /></li>"; if ($_POST['password'] != $_POST['password2']) $_SESSION['message'] .= "<li>Passwords don't match<br /></li>"; if (!empty($_SESSION['message'])) { $_SESSION['message'] .= "<br />"; header("Location: register.php"); exit(); } $email = mysql_real_escape_string($_POST['email']); $password = mysql_real_escape_string($_POST['password']); $result = mysql_query("SELECT email FROM projectlogin WHERE email = '$email'"); $emailcheck = mysql_num_rows($result) or die(mysql_error()); echo 'Registration was successful'; if($emailcheck > 0){ $_SESSION["message"] = "<li>Email address already in use.<br /><br /></li>"; header ('Location: register.php'); exit; } echo 'Registration was successful'; include($config["paths"]["resources"] . 'closedb.php'); ?>
  17. It will not echo 'Registration was successful'; but if the lines placed above $email = mysql_real_escape_string($_POST['email']); $password = mysql_real_escape_string($_POST['password']); works fine <?php session_start(); ob_start(); include('../resources/config.php'); include($config["paths"]["resources"] . 'opendb.php'); include($config["paths"]["resources"] . '_library/login.php'); $_SESSION['message'] = ""; if (empty($_POST['email'])) $_SESSION['message'] .= "<li>A email address is required.<br /></li>"; if (empty($_POST['password'])) $_SESSION['message'] .= "<li>A password is required.<br /></li>"; if ($_POST['password'] != $_POST['password2']) $_SESSION['message'] .= "<li>Passwords don't match<br /></li>"; if (!empty($_SESSION['message'])) { $_SESSION['message'] .= "<br />"; header("Location: register.php"); exit(); } $email = mysql_real_escape_string($_POST['email']); $password = mysql_real_escape_string($_POST['password']); $result = mysql_query("SELECT email FROM projectlogin WHERE email = '$email'"); $emailcheck = mysql_num_rows($result) or die(mysql_error()); echo 'Registration was successful'; if($emailcheck > 0){ $_SESSION["message"] = "<li>Email address already in use.<br /><br /></li>"; header ('Location: register.php'); exit; } echo 'Registration was successful'; include($config["paths"]["resources"] . 'closedb.php'); ?> Anyone see a problem or why this might be happening?
  18. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DESC LIMIT 0, 4' at line 1 $result = "SELECT * FROM products ORDER BY DESC LIMIT 0, 4"; Any help please?
  19. Doesn't work the result i get is; Mac Laptops () PC laptops () When i should have Mac Laptops (1) Mac Desktops (2) PC Laptops (1) PC Desktops (2) anyone know where i going wrong or if i'm doing this write <?php $result = "SELECT * FROM categories"; $result = mysql_query ($result) or die (mysql_error()); while($row = mysql_fetch_assoc($result)) { $id = $row['id']; $query = "SELECT categories_id, COUNT(categories_id) FROM products WHERE categories_id = '$id' GROUP BY categories_id"; $query = mysql_query ($query) or die (mysql_error()); $number = mysql_fetch_assoc($result); $categories .= ' <li><a href="categorie.php?id='.$row['id'].'">'.$row['categorie'].' ('.$number['COUNT(categories_id)'].')</a></li> '; } ?> <div class="CommHolder"> <h1>Categories</h1> <div class="categories"> <ul> <?php echo $categories ?> </ul> </div> </div> [attachment deleted by admin]
  20. any help would be great thanks Error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE categories_id = '1'' at line 1 <?php $result = "SELECT * FROM categories"; $result = mysql_query ($result) or die (mysql_error()); while($row = mysql_fetch_assoc($result)) { $id = $row['id']; $query = "SELECT categories_id, COUNT(categories_id) FROM products GROUP BY categories_id WHERE categories_id = '$id'"; $query = mysql_query ($query) or die (mysql_error()); $number = mysql_fetch_assoc($result); $categories .= ' <li><a href="categorie.php?id='.$row['id'].'">'.$row['categorie'].' ('.$number['COUNT(categories_id)'].')</a></li> '; } ?> <div class="CommHolder"> <h1>Categories</h1> <div class="categories"> <ul> <?php echo $categories ?> </ul> </div> </div>
  21. I have this code below it displays the categories in the navigation fine. But where it says (0) i want to display the amount of products in my products.table where categories is equal to the id.. any ideas on how to do this? <?php $result = "SELECT * FROM categories"; $result = mysql_query ($result) or die (mysql_error()); while($row = mysql_fetch_assoc($result)) { $categories .= ' <li><a href="categorie.php?id='.$row['id'].'">'.$row['categorie'].' (0)</a></li> '; } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.