Markie
Posts: 251
|
| Posted: 12/23/2008, 1:23 PM |
|
I have some problems passing a variable from an url to php exec()
My code:
<?php
$username = Markie;
exec('ls --ignore="outfile.csv" $username > ./$username/outfile.csv');
?>
As you probably can see I want to make a csv file with details about files in a folder (linux ls output). The folder has the same name as the username (in this case: Markie). I want to open the page with a browser, with this link: makecsv.php?username=Markie
This is clearly not working and I'm hoping for advice from one of you
_________________
The Netherlands, GMT+1
Tools: CCS 5.1, Windows 7, Navicat, Ultraedit
Local server: XAMPP with Apache, php and MySQL
Webserver: Windows 2008 IIS 7, php and MySQL |
 |
 |
datadoit
|
| Posted: 12/23/2008, 4:19 PM |
|
Try this:
exec("ls --ignore=outfile.csv ".$username." > ./".$username."/outfile.csv");
|
|
|
 |
Markie
Posts: 251
|
| Posted: 12/24/2008, 12:16 AM |
|
Yes! this does the trick, thanks datadaoit
_________________
The Netherlands, GMT+1
Tools: CCS 5.1, Windows 7, Navicat, Ultraedit
Local server: XAMPP with Apache, php and MySQL
Webserver: Windows 2008 IIS 7, php and MySQL |
 |
 |
|