Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Vanilla PHP Page

Hi, I'm a new user with a vanilla forum installed, I want know how can create a php page with Vanilla? I need get user info for work with a form in php.

Sorry for my bad english.

Tagged:

Comments

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    Not sure what you are trying to achieve, but maybe looking at those 2 examples could help:

    http://vanillaforums.org/addon/howtovanillapage-plugin
    http://vanillaforums.org/addon/howtoformvalidate-plugin

  • Options
    edited June 2015

    Thanks I create a page with custom pages plugin, hmm how show a message only for guests? I have this:

    <?php if (!defined('APPLICATION')) exit(); ?> <?php /*---------------- show only for users ----------------------- */ if(Gdn::Session()->UserID < 1) throw NotFoundException(); /*--------------------------- ------------------------- */ $Session = Gdn::Session(); echo '<pre>'; print_r($Session); echo '</pre>'; ?> <h1>Form</h1>

    I dont want show:

    Whoops!

    Page not found.

  • Options
    R_JR_J Ex-Fanboy Munich Admin
    edited June 2015
    <?php if (!defined('APPLICATION')) exit();
    
    $Session = Gdn::Session();
    
    // Redirect guests to another custom page
    if (!$Session->IsValid()) {
        Redirect('/another_custom_page_you_have_to_create_for_that_purpose');
    }
    
    // Output of decho is only visible for admins
    decho($Session);
    
    ?>
    
    <h1>Form</h1>
    

    Seems like you plan to create the form with the html knowledge you have. You should try using Vanillas form builder.

Sign In or Register to comment.