MyBB Community Forums

Full Version: what is my_post_key
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
what is my_post_key in delete link in ajax based post deletion. is this dynamically generated each time ? and which variable has value for it ?
$mybb->post_key is just a variable that contains a unique key/identifier for your user account. It's used to verify that requests sent to the server are actually from you. If someone attempts to spoof a URL request but has the wrong post key, MyBB will flag an error.
Edit: delayed response

headerinclude template consists of var my_post_key = "{$mybb->post_code}"; and it is a constant throughout the login session
It's one thing keeping this from working:

<img src="newreply.php?tid=159335&amp;processed=1&amp;action=do_newreply&amp;subject=Lol&amp;message=Fake+Reply">
How can I get the current value of "my_post_key" if I want to auto-create a new thread for users to comment on my blog posts? Is it stored in $_SESSION?

Also, I see another hidden hash field in the thread posting form called "posthash". What would I need to do about that?

Well, I guess posthash could be left blank since I'm not adding attachments to these new threads?

https://community.mybb.com/thread-1629-post-9736.html

But the field is already populated when I load newthread.php. So does there have to be something in that field or not?