0

i wanna put the text that user entered in textbox in a variable i don't want to send it to another page. how can i do it! in asp.net it would be :

string a = textbox1.text;

how could i do it using php?

html :

<html>
<body>
<input type="text" id="news">
</body>
</html>

php variable :

$news_text;

i wanna put text that user entered into $news_text please help me!

Pedramch
  • 81
  • 1
  • 8

2 Answers2

0

ASP.NET uses forms. There is no way to avoid using POST/GET/etc.

<?php
$news_text = isset($_REQUEST['news']) ? $_REQUEST['news'] : '';
?>
<html>
<body>
<form method="get">
    <input type="text" id="news"/>
</form>
</body>
</html>
Vince
  • 416
  • 2
  • 5
0

You have to send it to at least that same page to get a post value.

             $news_text = isset($_POST['news_text']) ? $_POST['news_text'] : '';
Peter Chaula
  • 3,456
  • 2
  • 28
  • 32