Seite 1 von 2

Problem mit meinem MOD

Verfasst: 12.05.2006 21:36
von phpBB User
Hallo zusammen,

Ich m�chte auf meinem Forum Flash-Games anbieten, die man �ber ein Men� ausw�hlen kann.
Leider bekomm ich es nicht hin, dass im {sender} die URL des Games steht.

games.php

Code: Alles auswählen

<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
$page_title = 'Games';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'game_body' => 'game_body.tpl'
));

$template->assign_vars(array(
'txt_1' => 'Simon Sagt',
'txt_2' => 'Straight Pool Billiards',
'txt_3' => 'Blox Forever',
'txt_4' => 'Gold Miner Joe',
'txt_5' => 'Star Ball Online',
'txt_6' => 'Puissance 4',

'url_1' => 'games/simon.swf',
'url_2' => 'games/billiards.swf',
'url_3' => 'games/bloxforever.swf',
'url_4' => 'games/goldminer.swf',
'url_5' => 'games/starball.swf',
'url_6' => 'games/puissance4.swf',

'submit' => ''.$PHP_SELF.'',
'sender' => ''.$sender.''
));

$template->pparse('game_body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>

game_body.tpl

Code: Alles auswählen

<a href="{U_INDEX}" class="nav">{L_INDEX}</a>
<table width="100%" border="0" cellpadding="4" cellspacing="1" class="forumline"><form action="{submit}" id="selector" method="post">
	<tr>
		<th class="thTop">:: Games ::</th>
	</tr>
	<tr>
		<td class="row1" colspan="2">
			<select name="sender" onchange="document.getElementById('selector').submit()" style="width:226; color:#4d4d4d; font-family:Tahoma; font-size:11px; background-color:#f1f4dd">
				<option value=""> Hier Game ausw�hlen </option>
				<option value="{url_1}" > {txt_1}</option>
				<option value="{url_2}" > {txt_2}</option>
				<option value="{url_3}" > {txt_3}</option>
				<option value="{url_4}" > {txt_4}</option>
				<option value="{url_5}" > {txt_5}</option>
				<option value="{url_6}" > {txt_6}</option>
			</select></td>
		</tr>
		<tr>
			<td class="genmed" align="justify"><object width="600" height="500"
				data="{sender}"
				type="application/x-shockwave-flash">
				<param name="movie" value="{sender}">
				<param name="menu" value="false">
				<param name="quality" value="autohigh">
				<param name="wmode" value="transparent">
			</object>
		</td>
	</tr>
</td>
</tr>
</form>
</table>

Verfasst: 12.05.2006 21:38
von fanrpg
Wo wird $sender definiert? :wink:

Verfasst: 12.05.2006 21:45
von phpBB User
Hier, oder nicht?

Code: Alles auswählen

<select name="sender"

Verfasst: 12.05.2006 21:48
von S2B
Nein, die Variable $sender wird nur definiert, wenn register_globals auf on steht, und das ist in ca. 95% aller Installationen auf off.

Code: Alles auswählen

$sender = (isset($_POST['sender'])) ? $_POST['sender'] : '';
:wink:

btw.: was sollen die '' bewirken? :-?

Verfasst: 12.05.2006 21:48
von fanrpg
Ja aber erst nach dem Absenden vorher geht das nicht... ausserdem muss dafür register_globals = on sein.
Nimm mal anstatt $sender das $_POST['sender']

Verfasst: 12.05.2006 21:58
von phpBB User
Hallo fanrpg,

ich hab es jetzt so gemacht, aber es Funktioniert nicht

Code: Alles auswählen

'sender' => ''.$_POST['sender'].''
Und Fit in php bin ich auch nicht :oops:

@ S2B wo genau soll der Code hin in meinem Script?
die " mach ich dann weg, wenn sie Überflüssig sind.

Verfasst: 12.05.2006 22:06
von phpBB User
Ups, es Funkioniert :lol: vielen Dank euch beiden.

Verfasst: 12.05.2006 22:06
von fanrpg
Ja aber erst nach dem Absenden vorher geht das nicht..
Lesen??

Verfasst: 12.05.2006 22:09
von phpBB User
Hab ich, dein Tipp war richtig :grin:

Im Übrigen ist register_globals bei mir On

Verfasst: 16.05.2006 18:11
von 2005
phpBB User hat geschrieben:Hab ich, dein Tipp war richtig :grin:

Im Übrigen ist register_globals bei mir On
Muiss man bei phpBB die VArialblem nicht IMMER über GET bzw. POST holen, da des irgentwie gesperrt wird, auch wenn globals on siind?