Jump to content

shoutbox...PLEASE LOOK AT IT :p


runnerjp

Recommended Posts

hey hey all ok iv got shout box all set up at [url=http://www.runnerselite.com/shoutbox/shoutbox.php]www.runnerselite.com/shoutbox/shoutbox.php[/url]
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

[code]<?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>";





    }





        ?>[/code]

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

[quote author=runnerjp link=topic=104175.msg415471#msg415471 date=1155567865]
no right shunt the marque code bit be in the php script i pasted above ???
[/quote]

What?

[code]<?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>";
?>[/code]
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

You can learn how to turn on error reporting by reading the examples on the page that [b]AndyB[/b] 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.
Link to comment
Share on other sites

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

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.
Link to comment
Share on other sites

<?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>";
?>
Link to comment
Share on other sites

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

@Jacka = You forgot $r[message]
@runnerjp = Learn about the difference of "" '' and where to use them in variables
Link to comment
Share on other sites

???

I guess you are saying that you can't see your website content?

Make sure that you have uploaded all files that your site relies on to show content (all php files, all include files, all pictures, etc...), and make sure that these files are in the same folder structure as they were on your local machine, i.e. if all your website graphics were in a folder called "graphics" on your local machine, make sure you have all those files in a "graphics" folder on your web host.

Also, if you changed your PHP file name to index.php, you need to be sure that any files you included or referenced know about this name change, i.e. if your file was previously called "test.php" and you changed it to "index.php", make sure all calls to "test.php" get changed to "index.php".
Link to comment
Share on other sites

its wierd  ok iv only got my index page set up and the shoutbox page...and thats oviusly a php.... my files where allready loaded to the site when it was a html site... all iv done is change it to php and it wnt lket me add anything at alll????  i changed it back to html and everything was their....its even loadin slow as if the images are going to apear and they dnt :S
Link to comment
Share on other sites

[quote author=runnerjp link=topic=104175.msg415597#msg415597 date=1155574398]
its wierd   ok iv only got my index page set up and the shoutbox page...and thats oviusly a php.... my files where allready loaded to the site when it was a html site... all iv done is change it to php and it wnt lket me add anything at alll????  i changed it back to html and everything was their....its even loadin slow as if the images are going to apear and they dnt :S
[/quote]

Post the full code of both your index and shoutbox pages please...
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.