Jump to content

HTML q tag doubt


Ignatius881

Recommended Posts

the way you have it now it will appear as.. "I am God" wrapped in quotes.. are you saying that you just want God to be in quotes..?

 

:(

 

Okay, the code that I wrote is this:

 

<textarea name="message" style="font-weight: bold; width: 570px; height: 250px;" cols="30%" rows="5"></textarea>

 

It's for a forum, and it uses many HTML tags. So, when an user writes something and I want to quote his text, I want the username to appear together with his quoted text, not only his quoted text.

Link to comment
Share on other sites

depending on whether you are storing this in a database.. you can add the username to the string before insertion.. perhaps something like..

 

$message = $_POST['message']; //grab the contents of your textarea.. assuming that your form method is post
$username = $_SESSION['username']; //however your store your usernames.. retrieve the correct username..
$message = "{$username}: $message"; //add username however you want
$message = mysql_real_escape_string($message); //sanitize data.. prepare for db insertion
$sql = "INSERT INTO table (message) VALUES ('$message')"; //replace with correct credentials..
$query = mysql_query($sql) or die(mysql_error()); //die() for debugging

 

then when you are ready to retrieve the message.. wrap it in <q>/q> tags..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.