SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: <?php echo @$_POST['type']; ?>
-
Mar 4, 2004, 23:40 #1
- Join Date
- Aug 2003
- Location
- NYC
- Posts
- 111
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
<?php echo @$_POST['type']; ?>
I found this in a thread somewhere here, and cannot find it again. It was used as a form value. Weird that a search doesn't give me results?
Code:value='<?php echo @$_POST['type']; ?>'
-
Mar 5, 2004, 00:38 #2
- Join Date
- Sep 2002
- Location
- Katy, TX
- Posts
- 956
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I think I remember seeing that post. I believe that '@' symbol is used to tell the system to only display, in your case, TYPE if it contains a value.
It's just for coding standards, I believe.
-
Mar 5, 2004, 04:57 #3
- Join Date
- Jul 2000
- Location
- Perth Australia
- Posts
- 1,717
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
the '@' supresses the error that PHP may generate if error_reporting is set to E_ALL , e.g. if $_POST['type'] is not set then a warning would be printed to output.
ideally you would(should?) ...
if(isset($_POST['var'])){echo $_POST['var'];}
-
Mar 5, 2004, 05:46 #4
if u once have this sentence:
PHP Code:if(isset($_POST["var"]) your_insert_to_database_function();
PHP Code:if(!empty($_POST["var"]) your_insert_to_database_function();
you just have to put the output form like this:
PHP Code:echo "<input type='text' name='xyz' value='$row[1]'>";
// start count from $row[0] = id
Bookmarks