CodeIgniter Forums

Full Version: If no value is entered...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Drayen[/eluser]
I've tried using "isset" and "empty" and neither seem to work. I just want to load a separate page if no value is entered. Thanks for any help.

Code:
if (!empty($_POST['queryphrase'])){$this->load->view('searchresults');}
    else{
    whatever...
    }

El Forum

[eluser]Tom Schlick[/eluser]
if($this->input->post('queryphrase') != '')
{
do the good stuff
}
else
{
do the bad stuff
}

El Forum

[eluser]Drayen[/eluser]
[quote author="trs21219" date="1232710750"]if($this->input->post('queryphrase') != '')
{
do the good stuff
}
else
{
do the bad stuff
}[/quote]

tyvm