Search results

  1. M

    Script error logs?

    X10 is your production server. You should set up a development server (not publicly accessible) by installing a web server and DBMS. XAMPP runs on most platforms and includes most things you'll need. Another all-in-one package for MS Windows platforms is WampServer.
  2. M

    can't set main domain

    I tried to PM it to you, but your account can't get PMs. The e-mail address associated with the "lauras" forum account is the kaimas mailbox on mikrovisata (it's not a good idea to type out e-mail addresses formatted as such, as it makes it easier for spammers to cull them using a spider...
  3. M

    CGI: cgiemail

    CGI scripting works fine. Check the many threads on server errors and CGI scripts for common problems, including permissions. See if there's anything interesting in the error log. Try the script on your own server. Create a minimal test case. If you can't figure out the source of the error, post...
  4. M

    Script error logs?

    It's best to develop on your own server, where you have more control. You can use remote debugging to debug programs interactively.
  5. M

    What ticks off an average normal guy to kill 12 people?

    The bankers already saw to that. Obama was handed the helm of a sinking ship. True dat. More on topic, who do you think is the better sociopath, Jack the Ripper or H. H. Holmes?
  6. M

    How do I create a contact form if I don't have PHP installed ?

    Don't threadjack, and don't resurrect long dead threads.
  7. M

    How to handle dynamic input fields in post method using Php

    Use array syntax in the form input names to get the input as arrays: <?php for ($i=0; $i < $_GET['url_no']; ++$i) { ?><label for="title_<?php echo $i ?>">Title:</label><input name="title[]" id="title_<?php echo $i ?>" /> <label for="url_<?php echo $i ?>">Link:</label><input name="url[]"...
  8. M

    help me with url rewriting

    What part of the syntax, exactly? You get an external rewrite whenever you include the scheme and host name in the substitution URL, or you use the redirect flag (R). Use neither the flag nor the scheme and you have an internal redirect. Read the rewrite engine documentation for more. The...
  9. M

    PHP Pagination

    Use the LIMIT clause. SELECT <columns> FROM `textbook` WHERE `class`=:class AND `ch` > :ch ORDER BY `ch` ASC LIMIT 1 Index column ch for best performance. An index on `textbook` (`class`, `ch`) will work.
  10. M

    How to sort alternative keys and values from an associative array in PHP

    Slightly simpler, toggle the value in a variable. <?php $parity=0; ?> <ul> <?php foreach ($links as $title => $link) { ?> <li><a href="<?php echo $link ?>" class="<?php echo $parity ? 'odd' : 'even' ?>"><?php echo $title?></a></li> <?php $parity = !$parity...
  11. M

    help me with url rewriting

    Example URLs should be live. Rather than making up names, give real ones that can be tested. Also, the location of the .htaccess file with the directives matters. The example you give should be in "[DOCUMENT ROOT]/subdir/subdir/.htaccess". If you want every URL ending with "punk.png" to be...
  12. M

    Discover nodes on a network

    Freenet has another approach: distribute known hosts through the peer network. It's far from perfect because the user must know of one node in the peer network (a chicken-and-egg problem, but it works well enough for Freenet, which works as a F2F network). The client can connect to that node and...
  13. M

    Discover nodes on a network

    What constitutes peerage for your app? Are all hosts running it peers (as in P2P apps), or are there peer subgroups (as in some games)? You could try multicasting, though not all IPv4 routers & hosts support it. If you want an example of how someone else does it, consider Gnutella. Client...
  14. M

    Perl/Tkx incorrectly displayed characters

    The incoming data needs to be decoded before you can use it. my $response = $lwp->get($url); my $content = Encode::decode($response->content_charset(), ${$response}{_content}); You don't need to encode the text before displaying it. $text->insert("end", $display_text); # rather than...
  15. M

    Algorthom for lottery draw

    That's basically the Fisher-Yates shuffle. You're not likely to find much better, as the modern version requires O(n) space and has O(k) time complexity. The only difference is the modern Fisher-Yates shuffles in place; the picked numbers are held in the same array that holds the unpicked...
  16. M

    mod_rewrite error

    @ehunt0_f: try the advice Zubair already gave to ralph2007. If that doesn't work, start your own thread rather than threadjacking this one. You may not have the same problem, and you are more likely to get more people to look at a shorter thread. If and when you start your own thread, be sure to...
  17. M

    PHP and MYSQL

    W3Schools is outdated, inaccurate and incomplete, and that's not just my opinion.
  18. M

    Python and PHP questions

    Having both branches, with the Python 3 interpreter installed as (e.g.) "python3" would be nice. Post a request in the feedback and suggestions forum with a poll.
  19. M

    Store php code in sql and execute it?

    A safer option is to use a limited template engine, storing strings in the template language. If you only need variable replacement, you can use preg_replace_callback to replace variable names with values. function lookup_var($matches) { if (count($matches) <= 2) { // simple variable...
  20. M

    jQuery thumbnail viewer - Reopens div when already open

    Use the DOM inspector. One of the lightbox elements is indeed centered by setting the left & right margin to auto. Keep playing with styling to get yours centered. Study the source of the lightbox example if you need implementation hints.
Top