-3

I want my php file not to be visible in the html document and to put another word instead 56/5000 I want to write another name instead of writing the name of my php file

M.J.A
  • 5
  • 3

2 Answers2

1

You will need to use URL re-writing.

On Apache Digital Ocean Article:

RewriteEngine on
RewriteRule ^about$ about.html [NC]

will route:

  • http://your_server_ip/about, because of the rule definition.
  • http://your_server_ip/About, because the rule is case insensitive.
  • http://your_server_ip/about.html, because original proper filename will always work.

But I strongly suggest that you stay away from it as much as is possible. Instead, start using a framework like Laravel, Codeigniter etc. Then you can name your Controller/action anything and would not have to write complex URL re-write rules.

Shammi Shailaj
  • 445
  • 5
  • 14
0

This is not possible. A href can’t be hidden from a link. But the files can be rewritten and the request URL can be changed to look like this − login.php/5001

Other than this, a post request can be used in the below way −

<form method="post" action="login.php">
    <input type="hidden" name="userinfo" value="5001">
    <button type="submit">Log in</button>
</form>

This will expose a single button in the browser.

kingkong.js
  • 659
  • 4
  • 14