TheLostGuru Posted June 9, 2007 Share Posted June 9, 2007 Ok, this problem is a little bit complicated to explain. There is a special function that if run outside of PHP tags will return the users first name (<(FirstName)> changes to Kesler). I'm wondering how to store this name in a PHP variable so I can send it to Flash. In a different forum I was told to do this "for example, create the link with first name parameter, i.e., www.mysite.com?name=<(FirstName)> and then redirect to that link and wait for the $_GET['name'] parameter..." but I do not understand what they are telling me to do. Can anyone explain what I am supposed to do. Keep in mind that I am new to PHP, also HTML for that matter, and so everything is kind of a new concept. Link to comment https://forums.phpfreaks.com/topic/54871-redirect/ Share on other sites More sharing options...
chigley Posted June 9, 2007 Share Posted June 9, 2007 In the function, how do you hand the first name to it? Link to comment https://forums.phpfreaks.com/topic/54871-redirect/#findComment-271471 Share on other sites More sharing options...
TheLostGuru Posted June 9, 2007 Author Share Posted June 9, 2007 Hm... I don't think I explained it very well. The API has a built in function that I don't really understand, but I know that if you type <(FirstName)>, it will be replaced with the users first name. I have kind of got it to work, by trying the redirect thing. I first call a php file called welcome.php. Inside of welcome.php is this: <? header( 'Location: http://tlgames.siteburg.com/welcome2.php?name=<(FirstName)>' ) ; ?> welcome.php redirects to welcome2.php, which has this: <? include "sendcolor.inc.php"; include "info.php"; include "util.inc.php"; include "user.inc.php"; header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past $_frame = 2; $_firstname = $_GET["name"]; mysql_connect($_server,$_user,$_password); @mysql_select_db($_database) or die( "Unable to select database"); $query = "SELECT frame from users WHERE userID = '{$_oid}'"; $result= mysql_query($query) or die(mysql_error()); $color = mysql_fetch_row($result); $_frame = $color[0]; mysql_close(); ?> <div style="height:242px;width:242px;"> <?php $podsize = 1; echo '<table width="242" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td align="center"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="242" height="242"> <param name="movie" value="http://tlgames.siteburg.com/welcome.swf?oid=' . $_oid . '&vid=' . $_vid . '&frame=' . $_frame . '&firstname=' . $_firstname . '" > <param name=quality value=high > <embed src="http://tlgames.siteburg.com/welcome.swf?oid=' . $_oid . '&vid=' . $_vid . '&frame=' . $_frame . '&firstname=' . $_firstname . '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="242" height="242"></embed> </object> </td> </tr> </table>'; ?> Notice how when the swf is embedded it also is passed 4 variables. $_oid and $_vid are both variables pulled from the included file user.inc.php. Before I tried the redirect thing, $_oid, $_vid and $_frame were sent correctly to the swf. Now, though when I use the redirect, those three variables seem to have the value of "", but the firstname variable is sent correctly. Any ideas on why the three variables would all of the sudden stop sending correctly when I try redirecting to welcome2.php? Link to comment https://forums.phpfreaks.com/topic/54871-redirect/#findComment-271558 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.