• Hi, I can’t save any PHP code with $_POST, $_SESSION etc. It just goes to a 404 page when I try to save it. Anyone, know what the issue is? I’m guessing it’s WordPress messing with code submission?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Would you please cross check and let know that the issue persist only when the code contains $_POST, $_SESSION etc?

    Thread Starter phatman

    (@phatman)

    I could insert other basic PHP code like ‘echo’ and it saves fine but anything with $_ and it wouldn’t save it just goes to a 404 page.

    Today the plugin is crashing WordPress so I had to deactivate it. I’m using WordPress 6 and PHP 8

    I can reproduce this,

    <form action=”<?php home_url( $wp->request ) ?>” method=”POST” class=”enter-activity”>
    /// ya da yada ya da

    <select id="userID" name="userID">
                <?php 
                if ($user_info->roles[0] == "administrator"){
                      foreach ($users as $user) {
                        echo "<option value='$user->id'>$user->display_name</option>";

    /// ya da yada ya da

    $newActivityID = isset($_POST[‘userID’]);

    This is a pretty a simple coding job that’s not working, very dissapointing

    WordPress 6.0.2
    Insert PHP Code Snippet (V 1.3.3)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can’t save PHP $_POST code’ is closed to new replies.