Welcome Guest, Not a member yet? Register   Sign In
CI4 controller can't 'see' a GET parameter
#1

(This post was last modified: 02-06-2020, 06:21 PM by Ged.)

the form:

Code:
<form action="/news/create">

    <label for="title">Title</label>
    <input type="input" name="title" /><br />

the link:

https://df2.pennyjack.co.uk/news/create?...+news+item
[url=https://df2.pennyjack.co.uk/news/create?title=test+title&body=this+is+a+test+body&submit=Create+news+item][/url]
the check code:

PHP Code:
public function create()
 {
helper('form');
$model = new NewsModel();

var_dump($this->request->getVar('body'));
echo 
'<br>';
var_dump($this->request->getVar('title'));

//die(); 

the result:


PHP Code:
string(19"this is a test body"

NULL 


It can see the body but not the title.  Any idea?

Thank you
Reply


Messages In This Thread
CI4 controller can't 'see' a GET parameter - by Ged - 02-06-2020, 11:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB