开发者

Convert code to POST

i have a script (php+html) full of forms and inputs, after the form is submited via p开发者_运维百科ost i can give the user a code (like was a GET form) q=test&t=3&u=9&q2=test&t2=3&u2=9&q3=test&t3=3&3u=9, then the user can put this code in a textarea for editing what he previously submitted

how to transform the code inputed in the textarea (q&t&u) to work like if it was submitted like a normal POST? like if i where using $_POST['q'], $_POST['u'] but from that code submitted (like foreach)?


Look into parse_str

$str = 'q=test&t=3&u=9&q2=test&t2=3&u2=9&q3=test&t3=3&3u=9';

parse_str($str, $data);

print_r($data);

/*
Array
(
    [q] => test
    [t] => 3
    [u] => 9
    [q2] => test
    [t2] => 3
    [u2] => 9
    [q3] => test
    [t3] => 3
    [3u] => 9
)
*/


What I understand from your question is. that you want save form and later want to allow ur visitor to update these details. Best way to do is. you can generate a code(password) keep it in database along with record and provide it to your visitor

visitor will enter that code(unique) to get his record and can update that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜