Hi!
It's really a silly question, but i've tried many ways to do it and it's still worthless.... :(
I have a form:

<form action="jobapp.php" method="POST" name="app">
	
	Please, enter your name:
	<input type="text" name="applicant" /><br />
	Please, enter your telephone number:
	<input type="text" name="telephone" /><br />
	Please, enter your e-mail address:
	<input type="text" name="email" />
	</form><br /><br />

and the awful problem is that i just can't make the entered values to be displayed.
I would really appreciate, if you could help me!!!! :$

Dani AI

Generated

Common causes for “submitted values not showing” are simple: the form never actually posts (no submit control or wrong action), the PHP file is being opened directly (file://) instead of served by a webserver, PHP short tags are used when the server does not support them, or output is shown unsafely/without validation. correctly pointed out that the data arrives on the PHP side; rightly suggested adding a submit control — both are relevant, but the checklist below covers the missing operational details.

Check list (in order):

  • Confirm a submit control exists and that the form’s method is POST and action points to the correct script or to the same page.
  • Open the page through a webserver (...) so PHP is executed, not via the filesystem.
  • Use browser devtools Network tab to verify a POST request is actually sent and contains the field names.
  • Avoid PHP short tags (<?) — use <?php.
  • Temporarily enable error reporting to catch runtime problems: ini_set('display_errors','1'); error_reporting(E_ALL);

A minimal, safe example for jobapp.php that reads, validates and safely displays values:

<?php
ini_set('display_errors','1');
error_reporting(E_ALL);

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $name = trim($_POST['applicant'] ?? '');
    $phone = trim($_POST['telephone'] ?? '');
    $rawEmail = trim($_POST['email'] ?? '');
    $email = filter_var($rawEmail, FILTER_VALIDATE_EMAIL);

    echo '<ul>';
    echo '<li>Name: ' . ($name !== '' ? htmlspecialchars($name, ENT_QUOTES, 'UTF-8') : 'not provided') . '</li>';
    echo '<li>Phone: ' . ($phone !== '' ? htmlspecialchars($phone, ENT_QUOTES, 'UTF-8') : 'not provided') . '</li>';
    echo '<li>Email: ' . ($email ? htmlspecialchars($email, ENT_QUOTES, 'UTF-8') : 'invalid or missing') . '</li>';
    echo '</ul>';
}
?>

Final notes: confirm input name attributes match exactly, and use the browser network inspector to see real payloads. Repopulation of the form fields after submit is convenient (set each input’s value to the escaped submitted value) and helps verify the server received the data.

Recommended Answers

All 4 Replies

Hi!
It's really a silly question, but i've tried many ways to do it and it's still worthless.... :(
I have a form:

<form action="jobapp.php" method="POST" name="app">
	
	Please, enter your name:
	<input type="text" name="applicant" /><br />
	Please, enter your telephone number:
	<input type="text" name="telephone" /><br />
	Please, enter your e-mail address:
	<input type="text" name="email" />
	</form><br /><br />

and the awful problem is that i just can't make the entered values to be displayed.
I would really appreciate, if you could help me!!!! :$

In your PHP file jobapp.php, you will receive the values entered in the form in the variable $_POST, since the the form method is "POST".

Long explanation:
When a user submits the form, the browser will send a HTTP Request to your server, with the values of the form in the HTTP Request. The HTTP Request will be a POST request, in url encoded format. The PHP server on receiving this request will decode the url encoded values, and generate the PHP Array $_POST, which these values.

To view the POST data, just retrieve them from the $_POST array.

You can dump all the values of the $_POST array just to see whats happening:

var_dump($_POST);

or you can access an individual value:

echo $_POST['applicant'];
commented: very nice explanation! +8

hello..
you should put one submit button...
Try this:

<?
if($_SERVER['REQUEST_METHOD']=='POST')
{
print_r($_POST);
}
?>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<form action="" method="POST" name="app">
	
	Please, enter your name:
	<input type="text" name="applicant" /><br />
	Please, enter your telephone number:
	<input type="text" name="telephone" /><br />
	Please, enter your e-mail address:
	<input type="text" name="email" />
	<br /><br />
	<input type="submit" name="Submit" value="Go!!" />
	</form>
</body>
</html>

put the above php code in your jobapp.php....

Is there anything else that you could advise me...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.