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
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
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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.