Trying to get contents of web page with php

7331

New Member
I am trying to get content from the page below. For my own purpose, i am just interested on the tag so then i could put it into an array for when i send the bot response back to Twitter API with their appropriate method. Here's what i tried:\[code\] <?xml version="1.0" encoding="ISO-8859-1"?> <conversation convo_id="$convo_id"> <bot_name>infobot2012</bot_name> <user_name>User</user_name> <user_id value='http://stackoverflow.com/questions/10564961/2' /> <usersay>$say</usersay> <botsay>Internal error detected. Please inform my botmaster. </botsay> </conversation> $url = "http://localhost/Program-O/chatbot/conversation_start.php?say=$say& hello&convo_id=$convo_id&bot_id=$bot_id&format=xml"; get_url_contents($url) $crl = curl_init(); //getting Parse error: syntax error, unexpected T_VARIABLE $timeout = 5; curl_setopt ($crl, CURLOPT_URL,$url); curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout); $ret = curl_exec($crl); curl_close($crl); return $ret;\[/code\]
 
Back
Top