[Tutorial] Creating dynamic signatures using PHP and MySQL.
#61

Seems noone know what to do here :=)
Reply
#62

Error on image result
Reply
#63

Delete
Reply
#64

I've created a SQLite version of this! Not been tested just yet.
Reply
#65

Hey I done exactly what you said but when I insert the username. The stuff doesn't come up.

Here is the first screen, it works ok:

http://prntscr.com/zv6mt

But when I click Submit, this comes up:

http://prntscr.com/zv6ra

Please help!
Reply
#66

Install php.
Reply
#67

Quote:
Originally Posted by VincentDunn
View Post
Install php.
Huh?
Reply
#68

I added it to the webhost and I got this:

Code:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'127.0.0.1' (using password: NO) in /home/a2180513/public_html/Signatures/signature.php on line 10
Reply
#69

Quote:
Originally Posted by FunnyBear
View Post
I added it to the webhost and I got this:

Code:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'127.0.0.1' (using password: NO) in /home/a2180513/public_html/Signatures/signature.php on line 10
You would be better off creating a MySQL user through PHPMyAdmin, rather than using the root user - as it seems it is expecting a password. This way you can better manage where it access data from, rather than giving it full database privileges!
Reply
#70

Use this URL: http://localhost/phpmyadmin to access your PHPMyAdmin installation, login as root with the details you created during the installation of XAMPP and then create your new user account for the database.
Reply
#71

Cool Tutorial, much appreciated.
Reply
#72

great, i've searching it for very long time, but now it's only show the picture, the information does not appear...

please help

EDIT: it's now work i just forgotten the color.... i used the black color, when my background color is black too

mine:
Reply
#73

will it work if I use a website host that uses MySQL?
Reply
#74

Really good tutorial!
Reply
#75

can anyone help me? I get this:


this is really wierd!!!

help me please

my PHP Code is this one:
PHP Code:
<? 
/*
***Made by: Nodroz***
*** Enjoy your signatures! ***
*/
$username="************"//Your MySQL Username.
$password="************"// Your MySQL Pass.
$database="************"// Your MySQL database.
$host="************"// Your MySQL host. This is "localhost" or the IP specified by your hosting company.
$player_name=$_GET['player_name']; // This gets the player his name from the previous page.
/* Next, we will make a connection to the mysql. 
If it can't connect, it'll print on the screen: Unable to select database. Be sure the databasename exists and online is. */
mysql_connect($host,$username,$password); // Connection to the database.
@mysql_select_db($database) or die( "Unable to select database. Be sure the databasename exists and online is."); //Selection of the database. If it can't read the database, it'll give an error.
/* To protect MySQL injection. */
$player_name stripslashes($player_name);
$player_name mysql_real_escape_string($player_name);
$query="SELECT * FROM pInfo WHERE username='$player_name'"// Gets all the information about the player.
$result=mysql_query($query);
$i=mysql_num_rows($result); // Here we are counting how many rows this result gives us.
/* We will now put the player's information into variables so we can use them more easily. */
/* DON'T FORGET: The names should be exact the same as in your mysql db.*/
if ($i == 1// If the user has been correct, then it'll give us 1 row. If its 1 row, then it'll proceed with the code.
{
        
    
$Playername=mysql_result($result,0,"username"); // Gets the username of the player and put it in the variable $Playername.
    
$Money=mysql_result($result,0,"Money"); // Gets the money of the player and put it in the variable $Money.
    
$Score=mysql_result($result,0,"Score"); // Gets the score of the player and put it in the variable $Score.
    // Creating of the .png image. 
    
header('Content-Type: image/png;');
    
$im = @imagecreatefrompng('playersig.png') or die("Cannot select the correct image. Please contact the webmaster."); // Don't forget to put your picture there.
    
$text_color imagecolorallocate($im255,255,255); // RED, GREEN, BLUE --> Go to www.colorpicker.com, select a nice color. Copy the R/G/B letters provided by colorpicker and put them here.
    
$text_username "$Playername"// This gets the information about player name to be showed in the picture.
    
$text_score "$Score"// Same as above ^^
    
$text_money "$Money"// Same as above ^^
    
$font 'font.ttf'//Upload your custom font to the directory where this file is placed. Then change the name here.
    /* USAGE OF THE imagettftext: First ($im) shouldn't be changed. (16) is the text-size. (0) is the angle of your text. Change it, and you'll see what's going on. (20) is de X-coordinate of the text.
    (36) is the Y-coordinate of the text. */
    
imagettftext($im1602036$text_color$font$text_username); // Prints the username in the picture. 
    
imagettftext($im1607269$text_color$font$text_score); // Prints the score in the picture.
    
imagettftext($im1607299$text_color$font$text_money); // Prints the money in the picture.
    
imagepng($im);
    
imagedestroy($im);
} else echo(
'Username is not in our database. Please try again.'); // If the username doesn't exist (so the row is 0) then it'll give en error.
mysql_close();
?>
Help me plz!!!
Reply
#76

are you sure you have image and The font named "Font.TTF" in same directory as this script(.php file) is in?
Reply
#77

have error:
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/*/public_html/reg.php on line 28 Username is not in our database. Please try again.
Reply
#78

Yes I managed to get it to work

heres mine:
Reply
#79

how to change url signature
example :
site-name.com/sig/player-name.png
Reply
#80

sorry for bump but some one has the .ini version ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)