By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 2,042 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

Unable to echo POST input

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


Thank you,
Odisey


Expand|Select|Wrap|Line Numbers
  1. <?php #index php script 3.4
  2.  
  3. echo '<p> 1 </p>';
  4.  
  5.           require_once ('mysql_connect_wvdiamonds.php'); //Connect to server
  6.  
  7.  
  8. echo '<p> Connected </p>';
  9.  
  10.           $id=1;
  11.  
  12. echo '<p> ID </p>';
  13.  
  14.           $query = "SHOW header FROM details1 WHERE des_id_pg1=$id";
  15.  
  16. echo '<p> Query </p>';    
  17.  
  18.           $result = mysql_query($query);   
  19.  
  20. echo '<p> Result </p>';    
  21.  
  22.           echo "<p> $_POST('$result') </p>"; 
  23.  
  24. echo '<p> Post echo 1</p>';          
  25.  
  26.           ?>
May 27 '07 #1
Share this Question
Share on Google+
1 Reply


pbmods
Expert 5K+
P: 5,821
Changed thread title to better match contents.

Expand|Select|Wrap|Line Numbers
  1. // Try this:
  2. echo $_POST['varname'];
  3.  
  4. // Instead of this:
  5. echo $_POST('varname');
  6.  
  7. // 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:
  8. echo "$_POST[varname]";
  9. echo "{$_POST['varname']}";
  10.  
http://php.net/string
May 27 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.