SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Zealot
    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'];  ?>'
    Anyway it looked interesting but the thread dropped off before it was explained, so I tried to apply the concept. Now I can't find the thread.

  2. #2
    googlicious graymatter bvarvel's Avatar
    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.

  3. #3
    ********* wombat firepages's Avatar
    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'];}

  4. #4
    Non-Member hyperimage's Avatar
    Join Date
    Dec 2003
    Location
    Croatia
    Posts
    259
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if u once have this sentence:
    PHP Code:
    if(isset($_POST["var"]) your_insert_to_database_function(); 
    or
    PHP Code:
    if(!empty($_POST["var"]) your_insert_to_database_function(); 
    to input into database.
    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 
    cya


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •