chronister Posted March 19, 2007 Share Posted March 19, 2007 Hello, What I wanna do is probably simple, but I am having a little trouble... I want to accept a movie title into a form field. Once submitted I want to take the search string append to a url and request that url. That url returns xml data that I then want to parse. Here is what I have thus far <form action="<?=$_SERVER['PHP_SELF'] ?>" name="findmovie" method="post" > <input name="title" type="text" value=""> <input name="Submit" type="submit" value="Submit"> </form> <?php if(isset($_POST['Submit'])){ $search_string=$_POST['title']; $string='http://www.trynt.com/movie-imdb-api/v2/?fo=xml&f=1&t='.$search_string; } ?> I have tried include and I get this error. URL file-access is disabled in the server configuration in C:\Program Files\xampp...... on line 12 I believe I can change this in the ini file, but I am not sure. any suggestions? Link to comment https://forums.phpfreaks.com/topic/43325-request-url-contents-and-parse-xml/ Share on other sites More sharing options...
Barand Posted March 19, 2007 Share Posted March 19, 2007 try <?php $search_string = 'Jaws'; $string='http://www.trynt.com/movie-imdb-api/v2/?fo=xml&f=1&t='.$search_string; $xml = simplexml_load_file($string); echo '<pre>', print_r($xml, true), '</pre>'; ?> Link to comment https://forums.phpfreaks.com/topic/43325-request-url-contents-and-parse-xml/#findComment-210372 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.