FAQ |
Kalender |
![]() |
#1 | ||
|
|||
Nykomling
|
Hejsan alla wnare!
Jag har ett stort problem som jag inte riktigt fattar. Tror jag har sökt nästan överallt och försökt allt jag kan.. Men ser inte felet....... Snälla hjälp. Felet som blir är att när jag trycker på submit så avslutas session och jag måste logga in igen. Detta är koden efter en FORM posten. session_start(); if($_POST['tbName'] != "") { $name = $_POST['tbName']; $access = $_POST['radioAccess']; $title = $_POST['tbTitle']; $access = $_POST['radioAccess']; $body = $_POST['editorBody']; $body = str_replace('\"', '"', $body); $userID = $_SESSION['userID']; //sql_insert fungerar till 100% sql_insert("page", "name,access,title,body,userID,created", "'" . $name . "'," . $access . ",'" . $title . "','" . $body . "'," . $userID . ",'" . date("Y-m-d H:i:s") . "'", false); $template = file_get_contents("src/template_page.php"); $template = str_replace("@access", $access, $template); $template = str_replace("@pagename", $name . ".php", $template); $template = str_replace("@cachefolder", $name, $template); $template = str_replace("@title", $title, $template); $template = str_replace("@content", $body, $template); $ourFileName = $name . ".php"; $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file"); $stringData = $template; fwrite($ourFileHandle, $stringData); fclose($ourFileHandle); echo "Page created"; } Allt fungerar men jag blir utloggad fattar bara inte varför... |
||
![]() |
![]() |
|
|