[Resolved] Using variable passed in URL
I’m able to pass a variable in a url like so:
.. and I am able to GET the variable and display it in a php echo like so (this is placed before the loop):
<?php $searchterm = $_GET["searchterm"]; ?> Search term: <?php echo $searchterm; ?>
BUT if I insert the echo in the query_post like so:
<?php query_posts('p=<?php echo $searchterm; ?>'); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
… it doesn’t seem to work correctly, but if I manually enter 544 in place of the echo it works as expected.
Any ideas!? Thanks
- The topic ‘[Resolved] Using variable passed in URL’ is closed to new replies.