Jump to content
MakeWebGames

Random Banner On Login.php


-CrAzY-

Recommended Posts

I Tryed This:

 

$auto = (int)rand(1, 2);
if ($auto == 1)
{
       [img=banners/1.jpg];

}
if ($auto == 2)
{
       [img=banners/2.jpg];

}
EOF;
$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'])
   ?  $_SERVER['HTTP_X_FORWARDED_FOR']
   :  $_SERVER['REMOTE_ADDR'];
if(file_exists('ipbans/'.$ip))
{

 

in login.php

But It Just Shows Two Banners And Some Writing ( if ($auto == 2) .. Etc. )

 

Can Someone Help

Link to comment
Share on other sites

Re: Random Banner On Login.php

 

<body onload="getme();">EOF;
$auto = (int)rand(1, 2);
if ($auto == 1)
{
       print"[img=banners/1.jpg]";

}
if ($auto == 2)
{
       print"[img=banners/2.jpg]";

}



$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'])
   ?  $_SERVER['HTTP_X_FORWARDED_FOR']
   :  $_SERVER['REMOTE_ADDR'];
if(file_exists('ipbans/'.$ip))
{

 

beat me to it again...

v,v

Link to comment
Share on other sites

Re: Random Banner On Login.php

 

</style>
</head>
<body onload="getme();">EOF;
$auto = (int)rand(1, 2);
if ($auto == 1)
{
       print"[img=banners/1.jpg]";

}
if ($auto == 2)
{
       print"[img=banners/2.jpg]";

}



$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'])
   ?  $_SERVER['HTTP_X_FORWARDED_FOR']
   :  $_SERVER['REMOTE_ADDR'];
if(file_exists('ipbans/'.$ip))
{die("[b]<font color=red size=+1>Your IP has been banned, there is no way around this. If you feel this is unfair please contact the Admin!
</font>[/b]</body></html>");
}

 

=

 

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/imgame/public_html/login.php on line 143

Please Help

Link to comment
Share on other sites

Re: Random Banner On Login.php

Try this:

</style>
</head>
<body onload="getme();">
EOF;
$auto = rand(1,2);
if ($auto == 1) echo "[img=banners/1.jpg]";
else echo "[img=banners/2.jpg]";

$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'])
   ?  $_SERVER['HTTP_X_FORWARDED_FOR']
   :  $_SERVER['REMOTE_ADDR'];
if(file_exists('ipbans/'.$ip))
{die("[b]<font color=red size=+1>Your IP has been banned, there is no way around this. If you feel this is unfair please contact the Admin!
</font>[/b]</body></html>");
}

 

Edit: I think it may have been the heredoc function.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...