Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6177679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:19:05+00:00 2026-05-24T00:19:05+00:00

as shown in the title, I have a page for users to create projects

  • 0

as shown in the title, I have a page for users to create projects and another page to add it into my database. However when I press submit with the form fields empty, the page it post to isn’t blank. But when I submit with the fields filled up, it just shows be a blank page without any errors and I have looked through both pages of codes but can’t seem to find anything wrong. Perhaps someone here could help me out? Thanks.

//codes on page where data is submitted.

if ($_POST['projectTitle'] != "" && $_POST['projectStatus'] != "" && $_POST['projectDesc'] != "" && $_POST['projectDeliv'] != "" && $_POST['year'] != "" && $_POST['month'] != "" && $_POST['day'] != "" && $_POST['projectSS'] != "") {

        $host = "localhost";
        $user = "root";
        $pass = "";
        $db = "fyp1";

        $pt = $_POST['projectTitle'];
        $ps = $_POST['projectStatus'];
        $pdes = $_POST['projectDesc'];
        $pdel = $_POST['projectDeliv'];
        $date = $_POST['year'] . "-" . $_POST['month'] . "-" . $_POST['day'];
        $pss = $_POST['projectSS'];
        date_default_timezone_set('UTC+8');
        $cDate = date('Y-m-d');
        $uid = $_SESSION['id'];

        $link = mysqli_connect($host, $user, $pass, $db) or die(mysqli_error());
        $query = "SELECT * FROM project WHERE project_title = $pt AND project_description = $pdes AND project_deliverables = $pdel AND project_skillset = $pss";
        $dub = mysqli_query($link, $query) or die(mysqli_connect_error($link));

        if (mysqli_num_rows($dub) == 0) {

            $insertQ = "INSERT INTO project(project_title,project_description,project_deliverables,project_start,project_end,project_skillset,project_status)
                VALUES ('$pt','$pdes','$pdeliv','$cDate','$date','$pss',$ps)";
            mysqli_query($link, $insertQ) or die(mysqli_connect_error($link));

            $getPID = "SELECT * FROM project WHERE project_title = $pt AND project_description = $pdes AND project_deliverables = $pdel AND project_start = $cDate AND projecct_end = $date AND project_skillset = $pss";
            $pid = mysqli_query($link, $getPID) or die(mysqli_connect_error($link));
            if (mysqli_num_rows($pid) == 1) {
                while ($row = mysqli_fetch_array($pid)) {
                    $proid = $row['project_id'];
                    $insertF = "INSERT INTO user_has_project(user_id,project_id) VALUES ('" . $uid . "','" . $proid . "')";
                    mysqli_query($link,$insertF) or die(mysqli_connect_error($link));
                    $message = "<p>Project Successfully Added!</p>";
                    $message .= "<a href='index.php'>Back</a>";
                    $a = true;
                }
            } else {
                $message = "<p>Project Failed To Be Added!</p>";
                $message .= "<a href='createProject.php'>Back</a>";
                $a = false;
            }
        } else {
            $message = "<p>Duplicate Project Found!</p>";
            $message .= "<a href='createProject.php'>Back</a>";
            $a = false;
        }
    } else {
        $message = "<p>Please Fill Up All Fields When Creating A Project!</p>";
        $message .= "<a href='createProject.php'>Back</a>";
        $a = false;
    }

// codes on page with form

    <div id="content">
        <?php if ($a == false) {
        ?>
                <h2 id="registerFont">Create Project</h2>
                <form name="createProject" method="post" action="doCreateProject.php" onSubmit="return validateForm(this);">
                    <fieldset>
                        <table>
                            <tr>
                                <th colspan="4"><h2>New Project</h2></th>
                            </tr>
                            <tr>
                                <th colspan="4"><hr /></th>
                            </tr>
                            <tr>
                                <td><label for="projectTitle">Project Title:</label></td><td><input name="projectTitle" type="text" /></td>
                                <td><label for="projectStatus">Project Status:</label></td>
                                <td><select name="projectStatus">
                                <?php while ($row = mysqli_fetch_array($result1)) {
                                ?>
                                    <option value="<?php echo $row['status_id']; ?>" ><?php echo $row['status_type']; ?></option>
                                <?php } ?>
                            </select></td>
                    </tr>
                    <tr>
                        <td><label for="projectDesc">Project Description:</label></td><th colspan="3"><textarea name="projectDesc" rows="5" cols="40" ></textarea></th>
                    </tr>
                    <tr>
                        <td><label for="projectDeliv">Project Deliverables:</label></td><th colspan="3"><textarea name="projectDeliv" rows="5" cols="40" ></textarea></th>
                    </tr>
                    <tr>
                        <td>Start Date:</td><td><?php echo $date; ?></td>
                    </tr>
                    <tr>
                        <td>End Date : </td>
                        <th colspan="3" align="left">
                            <select name="year">
                                <option>---Year---</option>
                                <?php for ($i = $cYear; $i < ($cYear + 100); $i++) {
                                ?>
                                    <option value="<?php echo $i; ?>"><?php echo $i; ?></option>
                                <?php } ?>
                            </select>
                            <select name="month">
                                <option>---Month---</option>
                                <?php while ($rows = mysqli_fetch_array($result)) {
                                ?>
                                    <option value="<?php echo $rows['month_id']; ?>"><?php echo $rows['month']; ?></option>
                                <?php } ?>
                            </select>
                            <select name="day">
                                <option>---Day---</option>
                                <?php for ($i = 1; $i < 32; $i++) {
                                ?>
                                    <option value="<?php echo $i ?>"><?php echo $i ?></option>
                                <?php } ?>
                            </select>
                        </th>
                    </tr>
                    <tr>
                        <td><label for="projectSS">Project Skill Set:</label></td><td><input name="projectSS" type="text"/></td><th colspan="2"><small>(Please Separate By Comma)</small></th>
                    </tr>
                </table>
            </fieldset>
            <br />
            <input name="submit" type="submit" value="Create Project" />
        </form>
        <?php
                            } else {
                                echo $message;
                            }
        ?>
                        </div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T00:19:07+00:00Added an answer on May 24, 2026 at 12:19 am

    I managed to solve the problem. When querying into the database, at my SELECT statement, the variables I forgot to add ”. E.g SELECT * FROM project WHERE project_title = ‘$variable’;

    Anyways. thanks for those who helped out. I really appreciate it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have two Tables: Document: id, title, document_type_id, showon_id DocumentType: id, name Relationship: DocumentType
This is probably best shown with an example. I have an enum with attributes:
My master page contains a list as shown here. What I'd like to do
I have essentially a survey that is shown, and people answer questions a lot
<a id=lblShowTimings runat=server title='<%# Eval(SHOW_Name) %>' onclick='PopulateTicketDiv(<%#Eval(SHOW_ID) %>)'> <-- this is the problem %#Eval(SHOW_Time)
It's shown that 'as' casting is much faster than prefix casting, but what about
Printing button is not shown in the report toolbar when they are opened in
My spring-context file is shown below. <beans xmlns=http://www.springframework.org/schema/beans xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:aop=http://www.springframework.org/schema/aop xmlns:jee=http://www.springframework.org/schema/jee xmlns:jms=http://www.springframework.org/schema/jms xmlns:lang=http://www.springframework.org/schema/lang xmlns:tx=http://www.springframework.org/schema/tx
How can I retrieve the information shown in the Mac's System Profiler app programatically?
I want to pass some parameters to my MVC UserControl like ShowTitle(bool) and the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.