PHP code not working on Godaddy but works in localhost

Beginner in php here. I have programmed a form in an html format and then included some php code to direct the form submission to process.php file. The code in process.php will then insert the form submission into MySQL.

When I ran the code in localhost, it worked perfectly fine. However, I have no idea what is wrong as subsequent attempts to run the code results in failure on my godaddy host website.

After i submit the form, it begins directing me to a blank process.php file. I tried check my code for errors but everything seems to be the same.

Even when error displayed is being enabled, all i get is a blank page after i hit submit on the homepage.

Things i have tried:
1. Changing the url from “Location:index.php?status=thanks” to ‘Location:
2. Check my code for any syntax errors(which there are none i can find)
3. Called Godaddy tech support to ensure their php connectivity to SQL server is function, and the tech support confirmed that there is nothing wrong with the serer.
4. Changing the file name and reconnecting(failed)
5. Reading through the stackoverflow questions for similar solutions, couldnt find any.

May I know what went wrong?

Below is the form coding for index.php:

<div class="jquery"/>
  <form method="post" action="process.php"/>
    <ul class="lists">
    <li class="title">Personal Details</li>
    <li class="fields">
        <label>Your Name:</label><br>
        <input type="text" name="name" /><br>
        <label>Contact Number:</label><br>
        <input type="text" name="contact"/><br>
        <input type="text" name="email" /><br>
        <input type="text" name="address" /><br>
    <li class="title" id="student">Student Details<span style="color:red" id="fontred">(Click Me To Expand!)</span></li>
    <li class="fields">
        <label>Student Name:</label><br />
        <input type="text" name="studentname"/><br />
        <label>Student Level:</label><br />
        <input type="text" name="level"/><br />
        <label>Subject:</label><br />
        <input type="text" name="subject"/><br />
        <label>Student Stream:</label><br />
        <input name="stream" type="text" /><br />
<div class="submit1">
<input type="submit" value="Find me a tutor now!" name="submit1" />

Here is the code for process.php:



if(!isset($name) || $name=='' || !isset($contact) || $contact=='' || !isset($email) || $email==''
    || !isset($address) || $address==''|| !isset($studentname) || $studentname==''|| !isset($level) || $level==''|| !isset($subject) 
    || $subject==''|| !isset($stream) || $stream==''
    $error="Please fill in all required fields before submission.";
    $sql = "INSERT INTO assignments(name,contact,email,address,studentname,level,subject,stream) VALUES('$name','$contact','$email','$address','$studentname','$level','$subject','$stream')";      


Source: forms

Leave a Reply