Unable to echo POST input

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Odisey
    New Member
    • May 2007
    • 14

    Unable to echo POST input

    Hello,
    I am still getting these concepts. Help me learn. What is wrong here? Most echos are for testing.


    Thank you,
    Odisey


    [CODE=php]<?php #index php script 3.4

    echo '<p> 1 </p>';

    require_once ('mysql_connect _wvdiamonds.php '); //Connect to server


    echo '<p> Connected </p>';

    $id=1;

    echo '<p> ID </p>';

    $query = "SHOW header FROM details1 WHERE des_id_pg1=$id" ;

    echo '<p> Query </p>';

    $result = mysql_query($qu ery);

    echo '<p> Result </p>';

    echo "<p> $_POST('$result ') </p>";

    echo '<p> Post echo 1</p>';

    ?>[/CODE]
    Last edited by pbmods; May 27 '07, 11:08 PM. Reason: Changed code language. Thanks for using CODE tags!
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Changed thread title to better match contents.

    [code=php]
    // Try this:
    echo $_POST['varname'];

    // Instead of this:
    echo $_POST('varname ');

    // Also note that if you want to use an array element in a string, you must either omit the quote marks around the key name, or else use curly syntax:
    echo "$_POST[varname]";
    echo "{$_POST['varname']}";
    [/code]

    Comment

    Working...