php automation with curl_exec

Konrad Soares :

I need to execute some php pages with curl_exec but I'm getting the message "Moved Permanently" and the pages isn't executing.

What Am I forgetting?

I have all the pages in one mysql table and my code is bellow:

<?php
include('server.php');
$results_path = mysqli_query($conn, "SELECT * FROM table_script");

while ($row = mysqli_fetch_array($results_path)) {

$file_string = $row['url'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $file_string);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");

if(($html = curl_exec($ch)) === false)
{
    echo 'Curl error: ' . curl_error($ch);
    die('111');
}
curl_close($ch);
echo $html;

}
?>