TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 29, 2024, 10:52:29 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,106
  • Total Topics: 21,213
  • Online today: 358
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online

Today In History Question

Started by Mitch, March 15, 2006, 08:49:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mitch

What my original code is:

$my_height = 15;
$today = mktime();
$today_day = date("j", $today);
$today_month = date("n", $today);

$request = db_query("SELECT pn_yid, pn_content FROM nuke_ephem WHERE pn_did=$today_day AND pn_mid=$today_month ORDER BY pn_yid ASC", __FILE__, __LINE__);
if (mysql_num_rows($request) > 0)
{
echo '<div style="height: '.$my_height.'ex; overflow: auto;">';
while($row = mysql_fetch_assoc($request)){
echo '<b>' . $row['pn_yid'] . '</b> - ' . $row['pn_content'] . '<br />';
}
                echo '</div>';
mysql_free_result($request);
  }


I would like it to scroll and then stop with mouse hovers over it I thought that code would be this:

$my_height = 15;
$today = mktime();
$today_day = date("j", $today);
$today_month = date("n", $today);

$request = db_query("SELECT pn_yid, pn_content FROM nuke_ephem WHERE pn_did=$today_day AND pn_mid=$today_month ORDER BY pn_yid ASC", __FILE__, __LINE__);
if (mysql_num_rows($request) > 0)
{

echo '<marquee bgcolor="transparent" scrollamount="2" direction="up" loop="true" width="100%" onmouseover='this.stop()'onmouseout='this.start()'">;

echo '<div style="height: '.$my_height.'ex; overflow: auto;">';
while($row = mysql_fetch_assoc($request)){
echo '<b>' . $row['pn_yid'] . '</b> - ' . $row['pn_content'] . '<br />';
}
                echo '</div>';
echo '</marquee>;
mysql_free_result($request);
  }


But its not. I get this error when I try to do it:

QuoteParse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/gamesnet/public_html/forums/Sources/Load.php(1613) : eval()'d code(34) : eval()'d code on line 10

IchBin

This line:
echo '</marquee>;

Needs to have this:
echo '</marquee>';

TwinsX2Dad

Lose one apostrophe and your echo gets lopsided.

Nobody wants a lopsided echo.

Mitch

Did what you told me to now I have a

Quote
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/gamesnet/public_html/forums/Sources/Load.php(1613) : eval()'d code(34) : eval()'d code on line 10

IchBin

Also this line:
echo '<marquee bgcolor="transparent" scrollamount="2" direction="up" loop="true" width="100%" onmouseover='this.stop()'onmouseout='this.start()'">;


Needs to be this:  (I think)
echo '<marquee bgcolor="transparent" scrollamount="2" direction="up" loop="true" width="100%" onmouseover='this.stop()'onmouseout='this.start()'>';


feline

the correct line:

echo '<marquee bgcolor="transparent" scrollamount="2" direction="up" loop="true" width="100%" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>';


Fel

crip

If micth hasn't run the sql .zip via myphpadmin it will never work....

Mitch

Hmm I can try to do this.

But just so everyone knows it was working before I decided to make it scroll.

Mitch

Ok well I got this to work. But then I just deleted it because it made the block headers "bounce".

IchBin

Quote from: feline on March 16, 2006, 09:32:13 AM
the correct line:

echo '<marquee bgcolor="transparent" scrollamount="2" direction="up" loop="true" width="100%" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>';


Thank you Fel, I haven't quite learned what needs to be escaped and why. In that example I finally understood it. :)

Fel