Jump to content

oni-kun

Members
  • Posts

    1,984
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by oni-kun

  1. Buddski's code is correct; $action ==='logout' , Does that use register_globals? You should never code in that manner. The method to get an argument from the url query is $_GET['id'], This can be also accessed in entirety by $_SERVER['QUERY_STRING'].
  2. Why don't you debug the problem and create a benchmark to see how fast the functions are en/decoding? If it hangs obviously there's something wrong with the logic in it, I don't see anything on hand that would make it time out. How many usernames is it encoding?
  3. You've not asked a specific questions, so I'll have to tell you to look up tutorals (as there are infinite online) for: Sessions / Login system: For your page security Htpassword/Htaccess: to deny unauthenticated users and disallow directory listings How to create an SQL table with users: For your admin/user hierarchy. Forms with PHP/ Sanitizing SQL: For your login form, important. I'm sure there are even hundreds of fully written examples for you, if you just look.
  4. Your TOS does not state that uploaded content is the own user's content and that they're responsible for the content they upload according to the TOS, this means if there is an unlawful thing put up you could get in trouble and be walked over. Other than that, I like it, It's simple, It actually tells the deletion policy (time till delete) and allows mobile uploads, It's a soft featured site without chunks of advertising, for now?
  5. IE handles headers a little more strictly, if not more conformed. Anything missing may deter the download from initiating.
  6. You should really read up on the php documentation (look at my sig), And i'm sure there are many tutorials out there that show the differences between ASP and PHP. Like asp, PHP has it's own file extension and opening style tags. (Note PHP >=5.0 is the current version of PHP, 4.0 and register_globals you should stay away from while learning)
  7. Is there not a feature with Nvidia to right click on an application and hit 'Play on TV' ? Maybe that was just for videos, but I was able to assign certain games etc. to different monitors when I had them, there must be something useful in the control panel, of course with the advances settings on.
  8. oni-kun

    Error

    It's simple. When you wanted to display somerthing else (IE: index.php?t=&id=1) you used it to echo data to the page, right? But from what I've seen you set it up so it displays the default content no matter what. Simply make it, so if 'id' exists in $_GET, such as the ID they're viewing, to NOT display the default data (isset($_GET['id']).
  9. What on earth are you guys talking about? If you're wanting to filter through the script and query array than use a method such as this: $script = $_SERVER['SCRIPT_FILENAME']; //Just, the file's name $query = $_SERVER['QUERY_STRING']; //Modify or leave out echo $script . '/?Genus=' htmlspecialchars($_GET['Genus']); //. '&page=...&foo=bar..' If you're wanting to replace previous characters, as you're having duplicates now.
  10. As the above post says, It makes $var2 null by default, meaning it is only used if it is defined (you can check if it is and ignore it with isset) function someFunction($var1, $var2 = null) { return $var1; if (isset($var2)) { return $var2; } } echo someFunction('Hello'); //valid echo someFunction('Hello', 'World'); //valid Although you can use somefunction(array($arr))
  11. oni-kun

    Error

    if (isset($_GET['id']) && $_GET['id'] == '1') { echo 'Page ID: ' . $_GET['id']; //Info you wanted //Page code.. } else { echo "Default page"; //Info you wanted to omit //etc.. } If you structure it like that, you won't get the (included) default page you didn't want?
  12. oni-kun

    Error

    What do you mean? At the beginning of the page, run an IF statement telling it to not output the unwanted data if the $_GET properties are as they are, this will prevent the unwanted content!
  13. If you're Canadian, The olympics.
  14. http://framework.zend.com/manual/en/coding-standard.coding-style.html#coding-standard.coding-style.control-statements.if-else-elseif That should support my like of the brackets being on top: If Zend coding standards are like PEAR's, than I say you should just stick to that.
  15. There's no way to tell it to expire in 7 days, unless you enter the current date into an SQL database, and base the activated date on that. If you don't it'll just keep upping date() one day each time it's executed.
  16. You can use this code, sourcecop encodes it right? Then it should expire at the date you specify. You may want to replace date() with $date='xx/yy/zz'.. if you wish to test if your code works (on the odd case your expiry does not function, to be safe)
  17. I'm not aware of a method without using an encoding software, such as Zend or CodeCop. If you want to risk the (albeit minute) possibility of them cracking your code, you can encode it in base64 (base64_encode, base64_decode (including the 'expiry date') and use eval. $code = "BBCCAA44FF[...]"; //whatever you encoded with base64_encode() eval(base64_decode($code)); //Run the encoded code, including expiry section
  18. Indeed! 4 more minutes left here (PST) , Can't wait till a good 2010. -pulls out the champagne- Cheers EDIT: "Let your problems last as long as your newyears resolutions"
  19. Yeah, I just prefer it this way, It is just easier to see the beginning of the bracket (especially in IDE) and just looks cleaner, on second line looks like one of those 'looks bad, but must do it' kinda things to me.. Atleast I don't do function foobar($foo, $bar, $baz){return $foo+$bar+$baz; DoSomething(); echo "done"; } .. *hides my sig*
  20. Yes, sessions are the simple way to go without $_GET/$_POST and is much more appropriate. Just note you'll have to put session_start(); on each page using sessions (first.php, second.php)
  21. It really comes down to what you are coding for, There is no 'norm' for most sites, I've seen many do it differently and in their own way, as for your JS passing the variables via a function may be more taxing than accessing the class or global directly. On their side, why are you using "document.whatever.innerHTML = ..." ? Why not be able to write directly to 'whatever' as a value? As for the 'wasteful' amount of PHP that is being used, you should encorporate a something such as while loops to display the data, but again, not sure what you're wanting to do.
  22. You're sending output before the header is sent, remove any whitespace or echo before the header() or you can simply add this code directly after <?php <?php ob_start(); //output buffer
  23. $username = 'adamriley'; if ($username == 'adamriley') { $fullname = 'adam lee riley'; } else { $fullname = 'nathan'; } That should work, your method does not seem so secure though, what are you trying to do?
  24. if (substr($value, 0, 1) == "'") { //Do nothing, or add param to function to skip quote } else { //Add quote to beginning } Do you mean something like this? But it would be helpful if you told us what the function was, and yeah, why it's adding them in the first place.
  25. Why not make it simple for the user, and output xml/JSON of the information they're using? You should have sufficient room for functioning, but not 100% sure the scope of what you're wanting to do it for.
×
×
  • 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.