Jump to content

awkward output


bftwofreak

Recommended Posts

For some reason when this code is executed:

<?php

/* 1st Place */
$tag['1'] = 'threesixohfreak';
$view['1'] = '<div class="tabbertab"><h2>1st: ' . $tag['1'] . '</h2><p></p></div>';

?>
<script type="text/javascript" src="modules/<?php echo $module_name ?>/d/tabber.js"></script>
<link rel="stylesheet" href="modules/<?php echo $module_name ?>/d/tabber.css" type="text/css" media="screen" />
<link rel="stylesheet" href="modules/<?php echo $module_name ?>/d/tabber-print.css" type="text/css" media="print" />

<div class="tabber">

<?php echo $view['1'] ?>

</div>

the output is <

 

Where did I go wrong?

Link to comment
https://forums.phpfreaks.com/topic/124272-awkward-output/
Share on other sites

It worked fine on my server. Maybe one of these changes the variable?

 

 

<script type="text/javascript" src="modules/<?php echo $module_name ?>/d/tabber.js"></script>

<link rel="stylesheet" href="modules/<?php echo $module_name ?>/d/tabber.css" type="text/css" media="screen" />

<link rel="stylesheet" href="modules/<?php echo $module_name ?>/d/tabber-print.css" type="text/css" media="print" />

 

Link to comment
https://forums.phpfreaks.com/topic/124272-awkward-output/#findComment-642517
Share on other sites

I tried that and same results:

<?php

$gameid = $_GET['gameid'];
$rdetails = file_get_dom('http://www.bungie.net/Stats/GameStatsHalo3.aspx?gameid=' . $gameid . '&player=' . $url_player);


/* 1st Place */
$tag[1] = 'threesixohfreak';
$view[1] = '<div class="tabbertab"><h2>1st: ' . $tag[1] . '</h2><p></p></div>';

echo $view[1];
?>
<script type="text/javascript" src="modules/<?php echo $module_name ?>/d/tabber.js"></script>
<link rel="stylesheet" href="modules/<?php echo $module_name ?>/d/tabber.css" type="text/css" media="screen" />
<link rel="stylesheet" href="modules/<?php echo $module_name ?>/d/tabber-print.css" type="text/css" media="print" />

<div class="tabber">

</div>

 

Link to comment
https://forums.phpfreaks.com/topic/124272-awkward-output/#findComment-642523
Share on other sites

ok now I've found out that it has to do with the array...

<?php

$gameid = $_GET['gameid'];
$rdetails = file_get_dom('http://www.bungie.net/Stats/GameStatsHalo3.aspx?gameid=' . $gameid . '&player=' . $url_player);


/* 1st Place */
$tag = 'threesixohfreak';
$view = '<div class="tabbertab"><h2>1st: ' . $tag . '</h2><p></p></div>';

?>
<script type="text/javascript" src="modules/<?php echo $module_name ?>/d/tabber.js"></script>
<link rel="stylesheet" href="modules/<?php echo $module_name ?>/d/tabber.css" type="text/css" media="screen" />
<link rel="stylesheet" href="modules/<?php echo $module_name ?>/d/tabber-print.css" type="text/css" media="print" />

<div class="tabber">

<?php echo $view ?>

</div>

 

 

Any way that I can keep it in an array cause I need the array.

 

Link to comment
https://forums.phpfreaks.com/topic/124272-awkward-output/#findComment-642524
Share on other sites

For some reason it seems your array isnt being defined. Try this

 

<?php

$tag = array();
$view = array();

$tag[1] = 'threesixohfreak';
$view[1] = '<div class="tabbertab"><h2>1st: ' . $tag1 . '</h2><p></p></div>';

echo htmlentities( $tag[1] )."<br />".htmlentities( $view[1] );

?>

 

and if that doesn't work, try this

 

<?php

$tag = array(NULL, 'threesixohfreak');
$view = array(NULL,'<div class="tabbertab"><h2>1st: ' . $tag1 . '</h2><p></p></div>');

echo htmlentities( $tag[1] )."<br />".htmlentities( $view[1] );

?>

 

Both output

threesixohfreak
<div class="tabbertab"><h2>1st: </h2><p></p></div>

Link to comment
https://forums.phpfreaks.com/topic/124272-awkward-output/#findComment-643529
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.