need help

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

    need help

    i have always used this code to manage a varable send to index:
    <?php
    if ($p != "") {
    include("conten t".$p.".htm" );
    } else {
    include("main.h tm");
    }
    ?>

    When i tried to run this code in a website on a new webhost it won't work...

    When i click on a link in the menu that sends a variable back to index,
    nothing happends it seems that the variable doesn't get a value.

    this webhost use php ver 4.3.4, the other webhost i use have php 4.1.2.

    Have php changed or is this something the webhost have to look into?

    any help appreciated

    thanx


  • Jon Kraft

    #2
    Re: need help

    "kh" <khage@start.no > wrote:
    [color=blue]
    > i have always used this code to manage a varable send to index:
    > <?php
    > if ($p != "") {
    > include("conten t".$p.".htm" );
    > } else {
    > include("main.h tm");
    > }
    > ?>
    > Have php changed or is this something the webhost have to look into?[/color]

    PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.


    HTH;
    JOn

    Comment

    • Matthias Esken

      #3
      Re: need help

      "kh" <khage@start.no > schrieb:
      [color=blue]
      > i have always used this code to manage a varable send to index:
      > <?php
      > if ($p != "") {
      > include("conten t".$p.".htm" );
      > } else {
      > include("main.h tm");
      > }
      > ?>
      >
      > When i tried to run this code in a website on a new webhost it won't work...[/color]

      There have been some changes to the default settings of PHP and there
      was a very good reason for this. Read the information Jon gave you and
      have a look at the superglobals in the documentation. For a quick fix,
      just add

      $p = isset($_GET['p']) ? $_GET['p'] : '';

      before your first line of code.

      Regards,
      Matthias

      Comment

      • kh

        #4
        Re: need help

        anyone have a script that do what i have described in this mail? Is there an
        other simple solution?

        kh

        "Jon Kraft" <jon@jonux.co.u k> skrev i melding
        news:Xns9498768 AEAEF4jonjonuxc ouk@130.133.1.4 ...[color=blue]
        > "kh" <khage@start.no > wrote:
        >[color=green]
        > > i have always used this code to manage a varable send to index:
        > > <?php
        > > if ($p != "") {
        > > include("conten t".$p.".htm" );
        > > } else {
        > > include("main.h tm");
        > > }
        > > ?>
        > > Have php changed or is this something the webhost have to look into?[/color]
        >
        > http://uk.php.net/manual/en/tutorial.oldcode.php
        >
        > HTH;
        > JOn[/color]


        Comment

        • kh

          #5
          Re: need help

          snip...[color=blue]
          > $p = isset($_GET['p']) ? $_GET['p'] : '';
          >
          > before your first line of code.
          >
          > Regards,
          > Matthias[/color]

          thanx, that solved the issue

          kh


          Comment

          Working...