Forum: PHP 15 Days Ago |
| Replies: 9 Views: 481 Having PHP handle static files, such as JS and CSS and gzipping them on the fly is inefficient.
A better approach is to have PHP write a gzipped version of the static file to the filesystem.
... |
Forum: PHP 32 Days Ago |
| Replies: 7 Views: 449 This it the embed code for that particular page:
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/NMAYr709-9Y&hl=en_US&fs=1&"></param><param... |
Forum: PHP 32 Days Ago |
| Replies: 7 Views: 432 To explain how this is done:
First you make a http request to the page you want to parse.
eg:
$url = 'http://example.com/';
$content = file_get_contents($url);
Then you parse the HTML.... |
Forum: PHP 32 Days Ago |
| Replies: 10 Views: 821 You can send SMS for free to most carriers by sending an email to their Email to SMS gateway.
A list of carriers is here:
http://en.wikipedia.org/wiki/List_of_carriers_providing_SMS_transit
... |
Forum: PHP Nov 17th, 2009 |
| Replies: 109 Views: 3,839 adler32 and crc32 were developed for a different purpose then security. They are used more for verifying data integrity or error detection.
They do not provide means to secure against intentional... |
Forum: PHP Nov 16th, 2009 |
| Replies: 109 Views: 3,839 CRC32 should NOT be used at all. Not as the last hash output, or before you hash it again with a secure hash. Just not at all.
Even if you take a crc32 hash and rehash it with sha256. It doesn't... |
Forum: PHP Nov 13th, 2009 |
| Replies: 109 Views: 3,839 @OmniX The length of the salt does matter. The salt should be random, yes, but it should also be long enough to make the precomputation attack infeasible.
I've also read those statements that the... |
Forum: PHP Nov 12th, 2009 |
| Replies: 109 Views: 3,839 Wouldn't you just love to prove it?
http://en.wikipedia.org/wiki/Millennium_Prize_Problems
I think I'll try and solve it tonight. Or maybe just buy a lottery ticket, better chance of winning that. |
Forum: PHP Nov 12th, 2009 |
| Replies: 109 Views: 3,839 function HASHITBAY_BE($toHash)
{
$maxLength = 42; //maximum length of the salt
$hashMethod = 'whirlpool' //encryption method...
$saltLength = strlen($toHash)*3;
if($saltLength >... |
Forum: PHP Nov 11th, 2009 |
| Replies: 2 Views: 601 The examples at http://www.sitepoint.com/print/1105/ should do... |
Forum: PHP Nov 11th, 2009 |
| Replies: 4 Views: 250 Are you using ob_start() before any PHP code?
eg:
<?php
ob_start();
include_once('session.php');
include_once('config.php');
// .. etc...
?> |
Forum: PHP Nov 6th, 2009 |
| Replies: 18 Views: 5,170 Looks great. I modified the class I wrote a bit after looking at your code.
Just a few suggestions:
You could optimize the string concatenation.
$buffer .= hash($algo, $input . $salt);
... |
Forum: PHP Nov 6th, 2009 |
| Replies: 18 Views: 5,170 Thought I'd write an example:
note: for PHP4 just remove the "public static" in front of each function declaration.
The class:
/**
* Generate cryptographic Hashes for passwords
*
*... |
Forum: PHP Nov 5th, 2009 |
| Replies: 18 Views: 5,170 There really is no reason to use 2 way encryption on passwords. Retrieving the password is not the concern, gaining access to their account is. So if the user forgets their password, send them a... |
Forum: PHP Nov 2nd, 2009 |
| Replies: 109 Views: 3,839 Sorry for resurrecting an old thread. But it was referenced recently and I thought I'd add to it.
crc32b should not be used with passwords as it is an insecure hash function. ... |
Forum: PHP Oct 14th, 2009 |
| Replies: 107 Views: 3,562 Here is the tutorial on how to get seeking possible in the JW Player.
http://www.longtailvideo.com/support/tutorials/HTTP-Video-Streaming
This allows seeking to a not yet buffered part of the... |
Forum: PHP Oct 11th, 2009 |
| Replies: 107 Views: 3,562 I just tried the video capture and the other tools they have, that is some really good stuff. Thanks for recommending it.
Btw, the link is:
http://www.nchsoftware.com/ |
Forum: PHP Oct 11th, 2009 |
| Replies: 107 Views: 3,562 For transcoding media files you're best bet is FFMpeg, http://en.wikipedia.org/wiki/FFmpeg
You can invoke it from the command line. If you want a graphical interface, VLC is also Open Source and... |
Forum: PHP Oct 9th, 2009 |
| Replies: 107 Views: 3,562 A tutorial on how to create your first PHP page. A single step by step, that would be the easiest way to start a total noob on PHP. |
Forum: PHP Oct 5th, 2009 |
| Replies: 8 Views: 285 You can't place a WHERE clause inside a SELECT statement.
http://dev.mysql.com/doc/refman/5.1/en/insert.html
However, you can do the SELECT and then INSERT if needed.
SELECT 1 FROM... |
Forum: PHP Oct 5th, 2009 |
| Replies: 6 Views: 536 I find the stream_context_create() function simpler then cURL since you don't have to remember or look up all those CURLOPT_* constants.
// the xml to send
$xml = 'your xml payload';
//... |
Forum: PHP Oct 4th, 2009 |
| Replies: 6 Views: 536 PHP5+, you can also use the stream functions.
http://www.php.net/manual/en/book.stream.php
http://www.php.net/manual/en/function.stream-socket-client.php
or the similar fsockopen() in PHP4:... |
Forum: PHP Sep 28th, 2009 |
| Replies: 26 Views: 1,855 It is actually very basic.
The only odd operations used are:
% - modulo or remainder
chr() - return the character represented by a number in ASCII table
floor() - round down the float to an... |
Forum: JavaScript / DHTML / AJAX Sep 21st, 2009 |
| Replies: 5 Views: 2,668 Something like this should work:
/**
* Return html numeric entities encoded string
*/
String.prototype.toHtmlEntities = function() {
return this.replace(/[^a-z0-9\.\-\_\s\t]/ig, function(c)... |
Forum: PHP Sep 18th, 2009 |
| Replies: 9 Views: 1,041 Which bz library? Do you mean zlib? Is this in mysql or PHP?
You can just decompress the result in the SQL query:
SELECT uncompress(test) as test FROM `table` WHERE `compressed` =... |
Forum: JavaScript / DHTML / AJAX Sep 18th, 2009 |
| Replies: 1 Views: 520 You can create or display and HTML Element, that has the message.
Example of creating one:
var msg = documement.createElement('div');
msg.innerHTML = 'Your message';
Then attach that div... |
Forum: PHP Sep 8th, 2009 |
| Replies: 4 Views: 385 Something not mentioned on that link is that POST requests are not cached. GET requests are, and thus reduce the load on your server. Subsequent requests using GET will appear much faster, since the... |
Forum: PHP Jul 1st, 2009 |
| Replies: 4 Views: 496 Here is an interesting page that could be used to create a password strength meter:
http://www.lockdown.co.uk/?pg=combi |
Forum: PHP Jun 16th, 2009 |
| Replies: 5 Views: 551 Yes, is is possible with wordpress. You can create custom pages with the funcitonality you want, through an extension.
Josh, I wouldn't write wordpress off because it got hacked in shared... |
Forum: PHP Jun 2nd, 2009 |
| Replies: 24 Views: 1,422 On windows you just have to download one of the windows binaries. Here is the link again to an unofficial windows builds:
http://ffmpeg.arrozcru.org/builds/
For example, the latest build they... |
Forum: PHP May 31st, 2009 |
| Replies: 24 Views: 1,422 Here is a bit on uploading files in PHP:
http://www.php.net/manual/en/features.file-upload.post-method.php
You can convert the file to flv after uploading using FFMPEG and FLVTool2 for the... |
Forum: PHP Mar 31st, 2009 |
| Replies: 8 Views: 767 ;ls -la is a linux shell command. The first part, ; is a command delimiter.
So if that were passed to the linux shell, it would first delimit any previous command, and then call the command ls... |
Forum: PHP Mar 26th, 2009 |
| Replies: 4 Views: 441 ctype_space seems to check if the string is composed of all spaces.
I think the function to use would be ctype_graph.
http://in.php.net/manual/en/function.ctype-graph.php
This makes sure all... |
Forum: JavaScript / DHTML / AJAX Mar 25th, 2009 |
| Replies: 6 Views: 1,153 newDiv.innerHTML = '<input type="file" name="' + divIDName + '" size="57"> <a href="#" onclick="removeAdditionalFile(this.parentNode, this.count)">Remove</a>';
this.count would refer to the... |
Forum: JavaScript / DHTML / AJAX Mar 21st, 2009 |
| Replies: 5 Views: 1,035 Take a look at the window.location object:
https://developer.mozilla.org/en/DOM/window.location |
Forum: PHP Mar 17th, 2009 |
| Replies: 12 Views: 942 What you want is called IPC (Inter Process Communication).
http://en.wikipedia.org/wiki/Inter-process_communication
This is why it is better to write a deamon (start a child process) using PHP... |
Forum: PHP Mar 15th, 2009 |
| Replies: 12 Views: 942 Are you trying to just input this yourself from the command line or want PHP to do it?
see: http://www.unixgeeks.org/security/newbie/unix/cron-1.html
Basically you need to use: crontab -e
... |
Forum: PHP Mar 15th, 2009 |
| Replies: 18 Views: 101,151 Just to clear things up:
str_replace() will remove *all* occurrence of whitespace.
$str = str_replace(' ', '', $str);
So it solves the problem in the original post. |
Forum: PHP Jan 10th, 2009 |
| Replies: 2 Views: 833 Regular expressions are quite simple.
Instead of matching exact characters like in your str_replace() you match patterns.
The pattern is held in two delimiters, denoting the start and end of... |
Forum: PHP Nov 30th, 2008 |
| Replies: 5 Views: 1,671 Abstract classes can also be used to hide complex code, while still being extensible.
Say implementing the Animal class was quite involved and complex, now someone who didn't know about Animals... |