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

why preg_match_all does not return the number of matches
My regex looks like

X[^x{4e00}-x{9fa5}]*Y

(where X and Y are two Chinese characters)

Problem!
I have another problem, when i run this code i get this error "Parse error: syntax error, unexp

need help in update query
hi
i have a dynamic form. i need help in how can i use update query when values from dynamic for

noob question
i traying to do a php form with auto replay for both(me and the user who send me a mail),

a u

php and downloading
I want to use a php script to create two files. Then I want it to redirect (or whatever) to have tho

Multiple while loops
I have several DB queries that I know should be returning results and aren't. I have a feeling it ha

fopen() security
As i understood the usage of fopen() for it to function correctly the Dir you write to has to be rw

Internal Server Error issues
This has been bothering me for weeks and I've been trying to solve it without asking for help, but e

IS Retail & Manufacturing
Hi

Can IS Retail and Manufacturing activities be done in same instance ie. in same client

Place specific image in html page when specific name is typed.
Hello,

Fairly new to PHP and was curious if someone might know how to solve a fairly simple r

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