...

View Full Version : Display help.



cosmicsea
11-28-2010, 08:10 AM
I have a search engine and have dynamic META description tags for my results. They however do not when you click view all media results for this listing which takes you to a media results page for that link.

I am using this

$description = 'Desc';


The rest of my code does a Preg_replace and removes the Desc and puts in the dynamic text for that page.

On my media results in the description it is static but also shows Desc in it because the code doesn't work for it like I said. Is there a way I can change Desc to $query to show the query instead by using echo or something?

here is what I am trying to do.

$description = 'echo "".$query.""';

I know this doesn't work but I thought the example may help.
Is there a way for me to throw in echo or something in there to make that work? any info is appreciated. thanks.

cosmicsea
11-28-2010, 09:34 AM
Basically I am asking, how could I place an echo or print statement into this?


$description = 'Desc';

Desc being where the echo or print would go.

MattF
11-28-2010, 09:47 AM
Is that honestly a serious question?



$description = htmlspecialchars($query);

cosmicsea
11-28-2010, 01:12 PM
Is that honestly a serious question?



$description = htmlspecialchars($query);


Unfortunately it is, and that doesn't work. It doesn't display anything. It will display htmlspecialchars($query) if I put


$description = 'htmlspecialchars($query)';
But I already knew that. Anything will display between the ''
Thats why I was trying to figure out how to print out $query inside ''

MattF
11-28-2010, 02:12 PM
$description = 'htmlspecialchars($query)';
But I already knew that. Anything will display between the ''
Thats why I was trying to figure out how to print out $query inside ''

Why are you adding the single quotes? It will obviously treat anything between those as a string. If you need to enclose anything within quotes, double them and escape: \''.function().'\'



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum