Solved

Parse error: syntax error, unexpected T_VARIABLE in /home/tvepisod/public_html/redirecttest.php on line 48

Posted on 2008-10-23
2
1,245 Views
Last Modified: 2012-05-05
HI there Im getting an error on line 48 of the attatched code regarding the case statement. Can anyone help?
<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>TvShow</title>
 

    <link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" />

    <!-- GC -->

        <!-- LIBS -->

        <script type="text/javascript" src="adapter/ext/ext-base.js"></script>

        <!-- ENDLIBS -->
 

    <script type="text/javascript" src="ext-all.js"></script>

    <script type="text/javascript" src="msg-box.js"></script>
 

    <!-- Common Styles for the examples -->

    <link rel="stylesheet" type="text/css" href="shared/examples.css" />
 

    <style type="text/css">

        .x-window-dlg .ext-mb-download {

            background:transparent url(images/download.gif) no-repeat top left;

            height:46px;

        }

    </style>

</head>
 

<body>
 

<?

//---------------------------------------------------------------------------------//

// you don't need to edit past this point :)

//---------------------------------------------------------------------------------//
 

// look through the ip-to-country DB to get geo location

$intUserIPNum = sprintf("%u", ip2long($_SERVER['REMOTE_ADDR']));

$fh = @fopen("ip-to-country.csv", "r");

if ($fh){

	while (($data = fgetcsv($fh, 1000, ",", "\"")) !== FALSE) {

		if (($intUserIPNum >= $data[0]) and ($intUserIPNum <= $data[1])){

			$strCountryCode = $data[2];

			break;

		}

	}

	fclose($fh);

}
 

switch ($strCountryCode) {

case "GB"

$redirectURL = 'http%3A%2F%2F1%2Eofsnetwork%2Ecom%2Fz%2F31581%2FCD7399%2F%26dp%3D0%26l%3D0%26subid1%3D%26subid2%3D%26subid3%3D%26subid4%3D%26subid5%3D';

break;

case "US"

$redirectURL = 'http%3A%2F%2Fwww%2Elynxtrack%2Ecom%2Fafclick%2Ephp%3Fo%3D7846%26b%3Dxgfg6fz9%26p%3D27636%26l%3D1';

break;

case "AU"

$redirectURL = 'http%3A%2F%2F1%2Eofsnetwork%2Ecom%2Fz%2F26680%2FCD7399%2F%26dp%3D0%26l%3D0%26subid1%3D%26subid2%3D%26subid3%3D%26subid4%3D%26subid5%3D';

break;

default:

$redirectURL = 'http%3A%2F%2Fwww%2Elynxtrack%2Ecom%2Fafclick%2Ephp%3Fo%3D7846%26b%3Dxgfg6fz9%26p%3D27636%26l%3D1';

}
 

?>
 
 

<!-- Start of StatCounter Code -->

<script type="text/javascript">

sc_project=3739435; 

sc_invisible=1; 

sc_partition=45; 

sc_security="b0782d8d"; 

</script>
 

<script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script><noscript><div class="statcounter"><a title="web stats" class="statcounter" href="http://www.statcounter.com/"><img class="statcounter" src="http://c46.statcounter.com/3739435/0/b0782d8d/1/" alt="web stats" /></a></div></noscript>

<!-- End of StatCounter Code -->
 

<script type="text/javascript">

 function showResult(btn){

document.location.href="<?=$redirectURL?>"

    };
 
 

        Ext.MessageBox.show({

           title: 'Please wait',

           msg: 'Checking your settings...',

           progressText: 'In Progress...',

           width:300,

           progress:true,

           closable:false,

           animEl: 'mb6'

       });
 

       // this hideous block creates the bogus progress

       var f = function(v){

            return function(){

                if(v == 12){

                    Ext.MessageBox.hide();

                    Ext.example.msg('Configuration', 'Missing Plugin!');
 
 

                }else{

                    var i = v/11;

                    Ext.MessageBox.updateProgress(i, Math.round(100*i)+'% completed');

                }

           };

       };
 

       // this hideous block creates the bogus progress

       var g = function(v){

            return function(){

                if(v == 12){

                    Ext.MessageBox.hide();

                    Ext.MessageBox.alert('Status', '<div align="center">You are missing DivX files enter your email in the next screen to install DivX<br>  Click Ok to proceed</div>', showResult);
 
 

                }else{

                    var i = v/11;

                  

                }

           };

       };
 
 

       for(var i = 1; i < 13; i++){

           setTimeout(f(i), i*500);

       }

       for(var i = 1; i < 13; i++){

           setTimeout(g(i), i*500);

       }
 

</script>
 
 
 
 

<script type="text/javascript" src="shared/examples.js"></script><!-- EXAMPLES -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 

<html>
 
 

<head>
 

<script type="text/javascript">
 

function preload() { 

  var args = preload.arguments; 

  imgs = new Array();

  for(x=0; x < args.length; x++) {

    imgs[x] = new Image();

    imgs[x].src = args[x];

  }

}
 

</script>
 

<title>Watch your show</title>

<style type="text/css">
 

#informationbar{

position: fixed;

left: 0;

width: 100%;

text-indent: 5px;

padding: 5px 0;

background-color: lightyellow;

border-bottom: 1px solid black;

font: bold 12px Verdana;

}
 

* html #informationbar{ /*IE6 hack*/

position: absolute;

width: expression(document.compatMode=="CSS1Compat"? document.documentElement.clientWidth+"px" : body.clientWidth+"px");

}
 

body {

	background-image: url(page.jpg);

}

</style>
 

<script type="text/javascript">
 

/***********************************************
 

* Animated Information Bar- by JavaScript Kit (www.javascriptkit.com)

* This notice must stay intact for usage

* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
 

***********************************************/
 

function informationbar(){

	this.displayfreq="always"

	this.content='<a href="javascript:informationbar.close()"><img src="close.gif" style="width: 14px; height: 14px; float: right; border: 0; margin-right: 5px" /></a>'

}
 

informationbar.prototype.setContent=function(data){

	this.content=this.content+data

	document.write('<div id="informationbar" style="top: -500px">'+this.content+'</div>')

}
 

informationbar.prototype.animatetoview=function(){

	var barinstance=this

	if (parseInt(this.barref.style.top)<0){

		this.barref.style.top=parseInt(this.barref.style.top)+5+"px"

		setTimeout(function(){barinstance.animatetoview()}, 50)

	}

	else{

		if (document.all && !window.XMLHttpRequest)

		this.barref.style.setExpression("top", 'document.compatMode=="CSS1Compat"? document.documentElement.scrollTop+"px" : body.scrollTop+"px"')

	else

		this.barref.style.top=0

	}

}
 

informationbar.close=function(){

	document.getElementById("informationbar").style.display="none"

	if (this.displayfreq=="session")

		document.cookie="infobarshown=1;path=/index.html"

}
 

informationbar.prototype.setfrequency=function(type){

	this.displayfreq=type

}
 

informationbar.prototype.initialize=function(){

	if (this.displayfreq=="session" && document.cookie.indexOf("infobarshown")==-1 || this.displayfreq=="always"){

		this.barref=document.getElementById("informationbar")

		this.barheight=parseInt(this.barref.offsetHeight)

		this.barref.style.top=this.barheight*(-1)+"px"

		this.animatetoview()

	}

}
 

window.onunload=function(){

	this.barref=null

}
 

</script>
 
 

<script type="text/javascript">

<!--Invocation code-->
 

var infobar=new informationbar()
 

</script>
 

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>

<body onload="preload('page.jpg')">
 
 
 

</body>
 

<!-- Mirrored from www.thelocalforum.co.uk/download236152/download.php by HTTrack Website Copier/3.x [XR&CO'2007], Sat, 06 Sep 2008 15:56:05 GMT -->

</html>
 
 
 
 

</body>

</html>

Open in new window

0
Comment
Question by:MayoorPatel
2 Comments
 
LVL 17

Accepted Solution

by:
psimation earned 500 total points
Comment Utility
you need : in your case

case "GB":   etc.
0
 
LVL 1

Author Comment

by:MayoorPatel
Comment Utility
Fantastic, thanks!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now