I have a problem i am sending request to saveing data and if is work so i want to do redirect , but i get blank page
//this the function to save
public function WriteToFileText($array) {
$filename ='here is the name of the file ,the name is correct and i can print it';
require($filename); //this sentenct give me the problem
foreach($array as $key => $value) {
$text[$key] = array_merge($text[$key],$value);
}
//protection <img src='http://www.yiiframework.com/forum/public/style_emoticons/default/huh.gif' class='bbc_emoticon' alt='???' />?
$tout = "<?php \n";
$tout .= '$text = array ( ' . "\n";
foreach($text as $key => $value)
{
$tout .= ' "' . $key . '" => array( ' . "\n";
foreach($value as $key2 => $value2)
{
$tout .= ' "' . $key2 . '" => "' . $value2 . '",'. "\n";
}
$tout .= " ), \n";
}
$tout .= "); \n";
$tout .= "?> \n";
$fh = fopen($filename, "w") or die("Could not open log file.");
fwrite($fh, $tout) or die("Could not write file!");
fclose($fh);
return true;
}
and if its return me true , i am try do to redirect
return Yii::$app->getResponse()->redirect('./index.php?r=' . $pages_link[$index + 1])
and the problem that i see blank page ....
if i will remove the require($filename); the redirect will work perfect but i will not savind the data becouse i dont get the data from the file what can be the problem?