Jump to content

stuartriches

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

stuartriches's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Personally I like Cartweaver, in large part as it isn't template driven and can therefore integrate into existing sites/designs via include files. It doesn't have the highly designed look of some of the template driven solutions, but I've foound it to be reliable, easy to use and implement and (with a bit of CSS knowledge) fairly straightforward to integrate.
  2. I would agree with fortnox007 that it would be better to use the db to record the orders. Unless I am missing something, won't the customer lose all their order history if they are on either a different PC to normal, or decide to clear their cookies out? If a customer uses different machines (I alternate between my laptop and PC at home, and can also use a different machine in the office), then their order details are going to be spread across a number of machines. Are you keeping the orders in a database for the client to use and analyse? Without doing this, they will miss out on the possibility of analysing this data to find many useful insights, e.g. customers who haven't ordered recently, abandoned carts etc. Have you tried using a standard shopping cart package? This should allow you to create and handle most of what you need to do, quicker than you can code it yourself. Personally I use cartweaver for php, and it does all you require: 1) Go to product page 2) Enter quantity in input field, click "order now" button 3) Redirect to the order page where a list of the user's current order is shown, 4a) Continue shopping, or 4b) Submit the order and personal (*non-financial*) info via email as well as providing the admin pages, catalgue maintenance etc . Coping with offline payments is also straightforward as you simply turn the payment processor off, and allow all orders to be finalised in "pending" status, allowing the client to update them to paid once the offline payment has been processed. I like cartweaver as the licencing model allows it to be used on a "buy once, use many" model and its easily incorporated into existing sites and designs as it isn't built around difficult-to-changeemplates.
  3. Last line should read: What I need to end up with is a single occurence of book 1 with both genres 1 and 5 set in the form.
  4. As mentioned, the page is failing with a 404 error as the URL called is http://www.yardleyheroes.co.uk/admin/edit.php?match_id=50 it should be http://www.yardleyheroes.co.uk/admin/edit_result.php?match_id=50
  5. Why not simply make the path to the library files non-relative? With your library folder lib always under your root folder couldn't you just use: require_once('/lib/class.phpmailer.php'); It would avoid any potential problems arising include files calling phpmailer where the include files are being used at different levels e.g. /send_mail.php and /admin/send_mail.php If you think the absolute path may be different across servers )e.g. your local test, and a production machine) you could set a variable e.g. define(‘ABSPATH’, dirname(__FILE__).’/'); require_once(ABSPATH.’wp-settings.php’);
  6. Hi I am new to PHP / mySQL although not to programming and am trying to work out how to deal with the following situation: I have a form for a user to add a book to a database, along with the genres that the book belongs to. Each book can have a number of genres . There are 3 tables, books, genres and bg_xref in the following formats table: books fields: id, title, author, date published table: genres fields: id, genre table: bg_xref fields: id, book_id, genre_id I am now trying to build the form that allows the user to update an existing entry for a book. the genres are selectable from a multi-selection list which I am populating from all the possible values in the genres table. Currently I have the following database selections: mysql_select_db($database_conn, $conn1); $query_rs_getBooks = "SELECT books.id, books.title, books.author, bg_xref.genre_id FROM books LEFT JOIN bg_xref ON books.id = bg_xref.book_id"; $rs_getBooks = mysql_query($query_rs_getBooks, $conn1) or die(mysql_error()); $row_rs_getBooks = mysql_fetch_assoc($rs_getBooks); mysql_select_db($database_conn, $conn1); $query_rs_getGenre = "SELECT * FROM book_genres ORDER BY genre ASC"; $rs_getGenre = mysql_query($query_rs_getGenre, $conn1) or die(mysql_error()); $row_rs_getGenre = mysql_fetch_assoc($rs_getGenre); I have then created a form that the user uses to update the book, but am trying to work out how to prepopulate the selection list based on teh results of the join e.g. <form method="POST" action="<?php echo $editFormAction; ?>" name="update_book"> <fieldset class="full"> <legend>Enter book details below</legend> <table> <tr><td>Title: </td><td><input type="text" size="50" value="<?php echo htmlentities($row_rs_getBooks['title'], ENT_COMPAT, 'iso-8859-1'); ?>" name="title"></td></tr> <tr><td>Author: </td><td><input type="text" size="30" value="<?php echo htmlentities($row_rs_getBooks['author'], ENT_COMPAT, 'iso-8859-1'); ?>" name="author_surname"></td></tr> <tr><td>Genre(s)</td><td><select name="genre" multiple size="4"> <?php do { ?> <?php if (($row_rs_getBooks['genre_id']) != $row_rs_getGenre['id']) { ?> <option value="<?php echo $row_rs_getGenre['id']?>"><?php echo $row_rs_getGenre['description']?></option> <?php } else { ?> <option value="<?php echo $row_rs_getGenre['id']?>" selected><?php echo $row_rs_getGenre['description']?></option> <?php } } while ($row_rs_getGenre = mysql_fetch_assoc($rs_getGenre)); $rows = mysql_num_rows($rs_getGenre); if($rows > 0) { mysql_data_seek($rs_getGenre, 0); $row_rs_getGenre = mysql_fetch_assoc($rs_getGenre); } ?> </select></td></tr> </table> </fieldset> <input type="hidden" name="id" value="<?php echo $row_rs_getBooks['id']; ?>"> <input type="submit" value="Update book details"> <input type="hidden" name="MM_update" value="update_book"> </form> Book id = 1 is classified against genres 1 and 5, so my SQL query returns 2 rows: book.id = 1 + bg_xref.genre_id = 1 book.id = 1 + bg_xref.genre_id = 5 At the moment the form is generated for the first row of the results set with <tr><td>Genre(s)</td><td><select name="genre" multiple size="4"> <option value="5">Humour</option> <option value="4">Non Fiction</option> <option value="2">Novel</option> <option value="3">Picture Books</option> <option value="1" selected>Poetry</option> with a second entry in the results set for book 1 and genre 5. What I need to end up with is a second occurence of book 1 with both genres 1 and 5 set in the form. Thanks Stuart
×
×
  • 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.