Jump to content

oni-kun

Members
  • Posts

    1,984
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by oni-kun

  1. Whatever. Back in my day we called it DOS. I understand it has evolved since then but...meh, can't teach an old dog new tricks such and all. Just to remember 'Diskpart Operating System' .. It really is/was the core of Windows, I suppose calling it what it was in its , er, prime *cough*. Makes me want to telnet some sites for fun. -pulls out lynx- Was being the operative word. MS-DOS hasn't been a part of windows since before NT. But, we've already had this conversation. Not was, What do you think the 3.1/95/98/ME/NT/XP/Vista boot installer is based on? DOS. It's not part of the NT kernel anymore but it's sure fortunate that they continued a fair base of consistency with their command line parser. Just like W7 is including 'Windows PowerShell' by default, just another step of co-existing with the 'command line interface.' It's obvious the difference, as 3.1/95 was only but a graphical shell, that you had to actually start by typing 'win' in dos.
  2. That is right. Due the the nature of computer hardware and the infrastucture of the internet, there is absolutely no foolproof means to authenticate a user without them authenticating themselves.
  3. This has been around forever. May as well not even be news, just, er, uberfeeds their objectives. Moot made top influential person of 2009 (Time magazine) in a poll,.. 100% fueled by atleast over 9000 fans and perl auto-submitters.
  4. Whatever. Back in my day we called it DOS. I understand it has evolved since then but...meh, can't teach an old dog new tricks such and all. Just to remember 'Diskpart Operating System' .. It really is/was the core of Windows, I suppose calling it what it was in its , er, prime *cough*. Makes me want to telnet some sites for fun. -pulls out lynx-
  5. Well, at one time the poll was at 17:8, and did go down the next morning. (Or was I dreaming?)
  6. It's an error with the GUID directive in Vista, they were implementing it in experiment and ditched it after a milestone release. And by DOS you mean Windows Command Prompt? EDIT: OP link is broken because the original poster of the external site decided to use smart quotes in the url/title. What a perfect example of....
  7. This has been prevalent in all operating systems over NT Kernel 5.2R-1. Most of these 'hacks' are simple registry tweeks, and old as well, have you downloaded a 'stripped' version of XP before? They include a plethora of useful shortcuts. The 'godmode' string is stupid, Appending a GUID (the list of registry tweeks) to any string will do the same, it can be 'shell:::{ED7BA470-8E54-465E-825C-99712043E01C}' for example. XP denies it's an NTFS stream ftr.
  8. Add a .htaccess file to your web root, and add the following line: AddType application/x-httpd-php5 .phtml .php .tpl .inc This will force .inc and .tpl to be parsed as PHP code, and will display the same as a (.php) document.
  9. You can shorten it, and even add a link making it truly dynamic with PHP. But yeah, JS will be needed to expand the actual area. $string = 'I am a long title, Shorten me to 30 characters and it will be interesting to see the result'; function shorten($string, $length, $id) { if (strlen($string) > $length) { $string = substr($string, 0, $length)."<a onClick='expandText(".$id.")'...</a>"; } return $string; } $shorttitle = shorten($string, 30, 'div1'); echo $shortitle; The onClick code won't work, but I showed you an example of how you can pass the id of the string you want to shorten, or you can just define it yourself (simpler if you need be)
  10. Technically if you view their website, you are downloading their data for your own use (viewing), so unless the specific part of the website is copyrighted than it, atleast should be ethically acceptable to be able to. The only thing you can really do without them having an API is this: $sitename = "http://example.com/data.php?page=2"; $contents = file_get_contents($sitename); preg_match("/<title>([\w\s]*)</title>/i", $contents, $matches); //Match something on the page $webpage_title = $matches[1]; That for example, should download the page and dynamically pull the title tag (thus information) out of it. Just an example.
  11. If you're not understanding how to do the most basics of PHP, I'd recommend you look up some tutorials and understand what that code is before you implement it. There are a variety of resources that could show you how to do so, without you having to do it yourself. As for your problem, replace 'howtodoit.zip' (including quotes) with $filename, make sure there are no quotes around the variable. Of course you have an empty variable now, so at the top somewhere in your script, you can write $filename = 'randomname.zip'; Or to call from url: $filename = $_GET['file']; or similar.
  12. As you're not explaining yourself I'd have to say you just shouldn't ask. If it were an encoded file, I bet you that they've copyrighted it. And by using it you're binded to their terms,eh? Unless it's GNU/GPL I doubt you're going to get someone to unencode it.
  13. If this is a javascript question than ask in the javascript forum! And I'm sure there are many tuts online for this....
  14. The regular expression is a sequence consisting of the character '#', the expression '[\r\n]+' with the replacement '\n'. Read up on preg_replace to learn more about this function.
  15. You're using an array in your str_replace function. What the array does, is essentially iterates through each one and replaces it. (\r, \n, \r\n) \r \n and \r\n will be replaced. So if on the page there is '\n', it'll become '\r\n'. Then what? There's more elements in the array you have. the '\r' in '\r\n' will become '\r\n\r', and again, '\r\r\n\r'. The array makes you replace the replacement's replacement in other words, you're overwriting your result.
  16. Yeah, it's more of a 'reference manual' of sorts. It's the equivalent (for most) of stating 'this is a car', but neglecting to show you have to drive it.
  17. You'll need to use something such as CURL, Here are some examples. More about it here. CURL is a wrapper that is able to send POST data easily, it's a much more efficient method over sending headers yourself and all that.
  18. Your code is of error, say there already is an \r\n on the page, You'll be replacing it in order, so \r\n = \r\n = \r\r\n\r\n ... The order of the array is important, so you should use something like Rajivgonsalvas' code.
  19. You can do it all on one page, ideally. Just set it so it displays each step through $_GET (so they can go 'back' etc, like index.php?step=3) And for storing your data, You'd be best off using sessions. You can directly apply the data such as: <?php session_start(); //Start session $_SESSION['fname'] = $_POST['fname']; ?> And store it for global use on your site, But what I'd recommend is to sanitize input, with functions such as mysql_real_escape_string if inputting anything into the database. It's best to keep it session-only until the last 'submit' page where you do the final checks and make sure the data is valid, then place it into the database and redirect them or whatnot. If they go 'back' the session variables will still be set, so you can do something like: First Name: <input value="<?php if (isset($_SESSION['fname'])) { echo $_SESSION['fname']; } ?>"/> That'll be easier than setting everything in cookies which is unreliable. Session variables are kept serverside so there's not a need for security I assume in your application. This assumes you know how to start and use a session.. if you need help just ask ^^;
  20. That could work as well, but it'd be a timed session, meaning the person cannot view the page after a certain amount of time (albeit an easier solution).
  21. I know what you mean, half the codes that come out of books like that look like they were written in the '60s and are not fun to copy and have to check every single character for error. I created my own site and did the same, just created whatever I wanted, challenged myself, and over a period of months learned how to make extended objects, sanitize and secure data, create my own purposeful functions for projects, And if it was bad code it would simply not cut what I wanted, being a perfectionist i'd research and look at examples and make it perfect, and retain all that.
  22. Well, essentially there is no method of doing this unless you: A) Make them click an exit link, which will expire the session (if the exit this will not happen) B) Create a cron job and set the table to refresh at a set time if no one is 'logged' to the page.
  23. This should return the last entered ID: <?php $qry = mysql_query("INSERT INTO `Cars` (`ID`,`Make`,`Model`) VALUES (NULL,'$_POST[Make]','$_POST[Model]');"); echo "Car ID is " . mysql_insert_id(); ?> Note you should never use short tags (<?) in PHP. It is widely disallowed and not compatable. EDIT: You should use mysql_real_escape_string on your query to disallow SQL injection..
  24. What scenario are you wishing to achieve this? Is the redirect permanent? What I'd recommend is creating a table, and when the page is viewed it enters 'viewed = 1' for example and if another user comes on it'll have that value and you can appropriately redirect them, A cron job can set 'viewed' back to false if you wish it to reset.
  25. You can use a simple regular expression match. I've written one that should work, here's an example: $str = 'Johnny302'; if (!preg_match('/[^a-z]/i', $str)) { die('Your username contains invalid characters!'); } else { echo 'Your name is valid'; } That expression will allow only a-z A-Z. What most people don't know, You can use this function as well: ctype_alpha: It should provide a faster alternative if you wish not to use preg_match.
×
×
  • 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.