Welcome to WebmasterWorld Guest from 54.224.108.85

Forum Moderators: coopster & jatar k

Submit will not work

     
6:03 pm on Nov 8, 2017 (gmt 0)

Junior Member

5+ Year Member

joined:Oct 19, 2011
posts: 179
votes: 1


I'm working on a php/Unity3d/MYSQL application on a WAMP local server. I was trying to perform an insert to the database, but for some reason nothing is happening. I enter the values, hit the submit key and nothing.

Here is the form part
<form method="post" action="AddUser.php">
USERNAME: <input type="text" name="username" value="">
EMAIL:<input type="text" name="email" value="">
LOCATION:<input type="text" name="location" value="">
USERTYPE:<select name="status">
<option value="Type">User</option>
<option selected value="Admin">Admin</option>
</select>
</form>
<input type="submit" name="submit" value="submit"><input type="reset">


Here is the php part.
  include('dbconfig.php');

$newUsername=$_POST['username'];
$userEmail=$_POST['email'];
$location=$_POST['location'];
$userType=$_POST['Type'];
$userPassword=random_password();

echo $newUsername;
echo $userEmail;
echo $location;
echo $userType;
echo $userPassword;


Just want to make sure things are coming through, will add the INSERT statement after I get the values. I realize I've been out of the php game for a while, but what am I missing here?
Thanks!
7:48 pm on Nov 8, 2017 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Apr 1, 2016
posts:1864
votes: 470


Your input type="submit" is outside of the </form> tag. it should look like this:


<form method="post" action="AddUser.php">
USERNAME: <input type="text" name="username" value="">
EMAIL:<input type="text" name="email" value="">
LOCATION:<input type="text" name="location" value="">
USERTYPE:<select name="status">
<option value="Type">User</option>
<option selected value="Admin">Admin</option>
</select>
<input type="submit" name="submit" value="submit"><input type="reset">
</form>
8:02 pm on Nov 8, 2017 (gmt 0)

Junior Member

5+ Year Member

joined:Oct 19, 2011
posts: 179
votes: 1


D'OH! Thanks!
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members