webznz Posted February 14, 2010 Share Posted February 14, 2010 I have been trying to find out how to store html code into a mysql table then later use it on another page. I have a form where the user can input products lets say for a car. one of the fields is for embedded Picasa slide show code. here is the form for inserting: <!-- controll panel start here --> <form method="post" action="php/update.php"> Item Type:</br> <input type="text" name="Name" size="25" /></br></br> Modle:</br> <input type="text" name="ModelName" size="25" /></br></br> Description:</br> <textarea rows="10" cols="20" wrap="physical" name="Description"> </textarea></br> Slideshow:</br> <textarea rows="10" cols="20" wrap="physical" name="SlideShow"> </textarea></br> Price:</br> <input type="text" name="Price" size="25" /></br></br> <input type="submit" value="Update Database" /> </form> <!--controllpanel links start here --> once update database is clicked the information in the text fields are then sent to update.php which is here: <?php $Name =$_POST['Name']; $ModelName =$_POST['ModelName']; $Description =$_POST['Description']; $SlideShow =$_POST['SlideShow']; $Price =$_POST['Price']; mysql_connect ("localhost", "root", "onlyiknow") or die ('Error: ' . mysql_error()); mysql_select_db ("mtsproducts"); $query="INSERT products (Name, ModelName, Description, SlideShow, Price)VALUES ('".$Name."', '".$ModelName."', '".$Description."', '".$SlideShow."', '".$Price."')"; mysql_query($query) or die ('Error updating database'); echo "1 entry entered" .$Name. " " .$ModelName. " " .$Description. " " . htmlspecialchars($SlideShow) . " " .$Price ; ?> The questions I have are - Am i storing the embedded code correctly into the mysql SlideShow column? - How do i later use/call this code so it shows my picasa slideshow on a different page? any suggestions would be much appreciated. Link to comment https://forums.phpfreaks.com/topic/192020-how-to-store-html-code-into-mysql-table-then-use-it/ Share on other sites More sharing options...
webznz Posted February 14, 2010 Author Share Posted February 14, 2010 I realize i named this thread a stupid name, it should be I need help, or how do you? etc etc.. sounds like im telling people how to do it when i dont actually know myself. Is there a way to edit the thread? i have looked everywhere. Link to comment https://forums.phpfreaks.com/topic/192020-how-to-store-html-code-into-mysql-table-then-use-it/#findComment-1012081 Share on other sites More sharing options...
jonnypixel Posted February 15, 2010 Share Posted February 15, 2010 Hi, im just a begginer... but wouldnt you echo the $SlideShow on a new page? probably wrap a div around it as well... i mean this as an example; <div> <?php echo $SlideShow ; ?> </div> Link to comment https://forums.phpfreaks.com/topic/192020-how-to-store-html-code-into-mysql-table-then-use-it/#findComment-1012419 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.