Search results

  1. M

    PHP Optimization Techniques?

    You should be less concerned with optimization and more concerned with algorithmic efficiency and development practices. As the great Knuth once wrote, "premature optimization is the root of all evil." Optimization is one of the last things to attempt, after your software has matured and the...
  2. M

    Replacing all img src in loaded html

    The start and end identifier must be exactly the same. Only identifier characters and (optionally) a trailing ";" can be present in the line with the closing identifier. You have "STX" as an opening identifier, so the string is never closed (as you can see by the red in this colorized source). I...
  3. M

    Replacing all img src in loaded html

    Build the form in the usual way (with DOMDocument::createElement calls) and insert or append the form element to the body element. As an alternative to creating the form programmatically, you can create a DOMDocumentFragment then have it parse a string containing the form. You then add the...
  4. M

    php classes help

    The concepts in OOP differ fundamentally from procedural programming. While any procedural program could be transformed into an OO one mechanically, the result will be low quality, according to OO design principles and best practices. Your best bet is to first study OO principles, then create a...
  5. M

    Replacing all img src in loaded html

    $html already has an <html> element, and should already have <head> and <title> elements. After the loop and resetting libxml's error setting, all you should need is the echo $html->saveHTML();. The rest gets you malformed HTML. When you say "it doesn't work", how exactly doesn't it work...
  6. M

    Custom Paypal Script for Combined Shipping?

    Either: calculate the shipping cost based on the combined weight of the items, or assign each item a base cost for shipping that item and total these shipping costs, or check if the carrer has a way to calculate shipping based on weight, source and destination postal codes and use that, or...
  7. M

    eek!

    Take a closer look at the terms of service. You don't need to post, just login. Seriously, read it again; you may have missed other aspects of the terms that will get you into trouble. Check the News and Announcements forum when you login to keep abreast of any issues or changes coming in the...
  8. M

    (URGENT) PHP Script is not being compiled

    You've told us almost nothing. When asking for help, give the details as to what you did, what the expected results were and what actually happened, including any error messages. When asking about code, include a minimal (i.e. complete yet concise) sample. When asking about web pages, include a...
  9. M

    Wordpress Pixopoint Menu Plugin Help

    You still haven't described how the menus aren't working. When I visited the site using IE9, hovering over the first three top-level menu items ("services", "work" and "about") produced sub-menus positioned under the top-level item. Clicking on an item in these sub-menus opened a new page.
  10. M

    Replacing all img src in loaded html

    Take a closer look at the "Extracting data from HTML" document you linked to. It does almost what you want; it iterates over all elements in a document with a certain tag, performing an operation on each. Where it differs is in processing all anchor elements ("//a") rather than images ("//img")...
  11. M

    The Script that Would Not Die

    Thanks for posting follow-ups. Not many do that. Depending on how $_SESSION is filled out, your code may quote values stored therein multiple times. You should prepare data to be passed to a layer (e.g. quoting) at the point you're about to pass the data to the layer, not before. Thirdly, the...
  12. M

    Post multiple images in a form - Upload to server help

    There is sort of a generic answer for PHP (basically the information in "Handling file uploads", "How do I create arrays in a HTML <form>?" and "File input (or “upload”) in HTML forms", all of which you should read), but that PHP was being used wasn't established in the first post. The short...
  13. M

    Best C and C++ compiler!

    There's the up-and-comer, LLVM. Apple has made it the default compiler in XCode 4. You can build it with Microsoft's Visual Studio. The ClangVSx add-in lets you use LLVM from within Visual Studio. The core of LLVM is a compiler backend, responsible for code generation but little else. You can...
  14. M

    Wordpress Pixopoint Menu Plugin Help

    "It doesn't work" tells us almost nothing. When asking for help, describe what you expect or want to happen and what actually happens. Include minimal sample code. For web sites, include a link to a live page. If it's a display issue that affects only some browsers, include screen shots.
  15. M

    Post multiple images in a form - Upload to server help

    That's not nearly enough information. You're assuming we know more about your site internals than we do. Any recommendations we could give at this point wouldn't be specific to your site and may be off-base. <img> elements can't transfer files to the server, they just cause the browser to load...
  16. M

    Cron Job Question

    Good work so far. See the cron job samples in the X10 Wiki article for a way of shortening the minutes field using step values ("/[number]").
  17. M

    C programming

    That's only to be expected on a 32-bit machine, or when using a Microsoft compiler. For example, a long on a 64-bit machine running Linux in a program compiled in 64 bit mode will use 8 bytes. To get the minimum and maximum integer values on a system, consult limits.h.
  18. M

    php configuration problem please help...

    myccsclass12, are you asking about your site on X10, or running on your own computer? That the extension is a DLL suggests the latter. X10 runs Linux, which has a different library format, one that uses an extension of ".so". If you are asking about your own computer, what server software...
  19. M

    Mysql connection

    Then why are you posting? Don't post if you're not going to contribute. For everyone else, the only documents you need are the one Gouri linked to and "MySQL Information".
  20. M

    Line breaks have stopped working.

    <br/> isn't semantic. HTML is a structuring language, not a formatting one. When producing HTML, you shouldn't be thinking in terms of presentation but document structure. Pick appropriate elements (such as <p> or a list), then style the result with CSS. You can use the white-space property to...
Top