Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9009309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:09:23+00:00 2026-06-16T02:09:23+00:00

Im not sure if POST is not working or if function is not working.

  • 0

Im not sure if POST is not working or if function is not working.
So heres the code for one page:

<?php require_once("includes/Functions.php"); ?>
<?php include("includes/front.php"); ?>
<div id="register"> 
<form action="Includes/Functions.php" method="post" name="createUser"> 
Username: <input type="text" name="user" maxlength="16"/><br />
Password: <input type="password" name="pass" maxlength="30"/><br />
Repeat password: <input type="password"/><br />
E-mail: <input type="email" name="mail"/><br />             
<input type="submit" value="Next" />            
</form>
<a href="/login.php">Log in</a>  
</div>
</body>
</html>
<?php include("includes/footer.php"); ?>

Here is the begining of functions.php:

<?php require_once("connect.php"); ?>
<?php
if(isset($_POST["createUser"]) && isset($_POST["user"], $_POST["pass"],    $_POST["mail"])){
call_user_func_array("createUser", array($_POST("user"), $_POST("pass"), $_POST("mail")));
} 

Using echo method of troubleshooting I see that echo is working everywhere in code but not in the function I need.

Here is the function:

function createUser ($username, $password, $email){
//Get from form
$username = $_POST["user"];
$password = $_POST["pass"];
$email = $_POST["mail"];
$hashedPassword = sha1($password);
//Submit to database
//make query
$query = ("INSERT INTO users ( username , email , hashPass ) VALUES ( '$username' ,  '$email' , '$hashedPassword')");
//use query
if (mysql_query($query, $connection)) {
//userMade.php
header("Location: ../userMade.php");
exit;
} else {
echo "<p>I suck!</p>";
echo "<p>".mysql_error()."</p>";
} 
}

No PHP or MySQL errors are being reported, I only see a blank page.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T02:09:24+00:00Added an answer on June 16, 2026 at 2:09 am

    In functions.php you are checking if(isset($_POST["createUser"])...

    The form name attribute is not submitted during the post, so this if-statement will always fail.

    You will want to use the name/value attribute of the submit button, or a hidden input field in order to satisfy this condition

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am not sure why but the post to my external PHP file is
I'm not sure whether to post it here or at ServerFault. Anyway, I'm trying
Caveat : I'm not sure if this post might be better suited for SuperUser
I am not sure if the is a duplicate post. But I have a
I am not sure if I can post this sort of question (apologies in
I'm not sure if this is the right place to post this question but
As the post title implies, I have a legacy database (not sure if that
I've tagged this post as WordPress, but I'm not entirely sure it's WordPress-specific, so
I'm working on an ajax loading function on a Wordpress single page portfolio. The
Here is what I have... function checkDB(code, userid) { $(#notice_div).html('Loading..'); $.ajax({ type: POST, url:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.