Forum Moderators: coopster
When users sign up to the site, they fill in a form with various info, this info is saved to the DB fine... There is an option for the user to edit their info, edit_widget.php
When I test it out, I am able to edit the first 10 fields of the form, submit the changes, and they save correctly.
<input name="widget" type="text" size="70" maxlength="500" value="<? echo $row['widget']?>" /> is an example that works properly...
But if I change either of the last 2 fields which are <textarea>'s It causes some type of error and no info saves, meaning users cannot edit any of their information, which is crucial for this site.
The text areas also display fine in my editing program, but in IE there is some white space before them, for unknown reasons..and in FireFox the textarea has no whitespace but it exceeds the pagecell a little bit...leading me to believe this is where the problem is...
<textarea name="story" cols="70" rows="4" wrap="virtual"> <? echo $row['story'];?></textarea> is an example of the text area's...
I'm aware that upon clicking submit, another php file runs and transfers that info into the db, I don't think that file is the problem since If I edit the first 10 fields it works fine...
So what could be a problem with this that causes an error and no data to be edited/saved? Is it on page? Is it within the database?
Perhaps I'm overlooking something very simple, but I am a total newbie php/mysql.
Any help is greatly appreciated..
How would I go about applying that function so regular text and whatever the user is gonna enter will also update?
Thanks so much
**update**
I tried this on one and it worked, I tried it on another and it doesn't update. None of the fields or text areas update when I change them ..
I can post the code that I received here, but I don't understand why it would work for one but not the other...
$firstname = addslashes( $_POST['firstname'] );
$lastname = addslashes( $_POST['lastname'] ); And so on. Now in your MySQL query you can use the variables $firstname and $lastname because they should be safe. This works in most cases but to be absolutely safe you should use the quote_smart() function example on the php.net site here [php.net ]
For the fields that still didn't work when you changed them to "hello" there is something else wrong with them. My advice is to find someone who knows PHP well and hire them to finish the job.
Can't say I've had good experience hiring people since this happend.
I just tried to enter some new entries and test it, and for some reason the editing works now...so It can't be the code...
It basically works on every user but not the #1 in the database, I can't figure out why...
Thanks again for your help.