A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: perl > php conversion

  1. #1
    Official FK nice guy and MOD 3PRIMATES's Avatar
    Join Date
    Apr 2002
    Location
    Portland Oregon
    Posts
    1,645

    perl > php conversion

    Hello all, I am wondering if anyone would be kind enough to help me with a perl to php conversion.

    The perl code
    PHP Code:
    $buffer=$ENV{'QUERY_STRING'};
    # Split the name-value pairs
    @pairs split(/&/, $buffer);
    foreach 
    $pair (@pairs) {
       (
    $name$value) = split(/=/, $pair);
       
    # Un-Webify plus signs and %-encoding
       
    $value =~ tr/+/ /;
       
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C"hex($1))/eg;
       
    $value =~ s/<!--(.|\n)*-->//g;
       
    if ($allow_html != 1) {
          
    $value =~ tr/</ /;
          
    $value =~ tr/>/ /;
       }
       
    $FORM{$name} = $value;

    Thanks for any help

    3P

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    you dont have to convert that since php already does it for you - you will find all url parameters in the $_GET array.
    The only difference: you would have to remove unwanted html yourself

    Musicman

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center