Jump to content

oni-kun

Members
  • Posts

    1,984
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by oni-kun

  1. They're called url slugs, Here is an example: function slug($str) { $str = strtolower(trim($str)); $str = preg_replace('/[^a-z0-9-]/', '-', $str); $str = preg_replace('/-+/', "-", $str); return $str; } I'm sure there are many many many many examples online, as WP/Virtually every other CMS out there utilizes them.
  2. It clearly states what is wrong. Are you using an older version of the plugin you installed? Check on the developer's page for any information. What it means is it simply cannot pull the RSS feed from Google, This could be their fault or the developers.
  3. If someone asks for help, You give it to them. You do not promote poor programming practises with a paid service which is ridden with horrible coding. Blatent advertising does not provide educational, productive or comprehensional value to the original poster. This is not a place for your pointless idiocrastic ideas, If you cannot come up with a valued solution or comment, Then simply do not post. You demand help on someone elses poor project? Are you 14? Should you not be on these forums?
  4. This topic does not make any sense; But nonetheless use the simple unpack and you will get the magical bulletproof protection against "malicious" codes.
  5. 1) You'll never get definitive results with %200; 200 && 400 %200 == 0. 2) Counter will ALWAYS be 200 and will never update as you're not iterating the counter after the fact. Everyone is a winner now like in those ads?
  6. An undefined index is a fairly minor error, More as a warning. Whatever is on line 76 does not check if the index exists first, so it's a problem in their code. If error reporting were not set to E_ALL, It would most likely not even display this (As it's not a fatal error of any sort). If you wish to prevent the warning, You can go to before line 76 and place $whatever['pollresult'] = null; And then it will exist.
  7. There are many counter examples out there. You best just look at them. As for the "winnner" code, You can have a simple IF/ELSE statement on the code that will propagate the visit to the database. But as obvious, Record IP's per visits, so no one person can refresh the page 200 times and get it.
  8. [tex]Hashing != Encryption[/tex] MD5 and SHA1 families are not encryption in any means. As for encryption below 20 charaters, There is no way to define this behaviour. You can set a WHILE loop like so though: $text = "..."; while(strlen($enc) < 20) { $enc = crypt($text, 'foo'); } But you haven't stated why you want the encryption to be small. DES/3DES if a viable solution, but as for encoding BASE64 (via base64_encode/base64_decode) is a valid and compact solution if length and somewhat obfuscation is required. EDIT: You may as well use B64 as you're not wanting security. It's much faster than standard encryptions, and it can be easily decoded via the functions I mentioned. An example string is: gc3RyaW5nIG9mIHNvbWUga2luZC4=
  9. What I'd really recommend is looking though this book: http://commons.oreilly.com/wiki/index.php/PHP_Cookbook/ It's free and in HTML, It has amazing example problems which are used often with solutions. It's the closest I've ever come to what you're asking for.
  10. Zend wouldn't like it, As you're re-implementing crypt's initiation handler. zm_shutdown_basic and zm_shutdown_crypt are deprecated and removed in PHP 5.3.2. It would require patching much more than what is viable, as it'd take deconstruction of some of the engine's functions breaking more.
  11. Can I vote twice? lol. If you really can't decide I'd recommend the top right.
  12. BIGINT is stored in 8 bytes, from -2^63 (-9,223,372,036,854,775,808) to 2^63. I have a small inkling that it will not work on 32 bit arches. Now the question is, What indexes require.. I'm not sure the prefex, Yottoillian, Keys? Unsigned INT's go to 2,147,483,647, which is exactly 32 bits. So probably that is the best choice.
  13. Those should suffice nicely to your task in hand. If you're worring about the server load it takes to split a string, Think roughly 172+92 bytes for **ZVALs on ZEND's engine + C's overhead, And in today's memory? It wouldn't take much load at all on anything under 1M+ len. EDIT: Salathe, back off :-\
  14. Your PHP.ini settings are correct, but unfortunately the code you have posted relates to parsing a file size in bytes as megabytes/gigabytes. Are you sure there isn't documentation for your CMS on doing this? There must be, I bet you there is or it wouldn't be a good CMS in the first place.
  15. Yeow, Might be a fairly hard task to accomplish. What I'd start with is some checking the formatting of the number in raw, of course strtr and this would help: if (strlen($phone) == 10) sscanf($phone, "%3s%3s%4s", $area, $prefix, $exchange); } ... if(substr($phone,0,1)=='1') { sscanf($phone, "%1s%3s%3s%4s", $country, $area, $prefix, $exchange); } Here's a list on sprintf formatting: http://php.net/manual/en/function.sprintf.php Although there's a chance there's a flexible class already written onPEAR.
  16. @OP, Are you daft? the client won't even know what the hell is outputting it. (ASP, C, Ruby, JSP, CF, FF, PHP, LF, LNN, XMLDD); It will only see what is put out by the output buffer. The only possible problem is if PHP is parsing incorrect formatting, As it SHOULD BE the equivalent unless your coding or server is seriously mistaken, printed by ANSI C or MONO will not make a difference. Why not do something useful and run a binary frame DIFFs on the PHP output vs Client JS? Why the on god's earth are you packet sniffing? I'm not going to look at your problem, XMLHTTPReq's on client's ECMA's RT frames are not related to PHP.
  17. If you've read the manual, You'd see they use constants. What happens if you type "print FTP_FINISHED" ? It's a constant. FTP_FINISHED == 1 FTP_MOREDATA == 2 Therefor 1 and 2 are the proper responses. Null is a very common response if the stream cannot be connected (false == 0), and/or if there is an error in the function.
  18. ftp_nb_put How hard can this be?
  19. Alright. I know what you are trying to do, and the simple answer is No. The only physical request the browser client will make is directly to the image, It in no way serves the referrer or request URI along with it. If that were possible, the web would be much more bulky and insecure.
  20. Why not look at the various MySQL tutorials out there? We're not going to show you how to make everything come together, It's beyond what should be in a forum topic. Do you know how to set up a database? http://www.peergoal.com/tutorials/sql-setup/ Do you know any basic SQL commands? Here is a great place to learn. http://www.tizag.com/sqlTutorial/ And then you simply create the database. $con = mysql_connect("localhost","name","abc123pass"); if (!$con) { die('Could not connect: ' . mysql_error()); } if (mysql_query("CREATE DATABASE questions",$con)) { echo "Database created"; } else { echo "Error creating database: " . mysql_error(); } mysql_close($con); And then use a database manager to add an autoincrementing ID and then question column from there. Well, It's 2:30am and I'm tired, let someone else complete the work. And stop abusing the colour feature :-\
  21. A quotation means nothing, Again. If you were to escape the data twice (such as what magic_quotes_gpc might do on certain scenarios) you'd need to apply stripslashes on the output. There is no need to handle it further.
  22. What do you not understand? The second parameter of mysql_result should be the row index you wish to output. Why are you using code that you don't even understand.
  23. Within the database it should not matter if there is a quote or not. SQL does not see the quotes as anything special, Only PHP when parsing a string. There should be no problem as long as you are escaping each string before entry.
  24. var_dump will list information about a said variable, Be it an object or string and it can be used for debugging purposes on the apparently unescaped string. $name = mysql_real_escape_string($_POST['comment_name']); $content = mysql_real_escape_string($_POST['comment_content']); print '<pre>'; print var_dump($name); print var_dump($content); What does this return?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.