Welcome Guest, Not a member yet? Register   Sign In
Simple chat facility - if file exists not working
#5

(06-22-2020, 11:02 AM)jreklund Wrote: @christaliise: What exactly dosen't work? It dosen't find the file?

This are the correct way of building a path.
PHP Code:
APPPATH.'views'.DIRECTORY_SEPARATOR.'john'.DIRECTORY_SEPARATOR.'chris'.DIRECTORY_SEPARATOR.'chat'

redirect will however not work, unless you have a controller that's named chris.

Thanks jreklund.

I want first a search for the file, if it is found, then redirect, to 'chris/john/chat' (keep in mind it is chris that is logged in) page where the previous conversations will be exposed. That does not work as it redirects whether or not the file exists.

If the file is not found then it creates the 'chris/john/chat' & 'john/chris/chat' Controllers & view pages. The conversations can begin. That part I have working but it needs attention particularly in the variables for example.
PHP Code:
$lcuser $this->session->userdata('user_name');
$ucuser ucfirst("$lcuser"); 

redirect is not a problem. Yes, I have Controllers for all the pages, for example Controllers for "Chris/Chat", "John/Chat", "Chris/John/Chat, & John/Chris/Chat.

I dont understand your "correct way of building a path"? Can you explain?

I guess by "DIRECTORY_SEPARATOR" you mean forward slash? [/]. But I notice your full stops & single quotes ['.].

When doing a fwrite I use double quotes, spaces & full stops [" . ].
Reply


Messages In This Thread
RE: Simple chat facility - if file exists not working - by christaliise - 06-22-2020, 12:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB