Location: PHPKode > scripts > iYell > iyell/send.php
<?php
    include("head.php");
    // Anti-spam :
    $nr1 = rand(0,5);
    $nr2 = rand(0,5);
    switch(rand(1,3)){
        case 1 :
            $op = "+";
            $_SESSION["total"] = $nr1+$nr2;
            break;
        case 2 :
            $op = "*";
            $_SESSION["total"] = $nr1*$nr2;
            break;
        default :
            $nr3 = $nr2 = rand(0,3);
            $op = "+";
            $_SESSION["total"] = $nr1+$nr2+$nr3;
    }
    
?>
<script src="swfobject.js" language="javascript" type="text/javascript"></script>
<form action="sendsend.php" method="post">
    <label><span style="text-align: center; font-size: 16px;margin-top: 5px;"><strong>YELL HERE:</strong></span><textarea name="text"><?php 
    if(isset($_SESSION['text'])){
        echo(htmlentities($_SESSION['text'],ENT_QUOTES));
    } ?></textarea></label>
    <label><span>Your nickname : </span><input type="text" name="author" value="<?php 
    if(isset($_SESSION['author'])){
        echo(htmlentities($_SESSION['author'],ENT_QUOTES));
    } ?>" ></label>
    <br>
    <label><span>Add something?</span></label>
    <label><span>&nbsp;</span><input type="radio" name="add" value="no" checked id="chkno" style="width: 20px;">No, thanks</label>
    <label><span>&nbsp;</span><input type="radio" name="add" value="cam"  id="chkcam" style="width: 20px;">A photo taken with my webcam</label>
    <label><span>&nbsp;</span><input type="radio" name="add" value="link" id="chklink" style="width: 20px;">A link or an URL</label>
    <label id="link"><span>Your link : </span><input type="text" name="link" value="<?php 
    if(isset($_SESSION['link'])){
        echo(htmlentities($_SESSION['link'],ENT_QUOTES));
    } ?>" id="url"></label>
    <label id="cam"><span>Your photo :</span><div id="flashArea" class="flashArea" style="height:100%;display: inline-block;"><p align="center">This content requires the Adobe Flash Player.<br /><a href="http://www.adobe.com/go/getflashplayer">
						<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /><br />
    <a href=http://www.macromedia.com/go/getflash/>Get Flash</a></p>
	</div></td>
  </tr>

  <script type="text/javascript">
	var mainswf = new SWFObject("take_picture.swf", "main", "300", "350", "9", "#ffffff");
	mainswf.addParam("scale", "noscale");
	mainswf.addParam("wmode", "window");
	mainswf.addParam("allowFullScreen", "true");
	mainswf.write("flashArea");
	
  </script></label>
    <label><span>Prove us you're not a robot:<br><?php 
        echo($nr1 . " " . $op ." " . $nr2);
        if(isset($nr3)){
            echo(" " .$op ." " . $nr3);
        }
    ?> = </span><input type="text" name="calc" ></label>
    <p>Your yell will be published on a public website as a <a href="http://www.gnu.org/copyleft/" target="_blank">copyleft</a> content. If you think it's a problem, go to hell and don't click on send.</p>
    <input type="button" value="Nevermind…" onclick="history.go(-1);">
    <input type="submit" value="Send »">
</form>
<script type="text/javascript">
    function showhide(){
        if(!document.getElementById("chkcam").checked){
            document.getElementById("cam").style.display="none";
        }else{
            document.getElementById("cam").style.display="block";
        }
        if(!document.getElementById("chklink").checked){
            document.getElementById("link").style.display="none";
        }else{
            document.getElementById("link").style.display="block";
        }
    }
    
    function getURL(){
        if(window.XMLHttpRequest) // FIREFOX
            xhr_object = new XMLHttpRequest();
        else if(window.ActiveXObject) // IE
            xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
        else
            return(false);
    
        var done = false;
        // CONTROLE DE L'ETAT DE LA REQUETE
        xhr_object.onreadystatechange = function(){ 
            if(xhr_object.readyState == 4){
                if(xhr_object.status == 200){
                    if(xhr_object.responseText != "KO"){
                        document.getElementById("url").value = xhr_object.responseText;
                        document.getElementById("flashArea").innerHTML = "<img src='"+xhr_object.responseText+"' alt='Your photo'>";
                        done = true;
                    }
                }
            }
        }; 
    
        // ON APPELLE LA PAGE
        xhr_object.open("GET", "/camurl.php", true);
        xhr_object.send(null);
        
        setTimeout(function(){
            if(done == false){
                getURL();
            }
        },1000);
        
        
    }
    getURL();
    setInterval(showhide,100);
</script>
<?php
    include("foot.php");
?>
Return current item: iYell