Bold/Italic/Underline Buttons For Text Field.

How would I go about making buttons (much like the ones above where you type posts/replies on this or any other message board) that would insert HTML code for:<b>, <i>, <u> etc, wherever the user's cursor is at within the text field?...Is that even PHP? Or another web technology all together?


Regexp Text Bold Or Italic

What I'm trying to achieve: I run a forum, and want people to be able to make text bold or italic using a particular method which is to start the text to be formated with a bracket, and to end the text with a bracket then either i or b (i for italics, and b for bold) For example,

(this is some text)b
Is to be regexp'd to look like:
this is some text

It needs to be with the brackets than any other methods, as I am migrating data from a large system that uses this particular setup. What I've come up with so far is.

$dbRow->message = ereg_replace("[(]+.+[)]i","<i></i>", $dbRow->message);

This leaves in the brackets though, and also the control character (in this case, the i) at the end of the text. Also, the other problem is, that if you have a section of text to be italic, then of normal text, then more of italic, it just makes the whole lot italic.

View 3 Replies View Related

Draw Image With Bold/italic Text?

I need to draw image having text using gd library on basis of font selection. User has an option to make text bold/italic. I am using imagettftext to write text on the image. how can we draw having bold/italic text or is there a way to detect whether selected font supports bold/italic feature.

View 3 Replies View Related

Bold, Italics, Underline Str_replac'd Using The Same Char For Opening And Closing Tags

I want to write a _very_ simple text parser that would replace a
string like:

"This is text with /italics/, *bold* and _underline_."

and generate automatically something like this:

"This is text with <i>italics</i>, <b>bold</b> and <span

I've found a lot of code snippets explaining how to do BBCode, but
BBCode has different opening and closing pseudo-tags. In my example,
the opening and closing tags are the same (either /, * or _). So I
need something slightly more intelligent that would count the number
of /, * or _ tags, see if that number is even or odd and decide
accordingly if it must replace the char with an opening or closing
tag. (I hope my wording makes sense. It's very clear in my head :-D)

How would you implement that? I reckon it can't be hard, but I just
can't figure how to do it right now!

View 3 Replies View Related

Underline The Text Using Gd Library?

i am searching a long time that how to underline the text in gd libarary. i use unicode example but its not working good.

View 4 Replies View Related

Make The Text Underline Using GD Library?

Using GD library how to make the text underline.

I have used imagettftext ( resource $image, float $size, float $angle, int $x, int $y, int $color, string $fontfile, string $text ) this function for write text to the image. I could not make underline text on image.

View 3 Replies View Related

Regular Expression To Underline A Given Word In A Text...

With the sentence :

"Bordeaux est au bord de l'eau"

How to do to underline, for instance, the word "eau" ? without underlining
the substring of "Bordeaux" ?
I don't know how to isolate the word...

My current code :


but this underline "eau" in "Bordeaux" too and i don't want to !

View 6 Replies View Related

Email With Bold Text?

i tring to send email using following code:

PHP Code:

$to_email = '';
$headers =  "To: The Receiver <>
" .[code]....

Where i m wrong in first code. i want bold text in my email

View 10 Replies View Related

Bold Text In Textbox?

I have a text box for users to enter new text in.  The box also contains text that is determined by a variable that is created from a mysql query and some other added text.  I want to make a portion of the added text within the textbox bold.  How would I achieve this with php?

Code: [Select]

View 4 Replies View Related

Problem With Making A Text Bold

i have a some textual content in a field in my mysql database. say it is $row['text']

now i want to make all the occurances of a $keyword in $row['text'] as bold.

$res['text'] = str_replace($keyword, '<strong>'.$keyword.'</strong>', $res['text']);

it is working, but it is differentiating capital and small letters.

if the keyword is in small letters, it is not changing the same keyword in capital letters as bold.

how can i make all the occurances of $keyword in $row['text'] as bold irrespective of their case.

View 2 Replies View Related

Find A Word Within Text And Put It In Bold

i am making a search engine to search my site and the code is going well but i don't know how to find your search within the results and put it in bold (like google does). I use a thing called [URL] for getting the html of my website.

Code: [Select]<?php include('simple_html_dom.php'); ?>
$s = $_GET["s"];
if ($s == null) 
echo "you have not searched for anything";


View 6 Replies View Related

Unable To Get The Bold Search Text?

i have below code n it didnt work

$searchtext=explode(" ",$_POST['text']);

i dont get the bold search text?

View 1 Replies View Related

Auto Bold On Text Matching Keywords.

I enter my data in to the table but I don't include any html (of course). Well then now I am in pickle because I can not Bold the keywords. I want to automatically bold keywords.

View 7 Replies View Related

Remove Text That Is Bold In Content With Wordpress?

I am using the following code below to output content from a category, but the content has bold tags which in turn makes my entire sold bold. What would be easiest way to remove the bold text in my code?

<p><?php $content = get_the_content();
if (mb_strlen($content) > 700) {
$content = mb_substr($content, 0, 700);


View 2 Replies View Related

Print Prints Slowly For Bold Text?

i have page , in this page i have around 45 lines , the first 5 lines are document heading, and this document heading css style is just font-family-arial, font-weight bold , and heading inserted inside the td , no more style,problem is , this first 5 line print very dead slow, after 5the printer print the text very fastly, obviously the reset of the text are just fonr-weight:normel, Pleawse advise some tip/ideas to increase the printing fast ,

View 2 Replies View Related

Parse Text Between B(bold) Tag / Use Var_dump($tag) It Returns Array(0)?

i am trying to log into my hulkshare account, and then return my account information. The curl login is workfine but i dnt think my parsing is working because when i use var_dump($tag) it returns array(0) { }

I am trying to parse the points in my account and here is the code fro the table located between a bold tag < b>6302.00 downloads< /b>

<div id="content-wrap">
<div id="wrap-in">
<tr><td>You have collected:</td><td><b>6302.00 downloads</b></td><td><input type="button" class="btn2" value="Convert downloads" onclick="document.location='?op=convert_points'"></td></tr>
<tr><td>Used space:</td><td><b>354.0 of 200000 Mb</b></td></tr>
<tr><td>My published files link:</td><td colspan="2"><a href="" target="_blank"></a></td></tr>
<tr><td>My affiliate link:</td><td colspan="2"><a href=""></a><br><small>New user will get 10 downloads</small></td></tr>
$cookiefile = '/temp/cookies.txt';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, '');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'op=login&redirect=&login=XXXXXX&password=XXXXX');
curl_setopt($ch, CURLOPT_URL, '');
$contents = curl_exec($ch);
$dom = new DOMDocument();
$xml = simplexml_import_dom($dom);
$tag = $xml->xpath("/table/tbody/tr/tb/b");

View 1 Replies View Related

Check If A Text Field Has Been Altered Or Passing 2 Values Through Text Field?

I am trying to get something up where by:-> It dynamically displays input text fields that can be edited.> However I need the current id as well as the current value to display-> when a person submits the form, it updates all / or only each one that has been altered. Q:-> I need to use both the id and new value or old value when updating the database. How can this be done?Code below: of what i have attempted so far.

$sql5 = "SELECT * FROM $tableName";
foreach ($conn->query($sql5) as $row5) {

View 2 Replies View Related

GD Library - Underline

Using GD library how to make the text underline.

I have used imagettftext ( resource $image, float $size, float $angle, int $x, int $y, int $color, string $fontfile, string $text ) this function for write text to the image. I could not make underline text on image.

View 2 Replies View Related

Extract First 30 Characters Of One Text Field And Input Into The Post Title Hidden Field

my home page is an insert form where the user posts what they want to buy/sell. there are two fields in the db that i'm dealing with for this problem, one is the user's postint title and the other is the content they enter. i only have the user enter the content right off the bat, but they can always login and edit their post title whenever they want. can i extract the first 30 characters from the content and submit it into the post title hidden field when they initially fill out the form?

i've tried something like,
$title = $_POST['content'];
$title = substr($title, 0, 30);
... and then in my form...
<input type="hidden" value="<?php echo $title;?>

View 3 Replies View Related

Help? How To Create Next Buttons When Using A Flat Text Database

Ok, I know the code below does not work but I am wondering about the logic...

1 How do I just print 10 rows.
2 How do I get the buttons.

You get the Idea. Anyway, I would like to know if anyone has done this with text files. I always see mysql as examples but nothing using a flat text database.

$maxResults = 10;
$datafile = "sometextfile.txt";

$rows = @file($datafile);
for($size=0;$size<count($rows);$size++) {
$rows[$size] = chop($rows[$size]);
$coll = split("|",$rows[$size]);

// print something

if ($size > 0) {
$currPage = $size / $maxResults;
if ($currPage > 1)
print("<A HREF="test.php" >['prev']</A>");
for ($i = 0; $i < $size / $maxResults; $i++) {
if ($currPage == $i + 1)
printf("<A HREF="test.php"> </A> ",$i + 1);
printf("<A HREF="test.php"> </A> ",$i + 1);
if ($currPage < size / $maxResults)
print("<A HREF="test.php">['next']</A>);

View 5 Replies View Related

Create Text Boxes Along With Buttons In Webpage?

I am doing a project on php and sql and it involves posting of quetions by various persons and replying to those questions(which is a dicussion forum). Can i add text boxes for posting a question and displaying answers to those questions from a database.

View 1 Replies View Related

How Do I Underline My Search Results?

This is a PHP/MySQL question.

I have a search engine that finds matches of a word in artist names, and their album titles. How do I underline the word that is matched when I display the results? I've seen this on Yahoo! and was wondering how to do it.

View 3 Replies View Related

Replace Spaces In URL With Underline?

How can I replace spaces in URL with a underline(_)?

$query = mysql_query("SELECT * FROM users WHERE username = '$_GET[user]'");

But if a user has a space in her/his username I wanna replace the space with an underline. So the URL for profile.php?user=John Johnson would be profile.php?user=John_Johnson.

View 11 Replies View Related

Eclipse PDT Does Not Underline Syntax Errors And Code Completion

Ater installing Eclipse PDT on my Mac(snow leopard), I installed Remote System Explorer (RSE) from url.

Now the editor neither underline syntax errors, nor do the code completion. But the editor does color the code.

View 1 Replies View Related

Text After Space Character Cut Off In Input Text Field When Editing Form Back?

i have this edit form that allows user to edit data but the problems on the text box is that it deletes the rest of the data after the space from the first word i tried to increase the size of the varChars on mysql but did no work why it happens how can i stop from happening?? example if name elvis priesley when i try to edit it only comes elvis cuts off the other words after space this the form input

PHP Code:

<input type="text" name="name" id="name" class='text_box' value="<?php echo $_GET['name'];

View 3 Replies View Related

Get Form Field Value Then Use To "Stuff" URLs Behind Buttons?

On my PHP web page, I want to have an input field where the user can enter a web address. I want to do a quick validation to make sure it actually looks like a web address. If good, I want to append that web address to the URL behind some buttons the user can click.

For example, maybe I want to create something that lets the user enter a web address, then click buttons that send that address to the W3C CSS, HTML, and link-checking validators. Also, I can't have the page refresh between the input field entry and clicking the buttons; clicking the buttons needs to automatically pick up the value, stuff the URL, and redirect to the destination page.

View 4 Replies View Related

Quickly Adding Text To A Mysql Text Field That Is NOT Empty

Is there a way to insert text into a mysql text field that already has
text into it; without having first to extract the existing data and
append the new text to that string variable and then insert the new

Basically i'm looking for a way to do it with a single query not 2 (one
being a select to gather existing data).

View 6 Replies View Related

Rich Text Editor Which On Submit Updates The Field To Have The New Text

I have my content stored in a database. I need a rich text editor (so the user doesnt need to include HTML) so they can edit contact. So a rich text editor that displays whats in the current content field and can be edited so on submit it updates the field to have the new text. Get what i mean?

View 11 Replies View Related

Take Two Text Field Values And Add Together To Another Field?

<p>First Name <input type="text" name="first_name"> Last Name <input type="text" name="last_name"></p>
<input type="hidden" name="screen_name" value="first_name + last_name">

How do I take what was typed into first_name and last_name fields and add them together to the screen_name so when the field is submitted, it inputs the values appropriately for the screen_name field?I am looking for either a php or jQuery resolution.Would this do the trick?

<?php $screen_name = $_POST["first_name"]." ".$_POST["last_name"]; ?>
<input type="hidden" name="screen_name" value="<?php print $screen_name; ?>" />

View 3 Replies View Related

Enter Text Into A Text Field For Another Page?

I have page A text, that I wish to have entered into page B text fields. The usual procedure to transfer data between pages are sessions. But for argument sake I am denied the access of sessions how else am I able to automatically enter the text and submit the page it self?

View 3 Replies View Related

Text Returned From DB Gets Cutoff When Placed In A Text Field

I have a string that contains an apostrophe or a quotation mark, stored in a DB. I can retrieve the data, and display it properly (for editing) in a textarea, but when I try to put the string in a text field, it get's cut off right before the questionable character.

For example:
$string_in_database = "John's car."

 -displays correctly here <textarea><?php print $string_in_database ?></textarea> and displays this - John's car.

 -gets cutoff here <input type='text' value=''<?php print $string_in_database ?>' /> and displays this -  John

I've tried adding slashes and stripping slashes and I just can't figure out what I need to do.

View 3 Replies View Related

Copyrights 2005-15, All rights reserved