473,388 Members | 1,399 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

permission problem

Hello friends.... i have a problem in php. i am using dream weaver for doing php. in a page i wrote exec("notepad.exe"); and when i called the page from another system the notepad is executing in my system, not the system from which i called it. why is it so ? is this due to any permission problem of windows..

thanks.
Feb 6 '08 #1
5 1333
harshmaul
490 Expert 256MB
Hi,
PHP is a serverside language, you can't remotely execute programs from the server.

But there is a way.

Expand|Select|Wrap|Line Numbers
  1. header("Content-type: application/bat");
  2. header("Content-Disposition: attachment; filename=notepad.bat");
  3. notepad.exe
this should work. but it's not recomended cos running bat scripts remotely is a very dodgy thing, (think format ;) )
Feb 6 '08 #2
Hi,
PHP is a serverside language, you can't remotely execute programs from the server.

But there is a way.

Expand|Select|Wrap|Line Numbers
  1. header("Content-type: application/bat");
  2. header("Content-Disposition: attachment; filename=notepad.bat");
  3. notepad.exe
this should work. but it's not recomended cos running bat scripts remotely is a very dodgy thing, (think format ;) )
hi

where will i type this code... is it inside the <body> part.
Feb 7 '08 #3
harshmaul
490 Expert 256MB
Hi,

The best thing, is post your whole code (in proper code tags please) and i'll fit it in for you.
Feb 7 '08 #4
Hi

This is my code...


<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<?php
exec("notepad.exe");
?>

</body>
</html>


thanks
Feb 8 '08 #5
harshmaul
490 Expert 256MB
hi,
basically clear all of your code and write only the code i gave you..


so the contents of the page will be

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. header("Content-type: application/bat");
  3. header("Content-Disposition: attachment; filename=notepad.bat");
  4. notepad.exe
  5. ?>
Feb 8 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Wayne Wengert | last post by:
I am using VS.NET 2003, VB.NET, ADO.NET and an Access 2000 database. I want to display a list of all tables in an Access database. I want to put that list of table names in a listbox so the user...
12
by: Russ | last post by:
Hello. My new dev machine is running XP Pro. In the past all equipment has only used Windows 2000. I have had a lot of problems getting my projects up and running on the new machine. The current...
10
by: Florian G. Pflug | last post by:
Hi I installed a postgres-application (which was developed on debian woody) on red hat 9 today, using the postgres 7.3 rpms from redhad. One of my the triggers uses the pg_settings table (more...
3
by: Chua Wen Ching | last post by:
Hi there, I had applied this security permissions in my class library based on fxcop standards. Before namespace: using System.Runtime.InteropServices; using System.Security.Permissions;
6
by: Andy | last post by:
Hi I have created a facility to allow the user to upload an image file to the webserver. When the user creates the image for the first time i.e. the image does not exist within the directory...
2
by: Taishi | last post by:
New user of SQL Everything is on the same machine My error is close to the bottom After reading it today, I can see there is a problem with 2 dbases 'PUBS' and 'Master' There are also some...
6
by: Steve Richter | last post by:
I am getting error in a vbscript: ActiveX component cant create object: Excel.Application. The vbscript code is: Dim objExcel Set objExcel = CreateObject("Excel.Application") I am pretty...
1
by: doctorhardik | last post by:
other interesting thing i observe during my work which i describe below: i am using dotproject2.0.4 on fc3. it is working fine. but i want to generate pdf file report during this time i face...
3
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
4
by: xzzy | last post by:
I have a v1.1 web app that works on my local computer. However, running it at the host computer, the following breaks: when a viewer selects a different country, the State dropdown should...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.