Helpful Information
 
 
Category: Programming Languages
storing html in MySQL

hello,

sorry if this is described in the FM, but i have been looking...

does anyone store the html code in the MySQL database? i am trying to figure out a way to use his/her login information open up a personalized web page. in other words if jack logs in he sees jack's page, not sue's.

thanks.

You can but it's problemtic. Why not just store the URL of the page in the db?

Yeah.. i don't see why not? It's only text and chars you are entering.
Just make sure that you use the addslashes() function to add those slashes in there before you add it into the database otherwise mysql will give you problems.
Html codes has alot of " and ' that needs to be added slashes in front of it.

addslashes($html_code);

i hope that makes sense to you.... =)

scoobydoo

You sure can.
But are these pages all the same layout/categories/items etc, except that Johns page shows Johns header, johns bookmarks, johns other nice data?

In that case, you should create a table with all these data, and generate the pages with one script, and let it fill in all the user-specific data.

Much better, much more powerful, much http://www.devshed.com/Talk/Forums/cool.gifer!

------------------
--
...tiktak...tiktak...
--
...Tommyknockers, Knocking On Your Door...

hello eYe,

thanks for the input. this is where everyone seems to be pointing me.

this method also opens up a neat door: i can create a script for our customers to add a new user. if they get a new customer that they want to add, they can go into this form and add the info. in doing this they effectively create a "new" web page.

now if i can just figure out a way for them to ftp images to me via the admin script. any ideas?


thanks.

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by ted andersen:
Hello Ted,
is there a simple way to add the ability to ftp a file to me via the same script?
[/quote]
I've never used it, but PHP has some special tools to do this. Read the following part of the PHP-manual: http://www.php.net/manual/features.file-upload.php
I think that should do it.

Greetz,

EyE



------------------
--
...tiktak...tiktak...
--
...Tommyknockers, Knocking On Your Door...










privacy (GDPR)