Search Results

Search found 2 results on 1 pages for 'user194630'.

Page 1/1 | 1 

  • Secure ajax form POST

    - by user194630
    I was wondering how to develop a secure form post through AJAX. For example, i have: My HTML form. My JavaScript handling the submit. The submit url is "post_data.php" The posted data is: id=8&name=Denis The PHP verifies if variables id and name are POSTED and their data type. If this is ok it proceed to do some stuff on a database. My question is, how can i prevent someone from creating his own html form, outside my web site, or whatever, and posting false data to my PHP script? Imagine that data realy exists on my database, this could be bad. Thanks

    Read the article

  • Compare two associative arrays and create a new array with the matched arrays, PHP

    - by user194630
    I have this two arrays: $arr1=array( array("id" => 8, "name" => "test1"), array("id" => 4, "name" => "test2"), array("id" => 3, "name" => "test3") ); $arr2=array( array("id" => 3), array("id" => 4) ); How can i "extract" arrays from $arr1, where id have same value in $arr2, into a new array and leave the extracted array also in a new array, without taking into account key orders? The output i am looking for should be: $arr3=array( array("id" => 8, "name" => "test1") ); $arr4=array( array("id" => 4, "name" => "test2"), array("id" => 3, "name" => "test3") ); Thanks

    Read the article

1