How to insert corporate details into database |
Glad to hear you got it working, could be a web browser caching problem.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Maybe Ive spoken too soon. To achieve the results I want I still need to at least login before I open the 2nd page.
The problem appears to be associated with the cache. Ive tried the following, the 1st gave an error & the 2nd caused a reboot & also a login to get $product displayed. PHP Code: $this->output->clear_path_cache('path/to/clear'); Im not so sure if the path Im heading down is the right one, but so far I cant think of any other. This is what Im doing & trying to achieve. Im firstly uploading photos which have an associated $product name which gets entered into the database table field. That is working OK now. Then immediately after that function finishes it redirects to another page which uploads data by fwrite, and that must have the same $product name. At the moment when the data upload page opens the previous $product name appears which "on the face of it", is not satisfactory. I say "on the face of it", because within the Controller of the data upload I had the following, but deleted it. I was thinking $product could have been transferred without it appearing in the view page. But all of that appears to be disrupting the whole operation. PHP Code: $product = $this->session->userdata('temp_1'); Im now unable to get the data upload to work which stops at mkdir. Im hoping a reboot will fix that. Has anybody got any ideas on how I can transfer or carry forward the $product from one page to another?
try placing this in the top of your view file.
PHP Code: <?php If it's a caching problem that should fix it. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(11-24-2020, 06:13 PM)InsiteFX Wrote: try placing this in the top of your view file. It obviously is a caching problem but your code snippet didnt change anything. Everything is working now except the data upload page does not display the $product immediately. I need to re-login then it displays. In the Login Controller there is this; PHP Code: $data = array('user_id' => $result->user_id, 'date_reg' => $result->date_reg, 'user_name' => $result->user_name, 'pass_word' => $result->pass_word, 'first_name' => $result->first_name, 'last_name' => $result->last_name, 'country_territory' => $result->country_territory, 'temp_1' => $result->temp_1); Ive tried inserting that into the data upload Controller but it gives an error. Im tending to think the system needs to be logged in automatically similar to what I tried to do. Do you know how?
You need to create an remember me cookie with a hash code to login the user automatically.
Your best bet would be to download and take a look at how Myth/Auth is doing it. It has a Config file that has a remembering switch it it to turn it on or off etc.; CodeIgniter 4 - Myth:Auth What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(11-25-2020, 01:39 PM)InsiteFX Wrote: You need to create an remember me cookie with a hash code to login the user automatically. Still using CI3. There is a "Dont Remember Me" in the system but was intending to figure it out closer to when going online. The system times out if left idle then if there is an attempt to open a page it reverts to the login page. Im testing in Edge with username & password loaded into a cookie. So when testing doesnt work all that needs to be done is open the login page, login then retest. I was hoping the data upload Controller could do the re-login.
These where the top 3 CodeIgniter 3 Auth Libraries that where used.
CodeIgniter 3 - Top 3 Codeigniter Authentication Libraries What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(11-25-2020, 03:55 PM)InsiteFX Wrote: These where the top 3 CodeIgniter 3 Auth Libraries that where used. Interesting site but Im trying to keep things simple. I have a simple login process but due to the problem I have I just want to advance it a little. I will keep playing with the coding I submitted earlier.
Ive found the problem. When uploading data with photos you must keep separate in form_validation the data from photos. Just make two separate form_validations.
|
Welcome Guest, Not a member yet? Register Sign In |