0

Want to use the parameter that I get over the Custom Field Option in Wordpress for an included site with searching results.

This is my code (without the parameter everything runs, but how can I use the parameter in the URL?):

<?php $parameter = get_post_meta($post->ID, 'searchingword', false); ?>
        <?php foreach($parameter as $parameter) {
            echo file_get_contents_curl('http://www.domain.com/searching.php?search=.$parameter.');         } ?>

1 Answer 1

2

Your syntax is wrong. Try this:

echo file_get_contents_curl('http://www.domain.com/searching.php?search='. $parameter);

And in the foreach loop you have to use 2 different variables:

foreach($parameter as $param) {
    echo file_get_contents_curl('http://www.domain.com/searching.php?search='. $param);
    ...
Sign up to request clarification or add additional context in comments.

1 Comment

Great that is it. Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.