Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. None. That's really the only resource you'll ever need. If you use FF you can even get the PHP Manual add-on so you can search for functions right off the integrated search bar. And if you are using a proper IDE you can look-up manual information with a few taps on the keyboard.
  2. Very poor db design. How does yes and on_file differ? What is either meaning? SELECT (CASE table2.Type WHEN 'on_file' THEN 'yes' WHEN 'yes' THEN 'on_file' ELSE 'missing' END) AS Status, ID FROM table1 RIGHT JOIN table2 USING (ID) WHERE Status = 'missing';
  3. ooow that's a nice font.. now I can have update my jpeg of my Bank PIN on my site You mind then also putting up your bank account number as we can't do much without that.
  4. This reminds me of the Observer pattern take a look at SplSubject and SplObserver
  5. The Math involved is of the level 1 + 1 and you can do that, can you? What does calculateValue() do? Return a page number? function calculateValue($index, $total_rows, $per_page) { if (0 > $index) return 0; if ($index > $total_rows) return $total_rows - 1; return ceil($total_rows/$per_page); }
  6. if ($per_page > $index) Does not make any sense. Shouldn't it be: if ($index > sizeof($total_rows))
  7. http://www.phpfreaks.com/forums/index.php/topic,298487.msg1413445.html#msg1413445
  8. In the corporate world you don't have a choice of browser, you use what is installed (in most cases IE6) and your visitors may feel offended by your statements. Your website only tells possible employers as to why not hire you: Which means always too late at work, always exceeds the deadline, .. and it's filled with these kind of statements like: Which means you are a liability if they ever want to let you work from home. Typo's. Inconsistency. My advice: take a good hard second look and keep your design consistent. Don't forget that your website names the company you work for and therefor reflect to prospects the quality they are likely to get. So, although it may seem fun what is on your portfolio. It may harm the company you work for on the other hand if you know how to sell you well it may in turn create new leads/prospects for the company you work for and which in turn means you won't end up without a job.
  9. Why would you want your client to upload his signature to his website?
  10. Or a book, but you'll need the degree to understand it
  11. Instead of creating your own, you could use an existing one like Wordpress.
  12. You have explained it very well, 100 clients or 1 client. If this 1 client accesses this script n times, then you have n times running this script.
  13. 0x57414954464F522044454C4159202730303A30303A313527 translates to: ?WAITFOR DELAY '00:00:15' It's to check if your script is whether or not hackable.
  14. $rows = array(); while ($row = mysql_fetch_assoc($result)) { if (!array_key_exists($row['name'], $rows)) { $rows[$row['name']] = array(); } $rows[$row['name']][$row['date']] = $row['price']; }
  15. Andrew, don't you notice something about this?
  16. ignace

    what's this

    That's because it's $_FILE['fileToUpload'], I possibly forgot to mention that for uploads a different global was used.
  17. Apparently you don't understand how this all works. Your web server creates a new session for each client which means that for each client your script will start from 0, so if 100 clients connect you will have 100 scripts waiting 15 minutes with different delays until a script executes every second and your server crashes due to resource depletion. They are stateless, they are not aware of a previous started process. In this case you can only introduce state by using a database of some sort.
  18. ignace

    what's this

    Yes this works on every element: <input type="checkbox" name="checked[]"> <input type="checkbox" name="checked[]"> <input type="checkbox" name="checked[]"> <input type="checkbox" name="checked[]"> <input type="checkbox" name="checked[]"> <input type="checkbox" name="checked[]"> <input type="checkbox" name="checked[]"> <input type="checkbox" name="checked[]"> <input type="checkbox" name="checked[]"> print_r($_POST['checked']);//returns an array of all those which are checked.
  19. You are better off on these forums, nothing guarantee's that what he said is true or that he is the most knowledgeable on the subject. These forums on the other hand have a good deal of highly educated/experienced professionals recognizable by the tag below their name (Guru, Administrator, ..).
  20. This is the kind of thinking you need to get away from. Transforming your application from a badly-designed to a well-designed is not an easy task. Don't forget you are actually rewriting the application which means you put in twice the effort required then if you would have if you would have thought-out the application design. Well, look over my code. All you need is go over all stored items and check if it already exists if so then update otherwise create. If you are working against a deadline then I don't understand why you would start out with something you barely understand? Why didn't you stick to the things you understand?
  21. Well your current design is really inflexible due to $_POST, $_SESSION and the database being tightly coupled to your class. For highest flexibility you'd best remove all these dependencies like shown in my example. I could easily modify my example to be used with a database instead of a $_SESSION. $cart = Cart::fromArray($db->execute("SELECT * FROM cart WHERE user_id = {$_SESSION['user_id']}")->fetchAll()); .. if (array_key_exists(array('id', 'name', 'quantity', 'price', 'image'), $_POST)) { $id = $_POST['id']; $name = $_POST['name']; .. $temp = new CartItem(); $temp->setId($id); $temp->setName($name); $temp->setQuantity($quantity); .. $item = $cart->findItemByName($temp->getName());//or $cart->findItemById($temp->getId()); if (NULL === $item) {//does not yet exists $cart->addItem($temp); } else { $item->addQuantity(1); } foreach ($cart->toArray() as $item) {//store $db->execute("INSERT INTO cart (id, name, quantity, price, image) VALUES ({$item['id']}, {$item['name']}, {$item['quantity']}, {$item['price']}, {$item['image']}) ON DUPLICATE KEY UPDATE quantity = quantity + 1"); } } See, how easily I modified my code to match the new setting.
  22. ignace

    what's this

    The name represents an array in PHP and can be accessed as $_GET['fileX'] or $_POST['fileX']
×
×
  • 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.