Jump to content

$_POST not working... i can't see why...


jigsawsoul

Recommended Posts

I trying to echo out information from a forum using $_POST but its not working and i can't really see what i have done wrong if anything.

 

form. create-staff.php

<h4>Create Staff Member</h4>
<p>To create a staff member fill out the form below.</p>
<div class="meeting png_bg">
<form action="create-staff-2.php" method="post">
		<p>
			<label>Email:</label>
			<input class="text-input small-input" type="text" id="email" name="email" />
		</p>
		<p>
			<label>Password:</label>
			<input class="text-input small-input" type="text" id="password" name="password" />
		</p>
		<p>
			<label>First Name:</label>
			<input class="text-input small-input" type="text" id="firstname" name="firstname" />
		</p>
		<p>
			<label>Last Name:</label>
			<input class="text-input small-input" type="text" id="lastname" name="lastname" />
		</p>
		<p>
			<input class="button" type="submit" value="Submit" />
		</p>
</form>
</div>

 

php. create-staff-2.php

<?php 

session_start();

include ("../_functions/f_login.php");

sessionAuthenticate( );

$email = $_POST['email'];
$password = $POST['password'];
$firstname = $POST['firstname'];
$lastname = $POST['lastname'];

echo $email;
echo $password;
echo $firstname;
echo $lastname;

?>

:shrug:

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/189039-_post-not-working-i-cant-see-why/
Share on other sites

error_reporting(E_ALL);
ini_set('display_errors',1);

 

It will tell you if you have any errors in your script.

 

Also

$email = $_POST['email'];
$password = $_POST['password'];
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];

errors ?

Notice: Undefined variable: POST in /home/hr728/public_html/_uni/_admin/create-staff-2.php on line 13

Notice: Undefined variable: POST in /home/hr728/public_html/_uni/_admin/create-staff-2.php on line 14

Notice: Undefined variable: POST in /home/hr728/public_html/_uni/_admin/create-staff-2.php on line 15

 

i haven't used

 

POST

 

i've only used

 

$_POST

 

as below

<?php 

session_start();

include ("../_functions/f_login.php");

sessionAuthenticate( );

error_reporting(E_ALL);
ini_set('display_errors',1);

$email = $_POST['email'];
$password = $_POST['password'];
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];

echo $email;
echo $password;
echo $firstname;
echo $lastname;

?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.