Jump to content

MoZo1

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by MoZo1

  1. 1 more thing: with mysql_real_escape_string() and strip_tags() you can use that characters (and even the ' character) safely. They're unnecessary with this check (because the allowed characters can't be used for attack), but still recommended as double check.

  2. You should copy your entire code here, cause the switch is good, and with the $_GET array, it should run on every PHP versions.Oh, and you can try it with else if, I doubt it will work.

  3. Wow, thanks anyway, I've learned something new, but the submit image still have name and value, and it's still not working. Or rather, it works under firefox, but not under IE. But now I assume, that if it's not trash data, then the IE just directly don't send that. Thanks anyway!

  4. 1. Use addslashes and stripslashes in pairs, so if you have stored something with slashes, you have to get back the original form. So again: convert the data into a storeable format, then don't forget to reverse the convertion when reading it! Fx. you get can't by input, then you can only store can\'t, but then you have to give back can't as output.2. Check the corresponding SQL syntax.fx.:

    INSERT INTO employees (Lastname, Firstname, Title) VALUES('Hively', 'Jessica', NULL);

    3. This:

    function sql($txt, $db) //sql with error handling, $db=sql-connection	{	$result = mysql_query($txt, $db) or die ('Mysql error: ' . mysql_error() . '<br /> Original line: ' . $txt);	return $result;	}

    I haven't tested it, it should be correct. :)*EDIT: mysql_real_escape_string is a variation of addslashes, usually you can use it with stripslashes. The same bug can occur, but with very rare characters only. But beware it in the sql's LIKE command!!

  5. I have a form with a lot of image type submit buttons, and one drop-down list. The drop down list's name is amount, and the submit "images" have the same name, task2 (without _x and _y) with diferent values. Then in the debug section, when the program terminated because of illegal parameters, I use "print_r($_POST);", and watch this:

    Array ( [task] => box_move [amount] => 1 [task2_x] => 14 [task2_y] => 10 )Array ( [task] => box_move [amount] => 1 [task2_x] => 8 [task2_y] => 6 ) Array ( [task] => box_move [amount] => 1 [task2_x] => 10 [task2_y] => 8 )

    Each line I've got, by clicking the browser's backward button, then the same button again! I've found some forum articles on the net, telling that others have the same problem even without the same button name (fx. 1 code used isset-type check). The most embrasing, that the same code always works fine with Firefox, but not with Explorer and Conquerror.I have an idea, that I should set something in PHP or in explorer, that modify the posting method, but idk how. Anybody have an idea, or same problem, or anything? Thanks for any help!

×
×
  • Create New...