Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[PHP] Simple add badge in to external_flash_texts.txt [PHX]

Newbie Spellweaver
Joined
Oct 21, 2013
Messages
7
Reaction score
3
Hello Ragezone

If you upload a badge in your folder you wont open external_flash_texts.txt to add badge description because you are to lazy i found an great idea from my lovely friend

Screen:
1:
2:

PHP:
<?php$badgename = htmlspecialchars($_POST['badgename']);$badgedesc = htmlspecialchars($_POST['badgedesc']);if(empty($badgename)) { 	$error_title = "<font color='red'>(Badge name not found)</font>";}elseif(empty($badgedesc)) {	$error_desc = "<font color='red'>(Badge description not found)</font>";}else{$succes = "Badge name and description added";$myFile = "../r63/external_flash_texts.txt";$fh = fopen($myFile, 'a') or die("File not found.");$string = "badge_desc_".$badgename."=".$badgedesc."";fwrite($fh, nl2br($string). "\r\n");fclose($fh);}?><form method="post">
Badge name <?php if(isset($error_title)) { echo $error_title; }?></br><input id="name" name="badgename"></br>
Badge description <?php if(isset($error_desc)) { echo $error_desc; }?></br><input id="name" name="badgedesc"></br>
<input type="submit" name="submit" value="Submit">

credits
Myself to make it simple
 
Still alive.
Loyal Member
Joined
Apr 13, 2013
Messages
1,145
Reaction score
886
cool idea, thanks!

Greetz,
 
Junior Spellweaver
Joined
Jan 30, 2013
Messages
167
Reaction score
13
Only not every body uses the Folder ../R63/blablabla you know what im saying mabye is it an idea to put there Folder location here


Sorry for bad english im dutch
 
Newbie Spellweaver
Joined
Mar 22, 2013
Messages
56
Reaction score
9
Here already running Badge_name:
PHP:
<?php
error_reporting(E_ALL ^ E_NOTICE);
$badgename = htmlspecialchars($_POST['badgename']);
$badgedesc = htmlspecialchars($_POST['badgedesc']);
if(empty($badgename)) {     
$error_title = "<font color='red'>(Badgename Found)</font>";
}
elseif(empty($badgedesc)) 
{    
$error_desc = "<font color='red'>(Badge description not found)</font>";
}else{
$succes = "Badge name and description added";
$myFile = "./swf/gamedata/external_flash_texts/1.txt";
$fh = fopen($myFile, 'a') or die("File not found.");
$strings = "badge_name_".$badgename."=".$badgename."";
$string = "badge_desc_".$badgename."=".$badgedesc."";
fwrite($fh, "\r" .nl2br($strings). "\r\n" .nl2br($string));
fclose($fh);
}
?>
<form method="post">
Badge name <?php if(isset($error_title)) { echo $error_title; }?></br><input id="name" name="badgename"></br>
Badge description <?php if(isset($error_desc)) { echo $error_desc; }?></br><input id="name" name="badgedesc"></br>
<input type="submit" name="submit" value="Submit">
 
Elite Diviner
Joined
Aug 4, 2013
Messages
466
Reaction score
169
Only not every body uses the Folder ../R63/blablabla you know what im saying mabye is it an idea to put there Folder location here
Sorry for bad english im dutch
So edit it accordingly to where your texts are located.


On topic: Great release! Definitely is handy.
 

pel

Skilled Illusionist
Joined
Jan 27, 2012
Messages
382
Reaction score
343
Already coded something like that, but my problem was, that I've to switch the ftp server. So I worked with MySQL <: its much better xD
 
Back
Top