Php 提交后显示错误

Php 提交后显示错误,php,phpbb,Php,Phpbb,我想在用户单击submit之后立即显示一个错误(在phpBB中是trigger_error) 我已经有一个功能,检查是否有链接已发布。现在我想在点击提交帖子按钮后调用它 我在哪里找到的?可能在posting.php中?打开posting.php 在631行附近查找 if ($submit || $preview || $refresh) { 添加后 $post_data['your_url'] = "http://www.damienkeitel.com/index.php"; /

我想在用户单击submit之后立即显示一个错误(在phpBB中是trigger_error)

我已经有一个功能,检查是否有链接已发布。现在我想在点击提交帖子按钮后调用它

我在哪里找到的?可能在posting.php中?

打开posting.php

在631行附近查找

    if ($submit || $preview || $refresh)
{
添加后

  $post_data['your_url'] = "http://www.damienkeitel.com/index.php"; //remove the equals and url value if using in real post
  $your_url = $post_data['your_url'];
  $your_url_exists = (isset($your_url)) ? true : false;
  $your_url = preg_replace(array('#&\#46;#','#&\#58;#','/\[(.*?)\]/'), array('.',':',''), $your_url);

  if ($your_url_exists && http_file_exists($your_url) == true)
  {
    trigger_error('yeah, its reachable');
  }
  else if ($your_url_exists && http_file_exists($your_url) == false)
  {
    trigger_error('what da hell..');
  }
function http_file_exists($url) 
{ 
  $f = @fopen($url,"r"); 
  if($f) 
  { 
    fclose($f); 
  return true; 
  } 
return false; 
} 
开放式功能

在第19行附近找到

/**
* Fill smiley templates (or just the variables) with smilies, either in a window or inline
*/
添加后

  $post_data['your_url'] = "http://www.damienkeitel.com/index.php"; //remove the equals and url value if using in real post
  $your_url = $post_data['your_url'];
  $your_url_exists = (isset($your_url)) ? true : false;
  $your_url = preg_replace(array('#&\#46;#','#&\#58;#','/\[(.*?)\]/'), array('.',':',''), $your_url);

  if ($your_url_exists && http_file_exists($your_url) == true)
  {
    trigger_error('yeah, its reachable');
  }
  else if ($your_url_exists && http_file_exists($your_url) == false)
  {
    trigger_error('what da hell..');
  }
function http_file_exists($url) 
{ 
  $f = @fopen($url,"r"); 
  if($f) 
  { 
    fclose($f); 
  return true; 
  } 
return false; 
} 

似乎正在以我想要的方式工作,只是它总是显示URL存在!:我的黑板上有这个。如果我把www.78t8tjigsdfioua.com放进去,它会返回触发器错误(“该死的…”);哦,我知道发生了什么。它只检查域是否存在。所以,如果我已经有了它,就表明它存在,如果我有了它,也表明它存在。如何让它检查完整的URL?包括域之后的内容。另外,如果找不到URL,我如何让它继续提交?posting.php有很多代码更改,包括/functions\u posting.php、languages/en/common.php、style/your\u theme\u name/posting\u editor.html和viewtopic\u body.html。它正在工作。请访问我的论坛,我们可以进一步讨论。