![]() |
tell a friend project - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: tell a friend project (/showthread.php?tid=27757) |
tell a friend project - El Forum - 02-19-2010 [eluser]kierownik[/eluser] Hi all, I started a project with codeigniter to get familiar with it so I choose to make a tell a friend controller and view. Now I do not want to use a database and keep it flatfile based. Now I know how to write the time to my log-file but it seems it does not get updated. Could someone tell me what I am doing wrong! If you have any remarks on the coding side I love to hear it, I am here to learn to program correctly. The Code: Controller: tell_a_friend.php http://www.pastebin.com/f718db868 View: tell_a_friend_view.php http://www.pastebin.com/f2f6af688 I Could not post the code here, it was to long I think. Thanks, tell a friend project - El Forum - 02-20-2010 [eluser]kierownik[/eluser] Nobody :long: Now I was thinking in using just one file and make an array in that file. Code: $tellafriend = array( What would the best approach be to get the best result. I hope someone can help me. tell a friend project - El Forum - 02-20-2010 [eluser]SpooF[/eluser] I would use a single file, store each record on its own line in the format: {name|email|friendemail|ip}, you dont even need to place them on there own lines. Then to get your results you can simple read the file and use a preg match to find the information you need. Or do it via XML, which would probably be the better solution. tell a friend project - El Forum - 02-20-2010 [eluser]kierownik[/eluser] I will look into that thank you. I do not have any clue how to do it but I am going to try it. tell a friend project - El Forum - 02-21-2010 [eluser]slowgary[/eluser] The easiest way might be to create a multidimensional array just as you have, and use PHP's serialize() function to turn the array into a string, then store it to file. To retrieve it, just read in the string and unserialize() it. Easy. tell a friend project - El Forum - 02-24-2010 [eluser]kierownik[/eluser] I now made one that uses a database. I will now try to make one that is flatfile based. I will try to use the suggestions that you all made. tell a friend project - El Forum - 03-06-2010 [eluser]kierownik[/eluser] I have submitted my script to the wiki. The page can be found here: http://codeigniter.com/wiki/tellafriend/ tell a friend project - El Forum - 03-14-2010 [eluser]kierownik[/eluser] Updated the script to include jquery and using ajax to send calls to the database and validation. Get the script here: Wiki Page tell a friend project - El Forum - 03-14-2010 [eluser]kierownik[/eluser] Updated the script to fix an // Fixed an Undefined variable: data on line 77 Get the script here: Wiki Page tell a friend project - El Forum - 06-23-2010 [eluser]zibstefan[/eluser] add $this->output->enable_profiler(FALSE); to the method ajax_index() |