3v4l.org

run code in 300+ PHP versions simultaneously
<?php ob_start(); header ("Content-type: text/xml;"); echo '<?xml version="1.0" encoding="utf-8"?>'."\r\n"; echo '<items>'; $token = '603a0a066a8d71427114723059ef5a17fa1068b53d15a078edbe3ffca357e93c965b8ab84bc4c862c2224'; if(isset($_REQUEST['search'])){ if(isset($_REQUEST['offset'])) if(isset($_REQUEST['hd'])) $url = 'http://api.vk.com/method/video.search.xml?q='.$_REQUEST['search'].'&count=200&sort=1'.$_REQUEST['hd'].'&adult=1'.$_REQUEST['offset'].'&access_token='.$token; $html = simpleXML_load_file($url,"SimpleXMLElement",LIBXML_NOCDATA); foreach ($html->video as $item) { $play = $item-> player; $title = $item-> title; $img = $item-> image_medium; echo '<channel><title>'.$title.'</title><description><![CDATA[<table><tr><td style="vertical-align: top"><img src="'.$img.'" height="408" width="410"/><h1></h1></td></tr></table> ]]></description><stream_url><![CDATA['.$play.'&autoplay=1]]></stream_url> </channel>'; }} print("</items>"); $name = $_REQUEST['search']; $page = ob_get_contents(); ob_end_flush(); $fp = fopen("$name.xml","w"); fwrite($fp,$page); fclose($fp); $ftp_server="ftp.byethost10.com"; $ftp_user_name="b10_14110070"; $ftp_user_pass="roja1234"; $file = "$name.xml";//tobe uploaded $remote_file = "/htdocs/s/$name.xml"; // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // upload a file if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) { echo "successfully uploaded $file\n"; } else { echo "There was a problem while uploading $file\n"; } // close the connection ftp_close($conn_id); ?> <? $conexion = mysql_connect($mysql_host, $mysql_usuario, $mysql_password, true); $mysql_usuario = 'b10_14110070'; $mysql_password = 'roja1234'; $mysql_host = 'sql207.byethost10.com'; $mysql_database = 'b10_14110070_iptv'; //Seleccionamos la base datos y la conexión. mysql_select_db($mysql_database, $conexion); //Verificamos que no hay ningún error en la conexión if (!$conexion) die('No pudo conectarse: '.mysql_error()); else { //Preparamos la consulta $title = '$name'; $logo_30x30 ='http://www.visual8.co.uk/wp-content/uploads/2013/10/Video-Icon.jpg' ; $description = '$name'; $playlist_url = '$remote_file'; $consulta = "INSERT INTO testme (title, logo_30x30, description, playlist_url)"; $consulta .= "VALUES ('$title', '$logo_30x30', '$description', '$playlist_url')"; //Ejecutamos la consulta $resultado = mysql_query($consulta, $conexion) or die(mysql_error()); echo "<b>ARCHIVO REGISTRADO</b><br><b>nombre:</b> ".$title.", \n <br> <b>logo_30x30:</b> ".$logo_30x30.", \n <br> <b>description:</b> ".$description.", \n <br><br> <b>playlist_url:</b> ".$playlist_url.", \n <br><br>"; } //Cerramos la conexión mysql_close($conexion); ?>
Output for 8.3.0 - 8.3.7
<?xml version="1.0" encoding="utf-8"?> <items></items> Warning: Undefined array key "search" in /in/KrnTL on line 21 Warning: fopen(): open_basedir restriction in effect. File(.xml) is not within the allowed path(s): (/tmp:/in:/etc) in /in/KrnTL on line 24 Warning: fopen(.xml): Failed to open stream: Operation not permitted in /in/KrnTL on line 24 Fatal error: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, false given in /in/KrnTL:25 Stack trace: #0 /in/KrnTL(25): fwrite(false, '<?xml version="...') #1 {main} thrown in /in/KrnTL on line 25
Process exited with code 255.
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
<?xml version="1.0" encoding="utf-8"?> <items></items> Warning: Undefined array key "search" in /in/KrnTL on line 21 Warning: fopen(): open_basedir restriction in effect. File(.xml) is not within the allowed path(s): (/tmp:/in:/etc) in /in/KrnTL on line 24 Warning: fopen(.xml): Failed to open stream: Operation not permitted in /in/KrnTL on line 24 Fatal error: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /in/KrnTL:25 Stack trace: #0 /in/KrnTL(25): fwrite(false, '<?xml version="...') #1 {main} thrown in /in/KrnTL on line 25
Process exited with code 255.
Output for 8.0.13
<?xml version="1.0" encoding="utf-8"?> <items></items> Warning: Undefined array key "search" in /in/KrnTL on line 21 Warning: fopen(.xml): Failed to open stream: Read-only file system in /in/KrnTL on line 24 Fatal error: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /in/KrnTL:25 Stack trace: #0 /in/KrnTL(25): fwrite(false, '<?xml version="...') #1 {main} thrown in /in/KrnTL on line 25
Process exited with code 255.
Output for 7.4.33
<?xml version="1.0" encoding="utf-8"?> <items></items> Notice: Undefined index: search in /in/KrnTL on line 21 Warning: fopen(.xml): failed to open stream: Read-only file system in /in/KrnTL on line 24 Warning: fwrite() expects parameter 1 to be resource, bool given in /in/KrnTL on line 25 Warning: fclose() expects parameter 1 to be resource, bool given in /in/KrnTL on line 26 Fatal error: Uncaught Error: Call to undefined function ftp_connect() in /in/KrnTL:35 Stack trace: #0 {main} thrown in /in/KrnTL on line 35
Process exited with code 255.
Output for 7.3.0 - 7.3.31, 7.4.0 - 7.4.32
<?xml version="1.0" encoding="utf-8"?> <items></items> Notice: Undefined index: search in /in/KrnTL on line 21 Warning: fopen(): open_basedir restriction in effect. File(.xml) is not within the allowed path(s): (/tmp:/in:/etc) in /in/KrnTL on line 24 Warning: fopen(.xml): failed to open stream: Operation not permitted in /in/KrnTL on line 24 Warning: fwrite() expects parameter 1 to be resource, bool given in /in/KrnTL on line 25 Warning: fclose() expects parameter 1 to be resource, bool given in /in/KrnTL on line 26 Fatal error: Uncaught Error: Call to undefined function ftp_connect() in /in/KrnTL:35 Stack trace: #0 {main} thrown in /in/KrnTL on line 35
Process exited with code 255.
Output for 7.3.32 - 7.3.33
<?xml version="1.0" encoding="utf-8"?> <items></items> Warning: fopen(.xml): failed to open stream: Read-only file system in /in/KrnTL on line 24 Warning: fwrite() expects parameter 1 to be resource, bool given in /in/KrnTL on line 25 Warning: fclose() expects parameter 1 to be resource, bool given in /in/KrnTL on line 26 Fatal error: Uncaught Error: Call to undefined function ftp_connect() in /in/KrnTL:35 Stack trace: #0 {main} thrown in /in/KrnTL on line 35
Process exited with code 255.
Output for 7.1.26 - 7.1.33, 7.2.17 - 7.2.33
<?xml version="1.0" encoding="utf-8"?> <items></items> Notice: Undefined index: search in /in/KrnTL on line 21 Warning: fopen(): open_basedir restriction in effect. File(.xml) is not within the allowed path(s): (/tmp:/in:/etc) in /in/KrnTL on line 24 Warning: fopen(.xml): failed to open stream: Operation not permitted in /in/KrnTL on line 24 Warning: fwrite() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 25 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 26 Fatal error: Uncaught Error: Call to undefined function ftp_connect() in /in/KrnTL:35 Stack trace: #0 {main} thrown in /in/KrnTL on line 35
Process exited with code 255.
Output for 7.1.20, 7.2.6
<?xml version="1.0" encoding="utf-8"?> <items></items> Notice: Undefined index: search in /in/KrnTL on line 21 Warning: fopen(): open_basedir restriction in effect. File(.xml) is not within the allowed path(s): (/tmp:/in) in /in/KrnTL on line 24 Warning: fopen(.xml): failed to open stream: Operation not permitted in /in/KrnTL on line 24 Warning: fwrite() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 25 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 26 Fatal error: Uncaught Error: Call to undefined function ftp_connect() in /in/KrnTL:35 Stack trace: #0 {main} thrown in /in/KrnTL on line 35
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0
<?xml version="1.0" encoding="utf-8"?> <items></items> Notice: Undefined index: search in /in/KrnTL on line 21 Warning: fopen(.xml): failed to open stream: Permission denied in /in/KrnTL on line 24 Warning: fwrite() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 25 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 26 Fatal error: Uncaught Error: Call to undefined function ftp_connect() in /in/KrnTL:35 Stack trace: #0 {main} thrown in /in/KrnTL on line 35
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28
<?xml version="1.0" encoding="utf-8"?> <items></items> Notice: Undefined index: search in /in/KrnTL on line 21 Warning: fopen(.xml): failed to open stream: Permission denied in /in/KrnTL on line 24 Warning: fwrite() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 25 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 26 Fatal error: Call to undefined function ftp_connect() in /in/KrnTL on line 35
Process exited with code 255.
Output for 5.3.0 - 5.3.29
<?xml version="1.0" encoding="utf-8"?> <items></items> Notice: Undefined index: search in /in/KrnTL on line 21 Warning: fopen(.xml): failed to open stream: Permission denied in /in/KrnTL on line 24 Warning: fwrite() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 25 Warning: fclose() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 26 Warning: ftp_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/KrnTL on line 35 Warning: ftp_login() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 38 Warning: ftp_put() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 41 There was a problem while uploading .xml Warning: ftp_close() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 49 <? $conexion = mysql_connect($mysql_host, $mysql_usuario, $mysql_password, true); $mysql_usuario = 'b10_14110070'; $mysql_password = 'roja1234'; $mysql_host = 'sql207.byethost10.com'; $mysql_database = 'b10_14110070_iptv'; //Seleccionamos la base datos y la conexión. mysql_select_db($mysql_database, $conexion); //Verificamos que no hay ningún error en la conexión if (!$conexion) die('No pudo conectarse: '.mysql_error()); else { //Preparamos la consulta $title = '$name'; $logo_30x30 ='http://www.visual8.co.uk/wp-content/uploads/2013/10/Video-Icon.jpg' ; $description = '$name'; $playlist_url = '$remote_file'; $consulta = "INSERT INTO testme (title, logo_30x30, description, playlist_url)"; $consulta .= "VALUES ('$title', '$logo_30x30', '$description', '$playlist_url')"; //Ejecutamos la consulta $resultado = mysql_query($consulta, $conexion) or die(mysql_error()); echo "<b>ARCHIVO REGISTRADO</b><br><b>nombre:</b> ".$title.", \n <br> <b>logo_30x30:</b> ".$logo_30x30.", \n <br> <b>description:</b> ".$description.", \n <br><br> <b>playlist_url:</b> ".$playlist_url.", \n <br><br>"; } //Cerramos la conexión mysql_close($conexion); ?>
Output for 4.3.3 - 4.3.4, 4.3.10 - 4.3.11, 4.4.0 - 4.4.9, 5.0.3 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
<?xml version="1.0" encoding="utf-8"?> <items></items> Notice: Undefined index: search in /in/KrnTL on line 21 Warning: fopen(.xml): failed to open stream: Permission denied in /in/KrnTL on line 24 Warning: fwrite(): supplied argument is not a valid stream resource in /in/KrnTL on line 25 Warning: fclose(): supplied argument is not a valid stream resource in /in/KrnTL on line 26 Warning: ftp_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/KrnTL on line 35 Warning: ftp_login() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 38 Warning: ftp_put() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 41 There was a problem while uploading .xml Warning: ftp_close() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 49 <? $conexion = mysql_connect($mysql_host, $mysql_usuario, $mysql_password, true); $mysql_usuario = 'b10_14110070'; $mysql_password = 'roja1234'; $mysql_host = 'sql207.byethost10.com'; $mysql_database = 'b10_14110070_iptv'; //Seleccionamos la base datos y la conexión. mysql_select_db($mysql_database, $conexion); //Verificamos que no hay ningún error en la conexión if (!$conexion) die('No pudo conectarse: '.mysql_error()); else { //Preparamos la consulta $title = '$name'; $logo_30x30 ='http://www.visual8.co.uk/wp-content/uploads/2013/10/Video-Icon.jpg' ; $description = '$name'; $playlist_url = '$remote_file'; $consulta = "INSERT INTO testme (title, logo_30x30, description, playlist_url)"; $consulta .= "VALUES ('$title', '$logo_30x30', '$description', '$playlist_url')"; //Ejecutamos la consulta $resultado = mysql_query($consulta, $conexion) or die(mysql_error()); echo "<b>ARCHIVO REGISTRADO</b><br><b>nombre:</b> ".$title.", \n <br> <b>logo_30x30:</b> ".$logo_30x30.", \n <br> <b>description:</b> ".$description.", \n <br><br> <b>playlist_url:</b> ".$playlist_url.", \n <br><br>"; } //Cerramos la conexión mysql_close($conexion); ?>
Output for 4.3.5 - 4.3.9, 5.0.0 - 5.0.2
<?xml version="1.0" encoding="utf-8"?> <items></items> Notice: Undefined index: search in /in/KrnTL on line 21 Warning: fopen(.xml): failed to open stream: Permission denied in /in/KrnTL on line 24 Warning: fwrite(): supplied argument is not a valid stream resource in /in/KrnTL on line 25 Warning: fclose(): supplied argument is not a valid stream resource in /in/KrnTL on line 26 Warning: ftp_connect(): php_network_getaddresses: gethostbyname failed in /in/KrnTL on line 35 Warning: ftp_login() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 38 Warning: ftp_put() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 41 There was a problem while uploading .xml Warning: ftp_close() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 49 <? $conexion = mysql_connect($mysql_host, $mysql_usuario, $mysql_password, true); $mysql_usuario = 'b10_14110070'; $mysql_password = 'roja1234'; $mysql_host = 'sql207.byethost10.com'; $mysql_database = 'b10_14110070_iptv'; //Seleccionamos la base datos y la conexión. mysql_select_db($mysql_database, $conexion); //Verificamos que no hay ningún error en la conexión if (!$conexion) die('No pudo conectarse: '.mysql_error()); else { //Preparamos la consulta $title = '$name'; $logo_30x30 ='http://www.visual8.co.uk/wp-content/uploads/2013/10/Video-Icon.jpg' ; $description = '$name'; $playlist_url = '$remote_file'; $consulta = "INSERT INTO testme (title, logo_30x30, description, playlist_url)"; $consulta .= "VALUES ('$title', '$logo_30x30', '$description', '$playlist_url')"; //Ejecutamos la consulta $resultado = mysql_query($consulta, $conexion) or die(mysql_error()); echo "<b>ARCHIVO REGISTRADO</b><br><b>nombre:</b> ".$title.", \n <br> <b>logo_30x30:</b> ".$logo_30x30.", \n <br> <b>description:</b> ".$description.", \n <br><br> <b>playlist_url:</b> ".$playlist_url.", \n <br><br>"; } //Cerramos la conexión mysql_close($conexion); ?>
Output for 4.3.2
<?xml version="1.0" encoding="utf-8"?> <items></items> Notice: Undefined index: search in /in/KrnTL on line 21 Warning: fopen(.xml): failed to open stream: Permission denied in /in/KrnTL on line 24 Warning: fwrite(): supplied argument is not a valid stream resource in /in/KrnTL on line 25 Warning: fclose(): supplied argument is not a valid stream resource in /in/KrnTL on line 26 Warning: ftp_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /in/KrnTL on line 35 Warning: ftp_login() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 38 Warning: ftp_put() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 41 There was a problem while uploading .xml Warning: ftp_close() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 49 <? $conexion = mysql_connect($mysql_host, $mysql_usuario, $mysql_password, true); $mysql_usuario = 'b10_14110070'; $mysql_password = 'roja1234'; $mysql_host = 'sql207.byethost10.com'; $mysql_database = 'b10_14110070_iptv'; //Seleccionamos la base datos y la conexión. mysql_select_db($mysql_database, $conexion); //Verificamos que no hay ningún error en la conexión if (!$conexion) die('No pudo conectarse: '.mysql_error()); else { //Preparamos la consulta $title = '$name'; $logo_30x30 ='http://www.visual8.co.uk/wp-content/uploads/2013/10/Video-Icon.jpg' ; $description = '$name'; $playlist_url = '$remote_file'; $consulta = "INSERT INTO testme (title, logo_30x30, description, playlist_url)"; $consulta .= "VALUES ('$title', '$logo_30x30', '$description', '$playlist_url')"; //Ejecutamos la consulta $resultado = mysql_query($consulta, $conexion) or die(mysql_error()); echo "<b>ARCHIVO REGISTRADO</b><br><b>nombre:</b> ".$title.", \n <br> <b>logo_30x30:</b> ".$logo_30x30.", \n <br> <b>description:</b> ".$description.", \n <br><br> <b>playlist_url:</b> ".$playlist_url.", \n <br><br>"; } //Cerramos la conexión mysql_close($conexion); ?>
Output for 4.3.0 - 4.3.1
<?xml version="1.0" encoding="utf-8"?> <items></items> Notice: Undefined index: search in /in/KrnTL on line 21 Warning: fopen(.xml) [http://www.php.net/function.fopen]: failed to create stream: Permission denied in /in/KrnTL on line 24 Warning: fwrite(): supplied argument is not a valid stream resource in /in/KrnTL on line 25 Warning: fclose(): supplied argument is not a valid stream resource in /in/KrnTL on line 26 Warning: ftp_connect() [http://www.php.net/function.ftp-connect]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/KrnTL on line 35 Warning: ftp_login() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 38 Warning: ftp_put() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 41 There was a problem while uploading .xml Warning: ftp_close() expects parameter 1 to be resource, boolean given in /in/KrnTL on line 49 <? $conexion = mysql_connect($mysql_host, $mysql_usuario, $mysql_password, true); $mysql_usuario = 'b10_14110070'; $mysql_password = 'roja1234'; $mysql_host = 'sql207.byethost10.com'; $mysql_database = 'b10_14110070_iptv'; //Seleccionamos la base datos y la conexión. mysql_select_db($mysql_database, $conexion); //Verificamos que no hay ningún error en la conexión if (!$conexion) die('No pudo conectarse: '.mysql_error()); else { //Preparamos la consulta $title = '$name'; $logo_30x30 ='http://www.visual8.co.uk/wp-content/uploads/2013/10/Video-Icon.jpg' ; $description = '$name'; $playlist_url = '$remote_file'; $consulta = "INSERT INTO testme (title, logo_30x30, description, playlist_url)"; $consulta .= "VALUES ('$title', '$logo_30x30', '$description', '$playlist_url')"; //Ejecutamos la consulta $resultado = mysql_query($consulta, $conexion) or die(mysql_error()); echo "<b>ARCHIVO REGISTRADO</b><br><b>nombre:</b> ".$title.", \n <br> <b>logo_30x30:</b> ".$logo_30x30.", \n <br> <b>description:</b> ".$description.", \n <br><br> <b>playlist_url:</b> ".$playlist_url.", \n <br><br>"; } //Cerramos la conexión mysql_close($conexion); ?>

preferences:
250.07 ms | 409 KiB | 387 Q