0

I am filling an edit form from a database, so i retrieve text from a database field and place it in an input text as follows:

    echo '<b> Topic: </b><input type = text size = 50 value = ' . $filler['LP_Topic'].'>'. $br;

it works fine, but it only gets the first word of the topic, not the whole string!

if I just echo the result without an input it will work perfectly ! the problem happens when I add input regards

6
  • $filler is the retrieved row Commented Jul 5, 2017 at 16:24
  • 2
    Remove size = 50 from the input. Commented Jul 5, 2017 at 16:24
  • 2
    You also need quotes around the value of value=. Commented Jul 5, 2017 at 16:25
  • it was without it and didnt work then I added it hoping it solves the problem, but it didnt. so it doesnt work in both cases! Commented Jul 5, 2017 at 16:25
  • Thanks Sloan Thrasher, quotes solved the problem! Commented Jul 5, 2017 at 16:27

1 Answer 1

3

Try adding quotes around the value. All html properties/attributes are supposed to be quoted.

echo '<b> Topic: </b><input type="text" size="50" value="' . $filler['LP_Topic'].'">'. $br;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.