I can modify permisitions

I cannot modify the file permissiton. If i clicking the CHMOD nothing will come to change the permision options Please help me to fix this.

This function is disabled on free hosting

7 Likes

Why do you want to do it anyway?

7 Likes

We cannot help you “fix” the issue that chmods are disabled, but we can help you fix whatever issue you’re having that makes you think that chmodding would fix.

Because I can guarantee you: chmodding isn’t the solution. As for what is, please describe the issue so we can help you.

4 Likes

Hi mmandco,

It’s true that chmod() deals with file permission, but it’s rarely needed to change. Allowing it to have high values on free hosting is a security issue that nobody would approve of.

If you are having issues with uploading files, use $_FILES, file_get_contents() and file_put_contents() to transfer your files to a directory of your choice. This way you won’t have issues saving things as PHP already has permission to any folder under /htdocs.

If you need to keep them private, just add a “Deny from all” .htaccess file wherever you would like to keep secure files.

Executing binaries is definately not something allowed here, nor any legit free hostings.

Cheers!

1 Like

PHP is technically binary, you cannot run exe files either as the servers are based on Linux.
I agree storing such files which can be downloaded abd exexuted are against the terms of service.

4 Likes

Hi Ziverre,

There are binaries for Linux that can be uploaded and chmod() to be executable on the server, if chmod() and system-call functions (exec, passthru, etc…) are allowed. EXE files are for Windows exclusively.

As for whether allowing downloads to stored executables violates TOS, I really didn’t look into it. They can be otherwise placed on / linked to Mega.nz / Mediafire / Google Drive anyways.

Cheers!

2 Likes

From Section 5:

You will not use this Site or the Services in a manner (as determined by InfinityFree in its sole and absolute discretion) that:

  • Contains or installs .exe, .apk, .dmg, .cmd, .com, .bat, .osx, .msi, .app files;

Fully agreed, this is the best approach in any case as the 10MB file size limit would also apply to those files which tend to be larger.

5 Likes

I want to remove all the permission except mine

If I am wrong correct me.

My concern is we are externally mentioning the script path right in the below of html file
So
If we are using the inspector(developer mode) in chrome it will show the script path so if third party person execute the path in url it showing the entire JS scripts

I need is I should hide to view the third party access

See my recent reply please i have mentioned my concern Please suggest me any idea on this

That is not how you do it, nor can you do anything for it.
Keep the data that you need to be hidden to PHP, if the browser can load the javascript code then can other people.

5 Likes

Hi mmandco,

We need more info and more details on your intended feature, mentioning a script path in the browser does not necessarily be a bad thing, but if you want that procedure to be run on the server and only you can do it, definitely that’s something you should not put in JavaScript in the first place.

If you need to run a certain function, place that in a PHP file that is not publically accessible, then include that file in the part where you need it and enclose that call with all checking necessary.

For example, there’s index.php and fund_me.php, and fund_me.php contains the function and procedure to transfer $1M from your account to my account, then I will have the incentive to repeatedly visit fund_me.php as you mentioned the path to fund_me.php in the output of index.php.

To solve the problem, you need to include fund_me.php instead of leaving it public.

Your adjusted code should have the following flow:

<?php

if($transaction_conditions_met && !$has_transacted){
    include_once('private/fund_me.php');
}

?>
<!-- any html -->

and in the private folder, you should have 2 files, fund_me.php and .htaccess. The .htaccess file should have “Deny from all” as content to disallow public access.

Cheers!

4 Likes

I’m sorry, but that’s not how it works.

Javascript is executed in the browser of the visitor. So in order for it to work, your website needs to expose the code to visitors, so browsers can download the code to execute it. You can block access to the Javascript code and make it so that nobody can access it, but that would also prevent any browser from accessing this code to execute it.

There is just no way to technically let browsers run Javascript code without the users of those browsers also being able to see this code for themselves.

So like others have said: if there is any code that contains sensitive information, please consider moving that logic to PHP code on the server.

If you do want to restrict access to particular URLs on your site, you can do this with .htaccess rules. You can use this to block all traffic, or only allow specific traffic to access the URL. chmod is not the way to restrict access to URLs.

9 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.