Q: Better Way for Get PHP URI Action form I have Any Form for send data to mysql! now  What's Best, Secure , Optimized way for get action UrI.
One : 
function url(){
  $protocol = $_SERVER['HTTPS'] ? "https" : "http";
  return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}

<form action ="<?PHP echo url(); ?>" method="POST">

Two : 
    $url = http://localhost/test

    <form action ="<?PHP echo $url. '/admin/edit.php' ?>" method="POST">

Three : 
    $fol = '/test';
    define('PATH', $_SERVER['DOCUMENT_ROOT'] . $fol);

    echo ' <form action = "' . PATH . '/admin/edit.php" method="POST"> ';

Thanks

A: Option one is OK. Option two is the most secure, since it doesn't contain any user input. Three is impossible, since the document root isn't an HTTP path, but rather a local path on your webserver.

A: <form action ="" method="POST">

seems okay to me

A: PHP: Sql Injection
Refer things here. It explains the preventive measures for careful handling of data with mysql.

A: FORM tag is in HTML, its action property is a url of php file on server to REQUEST. 
I think we cannot send data direct from FORM tag to MYSQL 
All of ways you use have a same result on browsers. 
To improve the Secure, you can use another method such as HTTPS for submit data.
