Jump to content

[SOLVED] Multiple Textareas into one mysql prep splitted by an "enter"


Rub

Recommended Posts

I don't know how I do this..

So.. I got 3 textarea's for the content of the post

How do I get these 3 textarea's into 1 output for the database => content?

 

This is what I have been trying.. What is the right way to do it?

$title = mysql_prep($_POST['title']);
$contentArray = array("$_POST['textarea2']", "$_POST['textarea3']", "$_POST['textarea4']");
$contentEnter = join("/n", $contentArray);
$content = mysql_prep($contentEnter);

$query = "INSERT INTO posts (title, content) VALUES ('{$title}', '{$content}')"

Only require 1 line. Make sure that you have validated that there is input in each of the textareas prior.

<?php
$content = implode("\r\n",array($_POST['textarea2'], $_POST['textarea3'], $_POST['textarea4']));
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.