Jump to content

stupid flogging no errors


offsprg01

Recommended Posts

well this is causing me issues, mainly becuase the server admin won't turn on php errors. so the script just stops when it's broken making it really hard to trouble shoot. anyway here's the code that causing the issues.

 


<?php 

function truncateTickerMessage($String, $limit = 100) {
		$len = strlen($String);
	if ($len > $limit) $String = substr($String, 0, $limit) . '...';
	return $String;
}


require_once('../Connections/TestDB.php'); 

mysql_select_db($database_TestDB, $TestDB);

$query_Ticker = "SELECT * FROM Ticker ORDER BY TickerDate DESC LIMIT 5";
$Ticker = mysql_query($query_Ticker, $TestDB) or die(mysql_error());
$row_Ticker = mysql_fetch_assoc($Ticker);

$c = 0;

do {
	$c = $c++;

	$tickerLink[$c] = $row_Ticker['Link'];

	$tickerTitle[$c] = truncateTickerMessage($row_Ticker['Title']);
	$tickerMessage[$c] = truncateTickerMessage($row_Ticker['Message']);

} while ($row_Ticker = mysql_fetch_assoc($Ticker));

?>

 

can you guys seen anything i'm missing? it all looks correct to me.

Link to comment
Share on other sites

you'll also have to do ini_set('display_errors', 1);

 

still returns the same blank back ground

 

and here's the output code, i know this code worksm if i run it with some test data in the variable it works.

 


<script type="text/JavaScript">
<!--

//ticker java

        //scroller width
        var swidth=310;

        //scroller height
        var sheight=15;

        //background color
        var sbcolor='#000000';

        //scroller's speed
        var sspeed=1;
        //messages are set below:

<?php require('/includes/tickerSQL.php'); ?>

        var msg=''



        msg +=
        
            '<a href="<?php echo $tickerLink['1'] ?>" target="_blank" title=""><?php echo $tickerTitle['1']; ?></a><br />'+
            '<?php echo $tickerMessage['1']; ?><br />'+
            '<br />'+                     
            

        '';

 

 

Link to comment
Share on other sites

i tried replacing the sting 1 with numeric 1, still did not work. the error is in the included tickerSQL.php, which is the first code i posted

 

i know the code in my last post works becuase when i replace

 

<?php require('/includes/tickerSQL.php'); ?>

 

with

<?php $tickerLink[1] = '#'; $tickerTitle[1] = 'Title 1'; $tickerMessage[1] = 'Message 1'; ?>

 

it works.

 

i currently have it replace now, if you'd like to see it working

 

http://www.harwoodmarketinggroup.com/WIP/index.php

Link to comment
Share on other sites

well i found one problem it was this

 

<?php require('/includes/tickerSQL.php'); ?>

 

should have been this

 

<?php require('includes/tickerSQL.php'); ?>

 

but now i get no data in my variables :(

 

check out

 

http://www.harwoodmarketinggroup.com/WIP/index.php

 

to see what i mean. the black box that says click here at the top of the screen.

Link to comment
Share on other sites

When trying to trouble shoot a blank page, here's what I do.

 

At the very top of the script before anything:

 

echo "hi2u"; exit();

 

If I reload the page and don't see hi2u, 99% sure its a syntax error.

 

If I do see hi2u, just cut the echo line, move down a small chunk, and re-paste it.  Do this until you narrow down the one line that is causing it to blow up.  You'll often find is a bad file path, undeclared function, etc.

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.