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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.