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

Mysql query, two times?
Hello to all,

I'm new to php coding and i like it alot. I need help with some noob stuff.

help with this code please?
Hello,

I am trying to build a remote upload script for my image hosting site.

I am usi

Unifying logins of two different scripts
I have two different game scripts which I want to embed on my own site. The problem is I don't want

How a counter of users ? such as ---> (231 Viewing)
I want to count how many users are actually viewing the page, How is that possible?
Thank you guy

Get word number x from string?
How can I use a function to loop through a string, and "have a look at" every word in the

Problem with passing variables
I'm not really a php programmer so I'm really struggling with this issue.

I have a banner s

asking for direction
I have 2 tables in my data, which are "post" and "event"
I won't make a summa

some query on multilingual website
Hi all,

Which is the simplest and easiest method to make a website multilingual,
is it put

Disable html within defined tags
I have a mysql database that allows users to enter content with html, but I also want to have a tag

How can i use [] tags instead of <> tags for profiles??
On my site im making ive made it so u can register, login and u have a profile which u can update..<

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