Welcome Guest, Not a member yet? Register   Sign In
  Storing email copy
Posted by: El Forum - 07-13-2008, 11:15 AM - Replies (6)

[eluser]minoflow[/eluser]
I'm building a site where I have a few functions in my controller that send out emails. One for example will send an email if someone forgets their password. The email will contain their password as well as information about their account pulled from the database.

Everything works great, my only issue is that I don't like having all of the email's subject copy in my controller. Is there a way to take the copy and store it in a separate file? I've tried creating a config file, the problem was that the variables in the email subject were not being recognized and were throwing errors.

It seems like a language file would make the most sense but I might run into the same problems with the variables.

Any thoughts or ideas?


  (Solved)Securely storing and retrieving images
Posted by: El Forum - 07-13-2008, 11:15 AM - Replies (3)

[eluser]markanderson993[/eluser]
Alrighty well I have created an uploading system where upon signing up a user gets a unique folder 40 characters long created for them in an uploads folder. Here is my folder schema.

System
Uploads
Htdocs

Is it a good practice for the uploads folder to be outside the htdocs folder and is it a good practice for each user to get their own folder? If there is any conventional way to organize images and retrieve them(serving them from a php file so as to protect the original location and thwarting bandwidth thieves) could someone please point me in the right direction?


Any help would be greatly appreciated

Thanks,
Mark


  Need help on URL and search
Posted by: El Forum - 07-13-2008, 11:15 AM - Replies (4)

[eluser]cbmeeks[/eluser]
I'm looking to run a small search engine on my site.

Anyway, I want the user to simply type some words in a search box and click submit. The action form is set to GET instead of POST.

This makes the URL look like:

example.com/search/q?search=amiga+computers

My problem is that I can't seem to get my function "q" that is in my "search" controller to grab the search string "amiga+computers".

I imagine it's because I don't have query strings enabled.

I would settle for something like:

example.com/search/q/amiga+computers

But how do I get my input html to send the data like that? Is URL routing my answer?

Thanks!


  Newbie: Best methods for working with Multiple Images
Posted by: El Forum - 07-13-2008, 10:13 AM - Replies (6)

[eluser]ywftdg[/eluser]
Sorry if this very newbie level, but I am trying to find the best way to approach working with say multiple images in CI. I am working on portfolio site for a client (architects), and I have id,title,body, and images value for the database table projects. In the past I would store the image paths(comma separated) in my table. Then in the front end explode the array and loop through to spit them out. I am wondering if anyone has any better solutions, thoughts on this. The portfolio projects could range from having 1 image to maybe 20 images, so its different from post to post.

Alternate idea I had: read a directory (for that post id) for the images? So store a directory path instead o the actual image paths?

Curious what solutions anyones come up with or think works the best...


  Simply can't get .htacces to work..
Posted by: El Forum - 07-13-2008, 09:58 AM - Replies (6)

[eluser]Buch[/eluser]
Heya,

I've been trying every .htacces example availible on the forums and tried them all but still I can't get my images to work but my css on the other hand works rather fine (some small problem with body).

My build.

Code:
- Ci Folder
   - system
       - application and all that.
   - assets
       - images
       - css
       - js
When linking from within a view file I use
/assets/images/imagehere.png

And exactly the same with my Css but my css work partially when linking this way.
/assets/css/stylehere.css

The current .htaccess file I ended up with so my http://ci.mysite.com/ works without errors displaying is -->

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

But I really don't get why this should be such a big problem I just want it to work Sad
And I don't want to end up hard coding all the links :/


Best Regards
Kasper


  Problems with sessions
Posted by: El Forum - 07-13-2008, 08:30 AM - Replies (1)

[eluser]old_guy[/eluser]
I'm having a problem getting the sessions function to work properly. I have a login function that checks for login info and then sets a session value (I'm storing session info in a database) as follows:

function login()
{
$this->load->model('check_login');
$data = $this->check_login->ck_name();
$id = $data;
if ($id > 0)
{
$newdata = array('status' => 'ok');
$this->session->set_userdata($newdata);
$this->home();
}else{
$this->login_error();
}
}

When I run the above I get this error message "Message: Undefined property: Start::$session" which I assumed was because I didn't load the session library.

But, when I load the sessions library ($this->session->library('session') prior to the set_userupdate I get the following error "Message: Cannot modify header information - headers already sent by..."

Could use some help understanding this....thanks!


  $this->upload->data() problem
Posted by: El Forum - 07-13-2008, 06:24 AM - Replies (3)

[eluser]Mitja[/eluser]
I want to use $pluspayment_uploads['orig_name'][$i] but i have problem becouse CI function $this->upload->data() does not recognize multiple photos. I get error like

Message: Uninitialized string offset: 0 and 1
Filename: controllers/admin.php

this line: 'title_photo' => $pluspayment_uploads['orig_name'][$i]


Code:
if($_FILES['pluspayment_title_photo']['name'][$i] != '')
{
$pluspayment_uploads = $this->upload->data();
                            
$data_insert_polje = array(
     'arrangement_event_id' => $new_id ,
     'number_of' => $_POST['pluspayment_number_of'][$i] ,
     'price_eur' => $_POST['pluspayment_price_eur'][$i] ,
     'title' => $_POST['arrangement_pluspayment'][$i] ,
     'description' => $_POST['pluspayment_description'][$i] ,
     'title_photo' => $pluspayment_uploads['orig_name'][$i]
);
                        
$this->db->insert('arrangement_pluspayment', $data_insert_polje);    
}

any idea how to fix that?


  How to take backup of whole website
Posted by: El Forum - 07-13-2008, 04:43 AM - Replies (2)

[eluser]Unknown[/eluser]
Hi,
I am new bee to CI, please help me to take backup of my website.
I used zip class too but not much help.

Thanks in advance...


  A HUGE WTF?????? with CI!!!
Posted by: El Forum - 07-12-2008, 08:01 PM - Replies (9)

[eluser]cbmeeks[/eluser]
Ok, for the last 2 HOURS I could not get a basic install of CI to work. I've done it a ZILLION times.

But this time, I kept getting 500 errors.

I am using Arch Linux and normally I always install with this directory structure:

/home/httpd/system
/home/httpd/html/index.php

The index.php is the only file (other than .htaccess) that is in the web root. This works.

Well, I needed to work from my home directory because I've got Samba running on the machine. So, I installed CI (from a FRESH install of Arch) to:

/home/cbmeeks/projects/system
/home/httpd/html/index.php

The index.php was pointing to the correct /home/cbmeeks/projects/system path.

This did NOT work! Seriously, I spent 2 hours trying to get it to work. PHP was working (via phpinfo), apache was working. I restarted, rebooted, etc. I've done this before...at least I think I have.

But anyway, why would that not work?

Thanks

cbmeeks


  Applications built on CI with source code.
Posted by: El Forum - 07-12-2008, 07:51 PM - Replies (7)

[eluser]loathsome[/eluser]
Hello,

Does anybody know of some good CI applications whose source code is made available to look at? I'm interested in this due to learning purposes.

I already know about Bamboo :-) If you have an application you've coded yourself, feel free to share it - please.

Many thanks.


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Latest Threads
Array to HTML "Table"
by paulkd
4 hours ago
TypeError when trying to ...
by b126
5 hours ago
Webhooks and WebSockets
by InsiteFX
Yesterday, 10:39 AM
Retaining search variable...
by pchriley
Yesterday, 05:46 AM
Reading a session variabl...
by xanabobana
Yesterday, 05:05 AM
Update to v4.5.1, same us...
by kenjis
04-17-2024, 07:47 PM
Codeigniter 4 extend core...
by Semsion
04-17-2024, 05:08 AM
v4.5.1 Bug Fix Released
by lokman
04-16-2024, 02:12 PM
problem with textarea
by Nitin Arora
04-16-2024, 05:07 AM
Showing pdf on browser
by aarefi
04-16-2024, 04:38 AM

Forum Statistics
» Members: 84,554
» Latest member: krystal-magic-world
» Forum threads: 77,558
» Forum posts: 375,896

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB