MyBB Community Forums

Full Version: PHP Code Function Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Greetings,
I am very not good with PHP, and I have a question about what the following code in bold is for:
showthread.php Wrote:$query = $db->query("SELECT pid FROM ".TABLE_PREFIX."posts WHERE tid='".$nextthread[tid]."' ORDER BY dateline DESC LIMIT 0, 1");
$pid = $db->result($query, 0);
header("Location:showthread.php?tid=$nextthread[tid]&pid=$pid#pid$pid");
}
Is see this "header("Location.... thing quite a bit, and would like to know what purpose it serves.

Thanks!
It's a reditect function. As soon as the function is executed. you will be redirected to showthread.php?tid=$nextthread[tid]&pid=$pid#pid$pid
Thanks for the explanation!

Does this function also affect where the navigation links to?
No, the navigation links are normal html <a href=...> tags.