PDA

View Full Version : Self - Submitting Form


Michael Morris
02-04-2005, 10:20 PM
I'm working on a script that imports data from a custom database into vbulletin in the form of posts and threads. I've ran into a problem that a section of the script now takes so long to run PHP times out on the request. Rather than reconfigure PHP, I'd like to break the operation up into phases. As each phase completes it will send a page that has a self submitting form that loads the next phase. How do I make a self submitting form?

Dean C
02-05-2005, 12:02 AM
Take a look at the code vB3 uses when rebuilding the search index ;)

Michael Morris
02-05-2005, 12:59 AM
K, I will. Thx Dean. Uhm.. Do you know which file does that off hand?

Dean C
02-05-2005, 08:58 AM
admincp/misc.php :)

Michael Morris
02-05-2005, 03:14 PM
K, I found this in misc.php - looks like my candidate

if (($totalposts < $doprocess OR !$doprocess) AND $checkmore = $DB_site->query_first("SELECT postid FROM " . TABLE_PREFIX . "post WHERE postid >= $finishat LIMIT 1"))
{
if ($autoredirect == 1)
{
print_cp_redirect("misc.php?$session[sessionurl]do=buildpostindex&startat=$finishat&perpage=$perpage&autoredirect=$autoredirect&totalthreads=$totalthreads&doprocess=$doprocess&totalposts=$totalposts");
}
echo "<p><a href=\"misc.php?$session[sessionurl]do=buildpostindex&amp;startat=$finishat&amp;perpage=$perpa ge&amp;autoredirect=$autoredirect&amp;totalthreads=$totalt hreads&amp;doprocess=$doprocess&amp;totalposts=$totalposts \">" . $vbphrase['click_here_to_continue_processing'] . "</a></p>";
}
else
{
define('CP_REDIRECT', 'misc.php');
print_stop_message('rebuilt_search_index_successfu lly');
}

Thanks again.