Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Convert Text From Database For HTML


I'm pulling text from a database (MySQL) and I'm using the nl2br () function to convert the line breaks

DESCRIPTION="<?php echo nl2br($row_rsttheJobResults['description']); ?>"

This creates the following example

"A new line will be created soon < 'br' >
and here it is."

However the website that receives this cannot accept the characters < and >
So I want to convert this "< br >" into this "&lt;p&gt;"

Could anybody help me add to the nl2br () function to convert the < br > tags?

* the spaces between the < and br are there because they won't show in the message otherwise




View Complete Forum Thread with Replies

Related Forum Messages:
Storing Some Html Text In Database & Display Them
i have some text in HTML format ..i just want to store HTML text in database and retrive and display them as a HTML ...

View Replies !
Readout The Text From The Database Not Including The Html Formatting.
i have a database entry which is text formatted by html tags, on a page on my site i just want to be able to readout the text from the database not including the html formatting. is tere a simpler way of doing this instead of replacing every html tag with nothing.

View Replies !
Error Updating Html Text In A Mysql Database
I have a field in my database which needs to contain html code (for formatting of text, lists, and links). I can successfully add the data and view it on a webpage, but I cannot figure out how to edit it.

I have read about magicquotes, htmlspecialchars, addslashes, etc, and I have tried various combinations of these without any luck.

My code currently looks like this:

$id = $_POST['id'];
$myhtml = $_POST['myhtml'];

if (!get_magic_quotes_gpc()) {
$myhtml = addslashes($myhtml);
}

$query = ("UPDATE products SET myhtml="$myhtml" where id="$id"");
$result = mysql_query($query);

And the error is: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'myhtml="

Can anyone help?! or advise where I might be going wrong?

View Replies !
Convert Text
I have a text like this: "Thuy&#7873;n V Bi&#7875;n"
How to convert it to: "Thuyền V* Biển"

View Replies !
How To Convert The Md5 To Text.
i have information stored in my db that is md5. i have searched but havent been able to track it down yet, how to convert the md5 to text.

View Replies !
Convert .php Into .html
I have a pre-made php class that converts html into pdf documents. It can also convert php pages into pdf but it converts it before the php page executes. So in the resulting pdf you get all the php code. I was wondering is there a way i can let the php page execute and then let the pdf class convert it?

I know it will be hard to say that without looking at the php class. I was thinking would there be a way to execute the the php page, and have it made into an html page? So this way i can run the php class on the html page.

View Replies !
Convert PDF To HTML
I found loads of scripts to convert html and other formats to PDF but is there an easy way to do it vice versa?

View Replies !
Convert Html To Pdf
I'm too new in php. my boss wants me to convert a html page to pdf
form. anyone (here) can give me a tips how to do that?

View Replies !
Convert PHP/HTML To PDF
I need to convert PHP page or HTML page to PDF .
Google , and found some tools as follow ,

1) HTML_toPDF -- i have tried to use , however for our client website
, the PDF aligment is out and the fields are overlapping each other.
2) R&OS --- ok but did not convert html/php to pdf , thus the format
in pdf is different as the html/php format which our clients did not
like it.

Anyone have any ideas about different pdf tools? Have some sample code
is much appreaciated.

View Replies !
How To Convert Html To Doc
do you know how to convert html page into word doc file using php?

View Replies !
Convert To Html
I have the next code:

$mail = str_replace("á", "&aacute;", $mail);

This replace all characters á in corresponding html code. But How I can replace all html characters without put each by each replace sentence?

View Replies !
How To Convert Any Text To Unicode?
How can I convert any text to unicode please help me

View Replies !
How Can I Convert That Text To Date?
I'am trying to manipulate csv file using PHP, but my problem is that, one field there is date DD/DD/YYYY. My question is, how can I convert that text to date? So that I can insert it to the mysql database correctly.

View Replies !
Convert Text To A Percent
Im making a useless little program that takes 2 peoples names and tests their love compatibility as a percentage. I dont want a random number generator because I want to make it so when you enter the same name twice you get the same result.

Any ideas how to put the to strings together to get a varying percentage. I have tried a few things. One i converted both the strings to md5 and then did similar_text() to compare... however the percentages were always low... I want a mixed result.

View Replies !
How To Convert Ascii To Text
I replace some user input with their ascii equivalent so they display
on the webpage properly:

$entry = preg_replace ( "/'+/" , '&#39' , $entry);
$entry = preg_replace ( "/,+/" , '&#44' , $entry);

I then need to email the data, however in email the ascii code is
displayed, not the text.

Is there an easier way to convert the ascii back to the text without
another preg_replace?

View Replies !
Convert Text Field
I need to convert the charset of all the text fields in my db to utf-8. Can I do it via SQL alone or do I need some server side programming? A link to some article will suffice, altough I wouldn't mind a complete answer.

View Replies !
How To Convert Text From Latin -&gt; UTF-8
I had a table which contains text in the type of (latin1-swedish-ci),
and I want to change this type to UTF-8 Unicode.

How can I do this within the PHP script?

I tried to create new TABLE and insert values in the OLD table to the new one? but it is failed!

View Replies !
Simple Text Convert
Is there a simple way to get all weird charaters out of a string?

i.e. $string = "'¼¶ƒ";

In other words how do you get rid of ALL non-alphanumeric characters from a string?

View Replies !
Convert Image To Text
I am interested in developing an online utility that will enable users
to copy and past any image (or upload any image on the internet) to the
online utility, which will then convert the image to text.

The user may "convert image to text" and copy and paste the text
displayed into any word document, or send the text displayed to the
recipient's email address or can download the text file as a zipped
text file that will be presented to the user as a small zipped text
file icon. Code:

View Replies !
Html To Word Convert With Php
Html to word convert with php. Is there any one to help to convert a html php document to convert by doc(Word file).

View Replies !
Convert Html Pages To Pdf
i have this problem :convert html pages to pdf
is there any code available?
i want it to have support for images

i tried to use HTML2FPDF , FPDF but it did not work successfully!

View Replies !
Function To Convert HTML
I wrote this little function so that when I use eval() on HTML with PHP in it (eg: <font color="red"><?php print $name; ?></font>) it will convert the code into pure PHP so eval() works.

There are a couple of things to note:You CANNOT use the ' character in the PHP code (eg: $val['value']) as it will cause errors - use $val["value"] instead. Using a RegExp will probably fix this but I'm not yet that advanced . You can use ' in HTML code or in print(), echo() in your PHP code.It only works for <?php ?> tags. <? ?> will cause errors.
PHP Code:

View Replies !
Convert Html Table To Csv
i need to write a script to automatically convert some statistical data from an html table to csv there are two problems that i'm having, depending on the user or the options selected, some rows won't be shown, and some will so in the code, there are a heap of if statements to hide/show columns which makes it especially hard when we need to add new columns for the html view, something else i need to look into i guess.

i thought the easiest way, might be to use file_get_contents() to grab all the html code cos it's all laid out nicely already but then i thought about the colspans which would affect the comma seperatedness of the header columns (if you get that) does anyone know of a good, effective, scalable solution to this problem? Code:

View Replies !
Convert Word To HTML
How to convert MS Word 2003 file to HTML using php script?

View Replies !
Convert A Html Page To PDF
I need a script that will convert a html page to PDF. The html page is an Invoice which contains tables and images, which i would need tobe converted to the PDF document. All the scripts I've found, all require specific modules tobe installed on the server like html2ps, Curl, pdflib etc.

I havent yet found a script thats independent from having non-standard type modules installed. Maybe this is because of the resources to code such an application OR the amount of server resources it would take for php todo everything for the converting?

View Replies !
Convert An HTML Page Into A Jpg
i need to convert an HTML page into JPG, can u tell me how can i achieve this?

View Replies !
Convert Html Page To Pdf
Is it possible through php to have a create pdf button on the page on my site, and then it will create that entire page to a pdf document.

View Replies !
How To Convert The Whole Html Page Into Pdf Using Php
how to convert the whole html page into pdf using php?

View Replies !
Convert Output To HTML
Is it at all possible to convert PHP output in a .html page. Example:

# hallo.php

<?php
echo "Hello Word!";
?>

Output:

# hallo.html

Hello Word!

Any Idea?

View Replies !
Variable Holding Text Which I Want The Text To Have A $ In Front Of It To Convert It To A Variable.
I have a variable holding text which I want the text to have a $ in front of it to convert it to a variable.

View Replies !
Convert Word-to-Text On Linux
How can I read a Word document and convert it to text (just in memory
is fine) on a Linux machine where there is no Word installed?

View Replies !
Convert MS Word / Rtf / ... To Plain Text
i'm looking for standalone libraries that convert documents to plain text so i can let people edit the text in a textarea after uploading. One thing to notice is that i can not use COM because i can't configure the webserver.

Does anyone has interesting classes that are able to do this. I found a PHP class for ms word documents at http://obninsk.name/obninsk_doc/ but that doesn't work at all for my word documents.

View Replies !
Convert Php Data Into Text File?
I have a php file that gathers data from a specific website. I am then using that data (numbers) in a different application. The only problem is the html formatting. I just need the numbers, but I'm getting all the html tags with the data. Is there a way for me to have the php file output in to a seperate plain text file?

View Replies !
Convert Some Files From Html To Plaintext
I have many html files named like these:

c:dirfemo-black.html
c:dirloren-white.html
c:dirspark-white.html
c:dirkim-black.html
c:dirpaul-white.html

How can I convert only the files named "c:dir*-white.html" to
plaintext files named c:dir(original filename)-text.txt?
Is there a PHP module that does a good quality conversion HTML to...

View Replies !
How To Convert Html To Pdf And Print The Document
I need to know how to convert html to pdf and print the document with
different paper size?

View Replies !
Convert HTML Code To An Image
The function imagecreate() is limited to raw text. How can I convert
an string with HTML tags to an image?

For example, if I wanted to create a dynamic banner or web page heading
using style codes or even the inclusion of images with <img tags.

View Replies !
Convert Dynamic PHP Page To HTML?
I've got a PHP page on which I do mathematical calculations. I.e. there are a couple of input boxes and a button, that onClick calls a Javascript routine and outputs the results of the calculation in some other text boxes.

What I want to do now is to be able to firstly print the results by calling javascriptrint(), and also to save the page with the results and also email the page to a friend.

The easiest way would be if the page was a static HTML page. Then printing, saving and attaching it to an email are easy. So ideally, on the PHP page, I would click a button, that would pop up an HTML page, with the results of the PHP page. And then on that page I would have the option of saving as, printing or emailing.

View Replies !
Convert Php Site To Static Html?
I have a fully functioning php/MySQL application running and in production.

We would like the option to distribute the application and data therein via CD. Obviously the recipients wouldn't have php/apache/mysql installed in their system, nor would we want to do it for them. This is for a 1 week conference, and the CD would be in lieu of a printed book.

Is there something availabe that could crawl my application and archive the data as static pages?

View Replies !
Convert HTML Form Data To XML
I am working on a Google Map and have everything working the way I want. I just need a way to get data from a form to post into an XML file so I don't have to edit the XML everytime I want to update my list of locations for the map. Code:

View Replies !
Convert Word File To HTML
I have an idea that allow people upload MS Word file including Image and so on and then I will store it and view as HTML format; I just use function convert into HTML in MS Word but it's not good and sometime the HTML code display bad in web browser like FireFox
And I wanna instroduce it here and need ather ideas.

View Replies !
Inserting Adsense Code - Html Program That Automatically Coverts All My Text Files To Html Webpages?
I've purchased a text to html program that automatically coverts all my text files to html webpages within a template, but the only problem is how do I insert my adsense code into all 250 pages? I've seen articles regarding PHP includes for page templates, but I'm not sure how this would work inserting my code.

View Replies !
PHP HTML Email Doesn't Format The Text Using The Html Tags
I had a PHP script that sent an html email from a Flash form. It was all working on a Windows based server. Then my server was switched to a Linux based one. It now sends the email, but has a lot of random characters and doesn't format the text using the html tags. Code:

View Replies !
How Convert Http:// Text To Real Hyperlink?
I have some texts in MySQL databases. When I show this texts in webpages using PHP, I need to convert every ocurrence of

http://blablabla.com

to

<a href='http://blablabla.com'>http://blablabla.com</a>

, so my text will really became 'active'. The people who wrote the texts don't know HTML tags so I can't ask them to write explicity <a...> </a> commands. The problem is the same with text that contains the @ charactere, as

name@mailserver.com

. I have to change this to

<a href='mailto:name@mailserver.com'>name@mailserver.com</a>.

Please, I don't know how to use regular expression. I think It can make this replacemments very easy..

View Replies !
Convert Numerical To Text For Check Writing
Does anyone know of/have an open source class that will compose the text
version of a dollar amount? For instance, convert $525.62 to "Five hundred
twenty five and 62/100 dollars".

I'm trying to write a quick accounts payable app and I really do not want
to have to write this part from scratch!!

View Replies !
Convert PHP Output To Static HTML Files
I want to create a static HTML page for every single record of a MySQL database (to improve performance and search engine rankings as well). The approach should by like: open file showrec.php3?id=1234, read formatted html code into array and write the array into a file rec1234.html. Does anybody have a solution?

View Replies !
Convert HTML Entities To Unicode UCS2? What To Do?
Does anyone know how to convert HTML Entities into UCS2-String (Value).

For example: I need to convert Suowska 43 (value in mysql
database) to a unicode string with the specified polish character(s)
(Polish is just a example).

--- Currently i convert every usual ASCII-String by using the php
multibyte functions. This it how it looks like: ---

$string_ASCII = "test";
$string_UCS2 = mb_convert_encoding( $string_ASCII, 'UCS-2LE',
'ISO-8859-1');

View Replies !
Convert My Website Into Static Html Pages.
I made a website which is in php,mysql driven. I want to convert my website into static html pages..

View Replies !
Convert Html Table(or Array) To Image
Is there any easy way to make this convertion to be happend.

View Replies !
Convert Special HTML Characters On Include
All I need to do is include the file "menu.html" (the actual menu contents, exported from MS Word - a requirement) in the dailymenu.php template. However, the menu.html file has all sorts of special characters - due to the fact that french, spanish, and itialian food names contain special characters:

example: , , , , , , etc. etc.

so when I do a simple:

<?php include("includes/menu.html"); ?>

in the dailymenu.php file, the output is crapped up by the special characters not being converted.

Any way you know to include the menu.html file in dailymenu.php template and fix the special characters all at once?

View Replies !
Simple PHP Class To Convert A HTML File To PDF
I need a simple PHP class to convert a HTML file (with texts and images) to PDF. I'm using php4 and can't use php5 on my server.

View Replies !
Convert Special Characters But Not The Tags Of Html.
I have the follow code:

echo "<base target="_blank" /><font face="arial" size="2">
";
echo "<meta http-equiv=Content-Type content=text/html; charset=utf-8 />";
echo (htmlentities($NoteBook));

This code converts the special characters to format html. My problem is that the tags html (example <img src = "">) also are converted them and what I want only convert special characters but not the tags of html.

View Replies !
Regular Expression :: Convert HTML Into XHTML
I've been fiddling with it for ages now. To convert HTML into XHTML code, e.g. make <br> <br /> Code

$text = preg_replace('/(<img .*)("|'| )>/i','12 />',$text);

The problem It replaces some other tags too. For example I have:

<a href.....> but it changes it to <a href...... />

View Replies !

Copyright 2005-08 www.BigResource.com, All rights reserved