Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. foreach ($_FILES['att']['error'] as $key => $error) { if (UPLOAD_ERR_OK === $error) { $name = $_FILES['att']['name'][$key]; .. } } Instead of creating multiple threads you could have searched/browsed the manual and you would have found a very detailed explanation at http://php.net/manual/en/features.file-upload.post-method.php
  2. <body onload="startRecording()" onbeforeunload="endRecording()"> start- and endRecording() needs to be defined by you.
  3. Create one form for the entire table and use <button> instead of input. <button type="submit" name="delete" value="' . $counter . '" class="delete">Delete</button>
  4. libxml_use_internal_errors(true); $dom = new DomDocument(); if ($dom->loadHtmlFile('http://../file.html')) { $xpath = new DomXPath($dom); foreach ($xpath->query('//td[@score]') as $node) { print $node->nodeValue . "<br />\n"; } }
  5. Are they IP banned? Of course everyone has his own IP.
  6. Regex, DomDocument (in combination with DomXPath), Service, ..
  7. $array = array_merge(range('A', 'Z'), range(1, 9), array(0)); $recur = new MyRecur(); $recur->perform($array); print_r($recur->getArray()); class MyRecur { private $array = array(); public function perform($array, $prefix = '') { foreach ($array as $value) { $this->array[] = $prefix . $value; $this->perform($array, $prefix . $value); } } public function getArray() { return $this->array; } } PS: I hope you have LOOOTTTTSSSSS of RAM because the output of this array equals: 3.7x10^41
  8. http://dev.mysql.com/tech-resources/articles/hierarchical-data.html http://www.sqlsummit.com/AdjacencyList.htm
  9. What is 2x4? Is this a product (in a Mathematical sense) and therefor 8? Or is this the name of a material? If it is a material, then: Building A requires 5 2x4 and 1 window Building B requires 7 2x4 and 3 windows building (id, name) material (id, name) building_requires_material (building_id, material_id, quantity) building (1, 'A') material (1, '2x4'), (2, 'window'); building_requires_material (1, 1, 5) // Building A requires 5 2x4 building_requires_material (1, 2, 1) // Building A requires 1 window .. Building C requires 5 2x4, 3 windows, 1 door building_requires_material (3, 1, 5) // Building C requires 5 2x4 building_requires_material (3, 2, 3) // Building C requires 3 windows building_requires_material (3, 3, 1) // Building C requires 1 door
  10. To make this a bit more clearer (as you clearly don't have any networking background) take your friends street address and number and yours now assume your friend requests a package and gives your street adress + number, where does the mail send it to? I think your friend tricked you by changing the source and took a screen shot of this altered version.
  11. It creates a clone of the existing instance. If you are using PHP5 (and you should as PHP4 is deprecated) I highly advise you to drop this code and use the clone keyword instead.
  12. What do you mean? Try setlocale (LC_ALL, array ('ru_RU.CP1251', 'rus_RUS.1251')); This will match words if you use a function like str_word_count() it will not translate them.
  13. Why bother writing all this as it's already built-in $text = '%$%#$567hello!@#$%^& how@#$%%%$ are#$% you?'; print_r(str_word_count($text, 1)); The same applies: setlocale(LC_COLLATE, 'ru_RU'); $text = 'текст///вау:?23прохладный'; print_r(str_word_count($text, 1));
  14. If you want to let visitors print out your web pages in a decent manner then use the print media type. <link media="print" ..>
  15. If you want to create a new cache upon change, then create the new cache when the page content changes. By this I mean when the user edits a page create the new cache when he submits it.
  16. It does not matter which version I use. This is about usability, if a user has JS disabled (ex. NoScript) it makes your website unusable for these. Plus, what you did with JS can easily be done with PHP, only for the pop-up would you need JS but also for this I would look up an alternative, example: <a href="index.php?action=view&id=<?php print $id; ?>" onclick="popUpPreventsDefault(..)"> If JS is disabled they'll be directed to a page to see the information otherwise a JS pop-up is shown that counters the href action (.preventDefault() in jQuery).
  17. document.write(parentObject.one() + parentObject.two()); Should be either parentObject.one(); parentObject.two(); or replace document.write() to return() in these functions.
  18. Will not stop the massive SPAM
  19. What hosting do you currently have?
  20. do_something doesn't need the reference-operator (&) as objects are always passed by reference. do_something clones the current object and returns it, so the same as: function do_something() { return clone $this; } do_something is unnecessary here as you can just do: $test = new Test(); $test2 = clone $test;
  21. Yes, just add the selected address to the order (no reference). But you are also able to - instead of delete - hide an address and when they re-enter it, un-hide. Both serves your client needs (manage) and yours (historical data).
  22. $query = 'SELECT id, makeid, make, model FROM models JOIN make ON make.id = models.makeid ORDER BY make ASC, model ASC'; $result = mysql_query($query); $make = ''; while ($row = mysql_fetch_assoc($result)) { if ($make !== $row['make']) { echo '<h3>', $make = $row['make'], '</h3>'; } echo '<label for="model', $row['id'], '">', $row['model'], '</label>', '<input type="checkbox" id="model', $row['id'], '" name="model" value="', $row['id'], '">'; } Outputs: <h3>Acura</h3> <label for="model1">Acura model #1</label> <input type="checkbox" id="model1" name="model" value="1"> 2.. 3.. <h3>Audi</h3> ..
  23. From reading your description I can already tell you have gone about it the wrong way. You should not create tables for the moment people log-in they should already be present and serve all of your users.
  24. $headers = "Reply-To: info@languageschoolsuk.com\r\n"; $headers = "Return-Path: info@languageschoolsuk.com\r\n"; $headers = "From: info@languageschoolsuk.com\r\n"; You realize you overwrote the value of $headers 3 times and $headers now contains "From .." The proper format would be: $headers = "Reply-To: info@languageschoolsuk.com\r\n"; $headers .= "Return-Path: info@languageschoolsuk.com\r\n"; $headers .= "From: info@languageschoolsuk.com\r\n";
  25. Are you using Safari? There is a known bug that only happens with Safari, jQuery likes to fadeIn then fadeOut the content allowing the users to see virtually nothing. I'm still working on a solution, I am trying my best to make this website as cross-browser friendly as I can. Thanks for taking a look though. No I use FF but I tested your website how it acts when I disable JS. Your website should remain usable even if someone does not have JS.
×
×
  • 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.