Viewing 7 replies - 1 through 7 (of 7 total)
  • https://bdeas.com/marketplace

    make new directory “marketplace” and put mk.php there.

    Thread Starter jiungusa

    (@jiungusa)

    Then it doesn’t load in the original page that calls the php but,
    https://bdeas.com/marketplace
    but just shows the directory.

    I need a way to place the php file or call the php file so that when /marketplace needs it, I can give it.

    If you put in root directory where wordpress installed,
    how about:

    <form action=”<?php ABSPATH ?>/mk.php” method=”get”>

    It will goes to: https://bdeas.com/mk.php

    Thread Starter jiungusa

    (@jiungusa)

    I get a Oops! That page can’t be found.
    It looks like nothing was found at this location. Maybe try one of the links below or a search?
    error again.

    This was where it redirected to https://bdeas.com/marketplace/%3C?link=test&submit=Send

    Still /marketplace.

    This was what I used. <form action="<?php ABSPATH ?>/mk.php" method="get">

    Put it the theme root and try this:

    <form action="<?php get_stylesheet_directory_uri() . '/mk.php'; ?>" method="GET">

    An even better way would be the following:
    In template:

    <form action="" method="get">
      <input type="hidden" name="jiungusa_form_nonce" value="<?php echo wp_create_nonce('jiungusa_form_nonce');?>">
    
    <!-- Rest of Form -->
    </form>

    In functions.php

    add_action( 'init', function() {
      if( ! empty( $_REQUEST['jiungusa_form_nonce'] ) ) {
        require_once( 'mk.php' );
      }
    });

    Thread Starter jiungusa

    (@jiungusa)

    What do you mean by “theme root” and “in template”

    I get functions.php but I don’t get the rest.

    The theme root is where you theme functions.php, index.php, and style.css are. The template is where you place the <form> code.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘PHP File Redirection 404 Error’ is closed to new replies.