Hey. So here is my code...



$localhost = "localhost";
$dbuser = "root";
$dbpass = "";
$dbname = "test2";

$connect = mysql_connect($localhost, $dbuser, $dbpass);
mysql_select_db("$dbname", $connect);




$username = $_POST['username'];
$email = $_POST['email'];
$password = md5($_POST['password']);

$insert = 'INSERT into users(username, email, password) VALUE("'.$username.'","'.$email.'","'.$password.'")';




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
#apDiv1 {
    left: 34%;
    top: 195px;
#apDiv1 form table tr td {
    font-family: "Trebuchet MS";

<div id="apDiv1">
<form method ="post" action="regprocess.php">
    <table width="300" border="0">
        <td width="134">Username:</td>
        <td width="156"><input type="text" name="username"/></td>
          <input type="email" name="email"/>
          <input type="password" name="password"/>
          <input type="submit" name="submit" value="Submit"/>


And my error is: When I hit submit, my browser simply displays the code from my regprocess.php

So I assume there is an error either within my config or regprocess codes.
I have double checked both my database and table names.

Recommended Answers

All 2 Replies

regprocess.php, line 2: make sure you have a space between the include command and the filename.


Also, regprocess.php doesn't produce any output. Although, I don't believe this should cause the code to be printed, I suggest adding some print statements, a redirect, or something.

Actually, it could be that your server is not configured to process PHP properly. Can you set up a basic test script and check your output as per this example?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.