Jump to content

request url contents and parse xml


chronister

Recommended Posts

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

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.