The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How to make a banner code generator.

Page 2 of 2 Previous  1, 2

View previous topic View next topic Go down

Solved How to make a banner code generator.

Post by smurfavr on June 30th 2014, 5:04 pm

First topic message reminder :

How to make this code work on my site.This is the code which banner generator.

Code:
<div class="box">
<div class='boxhead'>Банер Генератор</div>     
<center>
<?php
$random_number = rand(1, 5);
$random_banner[1] = 'Колко е 18-9';
$random_banner[2] = 'Колко е 5+4';
$random_banner[3] = 'Колко е 8+1';
$random_banner[4] = 'Колко е 2+7';
$random_banner[5] = 'Колко е 15-6';

function validateIpAddress($ip_addr) {
     
if(preg_match("/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\:[0-9]{1,5}/",$ip_addr))
{
return true; 
} else { 
return false;
}
}
?>
<fieldset><legend>Статистиката съдържа само играта:Counter-Strike 1.6</legend>
<form method="post" action="">
<label><strong>IP Адрес:</strong></label>
<br />
<input name="ip" type="text" size="30"/>
<br />
<label><strong><?php echo $random_banner[$random_number]; ?></strong></label>
<br />
<input name="code" type="text" size="30"/>
<br /><br />
<input type="submit" name="napravi" class="button1" value="Създай"/>
</form>
</fieldset>     
<?php
if(isset($_POST['napravi']))
{
$ip = addslashes(trim($_POST['ip']));
$code =  trim($_POST['code']);
           
if($ip == NULL || $code == NULL)
{
echo "<br /><div class='error message'>Моля, попълнете всички полета!</div><br />";
} else {
if(validateIpAddress($ip))
{
if($code != 9) {
echo "<br /><div class='error message'>Кодът е грешен!</div><br />
";
} else {
$check = mysql_query("SELECT * FROM server_gen WHERE ip = '$ip'");
if($num = mysql_num_rows($check)){
echo "<br /><div class='error message'>Този IP адрес вече е бил използван.</div><br />";
echo '
<fieldset><legend>Демо на картинката</legend>
<img src="../small/small.php?ip='.$ip.'">
</fieldset>
<fieldset><legend>Кодове за вграждане</legend>
<label for="codebb">BBCode (за форуми):</label>
<input align="center" value="[url=http://www.ultra-zonecs.info][img]http://www.ultra-zonecs.info/small/small.php?ip='.$ip.'[/img][/url]" type="text" size="99">
<label for="codebb">HTML (за сайтове):</label>
<input align="center" value="<img src=http://www.ultra-zonecs.info/small/small.php?ip='.$ip.'>" type="text" size="99">
</fieldset>';
} else {
$sql = mysql_query("INSERT INTO server_gen (ip) VALUES ('$ip')");
echo '
<fieldset>
<legend>Демо на картинката</legend>
<img src="../small/small.php?ip='.$ip.'">
</fieldset>
<fieldset><legend>Кодове за вграждане</legend>
<label for="codebb">BBCode (за форуми):</label>
<input align="center" value="[url=http://www.ultra-zonecs.info][img]http://www.ultra-zonecs.info/small/small.php?ip='.$ip.'[/img][/url]" type="text" size="99">
<label for="codebb">HTML (за сайтове):</label>
<input align="center" value="<img src=http://www.ultra-zonecs.info/small/small.php?ip='.$ip.'>" type="text" size="99">
</fieldset><br /><br /><br />';
}
}
} else {
echo "<br /><div class='error message'>Моля, въведете реален IP адрес и порт.</div><br />";
}
}
}
?></center>
</div>

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down


Solved Re: How to make a banner code generator.

Post by smurfavr on July 15th 2014, 4:52 am

I can not say for sure.

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by SLGray on July 15th 2014, 5:05 am

I do not know how you got this code, but my browser console shows many errors.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35622
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on July 15th 2014, 5:09 am

Site of which is taken your code works.

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by SLGray on July 15th 2014, 5:12 am

Is it because the site is hosted by phpBB?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35622
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on July 15th 2014, 5:14 am

It's possible.

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by SLGray on July 15th 2014, 5:15 am

Not all phpBB mods will work on Forumotion forums.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35622
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on July 15th 2014, 5:48 am

If this mod can not work on my forum this topic is solved.

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by smurfavr on July 20th 2014, 5:29 am

Soloved

smurfavr
Active Poster

Male Posts : 1384
Reputation : 9
Language : Bulgarian

http://smurfa.bulgarianforum.net/

Back to top Go down

Solved Re: How to make a banner code generator.

Post by SLGray on July 20th 2014, 8:15 am

Topic Solved & Archived


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35622
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Page 2 of 2 Previous  1, 2

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum