Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HELP ME PLZ

0 views
Skip to first unread message

Gustavo Andrade

unread,
May 28, 2003, 6:35:20 PM5/28/03
to php-w...@lists.php.net
I HAVE THIS FOLLOWING CODE THAT WORKS PERFECTLY, IT IS A SMALL UPLOAD
SYSTEM.
(IM FROM BRAZIL)

<?
$extensao=substr($arquivo_name, -4);
if (!empty($arquivo) and is_file($arquivo)) {
$caminho="C:\\web\\upload\\";
$caminho=$caminho.$arquivo_name;
copy($arquivo,$caminho);
echo "<h1>O arquivo foi transferido!</h1>";
}else{
echo "<h1>O arquivo não foi transferido!</h1>";
echo "<h2><font color='red'>Nome, caminho ou extensão de arquivo
Inválido</font></h2>";
}
?>

into the $extensao=substr($arquivo_name, -4); i get the value of the upload
file extension.
All that i wish to do is to make an if like this one


if $extensao<>.rep {
echo "<h1>The file is not valid!</h1>";
}else{
echo "<h1>The file is valid!</h1>";

But i cant do that it does not work, can anyone help me?

joseph cachico

unread,
Jun 3, 2003, 1:38:36 AM6/3/03
to
Se eu compredi bem voce, sua resposta e esta :

if ($extensao != ".rep")


{
echo "<h1>The file is not valid!</h1>";
}
else
{
echo "<h1>The file is valid!</h1>";
}

gu_...@yahoo.com (Gustavo Andrade) wrote in message news:<2003060222113...@pb1.pair.com>...

0 new messages