Noob PHP question of the year

Frankie4Fingers

Power Member
Joined
Jan 8, 2009
Messages
679
Reaction score
216
I'm trying to add a line of code to a WP search results page so to call feeds related to the search keyword. I'm using WP 2.9.2 with Simple Pie Core and Simple Pie for WP.

The line I added is this:

Code:
<?php echo SimplePieWP('http://www.site.com/jc/rss_lastinsert.jsp?k=teacher&country=UK&l=<? echo $_GET["s"] ?>'); ?>
The WP search result page loads but gives the following error: XML error: Invalid document end at line 1, column 1

I'm 100% sure the error in the line of code is

Code:
<? echo $_GET["s"] ?>

because if I put the name of a location (e.g. London) in its place all works fine and the search page results show feeds related to job offers for teacher in London.

How can I solve this?

Thanks in advance.
 
Well I can tell you right off the bat that you dont need the <? and ?> around $_GET["s"]. You don't need to echo it again either.

Try something like this:
PHP:
<?php echo SimplePieWP('http://www.site.com/jc/rss_lastinsert.jsp?k=teacher&country=UK&l=' . $_GET["s"]); ?>
 
Back
Top