user710502
user710502

Reputation: 11471

Having issues passing values to my other page with post

I am new to PHP, and have been trying to make this work but nothing.. basically i have a simple registration form

I would appreciate your help

Upvotes: 0

Views: 51

Answers (2)

fperet
fperet

Reputation: 456

You should display PHP errors. Seems like PHP crashes on a half way, and we don't really know why. By the way U cant use the following array keys naming: $_POST[fname]. It should be $_POST['fname']

Turn displaying errors on using this:

ini_set('display_errors',1);

error_reporting(E_ALL);

Upvotes: 1

Brad Christie
Brad Christie

Reputation: 101604

Off-hand I'd guess 1 of two things (both relating to display_errors being disabled, so you're not getting any reason why it's failing):

  1. Your print has an "unescaped" ?> in it, so my guess is the compiler sees it and thinks it's done with PHP code. Often when this header is output from php, it is done so in this fashion:
    <?php echo '<?xml ... ?'.'>'; ?>
    Note the . concatenating the two characters to avoid compiler confusion.
  2. Your print is missing a semicolon (;)

However, you also missed the bit on not using extract on user-submitted data

Do not use extract() on untrusted data, like user input (i.e. $_GET, $_FILES, etc.).

(The etc. above would include $_POST as well) extract() is not necessary for $_POST[] to be populated, so do yourself a favor and just use $_POST.

Also, raw INSERTs from the form are another no-no.

Upvotes: 1

Related Questions