WordPress.org

Forums

Short Code of one page executing Short Code present in another page (1 post)

  1. vsramesh
    Member
    Posted 2 years ago #

    I am facing an unexpected issue with short code module in one of my machine. I have created my own login system with one shortcode [sign_in] for signin page and one shortcode [sign_up] for signup page (I used underscore not hyphen in shortcode)

    When i try to open the signup page, the code present in the signin also getting executed (I am destroying all the sessions in signin page when the username in the session is empty). Since i have captcha in my signup page and captcha session variable is getting cleared & so captcha validation is failed.

    But the ui of signin page is not displayed when i am in signup page. it is happening particularly in one machine.

    myplugin/myplugin.php
    ======================

    if (is_admin()) include( WP_PLUGIN_DIR . '/myplugin/admin.php');
    include( WP_PLUGIN_DIR . '/myplugin/signup.php');
    include( WP_PLUGIN_DIR . '/myplugin/signin.php');

    myplugin/signup.php
    ===================

    function signup_form_handler( $args = array() ) {
        if($_POST) {
          //...
        }else{
          require_once('ui/signup.php');
        }
    }
    
    function signup() {
    	return $output =  signup_form_handler($login_form_args);
    }
    add_shortcode("sign_up", "signup");


    myplugin/signin.php

    ===================

    function signin_form_handler( $args = array() ) {
        if($_POST) {
          //...
        }else{
          require_once('ui/signin.php');
            unset($_SESSION);                  <------------- When i am in signup page this part also getting executed......
            session_destroy();
        }
    }
    
    function signin() {
    	return $output =  signin_form_handler($login_form_args);
    }
    add_shortcode("sign_in", "signin");

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum's parser.]

    I hope some one from this forum will help to identify and resolve this issue.

Topic Closed

This topic has been closed to new replies.