Results 1 to 7 of 7
  1. #1

    sending a varriable value within url

    Hi

    I have been using a script for a while which used to send a value to the processing page, all of a sudden its stoped working on all my site..

    this how i use the code


    http://www.mysite.com/process_the_va...datatosend.com

    basically i'm sending a url to the processing page..

    but for some reason it don't work now...


    so to see if the variable "site" is set to what i want , i made a test file, with just this in it

    <?

    echo 'test ' .$site. ';

    ?>

    and all it returns is test..

    can you lot thing what could be the reason..

    this code has been working for over a year on 4-5 sites

    not its not working on any..

    as far as i can tell i have pinned it down to the reason the value of "site" is not being send to the processing page


    would be greatful for any advice and help

    thanks

  2. #2
    try this :

    PHP Code:
    <?php
    $site 
    $_GET['site']; 
    echo 
    'test ' .$site'';
    ?>
    Cheap web hosting
    Any CMS pre-installed
    Joomla Hosting

  3. #3
    Join Date
    Mar 2006
    Posts
    965
    If you're not putting any spaces after the $site variable, you could always

    replace this line:

    PHP Code:
    echo 'test ' .$site''
    with:

    PHP Code:
    echo 'test ' .$site

  4. #4
    Join Date
    Dec 2004
    Location
    Beirut
    Posts
    599
    <?

    echo 'test ' .$site. ';

    ?>
    this is surely not enough the variable $site isnot defined
    Define it by using : $site = $_GET['site'];
    POINTLeb Hosting Lebanese Hosting for the Middle East
    The fact that no one understands you , does not make you an artist
    Mo Ghaoui's Personal Blog

  5. #5
    thanks guys...


    my script is now working by adding

    $site = $_GET['site'];


    its odd why it was working for a year without it..

  6. #6
    Join Date
    May 2004
    Posts
    500
    You can get variables from the URL without using the $_GET method if register_globals is on in the server's php.ini. It would seem your host has disabled it (which is always a good idea, security wise) so that's why it broke your script.

  7. #7
    ^ ok cool thans for that.. learn something new everyday..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •