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

Looping Problem
I've got a client that has a database with about 200 events at any given time. I'm trying to loop t

php require help needed
Ok i tried to use the search funtion but the word require is everywhere.

i'm really new to cr

VAT
how should I deal with VAT?

if I have a product that costs £5.00 and VAT @ 17.5% (£0.87

update 2 columns by doing inner 2-column query
Hi,
is something like this possible?

update contract_all set col1,col2 =
(

php wont update my db
hello,

sorry for posting in mysql forum but i dont know where exactly is the problem but here

Word filter problem
Hello,

im trying to make a filter for words inputted in to my website but i want to store the

array_map() probably obvious mistake
The code below is part of a class to escape strings, but should also accept an array, using array_ma

big pagination problem in php
<?php

$connect = mysql_connect("localhost", "root", "")

animation progress while uploading files?
Hello, i have some website form to upload few files to server. i want to put some gif animation whi

upgrade from 4.7 to ECC 6.0
Hi all,
we are going to do an upgrade from R/3 4.7 to ECC 6.0. I need to know if i can find som

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