ignace
Moderators-
Posts
6,457 -
Joined
-
Last visited
-
Days Won
26
Everything posted by ignace
-
quizzes (quiz_id, ..) quizzes_questions (question_id, quiz_id, ..) quizzes_answers (answer_id, question_id, ..)
-
<form method="POST" action="#"> <input name="data1" size="50" value="<?php print isset($_POST['data1']) ? $_POST['data1'] : '' ?>"> <input type="submit" name="prv" value="Preview"> </form> <?php if (isset($_POST['Preview'])) { echo '<div style="width: 500px; height: 500px; overflow: scroll">', applyTemplate($_POST['data1']), '</div>'; } if (isset($_POST['submit'])) { //submit } You don't need session's to create a preview just make sure to auto-populate the form fields.
-
You are correct, the same applies for the negative column.
-
It would be best to use a intermediary table, like: products (product_id, product_name, ..) products_sizes (size_id, size_label, ..) products_has_sizes (product_id, size_id, quantity) -- <-- intermediary table Retrieve all sizes for a certain product: SELECT products.product_id, products.product_name, sizes.size_name, products_has_sizes.quantity FROM products_has_sizes JOIN products USING (product_id) JOIN sizes USING (size_id) class Store { public function fetchAll() { $query = 'SELECT products.product_id, products.product_name, sizes.size_id, sizes.size_name, products_has_sizes.quantity' . ' FROM products_has_sizes JOIN products USING (product_id) JOIN sizes USING (size_id)'; $result = array(); foreach ($this->db->fetchAll($query) as $row) { $product = new Product(); $product->setId($row['product_id']); $product->setName($row['product_name']); $size = new ProductSize(); $size->setId($row['size_id']); $size->setName($row['size_name']); $product->addSize($size, $row['quantity']); $result[] = $product; } return $result; } } $dao = new Store(); foreach ($dao->fetchAll() as $product) { echo $product->getName(), ' (', $product->getQuantity($product->getSize()), 'x', $product->getSize(), ")<br>\n"; }
-
When I mentioned a virtual-client I did not refer to a virtual host these are 2 different things. With a virtual-client I meant a program like VirtualBox which allows you to run an exact copy of your server including it's OS.
-
This website has other problems then the one's you mentioned, accessibility & usability being among those.
-
Checking for duplicates in table for current user
ignace replied to Smudly's topic in PHP Coding Help
It should be SELECT `url` FROM `websites` WHERE `userid` = '$userid' AND `url` = '$url' -
http://en.wikipedia.org/wiki/Post/Redirect/Get
-
Trying to Save generated xml to a sitemap.xml file.
ignace replied to blesseld's topic in PHP Coding Help
You could let the user copy-paste http://www.dev.domain.com/ and then using crawling techniques you would find internal links and using DomDocument you can then output it as XML. -
What is your intention with unset? To delete the rows from your database?
-
What is not working? What is the current output? And what is the desired output?
-
Like I said you should use set_include_path on Windows platform's the use of ini_set('include_path') does not seem to work (it never did for me and I am not sure about Linux) either way try it
-
You should use set_include_path. Instead of uploading everything to the production server it would be best to run an exact copy of your production server in a virtual-client so that you can correct any error's and not the entire world can see you correct these error's.
-
You can increase the count by altering max_file_uploads cf http://www.php.net/manual/en/ini.core.php#ini.max-file-uploads Chances are you also may want to increase upload_max_filesize with 8M you would have 200KB for each file.
-
I am no expert in CSS and have actually no idea what the browser applied CSS-rules are for the <legend>-tag but I tried and worked: <fieldset> <legend style="display: block; float: left; margin-top: -17px; background-color: #FFF; padding: 0 5px;">test</legend> <div style="display: block; float: right; margin-top: -17px; background-color: #FFF; padding: 0 5px;">test</div> test </fieldset> If you use a reset script (cf Eric Meyer) you'll notice the <legend>-tag is no longer where it used to be. It's quite possible the browser uses background-color: inherit for the <legend>-tag to animate no line under the tag itself from the <fieldset>.
-
$secondFriday = strtotime('second friday'); $lastWednesday = strtotime('last wednesday'); For more info see: http://www.php.net/manual/en/datetime.formats.relative.php
-
Problem in IE with a javascript form submissions
ignace replied to refiking's topic in Javascript Help
<sarcasm>Oh sorry, I didn't notice that in your very detailed description of your problem</sarcasm> Try that: <button onclick="document.addtocart.submit()" style="background-color:#3355CA; color:#FFFFFF; font-weight:bold; font-size:12px; padding-bottom:2px;">Add To Cart</button> -
Unless you use the directives auto_prepend_file or auto_append_file php_value auto_prepend_file "includes/functions.php" http://php.net/manual/en/ini.core.php -- scroll down to data handling
-
What amazes me is that you ask this question while you could have just read the DTD@http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_XHTML-1.0-Strict or validate it using your IDE or W3 validator. And what's a <legend>-tag? Nothing special just a tag with some default style applied to, you can use any tag you like (as many times you like, or one with the accesskey attribute if you want to maintain accessibility). Or for semantics sake, you could write: <fieldset> <legend class="legend left">..</legend> <div class="legend center">..</div> <div class="legend right">..</div> .. </fieldset>
-
Problem in IE with a javascript form submissions
ignace replied to refiking's topic in Javascript Help
LOL It should be: <button type="submit" style="background-color:#3355CA; color:#FFFFFF; font-weight:bold; font-size:12px; padding-bottom:2px;">Add To Cart</button> -
Add readonly="readonly" However anyone with FF and Firebug can alter it's contents, and JS can be blocked. Never trust the client.
-
How to split a string cleanly into at most 2 strings
ignace replied to hadoob024's topic in PHP Coding Help
Never underestimate the power of PlaystationHP -
I can already tell you your solution is going to be faster but a hell to maintain if they push through changes. Find a balance that works between a normalized and de-normalized structure
-
using addition and division in a MySQL table row?
ignace replied to shmeeg's topic in PHP Coding Help
The reason we advice this is to avoid an UPDATE anomaly. For example you have 3 fields: number1, number2, and total where total is the sum of number1 and number2. Now imagine I update number1 or number2 or both, total wouldn't be so accurate anymore.