-3
<? php $text = "hello world"; ?>

<input type="text" value="<?php echo $text; ?>">

in the browser gives me an input box with value:


Notice: Undefined variable: text in C:\xampp\htdocs\FIRST-PROJECT\index.php on line 26

mpassad
  • 51
  • 5
  • 2
    this obviously isn't full code nor actual code for that matter. Why don't you show us what you're really using? seeing an input, tells me you're using a form. – Funk Forty Niner May 10 '15 at 16:09

1 Answers1

1

<? php isn't a valid tag, so you're never creating $text. There is an extra space in there. Close the space after the ?, and make it <?php.

nomistic
  • 2,902
  • 4
  • 20
  • 36
Styphon
  • 10,304
  • 9
  • 52
  • 86