Is it possible to pass a variable into the tagvaule field? I tried the example below with no luck. I was able to print $keyword using the echo command, but haven;t gotten it to work as the tagvalue. I am a php novice! Any help would be appreciated!
example
$keyword = $_GET['search_query'];
print tubepressGallery('mode="tag" tagValue=$keyword resultsPerPage="12"');
?>
Thanks!
Passing a variable to the tagvaule field
Started by Randy Cintron, Nov 15 2010 05:03 PM
2 replies to this topic
#1
Posted 15 November 2010 - 05:03 PM
#2
Posted 15 November 2010 - 05:56 PM
You're close. PHP is picky about single vs. double quotes. Try something like this instead:
<?php $keyword = $_GET['search_query']; print tubepressGallery("mode='tag' tagValue='$keyword' resultsPerPage='12' "); ?>OR
<?php $keyword = $_GET['search_query']; print tubepressGallery('mode="tag" tagValue="' . $keyword . '" resultsPerPage="12" '); ?>
#3
Posted 15 November 2010 - 08:57 PM
It worked perfectly! Thank you!