problem with arguments

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cyberyan
Forum Newbie
Posts: 3
Joined: Thu Jun 26, 2003 5:42 am

problem with arguments

Post by cyberyan »

All arguments cannot be use on script
if i use $HTTP_GET_VARS or HTTP_POST_VARS it work

but i dont know if it work with file argument

I am on IIS 5 on WINDOWS 2000 PRO

Can somebody help me

Thanks
User avatar
releasedj
Forum Contributor
Posts: 105
Joined: Tue Jun 17, 2003 6:35 am

Post by releasedj »

I have no idea what you mean!

When you say "All arguments cannot be use on script" what do you mean by argument?

Do you mean in a function?

Please give some code examples!
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

if by "arguments" the parameter passed client->server are meant
have a read of Sticky: Before Post Read: Concerning Passing Variables in PHP 4.2+
I might be helpful ;)
cyberyan
Forum Newbie
Posts: 3
Joined: Thu Jun 26, 2003 5:42 am

Post by cyberyan »

Thank for this
i've not turn on the global_variable on php.ini

Now my pb is file global variable

Code: Select all

<form action="upload_single.php" method="post"
 enctype="multipart/form-data">
 Indiquez le nom du fichier à télécharger :
 <input type="file" name="Fichier">
upload_single.php

Code: Select all

<?php
$Errors="";
if(!empty($Fichier_name))
&#123;$CurBasePath=dirname($PATH_TRANSLATED);
  $NewName=$CurBasePath."/uppics/".$Fichier_name;
  copy($Fichier,$NewName);&#125;
else
&#123;$Errors="Aucun fichier choisi";&#125;
?>
<html>
<head>
<title>Affichage d'une image envoyer en téléchargement
</title>
</head>
<body>
<?php
 
if($Errors !="")
&#123;print("<b>Erreurs:</b> : $Errors<BR>");&#125;
else
&#123;print("Voici l'image téléchargé :<BR><BR>");
print("<img src="uppics/$Fichier_name" border="0">");&#125;
?>
</body>
</html>
in url i've this
upload_single.php?Fichier=F%3A%5Cmotos%5Cmini_7.jpg&submit=submit

and the result is

Erreurs: : Aucun fichier choisi

Thanks for all
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

http://www.php.net/features.file-upload has examples of how file uploads are handled with register_globals disabled.
Basically it's about moving the global variables to arrays.
e.g. $Fichier_name becomes $_FILES['Fichier']['name'] and $Fichier becomes $_FILES['Fichier']['tmp_name']
cyberyan
Forum Newbie
Posts: 3
Joined: Thu Jun 26, 2003 5:42 am

Post by cyberyan »

THANK FOR ALL

It works now
Post Reply