|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
useing javascript to pharse text?
instead of useing php i want to use a javasctipt to take text thats in a mysql database thats called with php but the javascript will take
|
|
#2
|
|||
|
|||
|
RE: useing javascript to pharse text?
|
|
#3
|
|||
|
|||
|
RE: useing javascript to pharse text?
I'm not sure I understand.
You can use PHP to create javascript, than you can create HTML with that javascript (for instance using the document.write() method). But why not just use PHP to create the HTML? Javascript cannot communicate with a database since it's clientside. |
|
#4
|
|||
|
|||
|
RE: useing javascript to pharse text?
what i mean is say i have :d in a database i select it with php/mysql but then when i print the data it takes :d and returns a image so i dont have to store img tags in a database..
|
|
#5
|
|||
|
|||
|
RE: RE: useing javascript to pharse text?
Quote:
like a smiley-code parser? you can do that in PHP: $text = str_replace(':d', '<img src="smiley.gif" alt="" />', $text); |
|
#6
|
|||
|
|||
|
RE: useing javascript to pharse text?
i have this code but on insert it fails and i include it on the veiw it still doesnt work...
ive been trying with this code for about 2 weeks now... http://powerclan.net/azura/apforums/bbcodes.phps |
|
#7
|
|||
|
|||
|
RE: useing javascript to pharse text?
You don't want to include this code before your insert, because you will never be able to parse it back to the original UBB codes when you want to edit a message.
You need to insert this before you echo the message to your HTML. This code is assuming your databasefield is called 'msg' and that you do a $list = mysql_fetch_object to get the message contents from your database. To be quite honest, this isn't the best UBB code parser I have seen sofar, there are better ones out there, and even I have written some better expressions to handle certain tags. You may want to built it up step by step, starting with one UBB code and trying if it works before you insert the whole bunch. Put your error_level to E_ALL to trap any possible errors. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > useing javascript to pharse text? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|