Unable to pass parameters to php page after upgrade from php3 to php4

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ravi & Paami

    Unable to pass parameters to php page after upgrade from php3 to php4

    After I tried upgrading my php version from 3 to 4, all my code which passes
    parameters between web pages have stopped working. Not sure what the problem
    is. Have tried defining the parameters in the accepting php page with a
    '$_GET["parameter_name "]; and also a $_REQUEST["parameter_name "]; but with
    no luck. Even tried Globals without any luck.

    Below is an eg. of what I am trying to do..
    ------------------------
    From an html page, - 'eg1.html', I am attempting to call a php page via an
    <a href> link. Below is the code for it..

    <a href="DirDisp.p hp?dirName=Tria l&year=2003">Tr ial</a>

    In the DirDisp.php file, - I normally just have
    $dirName = addslashes($dir Name);
    $year = addslashes($yea r);

    but since this didnt work in php4, tried..
    $_GET["dirName"];
    also tried ..
    $_REQUEST["dirName"];

    but nothing worked.
    ------------------------
    Before the upgrade this code and all others used to work fine. Even now,
    when I go back to php 3, this code works just fine. But the moment I modify
    the apache file httpd.conf to point to php4 and not php3, this code ceases
    to work.

    On trying to print out the value for the parameter, (in this case 'dirName'
    & 'year'), I get nothing. What am I doing wrong? Any help on this issue will
    be greatly appreciated.

    Thanks

    Ravi






  • M

    #2
    Re: Unable to pass parameters to php page after upgrade from php3 to php4

    Hi Ravi,

    Try this to see what is being passed.

    print_r($_POST) ;
    print_r($_GET);

    Use single quotes.

    if (isset($_GET['parameter_name ']))
    {
    $MyParameter = $_GET['parameter_name '];
    }

    Martin

    "Ravi & Paami" <ravipaami@hous ton.rr.com> wrote in message
    news:n5nMb.4380 3$WS1.5628@fe1. texas.rr.com...[color=blue]
    > After I tried upgrading my php version from 3 to 4, all my code which[/color]
    passes[color=blue]
    > parameters between web pages have stopped working. Not sure what the[/color]
    problem[color=blue]
    > is. Have tried defining the parameters in the accepting php page with a
    > '$_GET["parameter_name "]; and also a $_REQUEST["parameter_name "]; but with
    > no luck. Even tried Globals without any luck.
    >
    > Below is an eg. of what I am trying to do..
    > ------------------------
    > From an html page, - 'eg1.html', I am attempting to call a php page via an
    > <a href> link. Below is the code for it..
    >
    > <a href="DirDisp.p hp?dirName=Tria l&year=2003">Tr ial</a>
    >
    > In the DirDisp.php file, - I normally just have
    > $dirName = addslashes($dir Name);
    > $year = addslashes($yea r);
    >
    > but since this didnt work in php4, tried..
    > $_GET["dirName"];
    > also tried ..
    > $_REQUEST["dirName"];
    >
    > but nothing worked.
    > ------------------------
    > Before the upgrade this code and all others used to work fine. Even now,
    > when I go back to php 3, this code works just fine. But the moment I[/color]
    modify[color=blue]
    > the apache file httpd.conf to point to php4 and not php3, this code ceases
    > to work.
    >
    > On trying to print out the value for the parameter, (in this case[/color]
    'dirName'[color=blue]
    > & 'year'), I get nothing. What am I doing wrong? Any help on this issue[/color]
    will[color=blue]
    > be greatly appreciated.
    >
    > Thanks
    >
    > Ravi
    >
    >
    >
    >
    >
    >[/color]


    Comment

    Working...