Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 08-17-2006, 10:07 AM   #1 (permalink)
markster
Code Monkey
 
markster's Avatar
 
Join Date: Jun 2006
Posts: 65
markster is on a distinguished road
Exclamation Script not working in FireFox

I have written this script for a win button to place on a website. It works in IE, but not in firefox. Anyone know why?

PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Velocity Competitions - Win Button</title>
</head>
<body>
<?php
include "index.htm";
$ip $_SERVER["REMOTE_ADDR"];
if (
file_exists("Win Button Records" $ip ".txt"))
{
$i fopen($ip ".txt""r+");
$lastPlay fread($i1000);
fclose($i);
$currTime date("U");
$diff $currTime-$lastPlay;
}
else
{
$diff 1000000;
}
if (
$diff<172800)
{
echo 
"<script language=\"javascript\">alert(\"Sorry, you cannot play because you have already played in the past 48 hours. Please wait for 48 hours between playing.\")</script>";
}
else
{
play1();
}
function 
play1()
{
$code date("YnjG");
$winmsg "<script language=\"javascript\">alert(\"Congratulations! You have won free entry to any competition where the prize is non-cash. Your special code is " $code ". To redeem simply E-mail your code along with the name of your prize to winbutton@velocitycompetitions.co.uk and we will E-mail you back with details on how to claim your prize. You will not be able to play again for 48 hours.\")</script>";
$userno rand(1,20);
$winno rand(1,20);
if (
$userno!=$winno)
{
play2();
}
else
{
mail("winbutton@velocitycompetitions.co.uk""Win Button"" CODE: " $code "\n\nPRIZE: Free entry to non-cash comp");
echo 
$winmsg;
}
}
function 
play2()
{
$code date("YnjG");
$winmsg "<script language=\"javascript\">alert(\"Congratulations! You have won a free 1 day token. Your special code is " $code ". To redeem simply E-mail your code along with the name of your prize to winbutton@velocitycompetitions.co.uk and we will E-mail you back with details on how to claim your prize. You will not be able to play again for 48 hours.\")</script>";
$userno rand(1,100);
$winno rand(1,100);
if (
$userno!=$winno)
{
play3();
}
else
{
mail("winbutton@velocitycompetitions.co.uk""Win Button"" CODE: " $code "\n\nPRIZE: Free 1 day token");
echo 
$winmsg;
}
}
function 
play3()
{
$code date("YnjG");
$winmsg "<script language=\"javascript\">alert(\"Congratulations! You have won a free 3 day token. Your special code is " $code ". To redeem simply E-mail your code along with the name of your prize to winbutton@velocitycompetitions.co.uk and we will E-mail you back with details on how to claim your prize. You will not be able to play again for 48 hours.\")</script>";
$userno rand(1,1000);
$winno rand(1,1000);
if (
$userno!=$winno)
{
play4();
}
else
{
mail("winbutton@velocitycompetitions.co.uk""Win Button"" CODE: " $code "\n\nPRIZE: Free 3 day token");
echo 
$winmsg;
}
}
function 
play4()
{
$code date("YnjG");
$winmsg "<script language=\"javascript\">alert(\"Congratulations! You have won a free week token. Your special code is " $code ". To redeem simply E-mail your code along with the name of your prize to winbutton@velocitycompetitions.co.uk and we will E-mail you back with details on how to claim your prize. You will not be able to play again for 48 hours.\")</script>";
$userno rand(1,10000);
$winno rand(1,10000);
if (
$userno!=$winno)
{
play5();
}
else
{
mail("winbutton@velocitycompetitions.co.uk""Win Button"" CODE: " $code "\n\nPRIZE: Free week token");
echo 
$winmsg;
}
}
function 
play5()
{
$code date("YnjG");
$winmsg "<script language=\"javascript\">alert(\"Congratulations! You have won a free month token. Your special code is " $code ". To redeem simply E-mail your code along with the name of your prize to winbutton@velocitycompetitions.co.uk and we will E-mail you back with details on how to claim your prize. You will not be able to play again for 48 hours.\")</script>";
$userno rand(1,100000);
$winno rand(1,100000);
if (
$userno!=$winno)
{
play6();
}
else
{
mail("winbutton@velocitycompetitions.co.uk""Win Button"" CODE: " $code "\n\nPRIZE: Free month token");
echo 
$winmsg;
}
}
function 
play6()
{
$code date("YnjG");
$nowin "<script language=\"javascript\">alert(\"Sorry, you did not win a prize. You will not be able to play again for 48 hours.\")</script>";
$winmsg "<script language=\"javascript\">alert(\"Congratulations! You have won £15!! Your special code is " $code ". To redeem simply E-mail your code along with the name of your prize to winbutton@velocitycompetitions.co.uk and we will E-mail you back with details on how to claim your prize. You will not be able to play again for 48 hours.\")</script>";
$userno rand(1,1000000);
$winno rand(1,1000000);
if (
$userno!=$winno)
{
echo 
$nowin;
}
else
{
mail("winbutton@velocitycompetitions.co.uk""Win Button"" CODE: " $code "\n\nPRIZE: £15");
echo 
$winmsg;
}
}
$i2 fopen("Win Buttton Records" $ip ".txt""w");
fwrite($i2date("U"));
fclose($i2)
?>
</body>
</html>
markster is offline   Reply With Quote
Old 08-17-2006, 10:31 AM   #2 (permalink)
markster
Code Monkey
 
markster's Avatar
 
Join Date: Jun 2006
Posts: 65
markster is on a distinguished road
never mind, fixed it
markster is offline   Reply With Quote
Old 08-17-2006, 12:15 PM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
ok, just a tip. if you are having cross browse issues, then the problem will always be in the html, not the PHP.

so, view the source of the page that PHP generated and copy the relavent area and post it to us. there's not way i could have tried to figure out what a browser issue was with the php code you posted.

glad you got it fixed =D
__________________
Mike
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Weird Image Scrolling Script...Please Help mark4man HTML, XML, Javascript, AJAX 3 06-14-2005 07:51 AM
Firefox gets security upgrade 1.0.1 sde Code Newbie News 0 03-07-2005 06:46 AM
Firefox smashes funding target sde Code Newbie News 0 10-22-2004 05:45 PM
Script Not Working Ilya020 PHP 1 06-02-2003 06:40 PM
cgi not working on a new script sde PHP 3 05-20-2002 08:29 PM


All times are GMT -8. The time now is 08:28 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting