Jump to content

[SOLVED] Adding a mode to URL


DanC

Recommended Posts

Hi,

 

I'm still quite new to PHP. I really can't figure this out.

I have a file called chmod.php which only admins can use. This file chmods a few other files that need to be written to on the server.

However, chmod.php will ONLY chmod files if they aren't already writeable (is_writeable)...

 

I want to add a link to the bottom of chmod.php that says "Force CHMOD" and I want it to go into a different mode, e.g:

 

www.example.com/chmod.php will execute a normal chmod.

www.example.com/chmod.php&mode=force will execute a force.

 

How would I go about doing this in my script?

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/174132-solved-adding-a-mode-to-url/
Share on other sites

I'm sorry, I didn't realize that was what you where looking for.

 

You should be careful when putting variables in the url, anybody can edit them.

 

For example if you had a login script you wouldn't want to send somebody to http://url.com/login.php?login=successfull?type=user because somebody could easily change that to http://url.com/login.php?login=successfull?type=admin

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.