WAMP not reading PHP $_POST variables
Posted by: cdosrun01 (---.dyn.optonline.net)
Date: September 08, 2014 06:30PM

Hi, I'm new here and I've been having problem after problem with WAMP recently and I don't know why.

The current issue I am having is with accessing data submitted from a form. To test it out I tried using the code from the w3schools PHP form submission tutorial which is below, and I realized that the problem is with the server. After doing several google searches I found this:

This feature has been DEPRECATED as of PHP 5.3.0.

I am fine with that, but how am I supposed to read the variables from the HTML file if I can't use $_POST or $_GET? I tried looking online and no one has an answer. How am I supposed to use the variables in the HTML code in PHP since WAMP doesn't allow global variables anymore?

Pleas someone help because I have been at this for hours and am at the end of my rope!


HTML

<html>
<body>

<form action="welcome_get.php" method="post">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit">
</form>

</body>
</html>


PHP
<html>
<body>

Welcome <?php echo $_POST["name"]; ?><br>
Your email address is: <?php echo $_POST["email"]; ?>

</body>
</html>

Options: ReplyQuote
Re: WAMP not reading PHP $_POST variables
Posted by: Otomatic (Moderator)
Date: September 08, 2014 07:04PM

Hi,

> This feature has been DEPRECATED as of PHP 5.3.0.
What feature ?

Please, read and answer: READ THIS BEFORE YOU ASK A QUESTION

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: WAMP not reading PHP $_POST variables
Posted by: ruthermelchor (---.79.199.112.clbrz.inet.eastern-tele.com)
Date: September 10, 2014 05:42AM

Far as I know, global variables are still working yet some institutions re recommending to avoid using it in the future. For your problem, have you tried assigning your POST data first before calling them?

IE:

<php

$name=$_POST['name'];
$email=$_POST['email'];

echo "Welcome ".$name."<br>";
echo "Your email address is: ". $email;

?>



Edited 1 time(s). Last edit at 09/10/2014 05:45AM by ruthermelchor.

Options: ReplyQuote
Re: WAMP not reading PHP $_POST variables
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: September 20, 2014 06:25AM

Please, read AND PROVIDE ANSWERS TO these questios: READ THIS BEFORE YOU ASK A QUESTION


Make sure that your PHP file, the one with PHP code in it has the .php extension.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.