Page 1 of 1

PHP MySQL works in a non frame doc, but not in a frame doc?

Posted: Sun Mar 28, 2004 11:43 am
by dmacman1962
I have some code that dynamically gets a variable from the previous page, then goes to the correct directory and grabs the appropriately named swf file and works great. But I wanted to rebuild the page in a frame for several reasons, but now the php code is blank for the directory and the swf name?

The url from the previous page is as follows:

http://www.mytownsavings.com/template/g ... =eri000544

PHP is working, I tried a few tests, but this specific code just drops out:

Code: Select all

<?
$dbHost = "xxx";
$dbName = "xxx";
$dbUser = "xxx";
$dbPass = "xxx";
$connmts = mysql_connect($dbHost, $dbUser, $dbPass) or trigger_error(mysql_error(),E_USER_ERROR); 

$link = @mysql_connect($dbHost, $dbUser, $dbPass);
if (!$link){
	$errorMsg = "Could not connect to server";
	print "&result=Fail&errorMsg=$errorMsg";
	exit;
}
if (!@mysql_select_db($dbName)){
  $errorMsg = "Could not select $dbName database";
  print "&result=Fail&errorMsg=$errorMsg";
  exit;
}
$hold = $_REQUEST['merchant'];

?>
<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="800" height="325">
  <param name="movie" value="../template/dir/<? print $_GET["merchant"]."/".$_GET["merchant"]."."."swf"; ?>" >
  <param name="quality" value="high">
  <embed src="../template/dir/<? print $_GET["merchant"]."/".$_GET["merchant"]."."."swf"; ?>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="800" height="325"></embed>
</object>
Also, the middle frame goes to the database and grabs all offers, if any, and displays them. This is now not working elther?

Any suggestions would be greatly appreciated.

Thanks,

Don

Variable info not being passed for frames

Posted: Tue Mar 30, 2004 7:51 am
by dmacman1962
I have read several posts on the web about this issue. It seems the variable data is not being passed, therefore it has no data to display the correct directory and swf file.

I understand the issue, but not the solution. I have seen posts in regards to passing form data in javascript, but not passing a variable in php to the specific frames that need the data passed.

IE: the page is gold.php and the top frame is top.php, and the middle is middle.php.

I have seen references to targeting the frames with form data, and adding a url, but not passing the variable from the previous url to a specific (in this case, 2) frames at once.

This may spark someones grey matter in this case.

Again, thanks in advance,

Don

Posted: Tue Mar 30, 2004 10:21 pm
by litebearer
If I understand you correctly:

1. The non-frame php file functions properly and displays the swf

2. When the identical php file is loaded into a frame it no longer functions.

IF that is the case, I suspect the problem lies within your frameset.

A simple test...

create an html file as follows:
<html>
<frameset rows="65,*" cols="*" framespacing="0" frameborder="yes" border="4">
<frame src="" name="topFrame" scrolling="no" noresize >
<frame src="simple.php" name="mainFrame" scrolling="auto">
</frameset>
</html>
replace "simple.php" with the name of your php file that functions properly

save the html file in the same dir as the functioning php file.

load the html file into your browser.

Tell us the result.

Lite...