Page 2 of 2

Posted: Sun Dec 25, 2005 1:28 am
by Jenk
need to have session_start(); before any output is sent to the browser.

Posted: Sun Dec 25, 2005 11:14 am
by jts_01
I have that if you look at the second line.

Posted: Sun Dec 25, 2005 11:27 am
by John Cartwright
Jenk wrote:need to have session_start(); before any output is sent to the browser.
Basically, put session_start() on line 1

Posted: Sun Dec 25, 2005 11:53 am
by jts_01
Ok I put it on line one and the error goes away however the function does not work. It just displays the flash as usual.

Posted: Sun Dec 25, 2005 12:33 pm
by m3mn0n
And so the problem area focus shifts towards the page where the variables are set...

Please post that code, and an updated code for the session handling page.

Posted: Sun Dec 25, 2005 1:07 pm
by jts_01
This is the index page of my frames-

Code: Select all

<?php session_start(); ?>
<HTML>
<HEAD>
<TITLE>UNDER CONSTRUCTION</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251"
<meta name="resource-type" content="document">
<meta http-equiv="Content-Language" content="english">
<link rel="stylesheet" type="text/css"
href="main.css" />
<script language="JavaScript">
<!--
function go() {
  window.location.href =
    document.formName8.selectName8.options[
      document.formName8.selectName8.selectedIndex
    ].value;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

var submitRolls = new Object();

function submitroll(src, oversrc, name)
{
this.src=src;
this.oversrc=oversrc;
this.name=name;
this.alt="Submit Query";
this.write=submitroll_write;
}

function submitroll_write()
{
var thisform = 'document.forms[' + (document.forms.length - 1) + ']';
submitRolls[this.name] = new Object();
submitRolls[this.name].over = new Image();
submitRolls[this.name].over.src = this.oversrc;
submitRolls[this.name].out = new Image();
submitRolls[this.name].out.src = this.src;

document.write
	(
	'<A onMouseOver="if (document.images)document.images[\'' + this.name + "'].src=submitRolls['" + this.name + '\'].over.src"' + 
	' onMouseOut="if (document.images)document.images[\'' + this.name + "'].src=submitRolls['" + this.name + '\'].out.src"' + 
	' HREF="javascript:'
	);

if (this.sendfield)
	{
	if (! this.sendvalue)
		this.sendvalue = 1;
	document.write(thisform, ".elements['", this.sendfield, "'].value='", this.sendvalue, "';");
	}

document.write(thisform + '.submit();void(0);"');
if (this.msg)document.write(' onClick="return confirm(\'' , this.msg, '\')"');
document.write('>');

document.write('<IMG SRC="' + this.src + '" ALT="' + this.alt + '" BORDER=0 NAME="' + this.name + '"');
if (this.height)document.write(' HEIGHT=' + this.height);
if (this.width)document.write(' WIDTH='  + this.width);
if (this.otheratts)document.write(' ' + this.otheratts);
document.write('></A>');
if (this.sendfield)
	{
	document.write('<INPUT TYPE=HIDDEN NAME="' + this.sendfield + '">');
	document.forms[document.forms.length - 1].elements[this.sendfield].value='';
	}
}

//-->
//-->
</script>
<script src="home.js"></script>
<script src="imageenlarge.js"></script>
<style type="text/css">
<!--
.style2 {font-style: italic}
.style4 {color: #E7DFE7; font-weight: bold; font-size: 14px; }
.style6 {font-size: 12px}
.style7 {color: #0000FF; font-weight: bold; font-size: 14px; }
.style3 {font-size: 12px}
-->
</style>
</HEAD>
<body bgcolor="#999999" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" onload="MM_preloadImages('images/rollover.gif')">
<center>
  <?php
$url=$_GET['url']; if (empty($url)) { $url='index'; } 
changelocation($url);
function changelocation($url) {
include ('header.html');
echo '<table width="766" border="0" align="center" cellpadding="0" cellspacing="0">';
echo '<tr>';
echo '<table width="766" border="0" align="center" cellpadding="0" cellspacing="0">';
echo '<tr>';
echo '<td height="0">';
switch ($url) 
{ 
case 'index': 	
include ('main.html'); 
break; 
case 'hosting':
include ('hosting.html');
break;
case 'servers':
include ('servers.html');
break;
case 'about':
include ('about.html');
break;
case 'support':
include ('support.html');
break;
case 'membersarea':
include ('membersarea.html');
break;
}
echo '</td></tr></table>';
}
?>
</center>
</body>
</html>

This is the header where the flash is-

Code: Select all

<style type="text/css">
<!--
.logobg {
	background-image: url(images/logo.gif);
}
.style2 {background-image: url(images/logo.gif); font-family: Tahoma; font-size: 12px; }
-->
</style>
<TABLE WIDTH=766 BORDER=0 CELLPADDING=0 CELLSPACING=0>
  <TR>
    <TD><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="510" height="30">
        <param name="movie" value="flash/cougar1%20-%20menu.swf">
        <param name="quality" value="high">
        <embed src="flash/cougar1%20-%20menu.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="510" height="30"></embed>
    </object></TD>
    <TD><IMG SRC="images/5.jpg" WIDTH=256 HEIGHT=30 ALT=""></TD>
  </TR>
</TABLE>
<TABLE WIDTH=766 BORDER=0 CELLPADDING=0 CELLSPACING=0>
  <TR>
    <TD>
	<?php
if ((isset($_SESSION['new_user'])) && ($_SESSION['visited'] === true)) { 
     // The user has seen the initial banner.   Don't show it again.  
	 ?>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="510" height="205">
              <param name="movie" value="flash/cougar1_re.swf">
              <param name="quality" value="high">
              <embed src="flash/cougar1_re.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="510" height="205"></embed>
          </object>
		  <?php
} else { 
?>	
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="510" height="205">
              <param name="movie" value="flash/cougar1_.swf">
              <param name="quality" value="high">
              <embed src="flash/cougar1_.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="510" height="205"></embed>
          </object>
		  <?php
    // Set the session value so that the user doesn't see this banner view again 
     $_SESSION['new_user'] = true;  
} 
?></TD>
    <TD background="images/7.jpg" WIDTH=256 HEIGHT=205 ALT=""><div style="padding-top:15px; padding-left:20px; color: #BBBBBB;">Included With Every Package:
            <P><IMG height=13 hspace=4 src="images/c_orange.gif" width=12 align=absMiddle>15 Day money back guarantee<BR>
                <IMG height=13 hspace=4 src="images/c_orange.gif" 
width=12 align=absMiddle>Spam Protection<BR>
                <IMG height=13 hspace=4 
src="images/c_orange.gif" width=12 align=absMiddle>High quality reliable servers<BR>
                <IMG height=13 hspace=4 src="images/c_orange.gif" width=12 
align=absMiddle>Unlimited Sub Domains <BR>
                <IMG height=13 hspace=4 
src="images/c_orange.gif" width=12 align=absMiddle>Unlimited MySql DB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>
                <IMG height=13 hspace=4 
src="images/c_orange.gif" width=12 align=absMiddle>Unlimted E-Mail Accounts <BR>
                <IMG height=13 hspace=4 
src="images/c_orange.gif" width=12 align=absMiddle>Cpanel 10 w/ Fantastico<BR>
                <IMG height=13 hspace=4 src="images/c_orange.gif" width=12 
align=absMiddle>Screaming Fast Network</P>
            <P><img src="images/pic6.jpg"><span style="padding-left:15px "><img src="images/pic7.jpg"></span><span style="padding-left:15px "><img src="images/pic8.jpg"></span> </P>
    </div></TD>
  </TR>
</TABLE>
<IMG SRC="images/1.jpg" WIDTH=766 HEIGHT=9 ALT="">

Posted: Sun Dec 25, 2005 4:00 pm
by wtf
Best way to handle your problem is by using Flash's SharedObject whic is basically flash cookie.

Posted: Sun Dec 25, 2005 4:14 pm
by josh
You never set this variable:

Code: Select all

$_SESSION['visited']
you probably meant to use

Code: Select all

$_SESSION['newuser']
as this is the only session variabel you're setting, fix this and I bet it'll work

and flash shared object's can't be set to expire when the user closes their browser, so that's the downside to that.

Posted: Sun Dec 25, 2005 4:55 pm
by jts_01
You are the master man; it worked! Thanks guys for all your help.

Posted: Sun Dec 25, 2005 9:45 pm
by Jenk
just being pedantic.. but setting new_user to true to identify that the user is NOT a new user is somewhat... illogical.

Posted: Sun Dec 25, 2005 10:06 pm
by josh
hehe, I didn't even notice that's what he was doing, nice call