Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. upon registration: INSERT INTO members SET registered_date = now(), ip_address = $_SERVER['REMOTE_ADDR'] upon login: UPDATE members SET last_login_date = now(), ip_address = $_SERVER['REMOTE_ADDR'] WHERE id = $id
  2. create a .txt for each file on which they comment (create a file only once their is an actual comment) When you display a file look for a .txt with the same name and load it.
  3. Why make it so hard? You can keep it as simple as it just is (this requires javascript for the drag-and-drop). I roll out (using PHP): <ul> <li><a href="http://link1">mylink #{$pos}</a> <input type="hidden" name="links[]"></li> <li><a href="http://link2">mylink #{$pos}</a> <input type="hidden" name="links[]"></li> <li><a href="http://link3">mylink #{$pos}</a> <input type="hidden" name="links[]"></li> <li><a href="http://link4">mylink #{$pos}</a> <input type="hidden" name="links[]"></li> <li><a href="http://link5">mylink #{$pos}</a> <input type="hidden" name="links[]"></li> </ul> Then the user modifies these by dragging and dropping them into the new order: <ul> <li><a href="http://link1">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> <li><a href="http://link3">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> <li><a href="http://link4">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> <li><a href="http://link2">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> <li><a href="http://link5">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> </ul> Then I use: $links = $_POST['links']; $sizeof = sizeof($links); for ($i = 0; $i < $sizeof; ++$i) { $id = $links[$i]; $query = "UPDATE links SET position = $i WHERE id = $id"; //.. } I roll out just like I did before: <ul> <li><a href="http://link1">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> <li><a href="http://link3">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> <li><a href="http://link4">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> <li><a href="http://link2">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> <li><a href="http://link5">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> </ul> The links in the new order.
  4. Yes there is have a look at transactions: http://dev.mysql.com/doc/refman/5.0/en/commit.html
  5. <tr> <td class=\"header\">Name</td> <td class=\"header\">Title</td> <td class=\"header\">Email</td> </tr> perform stripslashes before you output it.
  6. function my_stristr() { $matches = array(); if (2 <= func_num_args()) { $args = func_get_args(); $haystack = array_shift($args); $needles = $args; foreach ($needles as $needle) { $matches[$needle] = stristr($haystack, $needle); } } return $matches; } $matches = my_stristr($haystack, $needle1, $needle2, $needle3, $needle4);
  7. Notice: Undefined index: select in C:\wamp\www\map\myform.php on line 13 Becuase you are missing select in your url http://domain/page.php?select=something Notice: Undefined variable: select in C:\wamp\www\map\index.php on line 28>UCLA (all along the dropdown menu). Because you need to add: $select = $_GET['select']; before: ($row_list['id'] == $select)
  8. $_SESSION['username'] = $_POST['username'] for example
  9. print '<a href="http://domain/page.php?user=' . $_SESSION['username'] . '">click</a>';
  10. Have you got an SMTP installed? Then modify your SMTP settings in the php.ini
  11. $parts = explode('-', $var); print $parts[1];
  12. use re-captcha http://recaptcha.net/ as a captcha code. They give you detailed information in how to use their API http://recaptcha.net/plugins/php/
  13. pass VARCHAR(16) to pass VARCHAR(32) register: INSERT INTO tbnlmembers VALUES(NULL, '$user', MD5('$pass'), '$fname', '$lname', '$email') login: SELECT * FROM tbnlmembers WHERE username = $username AND pass = MD5('$pass')
  14. You can use ini_set('sendmail_from', $from); or the better option: $headers = "From: $from\r\nReply-To: $from\r\n";
  15. UPDATE members SET passwd = $newpasswd WHERE member_id = $id Next time make some effort and read the mysql manual as what you are asking for is simple and is covered in each and every tutorial and php/mysql book.
  16. That is not to what the error is referring. 'select' does not exist in the _GET array.
  17. Can't find the other article, sorry.
  18. If you are looking for someone to write something for you then you should have posted in the freelance section.
  19. OO has a reputation (if used in a correct fashion) for letting your code-base grow without that many headaches. But this may be not an option at the time as the application is already build and re-building is expensive. So I would advice to try to re-factor your current code-base.
×
×
  • 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.