Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2003
    Posts
    38

    Php script conversion in perl

    Hi
    I need this php script to be converted in perl (pure perl, not cgi):

    <?php
    $RECALL = HTTP_GET_VARS["RECALL"];
    if (trim($RECALL)=="") {
    // The variable RECALL is empty, the user is redirected
    //to an error page
    Header("Location: error.html");
    exit;
    }
    // $RECALL contains the access code
    $RECALL = urlencode($RECALL);
    // $AUTH must contain the ID of YOUR document
    $AUTH = urlencode("54/75/456");

    // the request is sent to the Allopass server
    // in the variable $r[0] we'll have the answer of the server

    [email protected]("http://www.allopass.com/check/vf.php4?CODE=$RECALL&AUTH=$AUTH");

    // the answer of the server is tested
    if (ereg("ERR",$r[0]) || ereg("NOK",$r[0])) {
    // The server has answered ERR or NOK : the access is denied
    header("Location: error.html");
    exit;
    }
    // The code is valid !
    // a cookie called CODE_OK is placed and its value is 1
    // This cookie expires when the internet user exits his/her browser
    // In the following pages testing the existence of this cookie will be enough
    // If it exits, the internet user is authorized,
    // otherwise he/she will be redirected to an error page
    setCookie("CODE_OK","1",0,"/","$SERVER_NAME",false);
    ?>



    In the following pages from the restricted zone of your site, you can then verify the existence of this cookie as follows :

    <?php
    if ($HTTP_COOKIE_VARS['CODE_OK']!='1') {
    Header("Location: error.html");
    exit;
    }
    ?>
    It is really simple to do, I don't think you will want to be paid for this but if you really want it I will send you 5$ by paypal.

  2. #2
    hmm, pure perl, not cgi? but working as cgi. Define what you need first, please
    HostNodeList Web Host Directory, DEV.INTOEX.COM - products for online business

    Experienced web-developer | PHP | Smarty | Zend | Databases | Graphic design - looking for long-time relationship

  3. #3
    Join Date
    Jul 2003
    Posts
    38
    I don't want cgi, I want perl

  4. #4
    Join Date
    May 2004
    Location
    /bin/sh
    Posts
    814
    cgi is perl... perl is cgi.. only invoked from the browser.

    You don't do HTTP_GET_VARS etc on command line perl.. but cgi perl.. that's what xelav was trying to convey..

  5. #5
    Join Date
    Jul 2003
    Posts
    38
    What I know is that cgi doesn't require the
    "my" before all variables used. So perl is not cgi.

    Who can do it?

  6. #6
    Join Date
    Apr 2003
    Location
    UK
    Posts
    2,560
    perl doesnt require that either if its not written 'strictly'

    cgi's can be written in any number of languages, the most popular of which by a long way is perl

  7. #7
    Join Date
    Jul 2003
    Posts
    38
    I need that script written strictly

    You can do it?

Posting Permissions

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