Jump to content

nickholt1972

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

About nickholt1972

  • Birthday 06/28/1972

Contact Methods

  • Website URL
    http://www.nicholasholt.co.uk/

Profile Information

  • Gender
    Male
  • Location
    Bury, Lancs, UK

nickholt1972's Achievements

Member

Member (2/5)

0

Reputation

  1. Can anyone tell me why this page displays perfectly in IE but looks like its gone six rounds with Mike Tyson in Firefox? http://www.appletreenappies.co.uk/articles/construction.php comments very much appreciated
  2. I would imagine you'd have a form which has a secure login (this would involve a relatively simple selection of php scripts), the form fields would be something like Day, Subject and Assignment (where the teacher details the homework). On SUBMIT, that would scurry off to a database and populate a table (call it homework) with fields something like id, day, subject, assignment). Then the students would view a page, lets call it viewhomework.php which would include a [b]'SELECT day, subject, assignment FROM homework'[/b] statement which would display the information from the database. Then further to Barand's suggestion, you could have the students selecting their year and stream or class and via a couple of drop-down boxes could view their homework only. This would involve an extra couple of fields for the teachers to fill in and an additional [b]'WHERE year = ' . $year . 'AND class = ' . $class[/b] where $year and $class are the variable names assigned to the choices the student entered when filtering for his/her own homework. Its quite a straightforward script really (if you know a bit about PHP), so shouldn't be too difficult.
  3. I found it a bit sparse. Lots of white and not much explanatory text. It actually took a while to work out what the website was about and i'm still not sure. Maybe some kind of introduction for people who stumble upon your site because it took a great will of effort to persevere with it. The Google ads are very intrusive, and seem to me to be the focal point of the site. I would suggest a bit if colour or images to and break it up a little. Sorry to be so negative, I hope its helped though.
  4. Oh yes the code works as it is, but it doesn't let users [i]change[/i] the quantities in the basket. Currently it would just display id, productname, quantity and price but the quantity would be 1 by default because of the [b]$quantity = 1[/b] variable. I want to add the functionality so a user can decide to order 2 or 12 or whatever, and i don't know how to go about it. Thanks, Nick.
  5. I've set up a shopping basket. It works in so much as I can add items from my product pages to the basket and it lists them with their prices. Trouble is, now i need to be able to let shoppers alter quantities from the default (1), I also need to let them remove items. I've experimented with a text box or drop down list but if I send the quantity as a $_POST variable, it changes the quantity on all the items in the basket. This is the code which displays the items in the basket. You may note, i've hardcoded the default quantity (1) whilst i work out what to do. [code] $total = 0;   for ($i = 0; $i < count($_SESSION['basket']); $i++) { $alldetails = @mysql_query('SELECT * FROM stocks WHERE id = ' . $_SESSION['basket'][$i]); while ($row = mysql_fetch_array($alldetails)) {     echo '<tr>';     echo '<td>' . $_SESSION['basket'][$i] . '</td>';  // id     echo '<td>' . $row['alphaname'] . '</td>'; // product name $quantity = 1;     echo '<td>' . $quantity . '</td>'; // quantity $subtotal = $row['price'] * $quantity;     echo '<td align="right">£' . number_format($subtotal, 2) . '</td>'; // price     echo '<td>remove</td>';     echo '</tr>';     $total = $total + $subtotal;   }}[/code] Any suggestions would be greatly appreciated. Also the issue of removing items I don't esxpect to be too hard but still some assistance would be really helpful. Thanks, Nick.
  6. Thanks man, you have [u]no idea[/u] how long i've been fighting with that particular beast. Nick
  7. That's great, thanks. only problem is, I can't surround the variable with single quotes because i've got singles at the start and end of the SELECT statement. I can't change those to doubles or use doubles to surround the variable because i get error messages. And i can't escape them either. I appreciate your help.
  8. I've posted this in the MySQL forum, but it could be in either and this one has more traffic. I want to select items from my database where the id for the record is equal to the PHP variable being passed from the previous page. In theory the code should look something like... [b]$productdetails = @mysql_query('SELECT * FROM stocks WHERE id = $_SESSION['cart'][$i]');[/b] But I don't seem to be able to use a variable in a query. Does anyone know of an alternative method for getting round this problem? Thanks, Nick
  9. I want to select items from my database where the id for the record is equal to the PHP variable being passed from the previous page. In theory the code should look something like... [b]$productdetails = @mysql_query('SELECT * FROM stocks WHERE id = $_SESSION['cart'][$i]');[/b] But I don't seem to be able to use a variable in a query. Does anyone know of an alternative method for getting round this problem? Thanks, Nick.
  10. Further to my original post, I think I might not have explained myself too well so i'm posting the complete script (more or less, slightly simplified so you've less to trawl through) [code]<?php session_start(); if (!isset($_SESSION['cart'])) {   $_SESSION['cart'] = array(); } if (isset($_GET['buy'])) {   // Add item to the end of the $_SESSION['cart'] array   $_SESSION['cart'][] = $_GET['buy'];   header('location: ' . $_SERVER['PHP_SELF'] . '?' . SID);   exit(); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head><title>apple tree nappies online shop</title> </head> <body> <?php include_once 'dbconnect.inc.php'; if ($choice == "allnappies") {$result = @mysql_query('SELECT * FROM stocks WHERE alphatype = "NAPPY" AND display = "yes" ORDER BY id ASC'); } elseif ($choice == "onesize") {$result = @mysql_query('SELECT * FROM stocks WHERE sizetype = "One Size" AND display = "yes" ORDER BY id ASC');} elseif ($choice == "multisize") {$result = @mysql_query('SELECT * FROM stocks WHERE sizetype = "Multi Size" AND display = "yes" ORDER BY id ASC');}   // Display the title of each entry with a 'buy' link in a table // THIS FOLLOWING LINE IS THE ONE GIVING ME AN ERROR // while ($row = mysql_fetch_array($result)) { <table class="products"> <tr> <td>' . $row['alphaname'] . '</td></td> <td> <a href="' . $_SERVER['PHP_SELF'] .'?buy=' . $row['id'] . '">Buy</a> </td> </tr> </table>';   } ?> <?php echo count($_SESSION['cart']); ?> <p><a href="cart.php">View Cart</a></p> </body> </html>[/code] I'd really appreciate your input. Thanks.
  11. I had a shopping page which was working fine only I didn't like it. So in trying to fix what wasn't broken ... guess what? I broke it. I introduced sessions and shortly afterwards made the short trip to errormessagesville My products.php page starts with the following code [code]<?php session_start(); if (!isset($_SESSION['cart'])) {   $_SESSION['cart'] = array(); } if (isset($_GET['buy'])) {   // Add item to the end of the $_SESSION['cart'] array   $_SESSION['cart'][] = $_GET['buy'];   header('location: ' . $_SERVER['PHP_SELF'] . '?' . SID);   exit(); } ?>[/code] then it does some other SELECT FROM related shenanigans, before giving it some of this.. (and its this line which brings about the error) [code]while ($row = mysql_fetch_array($result)) {[/code] within my while statement, I display my product details and include the following link, which is SUPPOSED to add the product id to my array of purchased products. [code]<a href="' . $_SERVER['PHP_SELF'] .'?buy=' . $row['id'] . '">Buy</a>[/code] When I run the page, the number of items in my cart goes up, which is fine. However, I get the following message: [i]Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/.sites/123/site117/web/display2.inc.php on line 3[/i] (line 3 is [b]while ($row = mysql_fetch_array($result)) {[/b]) What I think i happening is the [b]while ($row...[/b] line is losing track of the preceding SELECT line so there's effectively no data but this only happened since I started piddling about with these pesky sessions. can any one suggest a solution?
  12. Has anyone any recommendations for a colour-coded text editor for PHP?
  13. I'm not really an 'advice-giving level' expert but I do a lot of things for ie and I don't think you need all those backslashes because if you're starting your echo string with a [b]' [/b]and ending it with a [b]'[/b], it won't mind if you have a load of [b]"[/b]s in the middle. nice looking site, by the way.
  14. HuggieBear, steveclondon, Guys, I really appreciated your comments re the site. I downloaded a few alternative browsers today including Firefox and i've made a few ammendments. http://www.appletreenappies.co.uk/products.php?product=multisize Please have a look and see if you can spot the difference. BTW I was using lots of DIVs, not layers but now i've popped all the product descriptions in tables. It still needs a bit of tweaking but its an improvement. So thanks for your input.
  15. I'm just releived my own website wasn't in your list
×
×
  • 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.