Forum Replies Created

Viewing 9 replies - 16 through 24 (of 24 total)
  • Thread Starter jpizzolato

    (@jpizzolato)

    Thanks Samuel.. that’s what I wanted.

    Thread Starter jpizzolato

    (@jpizzolato)

    I will post my original issue in the Plugins and Hacks Forum. Because I totally deleted the plugin I don’t know what version I was using. However, I can tell you that I installed it from the Word Press Plugins on the dashboard only a few weeks ago, so the version should be the current version or whichever version offered from that download.

    Thread Starter jpizzolato

    (@jpizzolato)

    Yes, it is a serious bug. I had hoped someone from the WP-eCommerce plugin would answer this post, but no one has.

    If you get an answer please let me know and I will do the same.

    Thread Starter jpizzolato

    (@jpizzolato)

    MORE INFO

    It appears that this is not a php and mysql issue, but a WordPress issue. What follows below after the “**” is the entire code. It is in a WordPress Page. The Page doesn’t have anything else in it except what you see. The bazaar thing about this is the WordPress website in question is hosted by GoDaddy. I duplicated this same exact test and same exact table in a HostGator hosted WordPress website. The HostGator test was fine. It only inserted 1 row, as it should. The GoDaddy test is putting out 3 rows. To me there has to be something different in how WordPress is defined.

    It looks like the WordPress Page is being executed multiple times on the GoDaddy site, which explains why there are multiple inserts. But, I only see “Insert is good” and “outside of if” displayed ONE time, which doesn’t make much sense.

    I called GoDaddy support but they weren’t any help.

    However, I did get around this problem by moving the actual Insert out of the WordPress Page and into a PHP file located in a folder on the server. Using the “require_once” and passing data through a database, I solved my problem of multiple inserts. But this problem is truly bazaar.

    ******************************
    $RidSTATIC=”5″; $UserName=”jpizzolato”; $RequestArea=”new test from phptest3″;

    $InsertReqQuery=”insert into request(RidSTATIC,UserName,RequestArea)Values(‘$RidSTATIC’,’$UserName’,’$RequestArea’)”;

    $InsertReqResult=mysql_query($InsertReqQuery);
    if($InsertReqResult)
    {
    ?>
    <p><font color=”#FFFFFF”>insert is good</font></p>

    <?php
    }
    ?>
    <p> outside of if </p>

    Thread Starter jpizzolato

    (@jpizzolato)

    Ipstenu, thank you for your support and suggestions. The code I supplied you is just an example, and a very simplistic example at that, of what I’m trying to accomplish. The actual code consists of many nested IFs because of my inability to get the dynamic re-direct to work. Aside from the Username there are other tests the program has to make.

    I will look over the documentation you suggested, as well as read up on using Page Templates to accomplish what I’m trying to do. Can you suggest a good documentation on how to use Page Templates for this purpose?

    Thanks again.

    Thread Starter jpizzolato

    (@jpizzolato)

    Thank you for looking at it. What follows is a very simplistic example of what I’m trying to do. I got an error on the Header statement and the wp_die() also received an error. The Page name is “key-code”. If someone brings up the key-code page from the menu, I only want them to receive the codes, IF they are logged in, otherwise I want to return the WordPress Login Page and kill the process. See below

    Is there another way of transferring control from a WordPress Page to another Page or Website??

    Page “key-code”

    <?php
    global $current_user;
    if ( isset($current_user) ) {
        $UserName=$current_user->user_login;
    }
    
    if ($UserName!="")
        {
        header("location:https://www.abc.com/login");
        wp_die();
        }
    
    echo "key is 123JKP";
    echo "alternate key is 876GHI";
    
    ?>

    I received a “Headers already sent” message and there was an error on the wp_die() command:

    Warning: Cannot modify header information – headers already sent by (output started at /home/jpwebdev/public_html/wp-content/themes/Polished/header.php:2) in /home/jpwebdev/public_html/wp-content/plugins/php-execution-plugin/includes/class.php_execution.php(273) : eval()’d code on line 9

    Warning: Missing argument 1 for wp_die(), called in /home/jpwebdev/public_html/wp-content/plugins/php-execution-plugin/includes/class.php_execution.php(273) : eval()’d code on line 10 and defined in /home/jpwebdev/public_html/wp-includes/functions.php on line 2682

    Thread Starter jpizzolato

    (@jpizzolato)

    No I am not looking to redirect a specific page. I am looking to redirect FROM a page when certain situations are met.

    I am using the plug-in exec-PHP which makes it possible to turn a WordPress page into a PHP file. So when the page is executed, say from a menu, its actually executing a PHP file. The first line of the WordPress page is actually <?php with the page being a combination of php code and html code.

    During execution of an “IF” statement I want to branch off to either another WordPress Page or an external website and then die() or exit;

    I am trying to redirect the page using the
    header(‘Location: https://www.xxxxx.com&#8217;); statement but I am getting the following error:

    Cannot modify header information – headers already sent by (output started at /home/jpwebdev/public_html/wp-content/plugins/all-in-one-seo-pack/aioseop.class.php:221) in /home/jpwebdev/public_html/wp-includes/pluggable.php on line 897

    Is there a way to re-direct the flow from the current WordPress Page or is this something you can’t do?

    WordPress also does not like the die() or exit; statement. All I get is a blank screen whenever a die() or exit; is executed.

    Thanks for your help

    Thread Starter jpizzolato

    (@jpizzolato)

    Thanks for the information. I’m not looking to always re-direct a specific page as these solutions do.

    I am coding PHP code within a WordPress Page (exec-PHP plugin) and under certain situations I want to redirect from the WordPress page to an external page or to a different WordPress Page.

    The header(‘Location: https://www.xxxxx.com&#8217;); that you would normally use in a PHP program to redirect isn’t working and neither is the exit; or die() statements.

    Thread Starter jpizzolato

    (@jpizzolato)

    My mistake .. it uses the photos in the Gallery folder for the Zooming in.

Viewing 9 replies - 16 through 24 (of 24 total)