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, 2022 in Web Development by Kithuzzz
• 38,010 points
678 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, 2022 in Web Development by rajatha
• 7,640 points
1,174 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, 2022 in Web Development by rajatha
• 7,640 points
307 views
0 votes
1 answer

How to create a simple map using JavaScript/JQuery

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

answered Jun 27, 2022 in Web Development by rajatha
• 7,640 points
925 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, 2022 in Web Development by gaurav
• 23,260 points
294 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
1,200 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
10,974 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,670 points
3,773 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,670 points
1,487 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP