homepage Welcome to WebmasterWorld Guest from 67.202.56.112
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Accredited PayPal World Seller

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
changing textbox size in phpmyadmin
aijohn




msg:1264988
 8:44 pm on Sep 6, 2005 (gmt 0)

I'm using phpmyadmin to edit text in the database. My only problem is the small size of the text boxes on the edit page. Does anyone know what code needs to be changed to make them larger?

 

aijohn




msg:1264989
 8:48 pm on Sep 6, 2005 (gmt 0)

As an alternate solution, is anyone willing to share a simple php script to upload and/or update large fields?

jatar_k




msg:1264990
 8:52 pm on Sep 6, 2005 (gmt 0)

how big do they need to be?

aijohn




msg:1264991
 8:56 pm on Sep 6, 2005 (gmt 0)

text files are max 1000 words

5000 characters

jatar_k




msg:1264992
 9:00 pm on Sep 6, 2005 (gmt 0)

you could easily enough make a page that loads a given row into a textarea and then allows you to submit the updated content.

Like a mini CMS (Content Management Software)

aijohn




msg:1264993
 9:25 pm on Sep 6, 2005 (gmt 0)

here's where I get lost

$text="The boy said, "My dog's name is Spot."";

// I need addslashes somewhere but not sure where.
// Also will I need stripslashes before displaying on the page?

$query="UPDATE table2 SET pagetext='$text' WHERE uid='5'";
mysql_query($query);
echo "Record Updated";
mysql_close();

jatar_k




msg:1264994
 9:37 pm on Sep 6, 2005 (gmt 0)

well, as opposed to addslashes you should use mysql_real_escape_string and then stripslashes when you pull it out for editing.

UPDATE (assuming it's posted and the textarea name is newcontent)

$text = mysql_real_escape_string($_POST['newcontent']);
$query="UPDATE table2 SET pagetext='$text' WHERE uid='5'";
mysql_query($query);
echo "Record Updated";
mysql_close();

I would imagine you would have to load uid along with the text on the form and post it as a hidden field or something. You may want to look at nl2br maybe but I don't know if you will need that or not. If you are the only person using this then other measures in regards to security shouldn't be needed.

Looking at the varname 'pagetext' I wonder if you might just want to look into a premade CMS solution that will already allow all this.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved