Rob Alston Rob Alston - 1 year ago 59
PHP Question

why is my textbox not populating?

I have removed all other code trying to find my error. The code below will echo the passed value/variable in the php portion of the code only in line 2 which verifies that the variable is being passed. The textbox in the html portion renmains blank and does not populate. Probably something simple that I am missing, but going crazy trying to find the error. Please tell me what I have done wrong?

echo $new_customer . $_POST['search'];

<!doctype html>
<html lang="en">
<input type="text" name="customer_name" value="<?php echo $new_customer; ?>" id="customer_name">

Answer Source

you need value for $new_customer.

$new_customer =  $_POST[search];

Unless you assign value to $new_customer you can't print it in html.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download