Jump to content

GET data from url


liamloveslearning

Recommended Posts

basically, ive got a html form that posts a GET request to a PHP file. what i want to do is to take the search query from the form and include it somehow onto the end of a URL. i just cant figure out how to add the search query onto the end of the URL in the PHP file 

      

 <?php
        $mm_xsl = new MM_XSLTransform();
        $mm_xsl->setXML("http://gdata.youtube.com/feeds/api/videos/-/Music?max-results=8&orderby=relevance&vq=foo+fighters");
        $mm_xsl->setXSL("video_feed.xsl");
        echo $mm_xsl->Transform();

        ?> 

so where it says foo fighters on the end, id like it to be replaced with whatever the search result was

 

Link to comment
https://forums.phpfreaks.com/topic/144068-get-data-from-url/
Share on other sites

basically, ive got a html form that posts a GET request to a PHP file. what i want to do is to take the search query from the form and include it somehow onto the end of a URL. i just cant figure out how to add the search query onto the end of the URL in the PHP file

       

 <?php
        $mm_xsl = new MM_XSLTransform();
        $mm_xsl->setXML("http://gdata.youtube.com/feeds/api/videos/-/Music?max-results=8&orderby=relevance&vq=foo+fighters");
        $mm_xsl->setXSL("video_feed.xsl");
        echo $mm_xsl->Transform();

        ?>

so where it says foo fighters on the end, id like it to be replaced with whatever the search result was

 

<?php
        $mm_xsl = new MM_XSLTransform();
        $mm_xsl->setXML("http://gdata.youtube.com/feeds/api/videos/-/Music?max-results=8&orderby=relevance&vq=$searchresults");
        $mm_xsl->setXSL("video_feed.xsl");
        echo $mm_xsl->Transform();
?>

 

and use a for to do so <input type="text" name="searchresults" id="$searchresults">

Link to comment
https://forums.phpfreaks.com/topic/144068-get-data-from-url/#findComment-755920
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.