Search results

  1. M

    map-mail-compose php return_path

    I finally got around to looking over the source. Turns out the cause is in the IMAP c-client library. imap_mail_compose calls rfc822_header(), which only outputs specific headers, not including Return-path. imap_mail_compose then goes on to print custom headers itself. Final analysis: there's...
  2. M

    While Looping Help

    If you'd indented your code, you'd notice there are two while loops at the same level, rather than nested. You want to nest them, which means you shouldn't assign the result of the second query to $result. Also, your HTML is malformed. You need to close table rows (<tr> elements) and you...
  3. M

    Display image in MYSQL

    After reading over your various posts, it looks like something is going on in dbconnect.php. Add better error handling to your code and learn exactly what it is you're doing. The cookbook approach fails early an often (as you're experiencing). Read the first line more carefully. That's the...
  4. M

    localhost/php/apache

    I once made this mistake. ping uses ICMP, which doesn't have ports. You can telnet to port 80. You can also run tcpview to see which ports are bound by which executables. For anyone who hasn't seen them before, Russinovich and Cogswell's Sysinternals utilities are invaluable. If you're...
  5. M

    Display image in MYSQL

    The full output from the webserver (including headers) is: HTTP/1.1 200 OK Date: Mon, 22 Jun 2009 04:38:17 GMT Server: Apache/2.2.11 (Freewebhostingarea.com) mod_perl/2.0.4 Perl/v5.10.0 X-Powered-By: PHP/5.2.9 Content-Length: 3 Connection: close Content-Type: image/jpeg The 3...
  6. M

    Display image in MYSQL

    At this point, whenever I think "This is a short script, I'll just post it," I force myself to test it. Invariably there's a typo.
  7. M

    SQL Database Optimization

    You're right in that indices can help with UPDATEs and DELETEs. However, there is a cost to using indices, including the need to update them, which will negatively impact performance. Generally, the trade-off results in a net gain.
  8. M

    mysql_query(select) result improperly empty

    Is the following a fair summary? New tables created using custom PHP scripts are not visible in phpMyAdmin. New tables created using phpMyAdmin are not visible in other PHP scripts. Changes to older tables made from custom PHP scripts are visible in phpMyAdmin. Changes to older tables made...
  9. M

    Display image in MYSQL

    There are plenty of forum posts, tutorials and examples in the PHP documentation that cover sanitization. Go over those and update your code. Alternatively, use prepared statements (with e.g. mysqli::prepare). If you're having problems, read "How To Ask Questions The Smart Way" and follow its...
  10. M

    Update Entire SQL Table

    description[] probably isn't doing what you expect. In the code posted, $_POST['description'] is a one element array. You could drop the implode() with no ill effect. To xav0989's recommendations I'd add replace (2) "or die(...)" with exceptions or trigger_error. You can also perform some...
  11. M

    map-mail-compose php return_path

    Note that the Return-path header is supposed to be added by the final mail server; even if you set it, it may be replaced. The stock imap_mail_compose looks for "return_path" and adds it to the list of headers. However, the output of imap_mail_compose on X10 doesn't include the Return-path...
  12. M

    Display image in MYSQL

    Even better, post a URL so the forum character encoding won't munge the data and we can examine the HTTP headers. Also, read a tutorial on storing and serving images from MySQL to get a better understanding of what's going on. Did you follow xav0989's comment and sanitize $_GET['image'] with...
  13. M

    PHP Shopping Cart

    It's not that I don't know how to recognize OOP (boy, can I), it's that I didn't notice any in the examples posted thus far. Then I did, in my itemExists: function itemExists($id) { $query = $con->prepare("SELECT ID FROM Items WHERE ID=?"); $query->bind_param('i', $itemID)...
  14. M

    SQL Database Optimization

    It's rather hard to answer this sort of question given so little information. Please post: the tables' definitions, the indices already defined on the tables ("SHOW INDEX FROM <table>;"), the query you run, and (if it's a SELECT query) the output of "EXPLAIN <query>" (2, 3), where...
  15. M

    going from asp classic to asp.net help

    Seconded. An MS-specific forum or newsgroup is the best place for this question, but here's one article to get you started. Of course, ASP.Net is a vast improvement over ASP, so unless you're talking about legacy code, you should switch to ASP.Net as soon as you can learn it. Being able to...
  16. M

    PHP Shopping Cart

    You're very welcome, except I don't know where I gave an OOP example. It's all procedural programming, as far as I can see.
  17. M

    SQL syntax Error

    INSERT INTO <tbl_name> SET <col>=<expr> ... is perfectly valid syntax. The problem is "show" is a SQL keyword. Enclose it in backquotes so the parser parses it as a table name: INSERT INTO `show` SET perf = '$perf', showname = '$showname'...
  18. M

    map-mail-compose php return_path

    You didn't provide enough information. How are you sending the e-mail? When asking about code, always include a minimal test case. You did do a good job describing what you want the script to do and what it actually does.
  19. M

    Warning: system() has been disabled...

    system() will never be enabled. Don't even try. You can do it manually by downloading http://s4.travian.gr/map.sql and using phpMyAdmin (accessible from cPanel) to execute it. You could also rewrite the updater to not use command line tools. PHP can readily fetch a file using PHP and execute...
  20. M

    PHP Code returns blank page...

    When asking questions about code: Include a description of what you want the code to do and what it actually does in the body of the message. Make sure the code you post is a minimal test case. The code you posted is fairly minimal, but doesn't look complete. format the code to make it...
Top