Jump to content


Photo

shoutbox...PLEASE LOOK AT IT :p


  • Please log in to reply
26 replies to this topic

#1 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 14 August 2006 - 10:01 AM

hey hey all ok iv got shout box all set up at www.runnerselite.com/shoutbox/shoutbox.php
and what im tryin to do is set it up so i can display peoples messages on my index page as a marquee ... so i got this php script to do this

<?php


#################################


include("shoutbox/config/config.php"); -- this is folder i have stuck it in!!


#################################





mysql_connect($host,$dbuser,$dbpass) or die(mysql_error());


// Select the database.


mysql_select_db($dbname) or die(mysql_error());





$query = "SELECT message, author, eml FROM shoutbox order by id DESC LIMIT 1";


$result = mysql_query($query);











    while($r=mysql_fetch_array($result))


    {





        echo "<marquee><font size='3'>$r[message] - <a href=\"$r[eml]\">$r[author]</a></font></marquee>";





    }





        ?>

and on my homepage where i wanted the marquee to appear i added this
<?php include("shoutbox/marq.php")?>

and nothing seems to happen even tho their is a message "test message" in the shoutbox bit :S any ideas any one pllleeaaasssseeeeee

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 14 August 2006 - 03:00 PM

I've looked at your html code and there's no visible marquee statement anywhere. Where are we supposed to look? Did you upload the changed code?
Legend has it that reading the manual never killed anyone.
My site

#3 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 14 August 2006 - 03:15 PM

no right shunt the marque code bit be in the php script i pasted above ???


What?

<?php
#################################
include("shoutbox/config/config.php"); -- this is folder i have stuck it in!!
#################################

mysql_connect($host,$dbuser,$dbpass) or die(mysql_error());
// Select the database.
mysql_select_db($dbname) or die(mysql_error());
$query = "SELECT message, author, eml FROM shoutbox order by id DESC LIMIT 1";
$result = mysql_query($query);
$marquee = "";
while($r=mysql_fetch_array($result))
{
   $marquee.= $r[message]. '<a href=\"$r[eml]\">'. $r[author]. '</a>'";
}
echo "<marquee><font size='3'>". $marquee. "</font></marqee>";
?>

Legend has it that reading the manual never killed anyone.
My site

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 14 August 2006 - 03:25 PM

yer that bit...if i have done it worng could u tell me how i could do it please :D


That was the intent of the code I posted.
Legend has it that reading the manual never killed anyone.
My site

#5 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 14 August 2006 - 03:29 PM

still comes up with nothing :S

#6 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 14 August 2006 - 03:32 PM

Show us. Give us a specific live URL where we can observe 'nothing' happening.
Legend has it that reading the manual never killed anyone.
My site

#7 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 14 August 2006 - 03:39 PM

There is no marquee tag anywhere in the code for that page. If you have included the file, it looks as though it isn't getting included. Do you have error_reporting turned off because I don't see any php errors reported in that page.
Legend has it that reading the manual never killed anyone.
My site

#8 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 14 August 2006 - 03:43 PM

Luckily, there's a php manual - http://ca.php.net/ma...r-reporting.php
Legend has it that reading the manual never killed anyone.
My site

#9 HeyRay2

HeyRay2
  • Members
  • PipPipPip
  • Advanced Member
  • 223 posts

Posted 14 August 2006 - 03:50 PM

You can learn how to turn on error reporting by reading the examples on the page that AndyB linked to... ;)

Also, can you post the code of page you are trying to include your scrolling marquee on? That would be most helpful in determining your issue.

#10 Chetan

Chetan
  • Members
  • PipPipPip
  • Advanced Member
  • 162 posts
  • LocationIndia

Posted 14 August 2006 - 04:07 PM

Not always, use this

<?php
ini_set('display_errors', '1');
error_reporting(E_ALL);
?>

I am a PHP Guru, ask me questions if you want to

#11 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 14 August 2006 - 04:08 PM

i find it easyer to look at what i am doing)useing graphics rather then html


Until you're prepared to look at code there's virtually no hope of you getting it working.  Somewhere in that generated mess is where the working php code needs to get included.

How your editor allows that is a mystery to me.
Legend has it that reading the manual never killed anyone.
My site

#12 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 14 August 2006 - 04:12 PM

well all i gotta do is enter my code in the this code area on my website (its like a buttin u press and it brings up like a word document where u can enter your codes) iv added the error log if thats a help????

#13 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 14 August 2006 - 04:14 PM

In order for php or included php to be parsed by your server, you have to name the file with a .php extension. 
Legend has it that reading the manual never killed anyone.
My site

#14 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 14 August 2006 - 04:20 PM

ok i did that now its comeing up with Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/runnerse/public_html/maq.php on line 16

#15 Jocka

Jocka
  • Members
  • PipPipPip
  • Advanced Member
  • 344 posts
  • LocationDallas, Texas

Posted 14 August 2006 - 04:22 PM

what is line 16?

#16 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 14 August 2006 - 04:24 PM

<?php
#################################
include("config/config.php");
#################################

mysql_connect($host,$dbuser,$dbpass) or die(mysql_error());
// Select the database.
mysql_select_db($dbname) or die(mysql_error());
$query = "SELECT message, author, eml FROM shoutbox order by id DESC LIMIT 1";
$result = mysql_query($query);
$marquee = "";
while($r=mysql_fetch_array($result))
{
  $marquee.= $r[message]. '<a href=\"$r[eml]\">'. $r[author]. '</a>'";
}
echo "<marquee><font size='3'>". $marquee. "</font></marqee>";
?>

#17 Jocka

Jocka
  • Members
  • PipPipPip
  • Advanced Member
  • 344 posts
  • LocationDallas, Texas

Posted 14 August 2006 - 04:25 PM

try changing this:
$marquee.= $r[message]. '<a href=\"$r[eml]\">'. $r[author]. '[/url]'";

to this:
$marquee.= $r[message]. "<a href=\"$r[eml]\">". $r['author']. "[/url]";

#18 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 14 August 2006 - 04:27 PM

wahooo its worked
thanks all

#19 Chetan

Chetan
  • Members
  • PipPipPip
  • Advanced Member
  • 162 posts
  • LocationIndia

Posted 14 August 2006 - 04:28 PM

For better performance use
$marquee.= $r['message']. '<a href="'.$r['eml'].'">'. $r['author']. '[/url]'";

@Jacka = You forgot $r[message]
@runnerjp = Learn about the difference of "" '' and where to use them in variables
I am a PHP Guru, ask me questions if you want to

#20 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 14 August 2006 - 04:31 PM

ok new problem.... now iv changed it to index.php everything i add to my website doesnt come up when published to web :(...i added i runnin man and it dunt go onto website...why is this... its a jpg file...should this affect it??




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users