1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Form result error

Discussion in 'XenForo Development Discussions' started by Lu Jia, May 22, 2011.

  1. Lu Jia

    Lu Jia Active Member

    Code:
    Server Error
    
    Undefined index: group_name
    
    XenForo_Application::handlePhpError() in ExternalPages/ControllerPublic/En/Creategroupgo.php at line 7
    ExternalPages_ControllerPublic_En_Creategroupgo->actionIndex() in XenForo/FrontController.php at line 310
    XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
    XenForo_FrontController->run() in /var/www/vhosts/domain.com/httpdocs/index.php at line 17
    this error will appear if i try to directly go in the form result's page, by-passing the form page, i want to know if it's possible to force users to go in form's page

    I tried a if ($_POST['group_name'] == NULL) {
    echo "go to form page";
    } else {
    form output code
    }

    but it doesn't work :(
    thanks in advance
     
  2. ragtek

    ragtek Guest

    PHP:
    if ($this->_request->isPost()) {
              .. do 
    something
    }
    else{
                 return 
    $this->responseView('foo''bar', array());
            }
     
    Lu Jia likes this.
  3. Lu Jia

    Lu Jia Active Member

    thanks! it works great!
    Is it possible to do it with templates too like <xen:if> <xen:else />?
     
  4. ragtek

    ragtek Guest

    AFAIK not, but that's really something that shouldn't be in the template!
     
  5. Lu Jia

    Lu Jia Active Member

    I fixed it by myself :) just rename 'foo' 'bar' with existing template :D
     
  6. Lu Jia

    Lu Jia Active Member

    PHP:
    if ($this->_request->isGet()) {
              .. do 
    something
    }
    else{
                return 
    $this->responseView('foo''bar', array());
            }
    how can I do it works with method GET too?
     

Share This Page