Page 1 of 1

fopen ect..

Posted: Fri Jul 08, 2005 9:36 pm
by SidewinderX
hello im doing some work with fopen, fput and fclose, the current code that deals with these functions is listed below:

Code: Select all

$sig = "blah blah blah blah";
$fp = fopen("$pid.php", "w");
fputs($fp, $sig);
fclose($sig);
My question is when this script runs, it creates a file called $pid.php in the root directory where this script is located. How do i make it so the file $pid.php is created in /images rather then / ?led $pid.php in the root directory where this script is located. How do i make it so the file $pid.php is created in /images rather then / ?lah blah blah";
$fp = fopen("$pid.php", "w");
fputs($fp, $sig);
fclose($sig);


My question is when this script runs, it creates a file called $pid.php in the root directory where this script is located. How do i make it so the file $pid.php is c script runs, it creates a file called $pid.php in the root directory where this script is located. How do i make it so the file $pid.php is created in /images rather then / ?How do i make it so the file $pid.php is created in /images rather then / ?h these functions is listed below:

Code: Select all

$sig = "blah blah blah blah";
$fp = fopen("$pid.php", "w");
fputs($fp, $sig);
fclose($sig);
My e work with fopen, fput and fclose, the current code that deals with these functions is listed below:

Code: Select all

$sig = "blah blah blah blah";
$fp = fopen("$pid.php", "w");
fputs($fp, $sig);
fclose($sig);
My question is when this script runs, it creates a file called $pid.php in the root directory where this script is located. How do i make it so the file $pid.php is created in /images rather then / ?
$sig = "blah blah blah blah";
$fp = fopen("$pid.php", &quote;w&quote;);
fputs($fp, $sig);
fclose($sig);


My question is when this script runs, it creates a file called $pid.php in the root directory where this script is located. How do i make it so the file $pid.php is created in /images rather thquote;, &quote;w&quote;);
fputs($fp, $sig);
fclose($sig);


My question is when this script rudc60ed]
$sig = "blah blah blah blah&quote;;
$fp = fopen(&quote;$pid.php&quote;, &quote;w&quote;);
fputs($fp, $sig);
fclose($sig);


My question is when this script runs, it creates a file called $pid.php in the root directory where this script is located. How do i make it so the file $pid.php is created in /images rather then / ?d]
$sig = "blah blah blah blah";
$fp = fopen("$pid.php", "w");
fputs($fp, $sig);
fclose($sig);


My question is when this script runs, it creates a file called $pid.php in the root directory where this script is located. How do i make it so the file $pid.php is created in /images rather then / ?s located. How do i make it so the file $pid.php is created in /images rather then / ? below:

Code: Select all

$sig = "blah blah blah blah";
$fp = fopen("$pid.php", "w");
fputs($fp, $sig);
fclose($sig);
My question is when this script runs, it creates a file called $pid.php in the root directory where this script is located. How do i make it so the file $pid.php is created in /images rather then / ?ent code that deals with these functions is listed below:

Code: Select all

$sig = "blah blah blah blah";
$fp = fopen("$pid.php", "w");
fputs($fp, $sig);
fclose($sig);
My question is when this script runs, it creates a file called $pid.php in the root directory where this script is located. How do i make it so the file $pid.php is created in /images rather then / ?ah";
$fp = fopen("$pid.php", "w");
fputs($fp, $sig);
fclose($sig);


My question is when this script runs, it creates a file called $pid.php in the root directory where this script is located. How do i make it so thg);


My question is when this script runs, it creates a file called $pid.php in the root directory where this script is located. How do i make it so the file $pid.php is created in /images rather then / ? this script runs, it creates a file called $pid.php in the root directory where this script is located. How do i make it so the file $pid.php is created in /images ra current code that deals with these functions is listed below:

Code: Select all

$sig = "blah blah blah blah";
$fp = fopen("$pid.php", "w");
fputs($fp, $sig);
fclose($sig);
My question is when this script runs, it creates a file called $pid.php in the root directory where this script is located. How do i make it so the file $pid.php is created in /images rather then / ?

Posted: Fri Jul 08, 2005 10:36 pm
by Burrito
add "images/" to your fopen.

ex:

Code: Select all

$fp = fopen("images/$pid.php", "w");
ges/$pid.php", "w");
our fopen.

ex:

Code: Select all

$fp = fopen("images/$pid.php", "w");
p];
php]mp;quote;w");
= fopen("images/$pid.php", "w");

$fp = fopen("images/$pid.php", "w");

Posted: Sat Jul 09, 2005 3:25 pm
by SidewinderX
ok i have another question that evolvs around the same thing but this time lets assume that the code im using is in the direcrory /admin. How can i create the $pid.php in the root directory or the /images direcory?

Posted: Sat Jul 09, 2005 3:36 pm
by Chris Corbyn
Just include the parent directory ".." in the path.....

Code: Select all

../

or

../images