|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Member
Iscritto dal: Jun 2001
Messaggi: 22
|
Problemi in PHP
Ho un pgm scritto in PHP che mi da il seguente errore:
Warning: checkdnsrr() is not supported in this PHP build in \eml.php3 on line non ho scritto io il programma e non conosco il PHP. cosa posso fare per far funzionare comuque il pgm? grazie Corraz ![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Apr 2001
Città: Merone (CO)
Messaggi: 1823
|
Questa funzione non è implementata su piattaforme Windows, quindi se la stai usando lì ricevi un errore. Se invece la stai usando in ambiente linux non saprei.
Bye. |
![]() |
![]() |
![]() |
#3 |
Member
Iscritto dal: Jun 2001
Messaggi: 22
|
ok, ma...
ok. non cìè un'alternativa? come posso non utilizzarequesta funzione o meglio come posso ostituirla?
Insomma cosa faccio per far funzionare il pgm? grazie Ciao |
![]() |
![]() |
![]() |
#4 |
Senior Member
Iscritto dal: Apr 2001
Città: Merone (CO)
Messaggi: 1823
|
Ci sono altre funzioni che fanno piu' o meno la stessa cosa pero' non le conosco molto bene. Se provi a chiedere nel forum di www.html.it nella sezione php trovi persone davvero in gamba che magari possono aiutarti.
Bye. |
![]() |
![]() |
![]() |
#5 |
Senior Member
Iscritto dal: Dec 2000
Messaggi: 126
|
ti riporto cosa dice il manuale php sulla funzione in oggetto:
Codice:
checkdnsrr (PHP 3, PHP 4 >= 4.0b1) checkdnsrr -- Check DNS records corresponding to a given Internet host name or IP address Description int checkdnsrr (string host [, string type]) Searches DNS for records of type type corresponding to host. Returns TRUE if any records are found; returns FALSE if no records were found or if an error occurred. type may be any one of: A, MX, NS, SOA, PTR, CNAME, or ANY. The default is MX. Host may either be the IP address in dotted-quad notation or the host name. See also getmxrr(), gethostbyaddr(), gethostbyname(), gethostbynamel(), and the named(8) manual page. pero' mi sembra strano che questa funzione nn sia implementata su Win come dice Beralios ![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Iscritto dal: Apr 2001
Città: Merone (CO)
Messaggi: 1823
|
Che non e' supportata e' scritto sul manuale che c'e' sul sito ufficiale di PHP www.php.net.
Come ho gia' detto non conosco molto bene queste funzioni, comunque cercando un po' in giro ho trovato questa funzione: Codice:
<?php /****************************************************** These functions can be used on WindowsNT to replace their built-in counterparts that do not work as expected. checkdnsrr_winNT() works just the same, returning true or false getmxrr_winNT() returns true or false and provides a list of MX hosts in order of preference. *******************************************************/ function checkdnsrr_winNT( $host, $type = '' ) { if( !empty( $host ) ) { # Set Default Type: if( $type == '' ) $type = "MX"; @exec( "nslookup -type=$type $host", $output ); while( list( $k, $line ) = each( $output ) ) { # Valid records begin with host name: if( eregi( "^$host", $line ) ) { # record found: return true; } } return false; } } function getmxrr_winNT( $hostname, &$mxhosts ) { if( !is_array( $mxhosts ) ) $mxhosts = array(); if( !empty( $hostname ) ) { @exec( "nslookup -type=MX $hostname", $output, $ret ); while( list( $k, $line ) = each( $output ) ) { # Valid records begin with hostname: if( ereg( "^$hostname\tMX preference = ([0-9]+), mail exchanger = (.*)$", $line, $parts ) ) { $mxhosts[ $parts[1] ] = $parts[2]; } } if( count( $mxhosts ) ) { reset( $mxhosts ); ksort( $mxhosts ); $i = 0; while( list( $pref, $host ) = each( $mxhosts ) ) { $mxhosts2[$i] = $host; $i++; } $mxhosts = $mxhosts2; return true; } else { return false; } } } if ( getmxrr_winNT( "microsoft.com", $hosts ) ) { echo count($hosts)." "; for ($i=0; $i<=count($hosts); $i++){ echo $hosts[$i];} } ?> BYe. |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 11:32.