AviNahum Posted April 14, 2009 Share Posted April 14, 2009 it's my first time i using OOP, and it's my first time i working on system that i totally separator between the HTML and PHP codes. so i trying to make a redirect screen that redirect the user to the index after registration (only for example) but when i print the redirect i dont want that print other parts... for example, this is my HTML code: <html> <body> some text </body> </html> i want it clear this totally! and print the redirect! this is my function: function redirect_screen($text, $url) { global $gvars, $skin_global, $DB; $htm = $skin_global->Redirect($text, $url); echo $htm; exit; } and this is the "Redirect" function (the html): function Redirect($Text, $Url) { global $gvars; return <<<HTML <html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1255" /> <meta http-equiv='refresh' content='2; url=$Url' /> </head> <body> <table width='30%' height='85%' align='center' dir="rtl" style="border:1px solid #dbdbdb;"> <tr> <td valign='middle' align="right"> <table border="0" cellpadding="0" cellspacing="0" width="100%" align="center" dir="rtl"> <tr><td> <table class="good_m_tile" align="right" width="100%" border="0" cellpadding="0" cellspacing="0" dir="rtl"><tr><td align="right" width="100%">thanks</td></tr></table> </td></tr> <tr><td> <table border="0" cellpadding="0" cellspacing="0" width="100%" align="center" dir="rtl"> <tr> <td align="right" class="linkt"> $Text<br /> you are transfor<br /><br /> (<a href='$Url'>some text</a>) </td> </tr> </table> </td></tr> </table> </td> </tr> </table> </body> </html> HTML; } as you can see it's print the HTML tag again... there is some function that totally clear all browser data? [sorry for poor English, i'm not english speaker :|] Link to comment https://forums.phpfreaks.com/topic/154004-redirect-screen-problem/ Share on other sites More sharing options...
MasterACE14 Posted April 14, 2009 Share Posted April 14, 2009 before any HTML output you can just use... <?php header("Location: somepage.php"); ?> ...to redirect them to whatever page. Link to comment https://forums.phpfreaks.com/topic/154004-redirect-screen-problem/#findComment-809472 Share on other sites More sharing options...
AviNahum Posted April 14, 2009 Author Share Posted April 14, 2009 yea, but i i wanna it's show some text in redirect, i just want to clear all data the browser got... Link to comment https://forums.phpfreaks.com/topic/154004-redirect-screen-problem/#findComment-809483 Share on other sites More sharing options...
AviNahum Posted April 14, 2009 Author Share Posted April 14, 2009 someone help please? Link to comment https://forums.phpfreaks.com/topic/154004-redirect-screen-problem/#findComment-809535 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.