Always inside frame - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Always inside frame (/showthread.php?tid=87892) |
Always inside frame - keithhui - 06-14-2023 I am using CI4. I make a simple view, however, it is always under a frame. http://www.myohomall.com/login After I login, the url is still the same. I find that all contents are under a frame. Do I set config wrongly? Also, my url can be accessed only by incognito mode of Chrome, but it is normal in Edge. How can I fix it? RE: Always inside frame - JustJohnQ - 06-15-2023 Can you show the code of the view? RE: Always inside frame - keithhui - 06-15-2023 (06-15-2023, 04:00 AM)JustJohnQ Wrote: Can you show the code of the view? Inside Controller User.php public function login() { helper('form'); $data['title'] = "Login"; $session = session(); // Check whether the form is submitted // Normal loading the login page if (!$this->request->is('post')) { return view('login', $data); } // Check the submitted form else { $post = $this->request->getPost(['loginid', 'password']); if (! $this->validateData($post, [ 'loginid' => 'required|max_length[255]|min_length[5]', 'password' => 'required|max_length[5000]|min_length[8]', ])) { $session->setFlashdata('msg', "Information is too short"); return view('login', $data); } $userModel = model(userModel::class); // $logModel = model(userModel::class); $loginid = $this->request->getVar('loginid'); $password = $this->request->getVar('password'); $validation = $userModel->where('loginid', $loginid)->first(); if ($validation) { $pass = $validation['password']; $auth = (md5($password) == $pass); // Login success if ($auth) { // Write log // $user->save(['']) // Set session $session_data = [ 'userid' => $validation['userid'], 'rolelevel' => $validation['rolelevel'], 'fullname' => $validation['fullname'], 'email' => $validation['email'], 'isLoggedIn' => TRUE ]; $session->set($session_data); // Redirect to main menu page return $this->main(); } else { $session->setFlashdata('msg', session('PASSWORDNOTMATCH')); } } else { $session->setFlashdata('msg', session('ALERT_LOGINFAILURE')); } return view('login', $data); } } RE: Always inside frame - JustJohnQ - 06-15-2023 My guess is that your hosting party is putting it in a frame. Try it with a very simple html doc and call it from your controller. If this ends up in a frame too, I would contact the hosting provider if I were you. RE: Always inside frame - keithhui - 06-15-2023 (06-15-2023, 10:30 PM)JustJohnQ Wrote: My guess is that your hosting party is putting it in a frame. Try it with a very simple html doc and call it from your controller. If this ends up in a frame too, I would contact the hosting provider if I were you. I am using Synology NAS web station. It is normal for basic php website. But when I am newly using codeigniter, it shows strange. Or you may access http://keithhui.myds.me/mcs/public/login for my problem. Thanks. RE: Always inside frame - JanFromHamburg - 06-17-2023 Looks good. Solved? RE: Always inside frame - keithhui - 06-18-2023 (06-17-2023, 04:00 AM)JanFromHamburg Wrote: Looks good. Solved? Not yet. Which statement is correct? return $this->main(); return view('main'); or others? The above staetment gets the same result - within a frame. |