Welcome Guest, Not a member yet? Register   Sign In
Blog
#1

models/blog_model.php

PHP Code:
public function insert_blog()
 
       {
 
               $this->title    $_POST['title']; // please read the below note
 
               $this->content  $_POST['content'];
 
               $this->date     time();

 
               $this->db->insert('blog'$this);
 
       


Hello,

I am learning how to create blog but I do not understand the code: 

PHP Code:
               $this->title    $_POST['title']; // please read the below note
 
               $this->content  $_POST['content']; 

$_POST['title'];  where does $_POST ['title'] comes from ?  why using $_POST?  Is it taken from view/ inputting entry of title or content ?

Thanks in advance.
" If I looks more intelligence please increase my reputation."
Reply
#2

Every single one of your threads is asking PHP-101 questions, showing that you have absolutely no idea what you are doing. Please learn basic PHP first.
Reply
#3

I want to give you the suggestion to take lesson from w3schools. They have mention every single parts of PHP part by part. You will learn basic PHP from there.
Reply
#4

Yes, I have learn php for 3 years. but CI for only several months. I know where to use $_POST in php context. But when you move it to CI I start to doubt it.

Usually is for forms. Is this the same way?

Can you take forms in views/blog_view.php and input it in models/blog_model.php ?

Thanks.
" If I looks more intelligence please increase my reputation."
Reply
#5

DON'T take lessons from w3schools.

Use something like Codecademy (https://www.codecademy.com/learn/php).
Reply
#6

(04-19-2016, 07:18 PM)davy_yg Wrote: Yes, I have learn php for 3 years.  but CI for only several months.  I know where to use $_POST in php context.  But when you move it to CI I start to doubt it.

You are either lying or programming is simply not for you, and I do mean that completely seriously.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB