if($this->page->add_blog_post($post_title, $post_author, $post_content, $file_name))
{
http_response_code(200);
echo "The blogpost was successfully added to the database.";
}
When I return that to a div:
$(responseMessages).text(response);
Everything works fine! However when I try to get the response in a alert box:
window.alert(response);
the insert is ok but I get all kind of extra data returned. How do I get that simple echo from the PHP in a alert box
<br />
<b>Notice</b>: Undefined variable: photo_path in <b>C:\wamp64\www\Flyingparadise\private\includes\classes\Controller\Admin\Page.php</b> on line <b>299</b><br />
<br />
<b>Notice</b>: Undefined variable: i in <b>C:\wamp64\www\Flyingparadise\private\includes\classes\Controller\Admin\Page.php</b> on line <b>302</b><br />
<br />
<b>Notice</b>: String offset cast occurred in <b>C:\wamp64\www\Flyingparadise\private\includes\classes\Controller\Admin\Page.php</b> on line <b>302</b><br />
<br />
<b>Notice</b>: Undefined variable: i in <b>C:\wamp64\www\Flyingparadise\private\includes\classes\Controller\Admin\Page.php</b> on line <b>303</b><br />
<br />
<b>Notice</b>: String offset cast occurred in <b>C:\wamp64\www\Flyingparadise\private\includes\classes\Controller\Admin\Page.php</b> on line <b>303</b><br />
<br />
<b>Notice</b>: Undefined variable: i in <b>C:\wamp64\www\Flyingparadise\private\includes\classes\Controller\Admin\Page.php</b> on line <b>304</b><br />
<br />
<b>Notice</b>: String offset cast occurred in <b>C:\wamp64\www\Flyingparadise\private\includes\classes\Controller\Admin\Page.php</b> on line <b>304</b><br />
<br />
<b>Notice</b>: Undefined variable: new_deskt_path in <b>C:\wamp64\www\Flyingparadise\private\includes\classes\Controller\Admin\Page.php</b> on line <b>304</b><br />
<br />
<b>Notice</b>: Undefined variable: Status in <b>C:\wamp64\www\Flyingparadise\private\includes\classes\Model\Dashboard.php</b> on line <b>208</b><br />
No worries. And indeed, it is most of the time better to take things slow and do them correct than rush it through and having to clean up the mess later.