0
在PHP中我怎樣才能重定向我的網頁,一旦scrpit運行成功案例0,但留在當前頁面的其他任何東西?PHP運行腳本,然後重定向一次完成
exec($command, $output = array(), $worked);
switch($worked) {
case 0:
echo "Database <b>". $database. "</b> successfully exported to <b>". $filename. '</b>';
// add redirect here
break;
case 1:
echo 'There was a warning during the export of <b>'. $database .'</b> to <b>'. $filename .'</b>';
break;
case 2:
echo 'There was an error during import.'
. 'Please make sure the import file is saved in the same folder as this script and check your values:'
. '<br/><br/><table>'
. '<tr><td>MySQL Database Name:</td><td><b>'. $database .'</b></td></tr>'
. '<tr><td>MySQL User Name:</td><td><b>'. $user .'</b></td></tr>'
. '<tr><td>MySQL Password:</td><td><b>NOTSHOWN</b></td></tr>'
. '<tr><td>MySQL Host Name:</td><td><b>'. $host .'</b></td></tr>'
. '<tr><td>MySQL Import Filename:</td><td><b>'. $filename .'</b></td>'
. '</tr></table>'
;
break;
}
在case 0重定向('another_page','refresh'); –
在重定向之前無法回顯,因爲您會收到錯誤消息。 –
做它重定向將重定向(「page.php」,「刷新),或完整的URL? – shaggs