chunk
Jul 24th, 2010, 12:41 AM
Hi,
please help me why this $url does not work with file_get_contents
<?php
include("connx.php");
$id = $_GET['id'];
$id = (int) $id;
$sql = "SELECT * FROM tbl_table WHERE id='$id'";
$res = mysql_query($sql);
$row = mysql_fetch_row($res);
$url = $row[2];
$cont = file_get_contents($url);
echo '<xmp>' . $cont . '</xmp>';
?>
the URL is something like
http://site.com/xml/student_name=name&fathername=father
and this is very long URL
please help me why this $url does not work with file_get_contents
<?php
include("connx.php");
$id = $_GET['id'];
$id = (int) $id;
$sql = "SELECT * FROM tbl_table WHERE id='$id'";
$res = mysql_query($sql);
$row = mysql_fetch_row($res);
$url = $row[2];
$cont = file_get_contents($url);
echo '<xmp>' . $cont . '</xmp>';
?>
the URL is something like
http://site.com/xml/student_name=name&fathername=father
and this is very long URL