Jump to content


[SOLVED] Page Title Determines Output

  • Please log in to reply
3 replies to this topic

#1 robindean

  • Members
  • PipPipPip
  • Advanced Member
  • 34 posts

Posted 01 June 2006 - 04:50 AM

Here's what I'm attempting to do. I'm only one step away from having it operate successfully.

a) Person enters my site and has an older version of flash player (let's say v6).

b) No matter what, the first page to load is simply "webcast.php"

c) Let's assume that "webcast.php" checks a server connection (see code for details) and discovers that the server is offline. No problem ... it prints html code with an embedded flash document which reflects this result.

d) The flash document loads and detects whether or not the user has flash player version 8. When it notices that the viewer is using v6, it redirects the browser back to webcast.php ... but with a tag on the end (webcast.php?upgrade)

e) The php code in the "webcast.php" document detects that it is titled "webcast.php?upgrade" and therefore displays different html code instead of the embedded flash document.

... deep breath ...

I'm close, but not there. I know how to do this with javascript but php is new to me. For some reason it ignores my concept of using "else" and embedds everything or ... er ... something.

Can I coax one of you to give me a tip on this? A solution? Here's my code thus far.


$server = "robindean.no-ip.info";
$port = "80";
$churl = fsockopen($server, $port, $errno, $errstr, 3);

$location = $_GET['location'];

if($location=="webcast.php?blank") {
print('blank page');

else if($location=="webcast.php?upgrade") {
print('upgrade page');

else if (!$churl) {
print('embedded flash server off page');

else {
print('embedded flash server on page');


#2 wisewood

  • Members
  • PipPipPip
  • Advanced Member
  • 226 posts
  • LocationRotherham, England

Posted 01 June 2006 - 09:09 AM

$_GET[location] is looking for something like this in the address bar...
[a href=\"http://www.yourdomain.com/yourfile.php?location=something\" target=\"_blank\"]http://www.yourdomain.com/yourfile.php?location=something[/a]

You need to use something like this...

address bar showing: webcasp.php?location=blank
$location = $_GET[location];

if($location=="blank") {
print('blank page');

Hope this helps you in the right direction.
wisewood: proven fact, I am both wise, and wooden.

#3 craygo

  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 01 June 2006 - 12:31 PM

You could also do this.
//insert upgrade page or code here

} else {
// insert regular page code here



#4 robindean

  • Members
  • PipPipPip
  • Advanced Member
  • 34 posts

Posted 01 June 2006 - 05:54 PM

Thanks to both of you! I managed to get it working : )

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users