Jump to content

Recommended Posts

hey guys, so here is what i'm trying to do.  i have 4 fields (noun1, noun2, noun3, verb1) for a person to fill out and what they put into these fields will be printed out at certain points throughout a quotation (basically, it's a madlib with quotes from the simpsons and futurama).  after the four fields, i allow them to select from a drop-down select menu with the options of bold, underlined, italics.  what i need done is that IF they select any of those, i need what is printed out from the fields to be printed out with HTML tag formats (<b><u><i>).

 

if you need more info, just let me know.  any help would be very appreciated.

Link to comment
https://forums.phpfreaks.com/topic/50412-function-to-add-html-tags-to-text/
Share on other sites

<?php

if (isset($_POST['italics'])) 
     $output = "<i>" . $output . "</i>";
if (isset($_POST['bold']))
     $output = "<b>" . $output . "</b>";
if (isset($_POST['underline']))
     $output = "<u>" . $output . "</u>";


?>

 

One way to do it.

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.