send a message

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • windandwaves

    send a message

    Hi

    This maybe a nice little script for some new-newbies to get amongst a bit of
    php action (I am still a newish-b myself)



    To follow is the PHP:

    <?php

    $content = '
    <html>
    <head>
    <title>test me</title>
    <script src="j/j.js" type="text/javascript"></script>
    <style type="text/css"> img.iletter { display: none; } </style>
    </head>';

    $location = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];

    if(($_POST["submit"] && $_POST["txt"]) || $x) {
    $content .= '<body onload="reveal( \'l\', 1, 300);" style="margin: 0px;
    padding: 50px; background-color: #000;">';
    if($x) {
    $letters = urldecode(base6 4_decode($x));
    }
    else {
    $letters = htmlentities($_ POST["txt"], ENT_QUOTES);
    $code = urlencode(base6 4_encode($lette rs));
    $content .= '<p style="color: white;">link is :
    http://'.$location.'?x ='.$code.'</p>';
    }
    $content .= letterer($lette rs).'<p style="clear: both;"><br><br> <a
    href="go.php" style="color: white;">try another one</a></p>';
    }
    else {
    $content .= '
    <body style="margin: 50px;">
    <form method="post" action="go.php" >
    <textarea name="txt" cols="30" rows="10">type anything you want
    here</textarea>
    <br><br><inpu t name="submit" type="submit" value="show me the money">
    </form>';
    }

    function letterer ($letters) {
    $v = '<div id="letters">' ;
    $len = strlen($letters );
    for($i = 0; $i < $len; $i++){
    $let = substr($letters ,$i, 1);
    $let = replacer($let);
    $v .= '<div class="iletter" id="divl'.($i+1 ).'" style="float: left";><img
    src="a/'.strtolower($l et).'.gif" alt="'.$let.'" class="iletter"
    id="l'.($i+1).' "></div>'; //
    }
    $v .= '</div>';
    return $v;
    }

    $content .= '</body></html>';
    echo $content;


    function replacer($lette r) {

    $search = array (
    ' ',
    '?',
    '>',
    '<',
    '*',
    ':',
    '.',
    );

    $replace = array (
    '_space',
    '_questionmark' ,
    '_gt',
    '_lt',
    '_asterix',
    '_colon',
    '_dot',
    );

    return str_replace($se arch, $replace, $letter);
    }


    ?>


Working...