CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 [Solved] PHP exec() and variable from url

Print topic Send  topic

Author Message
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
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.