function isDomainAvailible($domain)
{
//проверка на валидность урла
if(!filter_var($domain, FILTER_VALIDATE_URL))
{
return false;
}
$fields = array('title' => 'Тестовое сообщение', 'content' => "Тестовое описание");
//инициализация curl
$curlInit = curl_init();
curl_setopt($curlInit, CURLOPT_URL, $domain);
curl_setopt($curlInit, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curlInit, CURLOPT_POST, true);
curl_setopt($curlInit, CURLOPT_POSTFIELDS, $fields);
//получение ответа
$response = curl_exec($curlInit);
curl_close($curlInit);
var_dump($response);
if ($response) return true;
return false;
}
$curlInit = curl_init($domain);
$curlInit = curl_init();
curl_setopt($curlInit, CURLOPT_URL, $domain);
Обратная связь. Поля: Текст, Имя отправителя, E-mail отправителя.
но только чтобы не вставлять поля, чтобы не поганить дизайн
Select *
. Перечисляйте поля, это реально снизит нагрузку на опреативку при mysql_fetch_assoc()
$rss = new UniversalFeedCreator();
$rss->useCached(); // use cached version if age < 1 hour
$rss->title = "PHP news";
$rss->description = "daily news from the PHP scripting world";
//optional
$rss->descriptionTruncSize = 500;
$rss->descriptionHtmlSyndicated = true;
$rss->link = "<a href="http://www.dailyphp.net/news">http://www.dailyphp.net/news</a>";
$rss->syndicationURL = "<a href="http://www.dailyphp.net/">http://www.dailyphp.net/</a>" . $_SERVER["PHP_SELF"];
$image = new FeedImage();
$image->title = "dailyphp.net logo";
$image->url = "<a href="http://www.dailyphp.net/images/logo.gif">http://www.dailyphp.net/images/logo.gif</a>";
$image->link = "<a href="http://www.dailyphp.net">http://www.dailyphp.net</a>";
$image->description = "Feed provided by dailyphp.net. Click to visit.";
//optional
$image->descriptionTruncSize = 500;
$image->descriptionHtmlSyndicated = true;
$rss->image = $image;
// get your news items from somewhere, e.g. your database:
mysql_select_db($dbHost, $dbUser, $dbPass);
$res = mysql_query("SELECT * FROM news ORDER BY newsdate DESC");
while ($data = mysql_fetch_object($res)) {
$item = new FeedItem();
$item->title = $data->title;
$item->link = $data->url;
$item->description = $data->short;
//optional
$item->descriptionTruncSize = 500;
$item->descriptionHtmlSyndicated = true;
$item->date = $data->newsdate;
$item->source = "<a href="http://www.dailyphp.net">http://www.dailyphp.net</a>";
$item->author = "John Doe";
$rss->addItem($item);
}
echo $rss->saveFeed("RSS1.0", "news/feed.xml");