Most basic form question ever?


Posted on 16th Feb 2014 07:03 pm by admin

Hello,

I want to use this snippet to make sure the fields in a form are ok before processing it.

Did you know?Explore Trending and Topic pages for more stories like this.
Code: <FORM method="post">
To:


<input type="text" name="name" size="40" value="<?php if($name) { print $name; } else { print "Insert Name"; } ?>">

<input name="action" type="submit" value="Update Form">

</FORM>

It works, but I don't understand why.

The if statement is checking for the variable $name, but I haven't used the code that I would normally use.

What I see in all my tutorials would lead me to use...

$name= $_POST['name];

So, I'm confused as to where the $name variable is being found.

Thanks for your patience
No comments posted yet

Your Answer:

Login to answer
168 Like 18 Dislike
Previous forums Next forums
Other forums

Generate multilayered array from string.
ok so i have a string that looks like this:
Code: blog:edit_all,delete_all|users:edit_all,delete_

Help with search.php
Hello All

I need the search engine on a site I am building at the moment to display the searc

Save User Inputs while javascript reloading!
hi..
i have written a PHP code in which i reload the page when user selects a value in dropdown..

License Issue - service type user
Hi,

I would like to understand the following issue regarding sap license.
I wish to

Secure FTP
Hi experts,
There is no SFTP action in MII workbench.
This means it needs developing custo

Upload file!
Ok i have a form..
Code: <form name="form1" method="post" action=&quo

Form validation with functions
Hi there

I am trying to make a very simple form validation function. I currently have the fol

Email/MMS to Site
Hey guys. I'm looking for a way for a user to upload images and/or text via their cell phones. It

Header is not working in IE
Hi ! header function is not working in IE but it works in FF, Safari, Chrome. any help please. :

Multiple PHP errors when clicking a link..and..removing a ghost..
Hi - I have 2 problems with a new website - homeswapvacations.com, which I need help solving.

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash