• Php - form post
    8 replies, posted
echo "<td><input type = text value = " . $row[Location] . " name = Location size= 30 maxlength=10 /></td>"; How can I make php know that the name of the input type is Location, if I use quotations it messes up the echo.. I'm trying to do an update query and $_POST[Location] is set to NULL so I need to figure out the problem :S
[CODE]echo "<td><input type = \"text\" value = \"" . $row[Location] . "\" name = \"Location\" size=\"30\" maxlength=10 /></td>"; [/CODE] Use backslashes, or you could use colons within the echo, have fun! [editline]16th October 2010[/editline] also, put a \n after your </td> so it renders line breaks when you view the page source.
[code]$tLocation = htmlspecialchars($row['Location']); echo "<td><input type='text' value='$tLocation' name='Location' size='30' maxlength='10' /></td>";[/code] [editline]16th October 2010[/editline] I recommend you read something about php/html, your code is so fucked and broken, I have no idea how it even works.
[QUOTE=Erp;25447995]I recommend you read something about php/html, your code is so fucked and broken, I have no idea how it even works.[/QUOTE] You've got to be kidding, you don't need to have the quote marks there for it to work. It's just for easier reading.
I really hope you don't work freelance or for anyone, for that matter. [url]http://www.w3schools.com/html/html_forms.asp[/url] [url]http://php.net/manual/en/function.array.php[/url] Take a look at those.
It's personal preference, nothing else.
use single quotes, that's how I role.
roll*
Thanks for the help :)
Sorry, you need to Log In to post a reply to this thread.