Jump to content

boen_robot

Members
  • Posts

    8,493
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by boen_robot

  1. In general, when you hear "minifier", it's safe, and when you hear "obfuscator", it's potentially dangerous, and needs to be retested post-compression.Packer is presented as just a "compressor", but AFAIK, it's a minifier. The two check marks you see - "shirnk variables" and "base62 encode" are obfuscation features. If you use them, you may need to retest your code post-compression.
  2. Could you possibly upgrade PHP? Segfaults are typically a C related problem that can't easily be diagnosed from higher levels like XML/XSLT/PHP. There is a new libxml version (2.8.0), and chances are the latest PHP includes that latest libxml.If even that doesn't help, you'll have to reduce the example a little (hardcode the XML file, make both the XML and XSLT as small as possible, as long as they still keep segfault-ing, remove the trim and formatOutput if they don't have anything to do with this), and submit a bug report to PHP and/or to libxml.
  3. That's how most template engines operate, yes - a generic code base (typically including only the minimal HTML), with further specifics along the way, with the head and body contents typically being the first ones to be considered "more specific". The tricky bit is that the variable itself should be generated via the template engine (Twig in this case).Either that, or the engine needs to somehow allow you to pass control to a different template based on the value of a variable (which would be fixed from the start). The page you link to talks about an "extends" instruction, which extends a base template and can provide input for blocks. Sounds like what you need.
  4. Maybe you haven't written the query correctly? How does it look like?
  5. You need CSS for that. Or to be more precise, you need to use XSLT to generate HTML, which would in turn reference a CSS file.If you don't know CSS already, check out the CSS tutorial and pracice a little over some plain HTML files before you move on to apply it on an XSLT generated HTML.If you already have an HTML page, you could trigger XSLT from it using JavaScript, and insert the result somewhere on the HTML page. From that point on, the HTML page's CSS will take care for the styling.
  6. You can create/generate a playlist, and run the playlist instead of the individual files. To generate the playlist on-the-fly (so that the playlist always contains all MP3s), you'll have to actually use a programming language, such as PHP for example.There is no standard playlist format though. You'll have to use whatever format your player at school supports. If it's Windows Media Player for example, you can use WPL or ASX playlists. In my experience, ASX playlists seems to work better for HTTP files, while WPL works better for local files and network shares.
  7. Which is exactly what he already did (see second post in this topic)
  8. As a sidenote, if you're trying to read the file name and extension, a better way is with pathinfo().
  9. boen_robot

    Decode script

    Although the above are good for numbers, for characters, you may want to "manually" decode them... assuming that these stand for character data that is. Something like this: function decodeHexString($string) { $result = ''; for ($i = 0, $l = strlen($string); $i < $l; $i += 2) { $result .= chr(hexdec(substr($string, $i, 2))); } return $result;} Your $var returns gibberish though, so it's probably a little more complicated than that. You need to find out how the data was encoded to decode it properly.
  10. What HTML code does that output? Right click, "View Source", and paste everything from there here.
  11. You mean write it as an integer or what?2 MiB (2 megabytes, as seen in OSes, erroneously with the "MB" suffix, where the base is 1024) can be expressed as "2 * 1024 * 1024".2 MB (2 megabytes, as seen on HDD offers, where the base is 1000) can be expressed as "2 * 1000 * 1000".2 Mbit (2 megabits, as seen on ISP offers, where the base is 1000, except that the measurement is in bits, not bytes) can be expressed as "(2 * 1000 * 1000) / 8" (the "/ 8" is used to convert the value from bits to bytes).
  12. boen_robot

    Isset GET remove

    The easier way is to simply change the name so that all of it is "remove", not "remove" plus the StatusID, i.e. "&remove=" . $row2['StatusID'] and then instead of $value1 = $_GET['remove'] . $row2['StatusID'];if (isset($value1)) { check the $_GET itself, i.e. if (isset($_GET['remove'])) {
  13. $username is neither.The 'username' in $_POST['username'] is the "name" of the input.The value of $_POST['username'] is the "value" of the input (well, the one that is present upon submission to be exact).In PHP, you can only get values by the name of the input. You can't get values by IDs.
  14. If you use XMLHttpRequest (a.k.a. AJAX), it should.
  15. Since your source XML uses a CDATA, you may have to compare the whole text contents instead of just text(), i.e. <xsl:template match="SC_DF_FIELD_2[. = 'inactive']"><SC_DF_FIELD_2>retired</SC_DF_FIELD_2></xsl:template> Your XSLT should also contain a template that would define what to do for other nodes. Or at least templates that would eventually use xsl:apply-templates so that your template is matched.If you don't have other templates, and want to preserve all other nodes, you can use a template that just copies the node, and applies the inner templates (which will eventually lead to a match on your other template), like so: <xsl:template match="*|@*|node()"><xsl:copy><xsl:apply-templates/></xsl:copy></xsl:template>
  16. The two (especially HTML5) are in such a flux that what you learn today may not be applicable tomorrow.If you're keen enough, the best place to find cool stuff is the editor draft itself, combined with sites like caniuse.com, which tell you what is actually available in browsers today.
  17. As you can see in rmdir()'s manual page, the optional second argument is a context resource.A context provides additional data that may be needed to access the file/folder you're about to operate on. For example, if your folder was an FTP folder, the context argument would allow you to specify an FTP proxy to go through.You don't need to specify the file permissions. If you have them, the folder will be deleted, and if you don't, it won't.
  18. boen_robot

    session start

    You don't need to make the variable available across pages. You only need to make its value available across pages. That's what session functionality provides (a storage for values; via the $_SESSION variable), and what the example above does.
  19. boen_robot

    session start

    The statement $_SESSION['valid_user']=$username; adds a copy of the value of $username into "$_SESSION['valid_user']". It does NOT make the variable $username itself available to other pages.So if you want to read that value, you have to read the appropriate $_SESSION variable, since that's the only thing your script has access to. For example: session_start(); <?php output_header('output_header_list',$_SESSION['valid_user']);
  20. In xxxxA, you've never defined a form field called "grp1", and therefore, by the time xxxx2 starts, there's no such index, hence the error.Make that: <?php$grp1 = $_REQUEST['grp1'];?><input name="grp1" value="<?php echo $grp1; ?>" />
  21. boen_robot

    Mysql Space ?

    Most hosts include the database data into the space "quota" they are offering you. Others impose a separate limit. If you're going to become a host yourself, you'd have to use your OS' quota tools. For Windows, a quota for each OS username is set per partition. I'm not sure how it's done on UNIX (I assume it's per user globally), but I'm sure tools exist for it too.P.S. You seriously need to work on your English...
  22. boen_robot

    CGI ?

    BINGO! That's what CGI is. It's the "somehow" in the sentence above - the most popular way in fact, although from the above list, only PHP uses it.
  23. boen_robot

    CGI ?

    Yes. That's what CGI is - a protocol that defines what an executable program should expect as input (in STDIN, environment variables, etc.), and what it is expected to write in STDOUT for the web server to handle it properly.Server side code boils down to one of 3 approaches:1. A self-contained web server. No Apache or something like it needed - you just create a program using a certain language/framework, compile it (no way around that...), and start the generated executable.2. A web server module. This is one of the ways in which PHP could run as, and one way in which you could write your own modules. The server may provide a way for you to write interpreted rather than compiled code (which is what the PHP Apache module does).3. A CGI/FastCGI executable. This is the other way PHP runs as. FastCGI is basically the same as CGI, except that the executable is expected to remain available after the first request. And PHP just happens to be a (Fast)CGI application that lets you execute interpreted code.I guess what I'm trying to say is that "ordinary server-side code" is a very loosely defined term... basically, there's no such thing.It's like you're asking "Why should I use XML if I can just use XHTML or RSS?".
  24. AFAIK, you need to get Firebug. The log messages can be seen in its "Console" tab.
×
×
  • Create New...