php新人請求知道,關於post傳遞的問題

來源:互聯網
上載者:User
PHP post傳遞



因為是剛學PHP,所以有很多不懂的地方,所以還請熱心的朋友指導下。


回複討論(解決方案)

不能直接在php標籤中寫常值內容,要顯示要麼echo,要麼寫到標籤之外

text.php是什麼東西...

後台代碼修改為

  

字串用雙引號或者單引號包裹

後台代碼修改為

  

字串用雙引號或者單引號包裹
這樣是對的, lz那個text.php是幹什麼的?

樓主說出你的疑問讓我幫你解答一下。

4樓的方法是對的。
接收form過來的值,當然用$_POST。
而且在頁面中,也是要用 例如:

 

一個不錯的參考代碼:

 array(        'method' => 'POST',        'header' => 'Content-type:application/x-www-form-urlencoded',        'content' => $postdata,        'timeout' => 15 * 60 // 逾時時間(單位:s)      )    );    $context = stream_context_create($options);    $result = file_get_contents($url, false, $context);      return $result;  }    //使用方法  $post_data = array(    'username' => 'stclair2201',    'password' => 'handan'  );  send_post('http://www.qianyunlai.com', $post_data);              

表單裡面是input name='name'

你在$_POST裡面也要小寫 $_POST['name']

可以這樣
echo "welcome".
?>
welcome

you are years old

可以這樣

welcome 
you are years old

可以這樣

welcome 
you are years old

11樓的做法是比較好的做法,就是在HTML中插入php代碼
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.