Which One Better?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Which One Better?

    M learng php usng PHP 5 tutorial bt Php 5 intducd sm new variable like $_SERVER usng dis we cn easly display user brwser.So m confusd btwn old code nd new codezz.whch 1 u fink better fr wap devpmnt??

    #2
    new coding is $php_itself or $_server to make up php headers and footer has to be echo ""; or echo '';
    easy
    Code:
    <?php
    
    if (! $size > 0) {
        $size = 300;
    
    }
    
    $radius = floor($size / 2);
    
    
    header("content-Type: image/gif");
    
    
    $img = ImageCreate($size, $size);
    
    $color_alpha = ImageColorAllocate($img, 254, 254, 254);
    
    $color_white = ImageColorAllocate($img, 255, 255, 255);
    
    $color_black = ImageColorAllocate($img, 0, 0, 0);
    
    $color_gray  = ImageColorAllocate($img, 192, 192, 192);
    
    $color_red   = ImageColorAllocate($img, 255, 0, 0);
    
    $color_blue  = ImageColorAllocate($img, 0, 0, 255);
    
    ImageColorTransparent($img, $color_alpha);
    
    
    ImageArc($img,$radius, $radius, $size, $size, 0, 360, $color_black);
    
    ImageFill($img, $radius, $radius, $color_white);
    
    
    $min = 0;
    while($min++ < 60) 
    {
        
    if ($min % 15 == 0)
            
    $len = $radius / 5;
        
    elseif ($min % 5 == 0)
            
    $len = $radius / 10;
        
    else
            
    $len = $radius / 25;
    
        
    $ang = (2 * M_PI * $min) / 60;
        
    $x1 = sin($ang) * ($radius - $len) + $radius;
        $y1 = cos($ang) * ($radius - $len) + $radius;
        
    $x2 = (1 + sin($ang)) * $radius;
        
    $y2 = (1 + cos($ang)) * $radius;
    
        
    ImageLine($img, $x1, $y1, $x2, $y2, $color_black);
    
    }
    
    
    list($hour, $min, $sec) = preg_split ("/-/", Date("h-i-s", Time()));
    
    $hour = $hour % 12;
    
    
    $xs = intval(cos($sec * M_PI/30 - M_PI/2) * 0.75 * $radius + $radius);
    
    $ys = intval(sin($sec * M_PI/30 - M_PI/2) * 0.75 * $radius + $radius);
    
    $xm = intval(cos($min * M_PI/30 - M_PI/2) * 0.65 * $radius + $radius);
    
    $ym = intval(sin($min * M_PI/30 - M_PI/2) * 0.65 * $radius + $radius);
    
    $xh = intval(cos($hour*5 * M_PI/30 - M_PI/2) * 0.5 * $radius + $radius);
    
    $yh = intval(sin($hour*5 * M_PI/30 - M_PI/2) * 0.5 * $radius + $radius);
    
    
    ImageLine($img, $radius, $radius,   $xs, $ys, $color_gray);
    
    ImageLine($img, $radius, $radius-1, $xm, $ym, $color_blue);
    
    ImageLine($img, $radius-1, $radius, $xm, $ym, $color_blue);
    
    ImageLine($img, $radius, $radius-1, $xh, $yh, $color_blue);
    
    ImageLine($img, $radius-1, $radius, $xh, $yh, $color_blue);
    
    
    ImageArc($img, $radius, $radius, $radius / 8, $radius / 8, 0, 360, $color_red);
    
    ImageFillToBorder($img, $radius, $radius, $color_red, $color_red);
    
    ImageGif($img);
    
    ImageDestroy($img);
    
    
    ?>

    you can see it a php right make clock.php then upload it as a image there a nice clock script


    try this


    <a href=\"".$_SERVER["PHP_SELF"]."\">Next</a>
    Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
    Visit: WapMasterz Coming Back Soon!
    _______
    SCRIPTS FOR SALE BY SUBZERO
    Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
    FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
    _______
    Info & Tips
    php.net
    w3schools.com

    Comment

    Working...
    X