How can insert this into the databse after checking with fopen - 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: How can insert this into the databse after checking with fopen (/showthread.php?tid=11523) |
How can insert this into the databse after checking with fopen - El Forum - 09-11-2008 [eluser]phantom-a[/eluser] This is controller that handles a form submission with one field. a field called "url" I use fopen to check if the url the person submitted is valid, then I want insert it into a table called "links" into a field called "submitted_url". How can this be done? I have already the function working except missing the databse part where it inserts it into the table if its a valid url. Code: function submit() How can insert this into the databse after checking with fopen - El Forum - 09-11-2008 [eluser]Sumon[/eluser] Use a model Code: class url_model extends Model{ and use this model in your controller Code: function submit() How can insert this into the databse after checking with fopen - El Forum - 09-11-2008 [eluser]phantom-a[/eluser] That works! Thanks for example. How can insert this into the databse after checking with fopen - El Forum - 09-11-2008 [eluser]phantom-a[/eluser] eh just a thought is there security risks with fopen? I know "r" on it means readonly, but still What if someone submitted http://example.com/trojan.exe would my server download a virus? |