Copy link to clipboard
Copied
Hi
1) Please can somebody tell me the best way to make paragraphs in a dynamic website. ie. If I paste a certain amount of text directly into a cell in a table of a database then the paragraphs will be removed and the text will become one big block because there are no paragraph tags in the written text. So how do I add a bunch of written text without having to manually add paragraph tags? Do I need to make a form first in php which will add paragraph tags dynamically or is there a different way?
2) Also can somebody please help with the idea of images in a dynamic site. Currently, for a particular record, I type the name of an image (which is stored in my images folder) into the 'image' field (which is just a text field) in my mySQL database. The php code adds this name to the image tag on my website which then creates a full link to the image in the images folder. My question is: Is this a good way to go about doing this? Currently I do this manually as the site is small but what would be a better method? Should I create a form where I upload an image to the images folder whilst simultaneously taking the image name and adding it into the 'image' field in my database table?
3) On a website like Wikipedia, where the content is all stored in a tables of databases, the URLS of the pages are still very regular and standard (if you understand what I am trying to say) whereas in my website to display different data I would append a value or ID to the URL and then run queries to take information from the database to populate a template page. Is this a fine way of doing this? How would I get a website where every pages seems to possess it's own name or identity but still be dynamic? If one wanted to add a new page to the website then would one just use a form to create a new document with a particular name, which uses a particular template (/includes), as well as creates a record in the database - after the creater adds information and confirms then a new webpage would be created as well as a record in the database? Or is this all done a very different way?
Hopefully someone can help clear this up for me.
Thanks for your time.
Chris
Copy link to clipboard
Copied
1) If you are pasting text from another application, then newline or carriage return characters will be embedded in the text. But html collapses all whitespace to a single character, so you need to convert these to <br> or <p>. If you are using PHP, then look into using the nl2br() function.
2) That depends on the volume. You need to evaluate how much time it takes you to manually add the images, vs the time it will take you to develop a more automated solution. An experienced programmer could develop the solution in a few hours or less.
Copy link to clipboard
Copied
thanks for your answer! very helpful. chris
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more