Miscellaneous Code
  Home arrow Miscellaneous Code arrow Unique IP-icture
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MISCELLANEOUS CODE

Unique IP-icture
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2003-03-26

    Table of Contents:

    Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using the image, getenv, and rand functions, we draw unique png images for every visit to the page. Kinda just for fun, take a peek:

    By : bigphish

    <?php

    $your_ip = getenv ("REMOTE_ADDR");
    $your_var = preg_split("/\./",$your_ip);
    $oc1 = $your_var[0];
    $oc2 = $your_var[1];
    $oc3 = $your_var[2];
    $oc4 = $your_var[3];

    Header ("Content-type: image/png");
    $your_image = ImageCreate (600, 600);
    $bg_grey = ImageColorAllocate ($your_image, 169, 169, 255);

    if($oc1 > 15 && $oc2 > 15 && $oc3 > 15 && $oc4 > 15){

    $your_poly = array(
    "0" => $oc3 * rand(1,20) * 0.1,
    "1" => $oc4 * rand(1,20) * 0.1,
    "2" => $oc1 * rand(1,20) * 0.1,
    "3" => $oc2 * rand(1,20) * 0.1,
    "4" => $oc4 * rand(1,20) * 0.1,
    "5" => $oc2 * rand(1,20) * 0.1,
    "6" => $oc3 * rand(1,20) * 0.1,
    "7" => $oc3 * rand(1,20) * 0.1,
    "8" => $oc3 * rand(1,20) * 0.1,
    "9" => $oc3 * rand(1,20) * 0.1,
    "10" => $oc3 * rand(1,20) * 0.1,
    "11" => $oc3 * rand(1,20) * 0.1,
    );
    $shape = "POLY";

    } else {

    $clr1 = imagecolorallocate ($your_image, $oc4, $oc4, $oc3);
    $clr2 = imagecolorallocate ($your_image, $oc3, $oc3, $oc2);
    $clr3 = imagecolorallocate ($your_image, $oc2, $oc2, $oc1);
    $clr4 = imagecolorallocate ($your_image, $oc1, $oc1, $oc4);

    $shape = "CIRCLE";

    }


    $black = imagecolorallocate ($your_image, 0, 0, 0);
    $shp_clr = ImageColorAllocate ($your_image, rand($oc3,255), rand($oc2,255), rand(1,$oc1));
    $font = 5;
    $width = ImageFontWidth($font) * strlen($your_ip);
    $height = ImageFontHeight($font);

    if ($shape == "POLY"){

    ImageFilledPolygon ($your_image, $your_poly, 6, $shp_clr);
    }
    else if ($shape == "CIRCLE"){

    imagefilledarc ($your_image, $oc2 + rand(80,600), $oc1 + rand(80,600), $oc3 + rand(40,400), $oc3 + rand(40,400), 0, 359, $clr1, IMG_ARC_PIE);
    imagefilledarc ($your_image, $oc3 + rand(200,400), $oc4 + rand(200,400), $oc2, $oc2, 0, 359, $clr2, IMG_ARC_PIE);
    imagefilledarc ($your_image, $oc4 + rand(100,500), $oc3 + rand(100,500), $oc4 + rand(20,40), $oc4 + rand(20,40), 0, 359, $clr3, IMG_ARC_PIE);
    imagefilledarc ($your_image, $oc1 + rand(80,100), $oc2 + rand(80,100), $oc1, $oc1, 0, 359, $clr4, IMG_ARC_PIE);

    }

    ImageString($your_image, $font, 0, 0, $your_ip, $black);
    ImagePng ($your_image);
    ImageDestroy ($your_image);

    ?>

    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More Miscellaneous Code Articles
    More By Codewalkers

     

    IBM® developerWorks developerWorks - FREE Tools!


    NEW! Achieving True Agility -- How process can change the behavior of your tools

    Achieving true agility is a never-ending effort. We will showcase how you can become agile incrementally, a few practices at the time.Which practices should any agile team strive to adopt? What additional practices should you consider based on your needs to scale? Adopting practices are however made much easier with the right tool support. What about if your tools adapt to your practices? We will take a look at how the Jazz technology can be leveraged to make your process change the behavior of your tools.
    FREE! Go There Now!


    NEW! Download a free trial of WebSphere Business Modeler Advanced V6.1.1

    Visit IBM developerWorks to download a free trial version of WebSphere Business Modeler Advanced V6.1.1, IBM’s premier business process modeling and analysis tool for business users that offers process modeling, simulation, and analysis capabilities. IBM WebSphere Business Modeler helps you visualize, understand, and document business processes for continuous improvement.
    FREE! Go There Now!


    NEW! Download the free Web Application Security eKit

    Discover how IBM Rational AppScan Standard Edition can help you detext vulnerabilities in your web applications in the Web Application Security eKit. IBM Rational AppScan is a leading suite of automated web application security solutions that scan and test for common Web application vulnerabilities. The new Web Application Security eKit provides you with valuable resources, including white papers, demos, and additional information on the benefits of testing your Web applications.
    FREE! Go There Now!


    NEW! IBM Rational ClearCase Innovator's Series

    Learn from the best! Find out how developers use Rational ClearCase to be more flexible, innovative and deliver higher quality code in the Rational ClearCase Power Users eKit. This complimentary eKit provides a collection of materials, like articles, whitepapers, and demos that can help you become a power user of Rational ClearCase.
    FREE! Go There Now!


    NEW! Rational Talks to You:Per Kroll on Rational Method Composer Plug-in customization

    Join this Rational Talks to You teleconference on December 11 at 1:00 pm ET to get tips on building your own plugins with Rational Method Composer. Get your questions answered!
    FREE! Go There Now!


    NEW! Run your first CICS application on a PC using TXSeries for Windows

    Learn the basics of the IBM Customer Information Control System (CICS). With a hands-on exercise, learn how to get your first CICS application up and running on your desktop using TXSeries V6.1 for Windows. The tutorial shows you how to download and install a free trial version of TXSeries V6.1.
    FREE! Go There Now!


    NEW! The role of integrated requirements management in software delivery

    This paper is about the critical role that a discipline called integrated require­ments management can play in helping to ensure that your business goals and IT investments are continuously aligned—whether you are sourcing, integrat­ing, building or maintaining software. It also looks at ways that automated IBM Rational® products can work together to help you use requirements in the very best way.
    FREE! Go There Now!


    NEW! Trial download: IBM Rational Manual Tester V7.0.1

    Try the latest version of IBM Rational Manual Tester V7.0.1 by downloading a free trial from IBM developerWorks. This manual test authoring and execution tool promotes test step reuse to reduce the impact of software change on testers and business analysts and addresses the needs of teams performing at least a portion of their testing manually.
    FREE! Go There Now!


    NEW! Try IBM Rational Asset Manager V7.0 online!

    You can now evaluate IBM Rational Asset Manager V7.0 online without installing or configuring it on your own system! Rational Asset Manager helps create, modify, govern, find, and reuse any type of development assets, including SOA and systems development assets. Rational Asset Manager helps you reduce software development costs and improve quality by facilitating the reuse of all types of software development-related assets. Visit developerWorks to learn more about this product and register to explore its capabilities online.
    FREE! Go There Now!


    NEW! Webcast: Striking the right balance between manual and automated testing

    Join this webcast to learn how IBM Rational's Functional Testing solution enables you to implement automation your way, at your pace, with your existing staff. In this webcast, you’ll learn how you can eliminate redundancy of manual test scripts, reduce errors, and increase test coverage through test automation. After this presentation you will understand how IBM Rational Functional Testing solution can streamline your manual testing and make test automation easily attainable.
    FREE! Go There Now!



    All FREE IBM® developerWorks Tools!

    MISCELLANEOUS CODE ARTICLES

    - A Web App Based on a Model for the CodeIgnit...
    - Completing a Model for the CodeIgniter PHP F...
    - Validating Input Data with the CodeIgniter P...
    - Deleting Database Records with the CodeIgnit...
    - Inserting Database Records with a CodeIgnite...
    - Fetching Database Rows with a Model for the ...
    - Model Data and Validation Rules for a Generi...
    - Building a Generic Model for the CodeIgniter...
    - upload image to database sql
    - Random Password Generator
    - BCroot, get the root of a number with BC fun...
    - Find pi in a high precision
    - [PHP5] FORMCHECKER : data validation
    - SPL and ITERATOR : examples
    - Xml with Rss Feeds





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek