DareDevil
DareDevil

Reputation: 5349

how to add PHP Path

I am new to php and currently I am facing an issue , I have a directory in root folder of server say "MyFiles" and all db functions and code files in it. I have another folder inside "MyFiles\Forms" in this folder I have html form code and upon button submit I am calling a php file which is located in directory "MyFiles" , when I am running app its says document not found. below is the structure, www\Myfiles

register.php

login.php

logout.php

Forms

register_me.php

prompt_me.php

In "register_me.php" I am calling "register.php" .

below is the code

<html>
<body>

<form method="post" action="./Register.php">

First Name: <input type="text" name="FirstName" value='<?php  if(isset($_POST['FirstName'])) {echo $_post['FirstName']; }?>' >
<br><br>
Last Name: <input type="text" name="LastName" value='<?php  if(isset($_POST['LastName'])) {echo $_post['LastName']; }?>' >
<br><br>
 Password: <input type="password" name="Password" value='<?php if(isset($_POST['Password'])) {echo $_post['Password']; }?>' >
<br><br>
Email: <input type="email" name="Email" value='<?php  if(isset($_POST['Email'])) {echo $_post['Email']; }?>' >
<br><br>
Device ID: <input type="number_format" name="DeviceID" value='<?php if(isset($_POST['DeviceID'])) {echo $_post['DeviceID']; }?>' >
<br><br>
Phone No: <input type="number_format" name="PhoneNumber" value='<?php if(isset($_POST['PhoneNumber'])) {echo $_post['PhoneNumber']; }?>' >
<br><br>
Active: <input type="number_format" name="IsDeleted" value='<?php if(isset($_POST['IsDeleted'])) {echo $_post['IsDeleted']; }?>' >
<br><br>
<input type="submit" name="register" value="Register">

Upvotes: 0

Views: 93

Answers (3)

Pisumathu
Pisumathu

Reputation: 441

use full url for form action :

<form method="post" action="http://localhost/MyFiles/register.php">

Upvotes: 0

Harvey Connor
Harvey Connor

Reputation: 157

Use this:

<form method="post" action="/Forms/Register.php">

Upvotes: 0

Raj_King
Raj_King

Reputation: 556

Try this

<form method="post" action="../register.php">

Upvotes: 1

Related Questions