Forum Moderators: coopster

Message Too Old, No Replies

Parse Error

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T

         

purple

9:10 pm on Aug 30, 2006 (gmt 0)

10+ Year Member



Hi

I am trying to display some rss feeds, I want the php script to a pick up keyword search to then display a rss feed.

I get the following error Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in mydomain.com line xx

The code is as below any ideas what I am doing wrong?

<?php
$urllist="http://search.news.yahoo.com/usns/ynsearch/categories/47/index.html?p=<?=$_GET['Text']?>";
$numminitems="5";
$nummaxitems="15";
$tfont="Arial";
$tsize="1";
$tstyle="";
$tcolor="";
$dfont="Arial";
$dsize="1";
$dstyle="";
$dcolor="";
require_once("incrss.php");
?>

eelixduppy

9:35 pm on Aug 30, 2006 (gmt 0)



Change this line:

$urllist="http://search.news.yahoo.com/usns/ynsearch/categories/47/index.html?p=<?=$_GET['Text']?>";

To this:


$urllist="http://search.news.yahoo.com/usns/ynsearch/categories/47/index.html?p=$_GET['Text']";

Good luck!

jatar_k

9:41 pm on Aug 30, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



or even better

$urllist = 'http://search.news.yahoo.com/usns/ynsearch/categories/47/index.html?p=' . $_GET['Text'];

;)

purple

9:42 pm on Aug 30, 2006 (gmt 0)

10+ Year Member



Thanks for your speedy reply I still get the same message

purple

9:44 pm on Aug 30, 2006 (gmt 0)

10+ Year Member



jatar_k thanks that amendment works thanks to both of you for speedy replies well chuffed

jatar_k

9:56 pm on Aug 30, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



eelix's works but when you use an array inside double quotes then you need to use braces around it, like so

$urllist="http://search.news.yahoo.com/usns/ynsearch/categories/47/index.html?p={$_GET['Text']}";

eelixduppy

10:00 pm on Aug 30, 2006 (gmt 0)



oops..Thanks jatar ;)