Forum Moderators: coopster
Edit
ok i figured it out. read the description, it returns all the missing components we need to & them
here is my usage now
//copied the fn as on page 1 and replaced the broken pipe with a full pipe the exclamation point replace not relevant here
$ll ="\n<br>\n";$rel = "../java/q1.html";
function chkUrl($rel, $comps, &$error, &$cleaned) {
global $u1, $ll;
$error = 0;
//$comps = SCHEME + AUTHORITY+ PATH + QUERY + FRAGMENT ;
$cleaned = array();
echo "{$ll}is url [{$rel}] :" ;
//echo "{$ll}err " . $error . "{$ll} Cleaned:{$ll}";
if(! $u1->isUrl($rel, $comps, $error, $cleaned)){
}else{
echo " Ok ";
}
if(($error & SCHEME) == SCHEME && ($comps & SCHEME) == SCHEME)echo " err SCHEME$ll ";
if(($error & AUTHORITY) == AUTHORITY && ($comps & AUTHORITY) == AUTHORITY)echo " err AUTHORITY$ll ";
if(($error & PATH) == PATH && ($comps & PATH) == PATH)echo " err PATH$ll ";
if(($error & QUERY) == QUERY && ($comps & QUERY) == QUERY)echo " err QUERY$ll ";
if(($error & FRAGMENT) == FRAGMENT && ($comps & FRAGMENT) == FRAGMENT)echo " err FRAGMENT$ll ";
if(($error & AUTHORITY_WF) == AUTHORITY_WF && ($comps & AUTHORITY_WF) == AUTHORITY_WF)echo " err AUTHORITY_WF$ll ";
print_r($cleaned);
echo "{$ll}---{$ll} " ;
}
$comps = SCHEME + AUTHORITY+ PATH ;
chkUrl($rel, $comps, $error, $cleaned) ;
chkUrl($u1->url, $comps, $error, $cleaned) ;
$rel = "www.a.dgf/java/q1.html";
chkUrl($rel, $comps, $error, $cleaned) ;
$rel = "http://www.a.dgf/java/q1.html?s=2#s";
chkUrl($rel, $comps, $error, $cleaned) ;
[edited by: tgkprog at 2:57 am (utc) on Mar. 17, 2008]
php.net is a good source of php documentation:
[php.net...]
you should also check out the Charter [webmasterworld.com] and Library [webmasterworld.com] links for the PHP forum...