Php Dynamic Signatures - Using the GD Module and MySQL

free web hosting
Open Discussion > CONTRIBUTE > Tutorials

Php Dynamic Signatures - Using the GD Module and MySQL

SystemWisdom
PHP Dynamic Signatures using the GD Module

    [/tab]After much scowering on the internet to find a suitable tutorial on this subject, I came up empty-handed. So I was forced to learn it on my own through trial & error. And since I had discovered a lack of tutorials on this subject, I dediced to write one!


Working Example:
user posted image



Abstract:
[tab]Using the GD Module of PHP allows a developer to build custom Images with Dynamic Content. Such content could be the Requesting Users IP Address, Web-Browser Type, Operating System, even the number of times the user has seen the Image!

    [/tab]Luckily, Trap17 Supports the GD Module with PHP, so those who are hosted here on Trap17 can take full advantage of this tutorial! (Hint: Get Hosted With Trap17!)


By Rob J. Secord, B.Sc. (SystemWisdom)



Intended Audience:
Intermediate to Advanced PHP Web-Application Designers/Developers.

Assumed knowledge:
-- PHP Basics/Arrays
-- OOP Concepts such as Classes
-- MySQL Databases with PHP
-- MIME-Type Headers


Theory:
[tab]First, we will start with a simple Image Background that has some appeal (It is recommended that you create a simple Image Template in your favorite Image Editing software, like Photoshop) and remember to leave some space for the dynamic content to be added.

    [/tab]After that, we simply access the image using PHPs GD Module, and write some dynamic content to it. We then output the image as a GIF file format and set the MIME-Type Content Headers to reflect a GIF image.

[tab]To add to the images dynamic content, we will track the number of times an individual user requests the image, and store that into a MySQL Database. For this we will also require a database connection to MySQL.

    [/tab]On to the fun stuff!


NOTE: You can Download a complete ZIP file containing all files used in this tutorial as well as the suggested directory structure, at the end of this tutorial!


Implementation:

For this tutorial, I will use the following file structure (all files will be covered in this tutorial):


-- .htaccess
-- install.php
-- sig_syswiz.php (NOTE: Will be renamed to sig_syswiz.gif later in tutorial)
-- images
[tab]|--- systemwisdom.gif
-- fonts
    [/tab]|--- arial.ttf
-- dynasig
[tab]|--- dynasig.inc.php


The Bold entries are Folders, and the Italic entries are Files.
Now, imagine those are the real file and folder names, as I will use those names in examples for the rest of this tutorial.



    [/tab]We will start off by making (or selecting) an image to use as our Image Template, for this tutorial I will use the image below:

Image File: images/systemwisdom.gif
user posted image

[tab]You should copy your image to your web-server using the same directory structure as listed above (you could place it anywhere you want really, just be sure your PHP code can access it). Now that you know what the Image Template looks like, you can look at my Example Signature to compare it to the finished result.


    [/tab]Next we will use a True-Type Font for writing our Dynamic Content to the image. This gives us more flexibility with our fonts than what PHP provides for us. For this tutorial I am using a simple Arial Type font, and you can find this font in your Windows\Fonts directory (or on the Internet) or you could use any other True-Type Font that you want to use.

[tab]The font file should be added to your web-server using the same directory structure as listed above (fonts/arial.ttf).


    [/tab]Next we will get into the Bulk of the PHP code to achieve our Dynamic Signature. This code will be a Class called 'DynaSig' in the dynasig/dynasig.inc.php file and could be re-used for other signatures as well.
Note: Although the DynaSig Class file would require minor modifications to work with other signatures (mainly text locations), it could easily be enhanced to be more dynamic requiring no changes at all to the DynaSig Class file. That is an exercise I will leave up to you!

[tab]Now, I will begin by showing you the completed class file, and I will then explain each part of it as we go along in this tutorial.
Note: Although this class will work, it only provides basic functionality and much could be added to it, but we will keep it simple for this tutorial.

The DynaSig Class file would look like the following:

DynaSig Class file: dynasig/dynasig.inc.php
CODE

<?php

class DynaSig
{
   // Dynamic Signature Version
   var $m_szVersion;

   // True-Type Font Styles
   var $m_szFontFace;
   var $m_aFontColor;
   var $m_iFontSize;
   
   // Image Template File
   var $m_szRawImage;

   // Dynamic Image Object
   var $m_oRawImage;
   
   // Quote/Author Arrays for Random Quote
   var $m_szQuotes;
   var $m_szAuthor;
   

   function DynaSig()
   {
    // Version
       $this->m_szVersion = 'v1.0';
       
       // Default Font Styles
       $this->m_szFontFace = '';
       $this->m_aFontColor = Array( 255, 255, 255 );
       $this->m_iFontSize = 12;
       
       $this->m_szRawImage = '';
       $this->m_oRawImage = 0;
       
       // Random Quotations                  
       $this->m_szQuotes = Array();
       $this->m_szAuthor = Array();
   }
   
   //
   // PUBLIC MEMBER FUNCTIONS BELOW...
   //

   function SetImageFile( $szFile )
   {   $this->m_szRawImage = 'images/' . $szFile . '.jpg';
   }
   
   function SetFontFile( $szFile )
   {   $this->m_szFontFace = 'fonts/' . $szFile . '.ttf';
   }
   
   function SetFontColor( $iRed, $iGreen, $iBlue )
   {   $this->m_aFontColor[0] = $iRed;
    $this->m_aFontColor[1] = $iGreen;
    $this->m_aFontColor[2] = $iBlue;
   }
   
   function SetFontSize( $iSize )
   {   $this->m_iFontSize = $iSize;
   }
   
   function AddQuote( $szQuote, $szAuthor )
   {   if( strlen( $szQuote ) && strlen( $szAuthor ) )
       {
           $this->m_szQuotes[] = $szQuote;
           $this->m_szAuthor[] = '- ' . $szAuthor;
       }
   }
   
   function Create()
   {        
       $this->m_oRawImage = imagecreatefromjpeg( $this->m_szRawImage );
       imagealphablending( $this->m_oRawImage, true );

       // Bounds of Map Image
       $iWidth = imagesx( $this->m_oRawImage );
       $iHeight = imagesy( $this->m_oRawImage );

       // Get User Data
       $szIP = $_SERVER['REMOTE_ADDR'];
       $szOS = $this->GetOperatingSystem();
       $szBrowser = $this->GetBrowser();
       
       // Get User View Count
 $iViewCount = $this->CountViews( $szIP, $szOS, $szBrowser );
       
       // Write User Data to Image
       $this->WriteTTF( 10, 48, 'Hello '.$szIP.', You have viewed '.$iViewCount.' of my posts!' );
       $this->WriteTTF( 10, 61, 'You are using '.$szBrowser.' on '.$szOS.'!' );

       // Print Random Quote to Image
       $iIdx = rand( 0, count($this->m_szQuotes) - 1 );
       $this->WriteTTF( 10, ($iHeight - 20), $this->m_szQuotes[$iIdx] );
       $this->WriteTTF( 50, ($iHeight - 8), $this->m_szAuthor[$iIdx] );

       // Output Image to Browser
       imagegif( $this->m_oRawImage );

       // Free Image Resource
       imagedestroy( $this->m_oRawImage );
       return;
   }
   
   //
   // PRIVATE MEMBER FUNCTIONS BELOW...
   //
   
   function CountViews( $szIP, $szOS, $szBrowser )
   {
 // Connect to Database
 $iConnID = mysql_connect( 'localhost', 'my_username', 'my_password' );
 mysql_select_db( 'my_database', $iConnID );
       
       // Query Database for Matching User
       $szQuery = 'Select * From DynaSigData Where UserIP=\''.$szIP.'\' And UserOS=\''.$szOS.'\' And UserBrowser=\''.$szBrowser.'\'';
       $szQueryID = mysql_query( $szQuery, $iConnID );
       $szResultSet = mysql_fetch_array( $szQueryID );
       @mysql_free_result( $szQueryID );
       
       if( !$szResultSet )
       {
           // User not found, first viewing..
           $szQuery  = 'Insert Into DynaSigData (UserViews, UserIP, UserOS, UserBrowser ) ';
           $szQuery .= 'Values ( 1, \''.$szIP.'\', \''.$szOS.'\', \''.$szBrowser.'\' ) ';
           mysql_query( $szQuery, $iConnID );
           $iViewCount = 1;
       }else
       {
        // User found, add 1 to view count..
           $iUserID = intval( $szResultSet['UserID'] );
           $iViewCount = intval( $szResultSet['UserViews'] ) + 1;
           $szQuery  = 'Update DynaSigData Set UserViews='.$iViewCount.' Where UserID='.$iUserID.';';
           mysql_query( $szQuery, $iConnID );
       }
       
       // Disconnect DB
       @mysql_close( $iConnID );
       
       // Return View Count
       return $iViewCount;
   }

   function WriteTTF( $iLocX, $iLocY, $szText )
   {
       $oColor = imagecolorallocate( $this->m_oRawImage, $this->m_aFontColor[0], $this->m_aFontColor[1], $this->m_aFontColor[2] );
       imagettftext( $this->m_oRawImage, $this->m_iFontSize, 0, $iLocX, $iLocY, $oColor, $this->m_szFontFace, $szText );
   }

   function GetOperatingSystem()
   {
    // Operating System Types
       $aUserOS = Array( 'Windows XP'     => 'Windows NT 5.1',
                         'Windows 2000'   => 'Windows NT 5.0',
                         'Windows NT 4.0' => 'Windows NT 4',
                         'Windows 9x'     => 'Windows 9',
                         'Windows 9x'     => 'Win 9',
                         'Windows Me'     => 'Windows Me',
                         'Linux'          => 'Linux',
                         'Macintosh'      => 'Macintosh' );
                       
 // Check for Matching Operating System
       foreach( $aUserOS as $szKey => $szValue )
           if( preg_match( '/' . $szValue . '/i', $_SERVER['HTTP_USER_AGENT'] ) )
               $szUserOS = $szKey;
       
       // If OS Not Found, Set Default Operating System
       if( !isset( $szUserOS ) ) $szUserOS = 'Some Weird OS';
       
       // Return Operating System
       return $szUserOS;
   }

   function GetBrowser()
   {
    // Browser Types
       $aUserBrowser = Array( 'Internet Explorer 6' => 'MSIE 6',
                              'Internet Explorer 5' => 'MSIE 5',
                              'Internet Explorer 4' => 'MSIE 4',
                              'Firefox'             => 'Firefox',
                              'Netscape 7'          => 'Netscape7',
                              'Netscape 6'          => 'Netscape6',
                              'Opera'               => 'Opera' );
                       
 // Check for Matching Operating System
       foreach( $aUserBrowser as $szKey => $szValue )
           if( preg_match( '/' . $szValue . '/i', $_SERVER['HTTP_USER_AGENT'] ) )
               $szUserBrowser = $szKey;
       
       // If OS Not Found, Set Default Browser Type
       if( !isset( $szUserBrowser ) ) $szUserBrowser = 'Some Weird Browser';
       
       // Return Browser Type
       return $szUserBrowser;
   }
   
}   // End of Class
?>


    [/tab]First of all, you will see a Class Declaration named 'DynaSig' and within it, are a bunch of Member Variables. They are all self-explanitory (though I will explain them eventually anyway), as is the Constructor which sets their respective default values. Now assuming you understand Object-Oriented Programming, I trust you understand thus far.
[tab]Moving on, you will notice 4 Set Functions which are used to setup the Format of the Dynamic Signature Image. These are used directly after Creating a DynaSig Object to set the Image Template file, the True-Type Font file, the Font Color and the Font Size respectively. You will notice that the SetImageFile() and SetFontFile() functions automatically add the directory and the extension to the parameter passed in. This is a personal preferrence which simply enforces the file location and type. You may also notice that we are using JPEG type images as our Image Template. This is important due to the nature of JPEG and GIF Images, as we will discuss later in this tutorial.

    [/tab]Next is the AddQuote() function, which is the same as the Set functions from above, the only difference is that this function accepts 2 parameters (namely the Quote and Author) and adds their values to arrays. These arrays will be used to draw out a random quote later in this tutorial and write it to the Dynamic Signature Image.

[tab]Now since those were all very basic functions, I will not explain them as thuroughly as I will the next 2:

    [/tab]The Create() function, which is the last of our 'Public Functions' and the last one we will call when using our DynaSig Object, will output a Dynamic GIF Image to the requesting users browser.
[tab]From here, the Create() function will call all of the other 'Private Functions' used in the class. But the first thing our Create() function must do, is open an Image Handle to the Image Template file we will be using. This handle is a Copy of the Image Template and we can then alter it without altering the original Image Template File. We open this image handle using the imagecreatefromjpeg() function from the GD Module in PHP.
    [/tab]Now the reason why we open the Image Template as a JPEG is because GIF Images store their color indexes internally. If you open a GIF image of solid black, for example, you would not be able to add additional colors, since the GIF file only has a color index of Solid Black. Basically, the more colors in the GIF file then the more colors you can use with the GD module. Alternatively, JPEG files do not have this limitation, therefore it is more flexible to open your Image as a JPEG to get access to more colors. In the end however, we will still be outputting a GIF (generated dynamically) as they tend to be smaller in size.

[tab]Once we have the Image Handle opened, we can then determine the Images Size using the imagesx() and imagesx() functions. This will give us the Width and Height of our image (this could be used for dynamically positioning text).

    [/tab]After that, we determine the users IP Address using the built-in PHP Global Server Variable $_SERVER['REMOTE_ADDR'] which gives us a string containing the requesting users IP address! Brilliant! tongue.gif
[tab]Then we can query the requesting users HTTP Agent string contained in yet another PHP Global Server Variable called $_SERVER['HTTP_USER_AGENT'] which contains both the Operating System and Browser details. We simply match the patterns using Regular Expressions against some known types, and if a specified pattern exists, we know the users HTTP Agent! This can be seen in the GetOperatingSystem() and GetBrowser() functions at the bottom of the Class File. Since both of these functions are relatively simplistic I will not explain them in great detail, though feel free to ask questions if any of it confuses you.


    [/tab]Next we Query our Database to find the requesting users View Count, or in other words, how many times the user has accessed out signature image! This is done in the CountViews() function and I will describe it in greater detail later. For now, know that it returns an integer containing the requesting users View Count.


[tab]After all of that is done, all of our Information Gathering is complete, so now we will need to write that information to the image. This is accomplished by the WriteTTF() function which first allocates the correct Color (as set by the SetFontColor() function) for use in the Image, and then writes the Information to the Image according to the Font Styles defined by the Set functions. The most important part of this function are the first 2 parameters which specify the X and Y locations of where to write the text to the Image.

    [/tab]Next we will write our random quote to the Image. By adding quotes to our class using the AddQuote() function, we essentially build an array of Quotes. To choose one of them, we simply generate a random number between the Upper and Lower Bounds of the Array. This is accomplished with the PHP rand() and count() functions. With our random number we use it to index our array of quotes to write one of them to the Image. This process is pretty straight-forward.

[tab]Finally, the last part of the Create() function is to output the image to the requesting users browser and then release the Image Handle from memory. This is accomplished by calling imagegif() and imagedestroy() respectively.
One thing to note though, is that PHP will now output an Image instead of a Web-Page. Since our browser sent a request for a PHP page, it is expecting a Web-Page in return, not just an Image. We will have to modify the MIME-Type Headers to reflect the new content-type later on, before we use this class and call its associated Create() function. That will be done in our next file.


    [/tab]After the Create() function we have the CountViews() function, which is the last function we will need to discuss in our DynaSig Class file. As mentioned earlier, this function is used to Query the Database for the requesting user to count the number of times they have viewed our Dynamic Signature Image.
[tab]The first thing you'll notice, is that it connects to a Database. Your Access Credentials for Your DB MUST be supplied here (unless you change the code a bit). Next it searches the database for a user who matches the requesting users IP, OS and Browser. All 3 are used in the search to lessen the likely-hood of 2 users joining with the exact same data, and thus preventing user A to view user B's view count.
If the user IS found in the database, then we simply store the users view count in an interger variable, add 1 to it, and then update the database with the new view count.
Otherwise, if the user IS NOT found, then we set the users view count to 1 and insert a new record in the database for the current user.
That pretty much sums up the CountViews() function, and gives us the current users view count.


    [/tab]Now with that file done, and out of the way, you can place it on your web-server in the suggested directory mentioned at the beginning of this tutorial, and we will link to that file in the next file we discuss; the sig_syswiz.php file, which creates an object of our DynaSig Class, supplies the Image Template File and the Font Styles, and finally creates the image for output. You could have several of these files all pointing to different Image Templates, setting differnet Font Styles and still use the same DynaSig Class file.

[tab]Again, I will first show you the completed file and then we will walk through it together:

Main file: sig_syswiz.php
CODE

<?php

// Set Content Type to GIF with NoCache
header( "Content-type: image/gif" );
header('Expires: ' . gmdate('D, d M Y H:i:s') . 'GMT');
header('Cache-control: no-cache');

// Include DynaSig Class file
require( 'dynasig/dynasig.inc.php' );

// Create DynaSig Object
$oDynaSig = new DynaSig();

// Set Image Template File
$oDynaSig->SetImageFile( 'systemwisdom' );

// Set Font Styles
$oDynaSig->SetFontFile( 'arial' );
$oDynaSig->SetFontColor( 88, 100, 133 );
$oDynaSig->SetFontSize( 10 );


// Add Some Custom Quotes
$oDynaSig->AddQuote( 'I have not failed, I have just found 10,000 ways that won\'t work!', 'Thomas Alva Edison' );
$oDynaSig->AddQuote( 'Give me a museum and I\'ll fill it!', 'Pablo Picasso' );
$oDynaSig->AddQuote( 'Where the spirit does not work with the hand, there is no art.', 'Leonardo da Vinci' );

// Create and Output the Image
$oDynaSig->Create();

?>


    [/tab]The first thing I hope you notice, is the size of this file -- it is much smaller than the DynaSig Class File! Yay!
[tab]Next, you will notice that the Content-Type is set to GIF. Remember, when accessing this file, you are accessing a PHP file which by default outputs HTML as the content type. Since we are actually outputting a GIF Image through this PHP code, we need to change the content-type before-hand. Also, the image is set to expire immediately forcing it to not be cached, and instead re-processed with each request.
    [/tab]After that, we can begin creating our Dynamic Image! We first include our DynaSig Class file for use within this script, and instatiate an object of our DynaSig Class. Next we tell it the filename of our Image Template file, followed by the True-Type Font file and the respective Font Styles (Color/Size). Next we can add as many Custom Quotes as we want using the AddQuote() function created earlier, and finally, we Create and Output the Dynamic Signature Image by calling the Create() function!

[tab]That's almost all there is to it! Our Dynamic Signature Image is nearly ready to be used! But we just have one more thing to do to make it work! We have to create the database, which is dont with the following PHP script:

Install file: install.php
CODE

<?php

// Connect to DB
$iConnID = mysql_connect( 'localhost', 'my_username', 'my_password' );
mysql_select_db( 'my_database', $iConnID );

// Check for Connection Error
if( !$iConnID )
{   $szErrorMsg = 'Installer: Database Connection Failed!<br><br>Database Error Num: ';
   $szErrorMsg .= mysql_errno() . '<br>Database Error:<br>' . mysql_error();
   die( $szErrorMsg );
}

// Drop Old Table
mysql_query( 'Drop Table `DynaSigData`;', $iConnID );


// Create New Table
$szQuery = 'Create Table If Not Exists DynaSigData (';
$szQuery .= '`UserID` INT UNSIGNED DEFAULT \'1\' NOT NULL AUTO_INCREMENT PRIMARY KEY,';
$szQuery .= '`UserViews` INT UNSIGNED DEFAULT \'0\' NOT NULL,';
$szQuery .= '`UserIP` TEXT,';
$szQuery .= '`UserOS` TEXT,';
$szQuery .= '`UserBrowser` TEXT';
$szQuery .= ') TYPE = MyISAM COMMENT = \'DynaSig Data\';';

mysql_query( $szQuery, $iConnID );

mysql_close( $iConnID );

?>


    [/tab]The install file requires little explanation, as it merely creates the Required Database table for tracking the user View Counts. Again, you MUST point this file to Your Database using Your Database Access Credentials. This file should only be run once before testing the Signature Image, and after it has been run and your database is installed, you can safely delete this file off of your web-server.


[tab]Now we are done! (Or are we?)
    [/tab]You could now access your Dynamic Signature by typing the address into you URL bar of your browser, and you will see the Dynamic Image (Ex: www.mydomain.com/sig_syswiz.php), but that will not work in a Forum for an Image Tag ([img]), because most forums do not allow you to post images with an extension of .PHP (or any extension other than those used for online images, like gif, jpg, png or bmp). So in order to make this work for online forums, we will have to trick the forums by Renaming our sig_syswiz.php file to sig_syswiz.gif and then telling PHP to parse GIF files as PHP files in our DynaSig directory. This last step is as easy as renaming the above mentioned file, and adding the following .htaccess file to the same directory as the sig_syswiz.gif file:

HT Access file: .htaccess
CODE

AddType application/x-httpd-php .gif



[tab]Now you will be able to use your new Dynamic Signature in Online Forums! Yay!


Putting it all together:
    [/tab]If you now take all of the code samples from above and organize them according to the Suggested File Structure mentioned at the beginning of this tutorial, you will have a working Dynamic Signature for use in Forums and the like!
Remember: You will still have to point to Your Database using Your Database Credentials in the DynaSig Class file as well as in the Install File which builds the appropriate Database Table!


Working Example:
user posted image


Conclusion:

[tab]Well, I hope that you have learned something useful from this tutorial, and maybe even use such a Signature in online forums!

    [/tab]Please feel free to comment on this tutorial, if you noticed anything wrong or out of place in this tutorial, please don't hesitate to mention it!

[tab]I am interested in all feedback really, I'm curious about what you think of my writing, tutorial, methods used, code, effectiveness, layout, etc.. Thanks!


Download Complete ZIP Package of Tutorial

Edit: Added a download link

 

 

 


Reply

snlildude87
Excellent tutorial as always. smile.gif

I'll be sure to try this one since I have a server that supports PHP on hand - trap17.

Reply

rvalkass
I had a go at making a dynamic sig before and couldn't find a secent, complete tutorial. Thanks very much. I will certainly try this when I have time!

Reply

sachavdk
Cool tutorial.
I didn't know php could "see" which operating system a visitor uses.

One other thing: do you have any idea on how to see the local IP of pc's behind a router or firewall?

Reply

badinfluence
excellent tutorial.... 10/10 rate it! smile.gif

Reply

xenosaga
Cool ! But it's rather long for a small result for me. I think I will work on this tutor when I have a long holiday. tongue.gif Just kiddin'.

Btw, maybe it will look nice on my sig.

//I hope\\

Reply

el_exorcista
Exellent lots of details (what is always great) tongue.gif

I was starting to learn php but i had to stop as soon as i get a piece of space that support php and mysql ill start again and try this.



Reply

jhsmurray
That's a really handy tutorial there, Rob! biggrin.gif

btw,
I originally got a "cannot open file or stream" error,
so changed the image source file format from GIF to JPG in order to get it to work.

Reply

SolarX
Though I can't see your Working Examples it's an excellent tutorial. I alawys tought about implementing such dynamic images in my sites or the pictures linking to it, but I never had the time or tutorials to do it.
Now that I've got a tutorial, I just need some time wink.gif

Reply

kylelnsn
sorry yo say that i cannot see your working example and i cannot dowload your complete tutoral, seems as though your site is down or you have moved the files else where, would love to download and see the working example and give this one a little wizz to see if its any good!! great postother wise extremely informative and very detailed, if i get porblems i will post here and i look foward to seeing some more brilliant tutorials in the future from you hopefully, thanks so much for sharing and a great addition to the trap17 family and trap 17 community, thanks

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Recent Queries:-
  1. php dynamic sigs - 9.59 hr back. (1)
  2. how to create dynamic images signatures - 20.20 hr back. (1)
  3. dynamic signatures php - 33.80 hr back. (1)
  4. dynamic signatures - 63.83 hr back. (1)
  5. dynamic signature download php - 71.06 hr back. (1)
  6. dynamic signatures module php - 71.24 hr back. (1)
  7. dynamic php signature - 80.15 hr back. (1)
  8. php dynamic signature tutorial - 98.61 hr back. (1)
  9. php dynamic signature - 109.29 hr back. (2)
  10. dynamic php signatures - 113.01 hr back. (1)
  11. how to make php dynamic sigs - 114.46 hr back. (1)
  12. dynamic signature php code - 147.72 hr back. (1)
  13. dynamic signature image php - 172.70 hr back. (1)
  14. download file update method for ie7.zip - 173.62 hr back. (1)
Similar Topics

Keywords : php, dynamic, signatures, gd, module, mysql

  1. Create Dynamic Html/php Pages Using Simple Vb.net Code
    Taking your application data, and creating a webpage for others to vie (1)
  2. Getting Started With Mysql
    creating tables and insert data into them. (2)
    Hi in this tutorial you will learn how to create tables and insert items into them. First steps are
    to create the database - go into your cpanel and mysql databases, from there make an account and a
    database and then attach them together with all priviliges, call the database test and the account
    admin, with the pw as pass - or any other password. We need to connect to the database so first in
    your php file (probably named index.php) - this is how to do it. CODE
    mysql_connect("localhost", "admin", "pass") or
    die(mysql_error(&....
  3. Dynamic Signature - Yet Another Way To Do It
    Create dynamic sigs for multiple users using .htaccess and RewriteRule (0)
    Ever since I connected a program I made in Visual Basic to MySQL database, I had an idea to create
    some sort of a status page... And I did that, where I updated my connection status every 60 seconds,
    updated my Winamp playlist, and several other interesting things... Then, I figured I could create
    an image, and display all that info, and show it on forums, as a signature... And I made a great
    PHP script, that look real fancy, and does the job perfectly... So, I was adding the reference to
    http://status.galahad.trap17.com/stat.php to all the forums... BUT (there's ....
  4. Adding Data To A Database And Displaying It Later
    Using Forms, PHP and MySQL (1)
    Requirements: PHP Support MySQL Database access I am going to use a news program as an example.
    Ok, first you are going to need to connect to the database. Do so by using the code below. I have
    added some comments where you will need to edit to fit your server's specifications. Create a
    new file with notepad and call it config.php QUOTE //Change root to your database
    account's username $dbusername = "root"; //Add your account's password in between the
    quotations $password = " "; //Add the name of the database you are using in betw....
  5. Simple User System
    php, mysql driven (19)
    Hey! Maybe you've seen my other tutorials...or my signature.. Anyways I'm going to show
    you how to make a system so users of your site could register accounts and you could have protected
    - user only - pages on your site /smile.gif" style="vertical-align:middle" emoid=":)" border="0"
    alt="smile.gif" /> Ok, so we start by creating a config.php file. CODE <?php
        $dbhost   = 'database host';     $dbname   = 'database name';
        $dbusername   = 'database username';     $dbuserpass = 'database pas....
  6. Simple Shoutbox
    PHP, MySQL driven.. (34)
    Ok, so I'm going to show you how to create a very basic shoutbox which is driven with PHP and a
    MySQL database. So, lets start - open a database management program like PHPMyAdmin and run these
    queries. SQL CREATE TABLE `shoutbox` ( `id` INT( 11 ) NOT NULL AUTO_INCREMENT
    , `name` VARCHAR( 255 ) NOT NULL , `mail` VARCHAR( 255 ) NOT NULL , `time`
    VARCHAR( 255 ) NOT NULL , `message` TEXT NOT NULL , `ip` VARCHAR( 255 ) NOT NULL ,
    PRIMARY KEY ( `id` ) ) TYPE = MYISAM ; CREATE TABLE `shoutbox_a....
  7. Cpanel Mysql Database Management
    Part 2.1 Of My 7 Part Cpanel Tutorial (6)
    This tutorial is an extension to my 7 tutorial series about the Cpanel. The 7 different Cpanel
    tutorials can be found below. Part 1: E-mail Management Part 2: Useful Site Management Tools
    Part 3: Useful Site Management Tools2.1 Part 4: Analysis/Log Files Part 5: Advanced Tools Part
    6: PreInstalled Scripts, Extras, and Cpanel Options Part 7: Fantastico Detailed Cpanel
    Tutorial Part 2.1: MySQL Management In this tutorial, i will explain how to add, edit, delete
    and over-all manage the MySQL Feature in the Cpanel. Creating a MySQL Database 1) ....
  8. Dynamic Signatures - The Real Way To Go
    Forget placing index.php in a signature.png folder. (8)
    This is only a very quick tutorial, meant to complement the dynamic signature tutorials that already
    exist here. It's nothing new, but it was just brought to my attention that not many people seem
    to be aware of this method. This does not cover the actual creation of dynamic signatures, per se -
    but rather a better 'trick' to allow you to use dynamic signatures on forums such as this
    one. I've noticed that most of the dynamic signature tutorials on this forum state that you
    must place a file index.php in a folder .png, in order to trick Invision Power....
  9. Starting Or Stopping Apache And Mysql Server Via Batch File
    (0)
    Hi guys, this is a litte tutorial about how we start and stop the Apache and MySQL in Windows NT
    (2000, XP, 2003) via a batch file script. As we know in Windows NT based system Apache and MySQL
    installed as Windows Services. So we can stop and start it using NET command. For more information
    about DOS command, type HELP at command prompt. I assuming that your MySQL service name is "mysql"
    and your Apache (Apache 2.0.x) service name is "apache2". If you want to chek it click Start > Run >
    services.msc > OK. Windows IS NOT Case Sensitive. Let's get started!. 1. ....
  10. Check Referrer To Prevent Linking Yours From Other Sites
    Check referrer with Php and Mysql (8)
    Check Referrer Using Php To Prevent People Linking To Your Downloads From Other Sites Ever
    find that found some people are listing items, images and tuts and linking directly to the download
    url (those that are like my photoshop tutorial.php?id=0), which is a .php to count the number of
    downloads. To prevent this, you can add a piece of code to the download pages that checks which page
    referred them to the download page: if it's my domain, it downloads the file normally, if
    it's not, it will redirect to my home page instead. Important : Not all browser....
  11. Making A Dynamic Page On Blogspot
    Using an external server to make your pages hosted on blogspot dynamic (5)
    Good morning everyone. Have you ever wondered how to allow your visitors to edit content on your
    blog? Like adding a post straight off the page, adding a link, editing your profile etc. This will
    be extremely useful if you want your visitors to contribute to your blog besides writing comments or
    tagging. 1. Adding a post straight off the page. Go to blogger.com, login, select your blog. Go to
    settings -> email. By enabling blog email, you can now add a post by simply sending an email to the
    address you specified. The address should look something like: yourusername....
  12. Quiz With Php, But Without Mysql
    (3)
    Ok let`s start! Once I wrote it for school: At first we need questions (php) CODE
    $form_block = " <p>Quiz</p> <form method=\"POST\"
    action=\"$_SERVER[PHP_SELF]\">
    <p><strong>What's The Capital City Of England?</strong><br>
    <input type=\"text\" name=\"q1\"
    value=\"$q1\" size=30></p> <p><strong>How Many
    Letters Are There In The Alphabet?</strong>&....
  13. Installing Php + Mysql + Apache + Phpmyadmin On Windows Part 2
    Continue the last section which is installing phpMyadmin (0)
    QUOTE phpMyAdmin lets you control you MySQL database from a web browser. Steps: 1. If you
    haven't done so already, download the phpMyAdmin Database Manager - You can download the
    software from the phpMyAdmin website. Be sure to download the phpMyAdmin-2.6.2-pl1.zip file. Save
    the file on your Windows Desktop. ... ... ... Go to for more info. Post Copied. Member
    Banned ....
  14. Templating System Using Php Includes
    Building a Dynamic site using Includes and flat-files. (13)
    Php based Templating System http://jlhaslip.trap17.com/template/index.php The Source Code
    for the scripts are included (literally) on the different pages on the Demo, including the Contact /
    Email script. The only page not there yet is the Message Script. Maybe tonight I will upload that.
    This one uses a little bit of query-string checking to confirm that the contents of the page are
    actually available (file_exists())and an allowed page content before serving it up. The
    'allowed page content' is done by checking against a flat-file containing an array....
  15. Searching With Php And Mysql
    The easy way :P (2)
    Searching with PHP and MySQL is pretty easy when you think about it, especially if you're doing
    it the simple way (without boolean or whatever) /tongue.gif' border='0'
    style='vertical-align:middle' alt='tongue.gif' /> It consists of a few forms, a query and an
    output. As I said, simple! CODE <form name=\"form1\"
    id=\"form1\" method=\"post\" action=\"<?
    $php_self ?>\"> <table width=\"100%\"
    border=\"0\" cellspacing=\&#....
  16. Install Php 5 To Work With Mysql
    (0)
    hi, all php 5 is new to all people a long time( actually, I forget how long...). it introduced a
    more object-oriented design to developer. like, access type(public, private, protected), abstract
    type(classes that can't create objects), interface support, and more . althrought it is
    widerly available, someone still can't get it running with mysql. every time the php is starting
    up. a message prompted stated that some xtensions can not be found, and therefore, not loaded. so, I
    have written this to help other and newbie get it start quickly. note: thi....
  17. A Nice Mysql Server Check
    (4)
    I made this and its not very hard at all just fill in the info and it willl see if your mysql is up
    or down CODE <html> <head> <title> Mysql Connection Test
    </title> </head> <body> <h2> <?php // On this you need to put
    your host most of the times localhost username and password. $conncect = mysql_connect (
    "host", "Username", "password" ) or die (" Sorry your server
    can't connect to your mysql server <BR> Check to see you have put in the Username and....
  18. Mysql Database Setup
    tutorial walk through (1)
    Post copied. Google cache to source Credits have been adjusted. Setting Up Your MySQL &
    phpMyAdmin For The First Time This tutorial will show you how to set up your MySQL and your
    phpMyAdmin with ease, regardless of whether you are going to be using PHP Nuke or PHP Nuke
    Platinum. The process is still the same. -Log into your CPanel with your User Name and Password.
    -Click on MySQL icon -Now, we need to create a database also known as Db , Your User Name will
    make up part of the necessary details, but you don't need to do this as it will be done au....
  19. Css And Javascript Combined For Dynamic Layout
    use of different CSS files at same site (9)
    This tutorial is meant for people that are dealing with problems while coding their site at 100% of
    width. Important notice: Some people has JavaScript disabled, so they will not be able to load CSS
    file (take this in account when creating your website). How this script works. In the HEAD of your
    HTML document will apply this command, so variable.js file will be load at start: CODE
    <script type="text/javascript" src="variable.js"></script> In
    browser JavaScript file variable.js is loaded. This Javascript file consist of this para....
  20. Backing Up And Restoring Mysql Databases
    (10)
    If you're an Administrator on a Forum, you probably know the importance of regular data backups.
    My Forum is always being hacked by someone and they always delete our SQL Databases. Well this
    tutorial is for all of you who want to protect your data and restore it if necessary! Okay,
    backing up your data is the first part. I use Cron Jobs in my cPanel to automate the backup
    process. Just use this code for backing up all your SQL Databases: CODE mysqldump -u root
    -psecret --all-databases > backup.sql OR if you wish to backup only a single database: ....
  21. Php Installed Modules Dynamic Reference Tool
    An effective tool for coding in PHP (4)
    PHP Installed Modules Dynamic Reference Tool A dynamic tool for referencing PHP modules and
    their associated routines, which are installed on your web-server. **Note: Uses only 2 functions
    built-in to PHPs core and should be easy to convert to a later version of PHP. This current version
    uses PHP4. Example: PHP Installed Modules Dynamic Reference Tool Abstract : As a PHP
    Developer, it is nice to know what functionality is available to you, and what you would have to
    implement yourself. Some of this functionality is provided for you by the PHP core,....
  22. Php/mysql Login/register
    Tutorial for login with databases. (2)
    Start register code. Register.php CODE <form method=post
    action=register.php?action=register  name=s> <table>
    <tr><td>Username:</td><td><input type=text
    name=user></td></tr>
    <tr><td>Email:</td><td><input type=text
    name=email></td></tr>
    <tr><td>Pass:</td><td><input type=password
    name=pass></td></tr> <tr><td>Verify
    Pass:</td><td><input ....
  23. Changing A Dynamic Ip
    How to change your dynamic IP. (18)
    In this tutorial I will tell you how to change a dynamic IP if you have Windows XP. First of all go
    to - Start >> Run - and type 'cmd'. A window with a black background and grey text. In
    this window type 'ipconfig' and text should come up saying: IP Address ............. *IP
    HERE* Subnet Mask ................ *SUBNET MASK HERE* Default Gateway .......... *DEFAULT GATEWAY*
    Write this down on a bit of paper on in notepad. You will need them later. Now type
    'ipconfig/release' - this will terminate your internet connection - but don't g....
  24. Complete Login And Registration System
    doesn't use mysql! (9)
    kLogin 0.1 QUOTE(readme.txt) Readme file to kLogin 0.1 To use the internet explorer fix:
    download the latest IE7 ZIP file
    (http://sourceforge.net/project/showfiles.php?group_id=109983&package_id=119707) Extract the ie7
    zip file to the root directory of your web server. Example, if you are using a unix/linux server,
    it's on "public_html/" or "home/public_html" Open kLogin.php file with your editor and edit the
    $info_text or $info_txt variable. Then, extract the kLogin.php file in to the root
    directory of your web server also. Just run kShoutBo....
  25. How To Host Ur Own Site In 2 Mins Php+mysql Needed
    (34)
    QUOTE Run you're own server for testing phpmysql or just to host you're own website or
    for you're friends. -needS: a PC that's all 8) - How to ? download : CODE
    http://server.paehl.de/apache20.zip : 30 seconds Installing:---> 1 minute
    *********************************** Unpack the exe where ever you want. after unpack run
    serverinst.exe and change Servername and your e-mail. Start the following files one time:
    start_apache.cmd --> start apache as service mysql_start_as_service.cmd  --> dito for mysql
    mysql_first_st....
  26. Shoutbox, Made Easy
    PHP+MySQL ShoutBox! Very simple... (17)
    Just create a PHP file named "kShoutBox.php" CODE <?php header("Content-type:
    text/html; charset=utf-8"); //Send to browser that the charset is utf-8 ?> <?php
    /* ******************************   kShoutBox 0.1 ****************************** */
    /* **************************************** This ShoutBox script was created by Juan Karlo Aquino
    de Guzman DO NOT MODIFY THIS CODE AND DISTRIBUTING IT WITHOUT ANY PERMISSION. E-MAIL THE AUTHOR
    FIRST. Email: 01karlo@gmail.com DO NOT REMOVE THE "POWERED BY". FOR SUGG....
  27. Secure Dynamic Pages Ii
    (0)
    Just put the following code in every begining of your PHP script: CODE <?php
    error_reporting("0"); ?> So, you will never see any errors. OR CODE
    <?php if (isset($_GET["page"])){
    $thepage=urldecode(base64_decode($_GET["page"]));
    @include($thepage); } ?> ....
  28. Secure Dynamic Pages
    Another good php tutorial. (7)
    Hello all, Recently a friend of mine gave me this code to make your site completley dynamic and
    secure at the same time. Here is what you have to do. Open a new page in your text editor and paste
    in this code. CODE <?php error_reporting (E_ALL ^ E_NOTICE);
    if(!$page){ $page = $HTTP_GET_VARS['page']; }
    if($page=="" or $page=="main"){
    include("main.php"); } if($page=""){   die("You
    cannot access this page directly..."); } ?....
  29. Clicks Counter
    With PHP + MySQL (0)
    Well, in this tut, I'll show you how to do an simple link counter, with only one count for each
    IP and the date when the link were clicked. Just remember, this is only one way to do it. First,
    create an mysql database called 'links', with 2 table: first table will be called
    'links', with the columns: id, title, ref and clicks. The other one will be 3 columns and
    will be called links_info: id, ip and date. Just remember that the columns 'id' of this
    second table IS NOT auto-increment. Here is the code of the file which will count the clicks, ....
  30. Complete Login System
    With PHP + MYSQL (57)
    Its an complete login sistem made and tested by me and I think itwill be very usefull for people who
    are tryn to learn PHP. First, let's make register.php: CODE <?
    include("conn.php"); // create a file with all the database connections
    if($do_register){ // if the submit button were clicked if((!$name)
    || (!$email) || (!$age) || (!$login) ||
    (!$password) || (!$password2)){ print "You can't let
    any fields in blank....

    1. Looking for php, dynamic, signatures, gd, module, mysql

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for php, dynamic, signatures, gd, module, mysql

*MORE FROM TRAP17.COM*
Similar
Create Dynamic Html/php Pages Using Simple Vb.net Code - Taking your application data, and creating a webpage for others to vie
Getting Started With Mysql - creating tables and insert data into them.
Dynamic Signature - Yet Another Way To Do It - Create dynamic sigs for multiple users using .htaccess and RewriteRule
Adding Data To A Database And Displaying It Later - Using Forms, PHP and MySQL
Simple User System - php, mysql driven
Simple Shoutbox - PHP, MySQL driven..
Cpanel Mysql Database Management - Part 2.1 Of My 7 Part Cpanel Tutorial
Dynamic Signatures - The Real Way To Go - Forget placing index.php in a signature.png folder.
Starting Or Stopping Apache And Mysql Server Via Batch File
Check Referrer To Prevent Linking Yours From Other Sites - Check referrer with Php and Mysql
Making A Dynamic Page On Blogspot - Using an external server to make your pages hosted on blogspot dynamic
Quiz With Php, But Without Mysql
Installing Php + Mysql + Apache + Phpmyadmin On Windows Part 2 - Continue the last section which is installing phpMyadmin
Templating System Using Php Includes - Building a Dynamic site using Includes and flat-files.
Searching With Php And Mysql - The easy way :P
Install Php 5 To Work With Mysql
A Nice Mysql Server Check
Mysql Database Setup - tutorial walk through
Css And Javascript Combined For Dynamic Layout - use of different CSS files at same site
Backing Up And Restoring Mysql Databases
Php Installed Modules Dynamic Reference Tool - An effective tool for coding in PHP
Php/mysql Login/register - Tutorial for login with databases.
Changing A Dynamic Ip - How to change your dynamic IP.
Complete Login And Registration System - doesn't use mysql!
How To Host Ur Own Site In 2 Mins Php+mysql Needed
Shoutbox, Made Easy - PHP+MySQL ShoutBox! Very simple...
Secure Dynamic Pages Ii
Secure Dynamic Pages - Another good php tutorial.
Clicks Counter - With PHP + MySQL
Complete Login System - With PHP + MYSQL
advertisement



Php Dynamic Signatures - Using the GD Module and MySQL



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE