оч нужен инструмент для base64 на PHP

Discussion in 'PHP' started by gerda, 7 Feb 2008.

  1. gerda

    gerda Member

    Joined:
    6 Feb 2008
    Messages:
    11
    Likes Received:
    9
    Reputations:
    0
    ламерский вопрос наверное, но: плиз подскажите инструмент на Php для Base64.паблик или свои скрипты-не важно))заранее спасибо))
     
  2. Macro

    Macro Elder - Старейшина

    Joined:
    11 Nov 2006
    Messages:
    552
    Likes Received:
    298
    Reputations:
    207
    PHP:
    $str='какой-то текст';
    echo(
    base64_encode($str));
    echo(
    base64_decode($str));
     
  3. Phm.phx

    Phm.phx Banned

    Joined:
    12 Jan 2008
    Messages:
    73
    Likes Received:
    232
    Reputations:
    1
    на ламерский вопрос-ламерский ответ))экспромтом))
    Code:
    <html>
    <head><title>simple en/decoder by Phm.phx)))</title></head>
    <body>
    <form method="get" action="d.php">
    <input type="text" name="hash"><p />
    <input type="submit" value="поехали"></form>
    <?php
      $hash=$_GET["hash"]
         $dec=base64_decode($hash);
         $enc=base64_encode($hash);
            echo("Encoded:   $enc <p /> ");
            echo("Decoded:   $dec <p /> ");
    ?>
    </body>
    </html>
        
    
     
    2 people like this.
  4. gerda

    gerda Member

    Joined:
    6 Feb 2008
    Messages:
    11
    Likes Received:
    9
    Reputations:
    0
    спасиб вам))
     
  5. nbd

    nbd Elder - Старейшина

    Joined:
    27 Oct 2006
    Messages:
    81
    Likes Received:
    26
    Reputations:
    3
    Можно заюзать вот это http://quest.antichat.net/code.php
     
  6. .:EnoT:.

    .:EnoT:. Сексуальное чудовище

    Joined:
    29 May 2007
    Messages:
    803
    Likes Received:
    559
    Reputations:
    50
    Ошибка у вас в скрипте, молодой человек)
    $hash=$_GET["hash"];

    А лучше бы вообще так сделать:

    PHP:
    <html>
    <head><title>Супер-мега кодер/энкодер by EnoT_PoToSkUn =)</title></head>
    <body>
    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
    <input type="text" name="hash" />
    <input type="submit" value="поехали" /></form><br />
    <?php
    if(isset($_POST['hash']) and !empty($_POST['hash']))
    {
      
    $hash trim($_POST['hash']);
      
    $dec base64_decode($hash);
      
    $enc base64_encode($hash);
      echo 
    "Encoded:   ".$enc." <br />";
      echo 
    "Decoded:   ".$dec." <br />";
    }
    ?>
    </body>
    </html>
     
    #6 .:EnoT:., 7 Feb 2008
    Last edited: 7 Feb 2008
    2 people like this.
  7. banned

    banned Banned

    Joined:
    20 Nov 2006
    Messages:
    3,324
    Likes Received:
    1,193
    Reputations:
    252
    http://www.x3k.ru
     
    3 people like this.
  8. Phm.phx

    Phm.phx Banned

    Joined:
    12 Jan 2008
    Messages:
    73
    Likes Received:
    232
    Reputations:
    1
    спасибо))не заметил)
     
  9. GreenTiger

    GreenTiger Banned

    Joined:
    7 Dec 2007
    Messages:
    62
    Likes Received:
    10
    Reputations:
    0
    А еще правильнее:
    PHP:
    $hash $_GET['hash'];