PHP Making a local directory point to a web directory |
[eluser]Krisando[/eluser]
Hello people I'm trying to modify a local location of a directory and replace it with a web link. The tiny code is: Code: server_path = "c:\ots\" I've tried: Code: server_path = "http://localhost/" No luck so far linking to a web directory =[
[eluser]umefarooq[/eluser]
have u load database library, if not just go in config/autoload.php in libraries put database it will work fine.
[eluser]Krisando[/eluser]
Hmm thats above my level something as simple as that =/ Is this in the webserver file? I've found something called "autoloader.php" in my web server folder is that the same file?
[eluser]umefarooq[/eluser]
no in you CI folder system/applications/config/autoload.php file just edit it. or in your controller function call this. $this->load->database(); it will load database library. check this link http://ellislab.com/codeigniter/user-gui...mples.html
[eluser]Krisando[/eluser]
I've tried: Code: public function load($id) Still seems to be erroring, i've probably done something wrong. If i can turn this local directory: server_path = "c:\ots\" Into a http web one then I can fix my problems by linking to the corrent files directly.
[eluser]umefarooq[/eluser]
try this in your code just simple Code: $this->db->query("select id,password,email,blocked from accounts where id = $id");
[eluser]slowgary[/eluser]
This thread confuses me (so much does these days). Krisando, your question is about paths or folders (or links/symlinks) or something similar, but umefarooq - your suggestion is autoloading the CI database library. I could be missing something, but this seems like 2 people sitting in a room, each having a conversation about something totally unrelated, yet taking turns as if they were talking to eachother. I need to lay off the rocks. Anyways, have you figured out a solution to your problem Krisando? What is it exactly that you're trying to do? Are you configuring a server? What OS are you using? If you're using Linux, you may be able to create a symlink to solve your problem. You say you're trying to link to a "web directory" but the address you've included is localhost, which would actually be a local directory. Can't you just type in the directory that localhost is serving? I hope I haven't added any confusion to this thread. ;-P
[eluser]umefarooq[/eluser]
before krisando put this query in first thread i think he modified it. Code: $this->data = $this->db->query('SELECT ' . $this->db->fieldName('id') . ', ' . $this->db->fieldName('password') . ', ' . $this->db->fieldName('email') . ', well really strange. |
Welcome Guest, Not a member yet? Register Sign In |