header

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alain Dhaene

    header

    Hi,

    I have this problem

    <?php

    $doc = "name";

    $result = "code";

    header('Locatio n: content2.php?do cCode= $doc + resultCode=$res ult');

    ?>

    I have two variabeles (doc and result) i want to pass to content2.php

    There i will get them

    $doc_n = $_GET('docCode' );

    $result_n=$_GET ('resultCode');

    What's wrong with my header?

    Thanks



    Alain



  • Pedro Graca

    #2
    Re: header

    Alain Dhaene wrote:[color=blue]
    > <?php
    > header('Locatio n: content2.php?do cCode= $doc + resultCode=$res ult');
    > ?>[/color]
    [color=blue]
    > What's wrong with my header?[/color]


    Too many spaces; wrong syntax.

    Try (after changing server and path)

    header('Locatio n: http://server.com/path/to/content2.php?' .
    'docCode=' . urlencode($doc) .
    '&amp;resultCod e=' . urlencode($resu lt));
    --
    --= my mail box only accepts =--
    --= Content-Type: text/plain =--
    --= Size below 10001 bytes =--

    Comment

    • Shawn Wilson

      #3
      Re: header

      Alain Dhaene wrote:[color=blue]
      >
      > Hi,
      >
      > I have this problem
      >
      > <?php
      >
      > $doc = "name";
      >
      > $result = "code";
      >
      > header('Locatio n: content2.php?do cCode= $doc + resultCode=$res ult');
      >
      > ?>
      >
      > I have two variabeles (doc and result) i want to pass to content2.php
      >
      > There i will get them
      >
      > $doc_n = $_GET('docCode' );
      >
      > $result_n=$_GET ('resultCode');
      >
      > What's wrong with my header?[/color]

      You should put in the full URL, as some browsers don't support relative urls.
      You should not put spaces in your url. (these will usually work in IE, but NS 4
      work accept them)
      Different variables must be seperated with "&", not "+".
      Your variables should be url encoded.

      Try this:

      header('Locatio n:
      http://yoursite.com/content2.php?do cCode='.urlenco de($doc).'&resu ltCode='.urlenc ode($result));

      Regards,
      Shawn
      --
      Shawn Wilson
      shawn@glassgian t.com

      Comment

      Working...