Simple Registration page info is not added to database using localhost

0 votes

When I use localhost, after completing my registration form, for some reason it won't redirect to the "success" page, and nothing is added to the database. The same outcome occurred when I uploaded the files to a legitimate web server, however, the database did update with the new user.

I've been studying these PHP tutorials by Alex from the pop academy step-by-step from here: http://www.youtube.com/watch?v=5A50qmC7wFo

Here is the PHP code:

<?php 
                if (isset($_GET['success'])  === true && empty ($_GET['success'])  === false){
                    echo '<h8>You\'ve been registered successfully.<br>Please check your email for a confirmation link.</h8>';
                    header("refresh:20;url=index.php");
                } else{

                    include 'regform.php'; //REGISTRATION FORM

                    if (empty($_POST) === false && empty($errors) === true){
                        $register_data = array(
                        'first_name'    => $_POST['first_name'], 
                        'last_name'     => $_POST['last_name'], 
                        'username'      => $_POST['username'], 
                        'password'      => $_POST['password'],                          
                        'email'         => $_POST['email'],
                        'email_code'    => md5($_POST['username'] + microtime())
                        );
                        register_user($register_data);
                        header('Location: register.php?success');
                        exit();

                    } else if (empty($errors) === false){
                        echo output_errors($errors);
                    }
                }
            ?>  

Can someone please help me with this?

Jul 24 in Web Development by Kithuzzz
• 4,480 points
10 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Web Development

0 votes
1 answer

Not able to show/hide div which is nearest to checkbox using JQuery

pretty simple: $('.check-hide-show-content').hide(); // hide all content divs // ...READ MORE

answered Aug 2 in Web Development by rajatha
• 7,040 points
14 views
0 votes
1 answer

How can I create a simple page vertical scroll bar without using jQuery?

Surprisingly, there is not a great, simple ...READ MORE

answered Jun 22 in Web Development by rajatha
• 7,040 points
23 views
0 votes
1 answer

How to create a simple map using JavaScript/JQuery

var map = new Object(); // or ...READ MORE

answered Jun 27 in Web Development by rajatha
• 7,040 points
21 views
0 votes
0 answers

How to check radio button is checked using JQuery?

I have two radio buttons in one ...READ MORE

Jun 29 in Web Development by gaurav
• 17,580 points
12 views
+1 vote
2 answers

Scp Php files into server using gradle

Tru something like this: plugins { id ...READ MORE

answered Oct 11, 2018 in DevOps & Agile by lina
• 8,220 points
544 views
0 votes
1 answer

How do I create folder under an Amazon S3 bucket through PHP API?

Of Course, it is possible to create ...READ MORE

answered Apr 24, 2018 in AWS by anonymous
9,293 views
0 votes
1 answer

Failure uploading Image on AmazonS3 with PHP SDK

Try this, I took it out from ...READ MORE

answered May 4, 2018 in AWS by Cloud gunner
• 4,660 points
2,218 views
0 votes
1 answer

Trying to call AWS API via PHP

Try using AWS SDK for PHP, Link ...READ MORE

answered Jun 6, 2018 in AWS by Cloud gunner
• 4,660 points
992 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP