LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-18-2006, 12:39 AM   #1
paul_mat
Member
 
Registered: Nov 2004
Location: Townsville, Australia
Distribution: Fedora Core 5, CentOS 4, RHEL 4
Posts: 855

Rep: Reputation: 30
cgi bash script


hi there,

i want something really simple, basically i want to be able to click a button and execute a script, this script will then make a directory.

can someone tell me how to do that?
 
Old 04-18-2006, 03:50 AM   #2
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
hi there,
why bash? here is the php code...
PHP Code:
<?php
mkdir
("/path/to/my/dir"0700);
?>
you can easily assign a button to the function in html.
regards,
slackie1000
 
Old 04-18-2006, 04:17 AM   #3
paul_mat
Member
 
Registered: Nov 2004
Location: Townsville, Australia
Distribution: Fedora Core 5, CentOS 4, RHEL 4
Posts: 855

Original Poster
Rep: Reputation: 30
because that was just an example of what i want to do, i want to mount a cd drive, so i'll need to use bash
 
Old 04-18-2006, 10:02 PM   #4
paul_mat
Member
 
Registered: Nov 2004
Location: Townsville, Australia
Distribution: Fedora Core 5, CentOS 4, RHEL 4
Posts: 855

Original Poster
Rep: Reputation: 30
hey slackie1000, i was wondering if you know how to mount a CD drive using php? i've tryied

Quote:
<?
echo exec('/bin/mount /dev/cdrom /media/cdrom &');
?>
 
Old 04-20-2006, 03:03 PM   #5
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
hi there,
afaik you don't need the "echo" part.
PHP Code:
<?
exec
('mount /dev/cdrom /media/cdrom &');
?>
this should work.
regards,
slackie1000
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Directory listing - Calling shell script from a CGI script seran Programming 6 08-11-2005 11:08 PM
python cgi script and premature end of script headers Neruocomp Programming 1 07-28-2005 11:43 AM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 12:20 AM
KSEARCH cgi script itloser Linux - General 0 02-20-2003 09:20 AM
CGI and BASH. Can anyone helpme whit this code ? amartinez Programming 9 10-11-2002 03:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration