Jump to content

Zane

Administrators
  • Posts

    4,362
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Zane

  1. You know, unless your site is comparable to a place like facebook/twitter/myspace/etcetera (some other website that specializes in marketing personal information) then there's really no point in using HTTPS for you login. IMO, HTTPS is best used for credit card numbers, social security numbers, government PIN numbers, and other really sensitive data. Just like xcandiottix already said, AJAX does nothing different as far as data transfer (besides doing it behind the scenes.) Implementing HTTPS would be overkill unless your users' information is really THAT sensitive. I mean, really sensitive... HTTPS is a big deal. Sites like eBay, amazon, Paypal and so on couldn't exist without it. So the real question is... Are you considering your site to be this important? If so, then yes HTTPS would be a wise choice.
  2. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=310377.0
  3. This is called flushing the output buffer. Take a read on it here.. http://www.tuxradar.com/practicalphp/13/9/0
  4. use pathinfo().. it will return an array where you can use the "filename" key to get that.
  5. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=309960.0
  6. I missed the part about the "difficult to decode." In that case, add a salt to your string, serialize it, THEN use bin2hex.. easy enough. The salt is what keeps it all different. It's pretty much a password. Say you have the string "bubble" and you want to encode it.. You could add a salt to it like "yutmgjtutyhdk583474" giving you "bubbleyutmgjtutyhdk583474", which you'd then serialize (which isn't too hard to decode) and then bin2hex. $salt = "yutmgjtutyhdk583474"; $string = "bubble"; $encodeIt = bin2hex(serialize($string.$salt));
  7. Just to nitpick your code a little. Your are assigning two different things to $file, both are different. Meaning, the file_get_contents will overwrite the file handler returned by fopen. So the first line in your code is useless. Secondly, if you want a quick array of EVERY line in a file, use the file() function, it does exactly this. Thirdly, in your loop, you are creating a NEW form for every single line, which isn't that bad, but it isn't needed either. It's best practice to only have one form, unless the other form has a different purpose (like a login) The code below should help you out. $file = file("yourfile.txt"); if(isset($_POST['post']) && !empty($_POST['post']) { unset($file[$_POST['post']]); $fh = fopen("yourfile.txt",'w'); foreach ($file as $line) fwrite($fh,$line."\n"); fclose($fh); } echo "</pre> <form method="'post'" action="''">\n"; foreach($file as $line) echo $line . " \n"; ?> <
  8. bin2hex() This is what you're looking for.
  9. round() to the nearest tenth. round(3.141592654, 2) == 3.14
  10. Zane

    Idiots.

    Same here, fuck, fuckin up your holiday. You explicitly told them what to do, you've got all the right to ignore... go have a beer Though, I could see where you might worry about them screwing everything up before you get back, that would blow.
  11. what? I know you didn't just answer your own question... could you elaborate a little more.
  12. I'm not exactly sure why, but it's in the manual at least http://www.php.net/manual/en/language.types.boolean.php#86809
  13. What does your database look like ...... now
  14. No, they cannot re-route the data to another domain, only to the current page. Say for instance you have the results routed to a DIV located at the bottom of the page, theoretically, someone could have the data go to the top of the page; that's about it.. But they can only do it live; meaning, once they refresh it's all ...... refreshed.
  15. Please don't start on new topic on the same subject, because I or someone else will have to delete it. I have told you what you need to know, if you have questions, just ask. In my opinion though, your main priority should be getting your database setup ... functionally and normalized as to aid your PHP adventures. If you setup your database un-normalized, you'll just end up at square one later.
  16. objNoob's method would not be normalizing your database. Normalizing your database consists of utilizing your primary keys. If your "keys" are just varchars, they can easily be disorganized by having a differently spelled "Berry Juice." Perhaps one with two "i"'s. His method is essentially the same as my suggestion without the use of primary keys.
  17. Validating output from an AJAX request would just make a complete circle of validation... in other words.. it's redundant. If you're AJAX information is already being validated again by a server-side script, then there's no reason to validate it again with a client side script. The only thing you could possibly be worried about at this point is some one re-routing where the data goes; and just to elaborate on that, I mean someone could *only* route the data to the current page. So if your AJAX says to route the output to #results, theoretically, someone could re-route it to go to #somethingElse; but it would only last until they refreshed the page.
  18. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=309239.0
  19. Instead of having a comma separated ingredients list, you need an ingredients table. Also, you would need a relations table This way your relations table will be like so.. Let's say Cider has an id of 52 in the juice table; and raspberry has an id of 108 in the ingredients table. So in your relations table... or combinations table... whatever you want to call it.. you would have. Then you can select ingredients from combinations WHERE juice = 52 * This is what's known as a many-to-many to relationship.
  20. You can always spoof client side information, but usually AJAX is meant for an asynchronous connection with a server-side script, which you can't spoof. Well, by "can't spoof" I mean your security is such that you have *specific* GET and POST variables (and values) you are looking for. What exactly is it that you're worried about?
  21. SUM() would be faster, unless you're adding other variables along with it... PHP variables.
  22. I'm no Linux guru, but I know you can create a file with the touch command. Maybe that's what you're looking for.
  23. Zane

    line break help

    try using an actual newline character.. along or without your carriage return. In other words. \r\n instead of \r
  24. It's because the id in your COUNT function is ambiguous. Should be Count(b.id) or Count(a.id) Moreover, here's my take on your SQL situation. SELECT COUNT( b.id ) FROM basket b INNER JOIN products b ON b.id = p.id WHERE p.for_sale = "yes" AND b.ip_address = "'.$_SERVER["REMOTE_ADDR"].'" GROUP BY b.ip_address
  25. Zane

    Chatroulette

    Merton FTW!
×
×
  • 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.