Jump to content

Archived

This topic is now archived and is closed to further replies.

runnerjp

shoutbox...PLEASE LOOK AT IT :p

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

Share this post


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

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites
[quote author=runnerjp link=topic=104175.msg415484#msg415484 date=1155568770]
yer that bit...if i have done it worng could u tell me how i could do it please :D
[/quote]

That was the intent of the code I posted.

Share this post


Link to post
Share on other sites
Show us. Give us a specific [b]live URL[/b] where we can observe 'nothing' happening.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Luckily, there's a php manual - http://ca.php.net/manual/en/function.error-reporting.php

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Not always, use this

[code]
<?php
ini_set('display_errors', '1');
error_reporting(E_ALL);
?>
[/code]

Share this post


Link to post
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.

Share this post


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

Share this post


Link to post
Share on other sites
In order for php or included php to be parsed by your server, you have to name the file with a .php extension. 

Share this post


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

Share this post


Link to post
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>";
?>

Share this post


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

Share this post


Link to post
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

Share this post


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

Share this post


Link to post
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".

Share this post


Link to post
Share on other sites
also index.html should get removed or else old stuff

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Maybe your code has some endless loop and max execution is 3 days. With the server all I can say

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites

×

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.