Forum Replies Created

Viewing 6 replies - 31 through 36 (of 36 total)
  • Thread Starter Tyssen

    (@tyssen)

    I wasn’t looking at the example properly which had the header(“Location: $PHP_SELF”) above the doctype. :/ So I tried splitting the script up with this in my header above the doctype:


    require_once("ak.class.php");

    $arBindings = array("Home"=>array("/index.php", "1"),
    "Search Criteria"=>array("searchcriteria", "4"),
    "Quality Assurance"=>"/services.php",
    "Articles Archive"=>"/articles.php");

    $objAK = new AccessKeys($arBindings);

    if ($_POST)
    {
    if ($_POST["default"])
    {
    $objAK->useDefaults();
    header("Location: $PHP_SELF");
    }
    else if ($objAK->setCookies())
    header("Location: $PHP_SELF");
    }

    and the call that generates the output in my page, but I get a Call to a member function displayOptions() on a non-object error message.
    Trying another script that does the same thing works fine if I create an example outside of WP, but if I try to do it within WP, I get Invalid argument supplied for foreach(). The foreach is working on an array set up inside an include inserted in the header above the doctype etc.

    Thread Starter Tyssen

    (@tyssen)

    Yeah, I saw that, but it seems to refer to problems caused by WordPress files whereas mine, although it resides in my theme folder, is not a WP script. I don’t know much about how headers work in PHP so was wondering if there’s some kinda conflict.

    Thread Starter Tyssen

    (@tyssen)

    Anyone?

    The solution appears to be to remove the form from the_content() of the page or post and include it in the template that calls the page instead. You can either create a new template or use is_page to determine when to include the form.

    Going through and removing all the line breaks and tabs from my HTML helps eliminate most of the errors, but there’s still a couple where tags are being inserted in between tags with no spaces.

    Same problem here. I thought it might have something to do with the editor, but even when I move the form to an include and use the runPHP plugin and call it in that way, it still comes out with extra [p]s and [br /]s.
    It’s only on a contact form I’ve created myself though – the comments form doesn’t have the problem. :/

Viewing 6 replies - 31 through 36 (of 36 total)