# URL Error

**URL:** <https://www.phphelp.com/t/url-error/35898>\
**Category:** Uncategorized\
**Created:** [December 4, 2023, 7:27pm UTC](https://www.phphelp.com/t/url-error/35898 "2023-12-04T19:27:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![watsonjohn](https://www.phphelp.com/letter_avatar_proxy/v4/letter/w/73ab20/32.png) [@watsonjohn](https://www.phphelp.com/u/watsonjohn)\
**Post date:** [December 4, 2023, 7:27pm UTC](https://www.phphelp.com/t/url-error/35898/1 "2023-12-04T19:27:40Z")

</div>

The requested URL was not found on this server.  
I have a table in the database titled _persondetails_

personcreate.php

```auto
<?php
session_start();
?>

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap demo</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
  </head>
  <body>
    
    <div class="container">
        
        <?php include('message.php'); ?>
        <div class="row">
            <div class="col-md-12">
                <div class="class">
                    <div class="class-header">
                        <h3> Add Info
                            <a href="index.php" class="btn btn-danger float-end">Back</a>
                        </h3>
                    </div>
                    <div class="card-body">
                        <form action="infoconn" method="POST">
                             <div class="mb-3">
                                <label>First name</label>
                                <input type="text" firstname="firstname" class="form-control">
                             </div>
                             <div class="mb-3">
                                <label>Last name</label>
                                <input type="text" lastname="lastname" class="form-control">
                             </div>
                             <div class="mb-3">
                                <label>Date Registered</label>
                                <input type="date" datereg="datereg" class="form-control">
                             </div>
                             <div class="mb-3">
                                <label>Address</label>
                                <input type="text" address="address" class="form-control">
                             </div>
                             <div class="mb-3">
                                <label>Phone</label>
                                <input type="text" phone="phone" class="form-control">
                             </div>
                             <div class="mb-3">
                                <label>Email</label>
                                <input type="email" email="email" class="form-control">
                             </div>
                             <div class="mb-3">
                                <button type="submit" name="save_info" class="btn btn-primary">Save Info</button>
                             </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
  </body>
</html>

```

infoconn.php

```auto
<?php
session_start();
require 'dbconn.php';

if(isset($_POST['save_info'])) {
    $firstname = mysqli_real_escape_string($con, $_POST['firstname']);
    $lastname = mysqli_real_escape_string($con, $_POST['lastname']);
    $datereg = mysqli_real_escape_string($con, $_POST['datereg']);
    $address = mysqli_real_escape_string($con, $_POST['address']);
    $phone = mysqli_real_escape_string($con, $_POST['phone']);
    $email = mysqli_real_escape_string($con, $_POST['email']);

    $query = "INSERT INTO persondetails (firstname,lastname,datereg,address,phone,email) VALUES 
        ('$firstname', '$lastname', '$datereg', '$address', '$phone', '$email')";

    $query_run = mysqli_query($con, $query);
    if($query_run) {
        $_SESSION['message'] = "Info Added";
        header("Location: personcreate.php");
        exit(0);
    }
    else {
        $_SESSION['message'] = "Failed to Add";
        header("Location: personcreate.php");
        exit(0);
    }
}

?>

```

message.php

```auto
<?php
    if(isset($_SESSION['message'])) :
?>

<div class="alert alert-warning alert-dismissible fade show" role="alert">
        <strong>Holy guacamole!</strong> Success! <?= $_SESSION['message'] ?>
        <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<?php
    unset($_SESSION['message']);
endif;
?>`

dbconn.php

`<?php
$con = mysqli_connect("localhost","root","","exam_torres");

if(!$con) {
    die('Connection Error'. mysqli_connect_error());
}

?>

```

I have tried looking at other posts with the same problem, but all the suggested answers and solutions proved to be unfruitful.

---

<div class="post-metadata">

**Author:** ![astonecipher](https://www.phphelp.com/user_avatar/www.phphelp.com/astonecipher/32/2797_2.png) [@astonecipher](https://www.phphelp.com/u/astonecipher)\
**Post date:** [December 4, 2023, 7:30pm UTC](https://www.phphelp.com/t/url-error/35898/2 "2023-12-04T19:30:57Z")

</div>

Not providing the right type of information.

If the url is not correct then do you have a file for that url or are you using a main page that redirects?
