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.

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

Windows Authentication
I have a website which is windows authenticated.
now i want something more on this application.<

Trouble verifying database password
Thankyou to everyone who responded to my last post (I can't find the posting, it has been buried). <

Links not updating
I'm trying to fuel a simple navigation system for a news section. It works fine when it comes to ret

Send current URL in URL with a $_GET variable problem.
Hello community,

I have created a function that gets the current variable of a page, example:

array ...
hi
Code: function formatCategories($categories, $parentId)
{
// $navCat stores all child

Custom CMS
This is a big custom CMS script I'd like to develop and would like some help atleast figuring out wh

Images in email problem
I found this script for sending emails, it works but if the email has <img src="image.jp

mysql select query problem
how can i select multiple fields from multiple table in one query like

i have table name t1 a

If a record matches an existing record do nothing
So I don't know if I should put this here or in mysql, but what my script is for is for people to ad

How do i use vars in an array
Hiya peeps!

How do I use a var in an array. You will see $id but it isnt working.


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