Forum Moderators: coopster
This is the code I put in -
<table style="width:100%;" class="mainmenu5" cellspacing="0" cellpadding="4">
<tr>
<td style="font-size:8pt;text-align:center;">
<b>Top 3 Msn Song Downloads</b>
<?php
define('MSIFETCH_DIR', '/home/topuk/public_html/music');
require_once(MSIFETCH_DIR.'/msifetch.inc');
echo get_html('a:18:{s:6:"active";a:1:{i:0;s:57: "http://music.msn.com/services/rss.aspx?chartname=topsongs"; }s:8:"inactive";a:1:{i:0;s:42:"http://movies.go.com/xml/rss/boxoffice.xml"; }s:7:"feedurl";s:7:"http://";s:8:"textarea";s:94: "http://news.search.yahoo.com/usns/ynsearch/categories/news_story_search_rss/index.html?p=AUDIO"; s:9:"textarea3";s:68:"http://news.google.com/news?hl=en&ned=us&ie=UTF-8&output=rss&q=AUDIO"; s:8:"rss_desc";s:1:"1";s:12:"rss_max_news";s:1:"2";s:13:"rss_title_len";s:1:"5";s:20: "rss_feed_title_color";s:0:"";s:10:"disp_width";s:3:"200";s:15:"disp_background"; s:5:"WHITE";s:13:"disp_bord_col";s:7:"#000000";s:15:"disp_bord_thick";s:1:"0";s:15: "disp_bord_style";s:4:"None";s:13:"disp_text_col";s:7:"#CC0000";s:14:"disp_text_font";s:22: "Comic Sans, sans-serif";s:14:"disp_text_size";s:2:"15";s:6:"submit";s:14:"Fetch RSS Feed";}');
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br/> And it gives me this error -
Parse error: syntax error, unexpected T_STRING in /home/topuk/public_html/music/index.php on line 788
What do I do to fix it?
Thanks
[edited by: jatar_k at 4:21 am (utc) on Nov. 3, 2006]
[edit reason] sidescroll [/edit]
There is no error on the line provided, however I do notice that you are using a function get_html? This isn't a function, so unless you have it defined somewhere it's going to give you an error, probably something along the lines of the error you are getting since it comes within an echo.
Adding this to the script will let you know if the function is defined or not:
echo '</pre>';
print_r([url=http://us2.php.net/manual/en/function.get-defined-functions.php]get_defined_functions[/url]());
echo '</pre>';
Good luck!
This comments out the get_html function.
[edited by: jatar_k at 4:20 am (utc) on Nov. 3, 2006]
[edit reason] holy sidescroll batman! [/edit]
Ill explain more of what I am doing.
basically I have a php page with music content on, I have installed a script which allows me to get feeds and gives me the php code to put in the page. Thats the code I am tryinng to insert.
I thought it might of been because it has the <?php &?> tags in which are meant to be used only at the start and end of the page corect?
so e.g.
this is what my page looks like
<?php
bla bla
some ph code bla bla
<?php
my feed code the code i am inserting!
?>
some more content on the page
?> end of page.
<?phpbla bla
some ph code bla bla
my feed code the code i am inserting!
some more content on the page
?>end of page.
Once you open the php, <?php, everything that comes after it is parsed as PHP code. If you want to close it, ?>, you can do that, but you don't want to put php tags within php tags.
Here is a common case:
<?php
//php code goes here
?>
Something HTML
<?php
//some more php code on the same page
?>
You can even do something along these lines, which happens all the time:
<input type="text" name="product" value="<?php echo $product_name;?>" />
I hope this makes it a little clearer?
can you show me how I would put that code into the page?
I'm not exactly sure what you mean by that code. The code that you posted in your first message is fine, unless the get_html function isn't defined in the included file. If you have other php tags that enclose the whole body of the code that you gave me in your first post, then you want to remove those instead. Basically you only want PHP to be between <?php and?>, no HTML--by itself that is. It's perfectly fine to echo it.
I want to add the feed, and the feed 'code' is generated by this program I am using.
the code it give me is -
<?php
define('MSIFETCH_DIR', '/home/topuk/public_html/msifetch');
require_once(MSIFETCH_DIR.'/msifetch.inc');
echo get_html('a:18:{s:6:"active";a:1:{i:0;s:57: "http://music.msn.com/services/rss.aspx?chartname=topsongs"; }s:8:"inactive";a:1:{i:0;s:42: "http://movies.go.com/xml/rss/boxoffice.xml"; }s:7:"feedurl";s:7:"http://";s:8:"textarea";s:94: "http://news.search.yahoo.com/usns/ynsearch/categories/news_story_search_rss/index.html?p=AUDIO"; s:9:"textarea3";s:68: "http://news.google.com/news?hl=en&ned=us&ie=UTF-8&output=rss&q=AUDIO"; s:8:"rss_desc";s:1:"1";s:12:"rss_max_news";s:1:"2";s:13:"rss_title_len";s:1:"5";s:20: "rss_feed_title_color";s:0:"";s:10:"disp_width";s:3:"200";s:15:"disp_background"; s:5:"WHITE";s:13:"disp_bord_col";s:7:"#000000";s:15:"disp_bord_thick";s:1:"0";s:15: "disp_bord_style";s:4:"None";s:13:"disp_text_col";s:7:"#CC0000";s:14:"disp_text_font"; s:22:"Comic Sans, sans-serif";s:14:"disp_text_size";s:2:"15";s:6:"submit";s:14:"Fetch RSS Feed";}');
?>
So I put that where I wnated it in my PHP page, and it doesnt work because liek you said the start and end tags. So I removed the <?php &?> tags from the code and put it where I wanted it in my PHP page but I still get an error.........
Im confused. :(
[edited by: jatar_k at 4:22 am (utc) on Nov. 3, 2006]
[edit reason] sidescroll [/edit]
<?php
//some php code that you may already have in here
?>
<table style="width:100%;" class="mainmenu5" cellspacing="0" cellpadding="4">
<tr>
<td style="font-size:8pt;text-align:center;">
<b>Top 3 Msn Song Downloads</b>
<?php
define('MSIFETCH_DIR', '/home/topuk/public_html/music');
require_once(MSIFETCH_DIR.'/msifetch.inc');
echo get_html('a:18:{s:6:"active";a:1:{i:0;s:57:"http://music.msn.com/services/rss.aspx?
chartname=topsongs";}s:8:"inactive";a:1:{i:0;s:42:"http://movies.go.com/xml/rss/
boxoffice.xml";}s:7:"feedurl";s:7:"http://";s:8:"textarea";s:94:"http://
news.search.yahoo.com/usns/ynsearch/categories/news_story_search_rss/index.html?
p=AUDIO";s:9:"textarea3";s:68:"http://news.google.com/news?hl=en&ned=us&ie=UTF-8
&output=rss&q=AUDIO";s:8:"rss_desc";s:1:"1";s:12:"rss_max_news";s:1:"2";s:13:"
rss_title_len";s:1:"5";s:20:"rss_feed_title_color";s:0:"";s:10:"disp_width";s:3:
"200";s:15:"disp_background";s:5:"WHITE";s:13:"disp_bord_col";s:7:"#000000";s:15:
"disp_bord_thick";s:1:"0";s:15:"disp_bord_style";s:4:"None";s:13:"disp_text_col";s:
7:"#CC0000";s:14:"disp_text_font";s:22:"Comic Sans, sans-serif";s:14:"disp_text_size";s:2:"15";s:6:"submit";s:14:"Fetch RSS Feed";}');
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br/>
<?php
//some more php code that you may have in here
?>
I'm sorry if this doesn't answer you question. I'm thinking it does, but then again it's getting late after a long day; my brain might not be functioning ;)
>>holy sidescroll batman!
HAHA jatar Thanks!
I have uploaded the php file as a txt document.
Where the FEED CODE needs to be I have clearly stated with
#*$!#*$!#*$!#*$!#*$! CODE NEEDS TO GO HERE! #*$!#*$!#*$!#*$!#*$!#*$!X
And thhis code needs to go there, edit it as you may as long as it shows the darn feed lol.
<?php
define('MSIFETCH_DIR', '/home/topuk/public_html/music');
require_once(MSIFETCH_DIR.'/msifetch.inc');
echo get_html('a:18:{s:6:"active";a:1:{i:0;s:57:"http://music.msn.com/services/rss.aspx?
chartname=topsongs";}s:8:"inactive";a:1:{i:0;s:42:"http://movies.go.com/xml/rss/
boxoffice.xml";}s:7:"feedurl";s:7:"http://";s:8:"textarea";s:94:"http://
news.search.yahoo.com/usns/ynsearch/categories/news_story_search_rss/index.html?
p=AUDIO";s:9:"textarea3";s:68:"http://news.google.com/news?hl=en&ned=us&ie=UTF-8
&output=rss&q=AUDIO";s:8:"rss_desc";s:1:"1";s:12:"rss_max_news";s:1:"2";s:13:"
rss_title_len";s:1:"5";s:20:"rss_feed_title_color";s:0:"";s:10:"disp_width";s:3:
"200";s:15:"disp_background";s:5:"WHITE";s:13:"disp_bord_col";s:7:"#000000";s:15:
"disp_bord_thick";s:1:"0";s:15:"disp_bord_style";s:4:"None";s:13:"disp_text_col";s:
7:"#CC0000";s:14:"disp_text_font";s:22:"Comic Sans, sans-serif";s:14:"disp_text_size";s:2:"15";s:6:"submit";s:14:"Fetch RSS Feed";}');
?>
If you could so kindly have a stab at it, that would be appreciated!
I look forward to your response in the morning, its 4.35am here Uk :S
Thanks, Again
[edited by: jatar_k at 4:46 am (utc) on Nov. 3, 2006]
[edit reason] no urls thanks [/edit]
You are defining a large string variable, $music. Change your code to this, and it should work:
...blah blah blah
<table style="width:100%;" class="mainmenu5" cellspacing="0" cellpadding="4">
<tr>
<td style="font-size:8pt;text-align:center;">
<b>Top 3 Song Downloads</b>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br/>
<table style="width:100%;" cellspacing="8" cellpadding="4">
<tr>
<td style="font-size:7pt;" class="border2">
<td style="font-size:8pt;text-align:center;">';
define('MSIFETCH_DIR', '/home/topuk/public_html/music');
require_once(MSIFETCH_DIR.'/msifetch.inc');
$music .= get_html('a:18:{s:6:"active";a:1:{i:0;s:57: "http://music.msn.com/services/rss.aspx?chartname=topsongs"; }s:8:"inactive";a:1:{i:0;s:42:"http://movies.go.com/xml/rss/boxoffice.xml"; }s:7:"feedurl";s:7:"http://";s:8:"textarea";s:94: "http://news.search.yahoo.com/usns/ynsearch/categories/news_story_search_rss/index.html?p=AUDIO"; s:9:"textarea3";s:68:"http://news.google.com/news?hl=en&ned=us&ie=UTF-8&output=rss&q=AUDIO"; s:8:"rss_desc";s:1:"1";s:12:"rss_max_news";s:1:"2";s:13:"rss_title_len";s:1:"5";s:20: "rss_feed_title_color";s:0:"";s:10:"disp_width";s:3:"200";s:15:"disp_background"; s:5:"WHITE";s:13:"disp_bord_col";s:7:"#000000";s:15:"disp_bord_thick";s:1:"0";s:15: "disp_bord_style";s:4:"None";s:13:"disp_text_col";s:7:"#CC0000";s:14:"disp_text_font";s:22: "Comic Sans, sans-serif";s:14:"disp_text_size";s:2:"15";s:6:"submit";s:14:"Fetch RSS Feed";}');
$music .= '</td>
</tr>
</table>
</td>
<br /><br />
<div style="text-align:center;">
'.html_adds("").'
</div>
</td>
</tr>
</table>';
What was happening was the quotes in the line:
define('MSIFETCH_DIR', '/home/topuk/public_html/music');
I guess this leaves you with two options:
1) Get a new RSS Feed script from one of the various script repositories(sourceforge.net, hotscripts.com, etc...)
2) Refer to this thread on Troubleshooting [webmasterworld.com] and figure out where the problem lies in your current script.
In either case, I wish you luck!