473,805 Members | 1,887 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

$_POST shows nothing, how to debug ?

9 New Member
Hi,

I'm new to PHP and html but think I got to learn that stuff now, after some years Database-experience.

Iworking at my first form and can't see anything in the PHP-output, even no error-message !??? here are the 'giant' scripts:

1. html form:
<html>
<head>
<title>My first PHP-Form</title>
</head>
<body>
<form method="post" action="form_ou tput.php" >
please fill your e-mail adress !
<input type="text" name="email">
<input type="submit" value="Go! ">
</form>
</body>
</html>
------------------------------------
2. form_output.php :

<?php
error_reporting (E_ALL);
if (empty($_POST['mail'])) {
echo "nothing here ";
} else {
echo "the mail: ".$_POST['mail'];
print_r($_POST) ;
var_dump($_POST );
}
echo "strlen($_P OST['mail'])";
?>
-----------------------------------------------------
when I open the html with firefox I see the form-element and can type in, no errors, everything looks fine !
When I enter the "go" button, html disapears and the PHP-file is opended by firefox, but totaly empty ! no error, no nothing ! only the URL is to see !???

it goes more weird, when I insert this line somewhere in the PHP-script:

echo "<br />\n";

instead of a blank line, I see while executing: \n";
and emmidiatly attached the next line of code !

What's wrong there ? If read dozends of tutorials, all telling the same, as I think, I did !?

thanks for any tip, LaoDe
Sep 29 '06 #1
3 3636
ronverdonk
4,258 Recognized Expert Specialist
The name of your input field in form1 is 'email'. However, you check and use the $_POST['mail']. Change all these to $_POST['email'].
[PHP]if (empty($_POST['email'])) {
echo "the mail: ".$_POST['email'];
echo strlen($_POST['email']);[/PHP]

Ronald :cool:
Sep 29 '06 #2
LaoDe
9 New Member
Hi Roverdonk,

Thanks for the tip, even so it isn't the problem.

You are right, during all that testing, I missed that 'e' in the PHP-script, but now, after deleting the that 'e' from the html-script, the problem is still the same, just empty, white screen.

Could it be, that I need to run this 2 pages through an index.html or index.php via Apache, to make it work ?
you see, I'm pretty bloody unexperienced in putting the things together. I think I understand some basics of Webserver + html + PHP,+ mySQL but I miss a nice tutorial about how to put all together in the right way.

any links to that ? thanks a lot for your tip anyway and feel free to ask me anything about databases, you like.

cheers LaoDe

The name of your input field in form1 is 'email'. However, you check and use the $_POST['mail']. Change all these to $_POST['email'].
[PHP]if (empty($_POST['email'])) {
echo "the mail: ".$_POST['email'];
echo strlen($_POST['email']);[/PHP]

Ronald :cool:
Sep 30 '06 #3
LaoDe
9 New Member
Hi,

Just to let you know: I am 1 step further:

When I run the form-html as index.html and therfore run it via Apache, the PHP-output is fine.
So I need to learn now to make Apache + html + PHP + mySQL working fine together.

Right now I wonder, why Apache comes up with it's dummy page (which is renamed to index.html.org) , when I call 'localhost' and runs my form-html only, if I call localhost/index.html (which contains the form now) expresivly.

All related scripts are in DocumentRoot "/xampp/htdocs"
while ServerRoot "/xampp/apache"
I reduced direcotry index to only:
DirectoryIndex index.html

that is default from XAMPP. I didn't change that and proofed it.

That Indian seems to be a medicine-man !?

cheers LaoDe
Sep 30 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
3497
by: Kevin | last post by:
I am having problems in my php code. I am relatively new to php but I know some basics. This is the problem: when i try to echo some information that is typed into form back to the screen i get absolutely nothing. It seems like $_POST is an empty string, along with $_POST and $_GET. I looked around to see if someone else had the same problem and found
10
14698
by: arun.kumar.varma | last post by:
Hi, I'm learning PHP and prepared a simple login form. validate.php does the validation and it was behaving erratically. So, I did var_dump of $_POST variable and it's NULL. Did I miss anything here regarding the configuration or code? Code for validate.php is given below. <?php var_dump($_POST);
9
22594
by: bissatch | last post by:
Hi, How would I go about destroying POST vars after their use in a script? Is this possible? The reason is that when I use a script that, for example, add a row to a database. If for some reason the user refreshes the page, it will add another row. Is it the browser that resends the POST vars when a page is refreshed?
4
4422
by: Oak Hall | last post by:
foreach($_POST as $element=>$val) { echo $element.'--'.$val.'<BR>'; } Where a select multiple html field had several selected values only shows one?? How do I get the others. php 5.1b Thanks Oak
5
2548
by: IchBin | last post by:
I am cross posting to comp.lang.php and alt.comp.lang.php. I am having a problem with getting a post from a dropdownlist off a html form. While debugging, by instruction steps, for some reason I am never get passed the isset($_POST) after selecting an item in the dropdownlist. I have coded a simple script to duplicate what I am trying to do, just to make sure i understand it, and that works. This is the code and has to be something...
12
2670
by: Todd Michels | last post by:
Hi all, I am trying to send data from a form and insert it into a MSSQL DB. When I submit the data I get: Warning: mssql_query() : message: The name "Todd" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted. (severity 15) in "Myfile"
9
1976
by: shreedhan | last post by:
Hi I'm recenlty studying PHP myself and I have got a problem in passing variables to one php script from another i have following code as index.php <?php $name=HREEDN ?> <html> <head>
4
45628
by: mtuller | last post by:
I have a page that submits data to a database, and I want to make it so that if the page is refreshed, it doesn't submit the information again. I am trying to use unset the variables so that if the page is refreshed, it will not submit again. I saw a post about setting a time delay of something like 30 seconds, but would prefer just to unset the variable. I can't seem to get it working. Here is a snippet of what I have: echo 'First...
32
8217
by: Bill H | last post by:
I wouldn't consider myself a newbie to PHP since I have never written one line of code in it (am a perl guy myself), but part of a team I am working with is writing some php interfaces into a database and I noticed that they are relaying on HTML form value names to always be lowercase in their code (ie $_POST (fyi that may be typed wrong)) and from my experience it is always better, when reading in the post information to convert the the...
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10360
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10366
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9185
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5542
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3845
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.