Jump to content


These Forums Are Now Read-Only


For TubePress support, please post a question here or open a support ticket and we will be glad to assist.


Photo

Passing a variable to the tagvaule field


  • Please log in to reply
2 replies to this topic

#1 Randy Cintron

Randy Cintron

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 15 November 2010 - 05:03 PM

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!

#2 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

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 Randy Cintron

Randy Cintron

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 15 November 2010 - 08:57 PM

It worked perfectly! Thank you!