Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Problem Using System/exec Function.


I am faced with strange problem. Basically I want to make a script which would take mysql back up for me. I have come up with following. [ basically code is borrowed from some other place ]
PHP Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Warning: Ftp_exec() [function.ftp-exec]: SITE EXEC Is An Unknown Extension
This is kind of a part II to a question a posted earlier about exec and shell_exec not working.

I'm trying to use ftp_exec to execute some simple command:

$conn_id = ftp_connect("$server") or die ("Cannot initiate connection to host");
ftp_login($conn_id, "$username", "$userpass") or die("Cannot login");
$command = 'cd..'
if (ftp_exec($conn_id, $command)) {
   echo "$command executed successfully";
} else {
   echo "could not execute $command";
}
ftp_close($conn_id);


I'm getting the following error:

Warning: ftp_exec() [function.ftp-exec]: SITE EXEC is an unknown extension in /home/urieilam/public_html/work/video/test1.1.php on line 21
could not execute cd..

Have tried other commands as well, get the same. Could this be a security issue or something to do with p Safe Mode? I don't know much about commands, shell, etc..

View Replies !
Warning: Exec() [function.exec]:
I'm using PHP Version 5.0.4 in IIS5, Window 2003. When I execute my script, it prompt me the following error :

Warning: exec() [function.exec]: Unable to fork [ping 10.8.1.70] in c:Inetpubwwwrootswitch.php on line 62
Below is my script :

<?php
$line1 = exec("ping 10.8.1.70", $output);
exit;
?>

View Replies !
PHP System() And Exec()
Background: I am trying to execute a binary on the server located in the current directory where the php script is being run. The server is a linux (debian based). I am having trouble getting php to execute the binary properly, below is my code. Code:

View Replies !
System() And Exec()
If you start a program using this function and want to leave it running in the background, you have to make sure that the output of that program is redirected to a file or some other output stream or else PHP will hang until the execution of the program ends.

I have tried numerous time by redirecting to a file or other stream to free up a php web page that called a perl script for example, but the php script always hangs...has anyone had any luck freeing up a calling php script from a process, or program that it launched in the background? Code:

View Replies !
Exec(), System()
I write very, very simple script who call external program. The script is run on Linux Slackware, Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.8b PHP/4.4.4 here is my script:

<?php
echo exec('ls');
?>
this work properly.

but if i write:

<?php
echo exec('xine'); //xine is a multimedia player
?>

View Replies !
Bug In System And Exec Commands
If PHP is running via a web server, and mutiple system
calls are made within the script to another script,
hundreds of processes are created. Here is an example:

Script 1:
<?php
for ($i=1; $i<=5; $i++) {
system("php script2.php");
}
?>

Script 2:
<?php
exit;
?>

The effect is the same (and more difficult to stop) when
the system calls are made in the background. e.g.

system("php script2.php >>/dev/null 2>>/dev/null &");
system("php script2.php >/dev/null 2>&1");

I have even tried calling a shell script, which in turn
calls the second PHP script (both in the background), but
it still causes lots of processes.

The "exec" command is also affected.

At first, I thought this was a problem with either Zeus web
server of Fast CGI, but I have since tried it with Apache
and normal CGI with the same effect.

Does anyone have any idea why this happens and whether there is any way to prevent it? I have posted a bug report to bugs.php.net (ID 14997), but so far to no avail.

View Replies !
System() Or Exec() And Permissions
I'm trying to run a command (mogrify) that requires that I'm logged in as root, or at least I think this is the case. How can I do this?

View Replies !
Exec() And System() Problems
I am trying to use php's exec() or system() to execute a shell script that I wrote.

exec and system() work fine with a simple command like ls, but nothing happens when I point it at the shell script.

The shell script works fine from my shell login. Can't figure out what tho problem is. Is php just incapable of running shell scripts?

View Replies !
Using Passthru(), Exec(), System() Etc.
I have an executable that runs as expected from a command prompt but seems to do nothing when I try to run it from php, using passthru(), exec(), etc.

View Replies !
System/shell/exec/etc
I've got PHP 5.1.6, Apache 2.2.2, on Fedora 5. Everything is great except that when I use an of the external launching commands, persistent apps dont stay open. I have a simple shell script set up to load an app, and I have it write a PID file. Immediately after calling exec (milliseconds later) the PID is alive. However, within a few more milliseconds it seems to close.

I've made sure that the apache uid/gid have full access to the script and the apps it calls. When sudo'ing manualy in a shell with the apache uid, the script works flawlessly and loads the program, and stays open, as it should. I've verified that the app loads under the uid 'apache' with ps. When running it through PHP, it seems to close almost immediately after succeeding.

Is there some fundamental issue with how this works that I'm missing? I can't seem to get any real errors out of php, apache, or even the shell when redirected to a file. Should I try PHP4? Is PHP5 buggy with this kind of thing? I even tried running 'at' to schedule the script (so that it'd be invoked by at instead of the shell itself) but that failed, silently, as well.

View Replies !
Exec(), System() And Win 2003
I have searched high and low for the past 2 days for an answer to my problem. I have found a few references, but nothing has helped me. My problem is this: I am trying to ping a remote server from a PHP script in IE 6.0. When I load the page, the cmd.exe loads on the server and takes up all my CPU. I have to manually stop the process for it to go away.

My setup is this:
Windows 2003 Server
PHP 5.0.1

I have tried
- giving my system32cmd.exe full IUSR_%machinename% rights
- moved the cmd.exe to the script folder, to the PHP folder

And about a million other things that I can't remember =(. I have tried multiple functions, written in mulitple ways and the outcome is always the same. when the cmd.exe is opened it hangs on the 2003 server.

View Replies !
Use Exec() In PHP 5.2 On A Windows XP Pro System
I'm trying to use exec() in PHP 5.2 on a Windows XP Pro system. What I'm trying to do is use it to tell an already running program what to.

For example:
X:pathprogram.exe /something
or
X:pathprogram.exe /something_else

If I do the command through the command line, it works, but so far I have been unsuccessful in PHP. Usually it PHP just hangs, and give no error message, and does nothing to the program.

View Replies !
Using System/exec, How To Backup Database?
system("mysqldump --opt myDatabase > backup.sql");

here are my problems,

i don't think it works on the webserver. next, where exactly the file, backup.sql be place if it does succeed.

i believe we just can't execute commands on the webserver can we?

i also tried using the sql query BACKUP TABLE ... TO .. but i'm guessing the problem lies with the TO... how do i know what directory shall i place it therE?

for instance, my pages are placed in,

home/myname/public_html/...

i tried to put
home/myname/public_html/backup in the TO but nothing happens.

View Replies !
Exec(), System(), Shell_exec(), Etc + Nmap
i'm trying to create a script that executes nmap from my server, then displays the output.

i've tried:

$output = passthru('nmap -v -A'.' $ip');
$output = shell_exec('nmap -v -A'.' $ip');
system('nmap -v -A'.' $ip');

the problem i'm having is that using the above methods i only get the first line of output, ie.

Starting Nmap 4.20 ( http://insecure.org ) at 2007-08-31 21:46 CST

and nothing else. i've managed to find a way around it by sending the nmap output to a textfile, the using file_get_contents() to pull the data back in:

exec('nmap -v -A '.$ip.' > /usr/local/www/apache22/data/nmap/'.$ip.'.html');    
$file = "/usr/local/www/apache22/data/nmap/$ip.html";
$result = file_get_contents($file);
echo "(pre)$result(/pre)";

that works perfectly, but i'd rather not be writing anything to the drive. i guess the problem might be that nmap takes about 5-10 seconds to do its scan, and for some reason php doesn't want to wait that long, i really have no idea. can it be made to work without needing to write to files?

and for the curious minds, i'm not doing anything dodgy, i just wanted an online tool i could access from any computer to test networks i support .

View Replies !
System/exec Not Working In Browser
In two files, and I serve foo.php then I notice If I use commandline execution i.e. php foo.php then foo.txt is touched/created all right. i.e. system command is executed as expectedBut If I use browser then I notice that the shell command in config.php is *not* executedAny ideas as to why this might be happening? Code:

View Replies !
Command Window - Exec/system
I'm in the process of developing a script in Windows where I need to use exec/system. Whenever I execute either, Windows spawns a command window which automatically sappears. Is there a clean way to force Windows to NOT display the command window?

I've seen this discussed a few times previously, but, none of the
solutions seem to be working (tried both exec and system; tried using
cmd /c, tried using start /B, etc.)



View Replies !
Exec, Shell_exec, System, And Passthru Not Working At All
Can't get these commands to work! The following page simply doesn't
finish loading ( Waiting... Opening... :-( )

<?php echo system("dir"); ?>

The same for <?php echo exec("dir"); ?> or <?php echo
shell_exec("dir"); ?>, etc...

I'm running Apache 2.0.55 & PHP 5.0.5 with Zend Optimizer v2.5.10 on
windows XP SP2.

View Replies !
Exec And System Commands Blocked By Host
I've got this code, its the simpliest example I could make. It works perfectly on my windows xp/apache/php box, but doesn't do anything on a commercial website host. The actual code should use gzip to compress a folder but that doesn't work either.

Anyone know the reason why they would be blocking these commands? I suspect the problems with commonly used php apps like phpBB to be the real reason.

<?
exec("ping 127.0.0.1 > test.txt") or die();
// get contents of a file into a string
$filename = "test.txt";
$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize ($filename));

fclose ($fd);

echo $contents;

?>

View Replies !
Alternates To System() And Exec() In Order To Use ImageMagik?
My Web host apepars to not allow exec() and system(), as a line in my script:

system("convert -scale 100x100 $uploadfile $toimage");

gives the error:

"Warning: system() has been disabled for security reasons"

Is there some other way to use ImageMagik (or is it GhostScript?)'s
"convert" command in PHP that may be safer and generally allowed by Web
hosts?

View Replies !
Exec - Create An Executable That Return The System Drives
I need some help about exec command. I have create an executable that return the System Drives. It is based on DOS and does not need any parameter.

I have create my php script that executes the executable i've create and the source code is the following: ...

View Replies !
Running An .exe File Using Exec() Or System(), Unable To Fork Error
I have a problem with running an .exe file using exec() or system() I have downloaded a file called ffmpeg.exe for converting movie clips. I can use the program thourg the command line in windows (cmd), but I'm not able to have PHP run the file. First PHP gave be an "unable to fork" error. But then I gave users access to the cmd.exe file and solved that problem. So now is no problem running for example exec("dir");

View Replies !
Exec Function
Iv tried using this exec function and iv never used it before today.. im not completely sure what it does.

<?php

$command = "/movie/Without a Paddle.avi";

echo exec($command); ?>

I hoped that this script would open up a movie, but it doesnt.
I am using this function completely wrong or is there a problem with my code?

View Replies !
Exec() Function
I'm having trouble getting the exec() function to work in my script. I have never worked with this function and before I contact my server admin I want to verify my code is correct. script_name.php is in the same directory as this script that is running exec(). Is this correct?

exec("./script_name.php &");

View Replies !
Function Exec
I'm trying to execute a command with "exec" but it doesn't work. Here is my code : PHP Code:

exec("../../blast/blastall -p blastn -d est.txt -i testseq.txt -o test.txt");

I'm sure that my scrypt reads this line but nothing happen. Does someone know how to use this function ?

View Replies !
PHP Exec Function No Output
I am running PHP 5.1.6 (cli) on Linux. When i use the exec($cmd,
$output, $return) command the $output array is always blank if the
command had an error in it. There are only values if the command was
successful. How do I capture the error text returned?...

View Replies !
Php Exec() Function Is Not Working
I am trying to execute linux command with php. I am try to log on as super user, so I have used the following code:

exec("su root");
exec("<password>");

But I dont think its working, becuase if I want to change my directory and view the list, I find myself in the same directory.
I have used the following code:

exec("cd /");
Passthru("ls -l");

View Replies !
Ssh2 Mod And Exec Function
Something very strangne happens with the function ssh2_exec, i can't
read the stream answer after execution in the remote computer. I work
with apache 1.3.30 and php 4.3.10 , libssh 2.0.5 . the ssh2 module
looks to work correctly but sftp functions cause a big delay causing
server timeout and ssh2_exec can't read the output. Tryed many things
recommeded in php website and forums but always the first ssh2_exec
reading success and the following ones fail.

$stream=ssh2_exec($conn_id,'/usr/bin/ls ./public_html');

I tryed to read the output with:

stream_set_blocking( $stream, true );
$cmd=fread( $stream, 4096 );

after

while($line = fgets($stream)) {
$cmd .= $line;
}

and

while( !feof($stream) ) {
$cmd .= fgets($stream)
}

Nothing success to catch the output for the second execute order. In
the same process only the first exec could be read.
Anybody know

View Replies !
Disable The 'exec' Function
How do I disable the 'exec' function in my linux php server? It's important in order to prevent users from planting PHP browsers on their shell account.

View Replies !
Can Not Execute Exec Function In Php
I am facing a strange problem , in linux server system commands like exec, system are enabled but one particular command is not working properly , either its returning null or 127. Command is exec(whois -h whois.crsnic.net "bnbnmnmbnmn.com") But this command is working properly in another linux server.

Any suggestion is well come excepting reinstall or re-configuration as its not possible . Commands like exec('whoami') are working . Server:linhost161.prod.mesa1.secureserver.net 2.4.21-27.ELsmp #1 SMP Wed Dec 1 21:59:02 EST 2004 i686

View Replies !
Using Exec() Function In PHP5
I have problem by using exec() function in PHP5, Apache and Windows XP to run an external program from my PHP page reside on server. When I call my program using exec() the page just stops (waiting for www.mysite.com...). I have used by absolute path and result was same.

Also, I have tested my PHP page by running by using PHP (or PHP-cgi) interpreter in command line and it just works fine without any problem. I don't know why it doesn't work when I call it from my page. Can anybody help ? I think it is something wrong with Apache or PHP settings. Am I right ?

View Replies !
Exec() Function And Shell Scripts
I have a shell script written that basically grabs a selected .jpg or .png image file and wraps it as an .swf file for use in a dynamic Flash site. My question is this: What are the limitations of the exec() or system() commands? I can get them to work just fine with common linux commands(ie. ls -l, pwd, etc.), but it won't run these sort of commands:
./thisisascirptname
or
sh wrapper.sh

I get no results with these and yet when I perform the same operation on the command line by hand, it works just fine. This is the script I'm using to test it, by the way.

$lastline = exec("sh wrapper.sh", $all_output, $return_value);

print("<b>Last Line:</b><br>$lastline <p>
");

print("<b>All Output:</b><br>
");
for($index = 0; $index < count($all_output); $index++)
{
print("$all_output[$index] <br>
");
}

print("<br><br>
");

print("Return Value: $return_value<br>
");

The "ls" and other similar functions all return properly. I can't figure this out and it's driving me nuts. Any help?

View Replies !
Exec() Function Under Windows 2000 With IIS?
Are there any tricks to getting the exec() function to work under
Windows 2000 with IIS? PHP v4.0.2 is installed on the server.

View Replies !
System(), Exec(), Shell_exec(), But "Permission Denied"
I want to execute the php script via web server to run linux command. I try to use system(), exec(), shell_exec(), but the system show me "Permission Denied". i have set the file permission by using chmod 777 file.php .

View Replies !
Using Exec Function To Get A .exe Return Status Gives CGI Error
I'm trying to make a web page to work. It worked before so it has to
be something related with the configuration.
My problem is a call to a compiled executable (made for me) that
returns 1 or 0. It does not print any text to the standard ouput so
the error is strange:
CGI Error: The script can .. because of the HTTP headers (I have it in
spanish so the message is not the exact one).

As supposed, the HTTP headers are needed only if the executable prints
out a text to the browser but it's not the case. And (I repeat) It
worked as it before. The machine had to be formatted and the guy in
charge of that is not with me anymore.

View Replies !
Exec() Function Warning: Unable To Fork (Access Violation At 77F81B4D)
I am trying to execute a DOS command with the exec() function. All I get is fork errors or access errors, regardless of what file I try to execute. Example:

<?php
exec("sync.bat");
`sync.bat`;?>

Warning: Unable to fork [sync.bat] in C:testexec.php on line 3
Warning: Unable to execute 'sync.bat' in C:testexec.php on line 4
PHP has encountered an Access Violation at 77F81B4D


Id doesn't seem to matter what kind of file I try to execute, .exe, .bat or .com. Any ideas? Has ANYONE executed an external program under php/Windows?

View Replies !
Function System()
i like to know how to disable the system() function.

Is there a parametre in php.ini or is it only a question of authorisation ?

View Replies !
Using System() Function
I'm trying to set up a PHP script that'll execute an external application, vlc.exe (VideoLAN Player). Here's what I used:

<?php
$run=`start "VLC" "C:Program FilesVideoLANVLCvlc.exe"`;
echo $run;
?>

My Server Details:
Windows XP SP2 (Win32)
Apache Server 2
PHP 5.0.5

And it runs it, but with a different user for the process. If you open up Windows Task Manager, and click the Processes tab, it lists processes by "Image Name", "User Name", "CPU", and "Mem Usage". The script above executes the vlc.exe, it shows up on Task Manager, but with the User Name "SYSTEM", I guess because PHP ran it.

View Replies !
System Function
I have written a small application to run a password change via the net user command using the php system function. I already understand how privileges in this situation work. Since its running on an internal intranet and only for a few days I have setup IIS 5 to run as administrator and the administrator has full system access with no restrictions.

The script works on 2 of the 3 servers, and returns a result after execution. The third server returns the value "2" after running the same script. I am able to return a response for a simple command like "net user", so I know the script is executing correctly.

But when attempting to run the password change command or any other advanced command the value "2" is returned in all situations. When running that same command from the command line I either get a successful completion message or at least a net user error.

The only conclusion I could come to was a permission error, but running IIS as admin has thrown me for a loop. Code:

View Replies !
System() Function Fails
In a e-commerce site, our bank has given us a Java class that generates a key to validate an order. To make it work, it must be called something like this:

/usr/sbin/java/bin/java -cp /home/users/mysite/tpv.zip CrURLtpv /home/users/mysite/ orderid:0016 ammount:12.00 moneda:XEU language:eng

When via telnet I execute this command, it outputs a URL, which can be used to call the bank secure pay page. Now, obviously I need to get this URL from the PHP script, so I use the system() function and to my surprise I only get this error:

Error occurred during initialization of VM Could not reserve enough space for code cache

Any idea why is this happening? I'm sure the Java class is ok since it works properly when called from prompt. Does the system() function have any memory limitations, or something that may be altering the execution of the class? Is there any way to increase the ammount of memory that is available to the system() function to execute a command?

View Replies !
System Function To Run In Background
I have the following line of PHP code:

$ret_val = system("PHP myscript.php $param1 $param2 >> output.txt &");

Obviously the intention is to run a PHP file in the background
async'ly. This works 100% perfect on one server; running the script in
the background without errors. On another server the above line runs
the command immediately rather than in the background. Output is still
redirected OK and no errors are reported.

Does anyone know of a situation that might cause the above code wait
for the child process to finish before continuing? The file was copied
from one server to the other without any modifications. Furthor, both
servers are identical in software. One was literally imaged from the
other.

The only difference might be the file permissions. I created some
folders on both machines but I think on one of them I sudo'd to root to
create a folder and on the other I was logged in as a user (so CHOWN
might differ). In both cases though PHP has read/write access (no
errors were reported and identical script output is produced). The
permissions in question are those on the myscript.php and on the
output.txt file produced.

The PHP manual says nothing about file permissions affecting the
ability for a target script to run in the background. Any thoughts?
Should I be redirecting errout as well (e.g. 2>>errors.txt)? Maybe an
error is being reported on the second server and that is why PHP is
waiting? I can't see how PHP can know in advance that an error is going
to happen before it starts running the script in the background though.

View Replies !
Tracking System Function
I'm going to be making a tracking system, just wanted to know is there some function or something in PHP which will allow an automatic email notification to be sent to particular user(s) when a record of some type has changed status and the record is save.

E.g When I change the status of a record from planning to approved: then hit save. And once saved an email will be sent to Mr ABC telling them the record has been approved? Can this be done??

View Replies !
System() Function On Windows
Trying to use the system() function in my php code on a windows server 2003 system. Simple commands like:

system('dir');
work fine, but
Code:
system('net stop spooler');
doesn't work.

I guess this is a problem with windows user rights, but is there anything I can change in my script to make it work without having to start changing the windows user rights as I don't want to affect the security of windows?

View Replies !
Problem Using Php System Call Function
I'm trying to create a web based c++ compiler
for my computer science students. This will
allow them to submit small c++ programs and
view the errors or the output.

They type their code into a text box and when
submitted, I write there code to a file and
then attempt to compile it with a call to g++
using the system() function.

Simple unix commands work, like the following:
$command = `more hello.txt`;
echo"$command";
or
$command = `ls -l`;
echo"<pre>$command</pre>";
or
system("ls -l");

But the following will not work:

system("g++ hello.c >& err.out");
or
$command=`g++ hello.c >& err.out`;
echo"<pre>$command</pre>";

the ">&" forces the output to a file called err.out
wich gets created when ran from the command
line, but not when called from php.

Can this be fixed with php or is this more an administration
problem.

View Replies !
System() Function Is Not Working In Windows
I want to encrypt a text file's content using public key of other user. I'm working in windows NT and running my php in apache server. I've installed my gnupg in c:gnupg.
To encrypt the content I used the following code: PHP Code:

View Replies !
System(); Not Working Within A Made Function
for some reason system(); isnt working when i use it within a function i made, is there a reason? it works perfectly fine out of the function.

View Replies !
Errors Returned By System()function
I'm attempting to debug some code that uses the System function. When the
function is called, it returns Error 1. Does anyone know what that error
might be, or where I can find a list of error codes for the function?

View Replies !
Run Adobe Photoshop With The System Function
I am trying to run adobe photoshop with the system function. I have checked my directory structure and it looks good.

<html>
<head>
<title>
Hello
</title>
</head>
<body>
<?php
echo '<pre>'
$cmd = 'C:Program FilesAdobeAcrobat 7.0ReaderAcroRd32.exe'
system($cmd,$return);
echo '</pre>'
?>
</body>
</html>

error:


<pre>'C:Program' is not recognized as an internal or external command,
operable program or batch file.
</pre></body>

View Replies !
Anyone Know How To Enable Ingres DB Function In PHP On A Win2k System
Do I have to enable a DLL extension in the php.ini file.
I can't tell which one it is & the instructions on PHP.net
isn't too helpful.
I know Ingres support is only experimental but not sure if
I've even got the DLL's.
I'm using PHP 4.3.3
Ingres II

This is what's in my PHP.ini file...

;extension=php_iconv.dll
;extension=php_ifx.dll
;extension=php_iisfunc.dll
;extension=php_imap.dll
;extension=php_interbase.dll

View Replies !
Mail Function PHP Must Have Access To The Sendmail Binary On Your System During Compile Time.
i'm almost 100% sure my code is good as I basically copied and pasted the same code I had working on my web server. Now, I have it setup to email a form from a network server php file. The problem is that it isn't working. Neither is a header Location line either for that matter. I'm wondering why this is. Could it be because somehow these require php libraries that they don't have access to? It works fine on my web server. I found this snippet on the mail function: Quote:

For the Mail functions to be available, PHP must have access to the sendmail binary on your system during compile time. If you use another mail program, such as qmail or postfix, be sure to use the appropriate sendmail wrappers that come with them. PHP will first look for sendmail in your PATH, and then in the following: /usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib. It's highly recommended to have sendmail available from your PATH. Also, the user that compiled PHP must have permission to access the sendmail binary.

View Replies !
System(); Command Not Working On Remote System. Windows.
My server is a windows machine, on the same domain as python(also a windows machine). Apache is running as a service as an administrator. This is a test only environment to whom it may concern(I hate people telling me how insecure my system is) I'm just trying to run:

$last_line = exec('dir pythonc$', $retval, $g);
print_r($retval);
echo '<br>'.$g.'<br>';
echo '$last_line= '.$last_line.'<br>';
Which outputs:

Array ( )
1
$last_line=

The command from the command line works fine. And apache can access directories that only administrators can access on the local machine.

View Replies !
Make A News System With A Template System
i'm a total,and mean total newbie in PHP. I want to make a news system with a template system(like footer.php and header.php) but dont know how to?

View Replies !
Login System - News System
i have to do a news system wich use php/mysql.

i need 3 accounts:

* a 'reader' who doesn't need to log in to read the news
* a 'writer' who can write news in a pending news table
* a 'moderator' which validate a pending news, and make it a regular news,
viewable from the site (by the 'reader')

This is a small web site, so i can't use SSL; and i use php sessions.

Right now, i deal with account from a mysql users point of view, which
means, that a 'reader' can access all the admin part of the site, but will
ger errors when trying to read/write by sql query.

I was wondering if somedody could give me a trick to deny access to the
admin pages. Rigth now, i though about these:

* by decoding mydql rights? (how)
* by doing only-to-test query? (bad i think, especially for write right)

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved