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

form variables from database help.
Hi all,

I would like to have a form that gives you options based on the results of an mysql q

Parse String
I need to parse the string below into three variables. How would I do that?

john + 10/20/2008

Preg_match unknown modifyer
Hello,

Im trying to write a little script for my forums i need to get the reply from my forum

grouping within a foreach?
hello all,

I currently have a list of products spit out from my db via a foreach loop. Right

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_

Cursor statement failed with errors
Following statement failed with the errors.

cursor proj_cursor1 is (select projectID from

Navigation include for all site directories
Hi,

I need a navigation include that can deal with directories at different levels on a site.

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
what is wrong with this

Code: [Select]<?php
if ($_SERVER['HTTP_REFERER'])
{

How to give the privillege for triggers?
Hi,

How to give the privillage for triggers to particular user?

Please let me

php web service error
hey guys,
I'm working on a project requires the use of web services. I've been trying a few tutor

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