runnerjp Posted August 14, 2006 Share Posted August 14, 2006 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 https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/ Share on other sites More sharing options...
AndyB Posted August 14, 2006 Share Posted August 14, 2006 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? Link to comment https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74500 Share on other sites More sharing options...
AndyB Posted August 14, 2006 Share Posted August 14, 2006 [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 https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74511 Share on other sites More sharing options...
AndyB Posted August 14, 2006 Share Posted August 14, 2006 [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. Link to comment https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74517 Share on other sites More sharing options...
runnerjp Posted August 14, 2006 Author Share Posted August 14, 2006 still comes up with nothing :S Link to comment https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74521 Share on other sites More sharing options...
AndyB Posted August 14, 2006 Share Posted August 14, 2006 Show us. Give us a specific [b]live URL[/b] where we can observe 'nothing' happening. Link to comment https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74523 Share on other sites More sharing options...
AndyB Posted August 14, 2006 Share Posted August 14, 2006 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 https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74527 Share on other sites More sharing options...
AndyB Posted August 14, 2006 Share Posted August 14, 2006 Luckily, there's a php manual - http://ca.php.net/manual/en/function.error-reporting.php Link to comment https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74528 Share on other sites More sharing options...
HeyRay2 Posted August 14, 2006 Share Posted August 14, 2006 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 https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74534 Share on other sites More sharing options...
Chetan Posted August 14, 2006 Share Posted August 14, 2006 Not always, use this[code]<?phpini_set('display_errors', '1');error_reporting(E_ALL);?>[/code] Link to comment https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74557 Share on other sites More sharing options...
AndyB Posted August 14, 2006 Share Posted August 14, 2006 [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 https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74559 Share on other sites More sharing options...
runnerjp Posted August 14, 2006 Author Share Posted August 14, 2006 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???? Link to comment https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74562 Share on other sites More sharing options...
AndyB Posted August 14, 2006 Share Posted August 14, 2006 In order for php or included php to be parsed by your server, you have to name the file with a .php extension. Link to comment https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74564 Share on other sites More sharing options...
runnerjp Posted August 14, 2006 Author Share Posted August 14, 2006 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 Link to comment https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74571 Share on other sites More sharing options...
Jocka Posted August 14, 2006 Share Posted August 14, 2006 what is line 16? Link to comment https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74574 Share on other sites More sharing options...
runnerjp Posted August 14, 2006 Author Share Posted August 14, 2006 <?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 https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74575 Share on other sites More sharing options...
Jocka Posted August 14, 2006 Share Posted August 14, 2006 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]"; Link to comment https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74576 Share on other sites More sharing options...
runnerjp Posted August 14, 2006 Author Share Posted August 14, 2006 wahooo its workedthanks all Link to comment https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74578 Share on other sites More sharing options...
Chetan Posted August 14, 2006 Share Posted August 14, 2006 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 https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74579 Share on other sites More sharing options...
runnerjp Posted August 14, 2006 Author Share Posted August 14, 2006 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?? Link to comment https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74582 Share on other sites More sharing options...
HeyRay2 Posted August 14, 2006 Share Posted August 14, 2006 ???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 https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74599 Share on other sites More sharing options...
Chetan Posted August 14, 2006 Share Posted August 14, 2006 also index.html should get removed or else old stuff Link to comment https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74603 Share on other sites More sharing options...
runnerjp Posted August 14, 2006 Author Share Posted August 14, 2006 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 https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74612 Share on other sites More sharing options...
Chetan Posted August 14, 2006 Share Posted August 14, 2006 Maybe your code has some endless loop and max execution is 3 days. With the server all I can say Link to comment https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74617 Share on other sites More sharing options...
HeyRay2 Posted August 14, 2006 Share Posted August 14, 2006 [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 https://forums.phpfreaks.com/topic/17486-shoutboxplease-look-at-it-p/#findComment-74623 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.