Page 1 of 1

help on code php

Posted: Fri Aug 31, 2007 3:55 am
by domy
I need help on the code,I have seen the code,but I do not succeed to make to work it.
it comes recalled through a form that it has this code:

Code: Select all

<html>
<head>
<meta http-equiv="Content-Language" content="it">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>tesi/trovalink.php</title>
</head>
<body>


<?php
//apertura file

$filename =$_POST ["indirizzo"];
$file=fopen ("$filename","r");

//controllo se il file esiste o viene aperto correttamente
if (!$file){
echo "impossibile aprire il file remoto.";
//exit;
}

else {
echo "operazione riuscita";}

//scorro il file alla ricerca dei link

while (!feof ($file)) {

$linea=fgets ($file,1024);

//controllo per ogni linea se viene trovata l'espressione regolare

if (eregi ('href="([^"+)"[^>]*>([^<]+)',$line,$parts));{
$link[ ]=$parts;
}
}
fclose($file);
echo"$link[ ]";
?>
</body>
</html>
thanks.

aspect answers
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.

Posted: Fri Aug 31, 2007 9:01 am
by Begby
Doesn't work how? Are you getting errors? What is it supposed to do?

Posted: Sat Sep 01, 2007 3:31 am
by domy
these rows would have to give back the list of the link present in one page web whose address comes passed through one form.
excuse s my English is poor and excuse my if I do not comprise well.
however thanks for the aid that you will be able or want give to me.