Home > Software engineering >  Issue with path to file in forms ../
Issue with path to file in forms ../

Time:01-19

script location: public_html/apiclass/code/da_create_domain.php

Now I paste form in public_html/application/views/lessons/lessons.php

<form action="./apiclass/code/da_create_domain.php" method="post" name="form_create_domain" id="form_create_domain">
  <div align="center"></div>
  <table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td colspan="3"><div align="center"><span >Create domain </span></div></td>
    </tr>
    <tr>
      <td><div align="right"></div></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="3"><div align="center"><strong>dmoain information</strong></div></td>
    </tr>
    <tr>
      <td><div align="right">domain name</div></td>
      <td>&nbsp;</td>
      <td><input name="domainname" type="text" id="domainname"></td>
    </tr>
  </table>
  <div align="center"></div>
  <p align="center">
    <input type="submit" name="Submit" value="Create domain">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="reset" name="Submit2" value="Reset Form">
</p>
</form>

I need to run da_create_domain.php.

But I think I do wrong file path and no working.

<form action="./apiclass/code/da_create_domain.php"

Can someone correct me?

CodePudding user response:

Solved:

/../apiclass/code/da_create_domain.php

CodePudding user response:

Forget about ./ and ../.
Set the path to be relative from the document root (which I assume is public_html here)

action="/apiclass/code/da_create_domain.php"

./ means "current folder" and will result in /application/views/lessons/apiclass/code/da_create_domain.php

../ means "one folder up" and will result in /application/views/apiclass/code/da_create_domain.php

  •  Tags:  
  • Related