FRIHOST • FORUMS • SEARCH • FAQ • TOS • BLOGS • COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


uncoded code ! :P





salman_500
hey,

i well its me again.... i may be the most annoying person on the forums....but i really wana know new stuff Razz

so this time its somthing new....

well you see i got this tuts section at my site... and i wana display code in it.... so can eny1 tell me how to create a box of code with colors in like...like they have it on the official php.net site......

thnx ! Razz
hexkid
salman_500 wrote:
i got this tuts section at my site... and i wana display code in it.... so can eny1 tell me how to create a box of code with colors in like...like they have it on the official php.net site......


highlight_file() or highlight_string()
salman_500
hexkid wrote:
salman_500 wrote:
i got this tuts section at my site... and i wana display code in it.... so can eny1 tell me how to create a box of code with colors in like...like they have it on the official php.net site......


highlight_file() or highlight_string()


thnx !

ill make use of this :

Code:
<?php highlight_string('<?php echo "somthing here"; ?>


Very Happy

but i wanted to know.... you see i wana make this give a look like bb code... so how can do so..... just like you get while making a post here... with options of bold, italics, urls, images, etc...

thnx !

thnx ! Very Happy
hexkid
salman_500 wrote:
i wana make this give a look like bb code... so how can do so
Do a google search and your answers shall be revealed Smile

I hate BBCode!
For users who don't know HTML or BBCode what's the difference between telling them to type "<b>xxx</b>" or "[b]xxx[/b]" to get "xxx" in bold?
TomS
It's a security issue. If a user can write <b> , he could write any htmltag he knows. such as <script type="javascript"> or <iframe> or something like that to include foreign code. It extrame cases he even can write phptags.
So you say the user can write "[b]boldtext[\b]" but he can't write "[script=javasript.js]" or anything like this.
hexkid
TomS wrote:
It's a security issue.
I understand that, but what's so different, in a programming point of view, about validating <a>, <b>, <script>, <table>, ... rather than [url], [b], [script], [table]?

The original PHP BB coders (or whoever created the [...] syntax) had the idea to use [ and ] instead of < and > because they weren't able to cope with user input, or because they wanted to create a new "language"? Either way, I hate BBCode!
salman_500
hexkid wrote:
TomS wrote:
It's a security issue.
I understand that, but what's so different, in a programming point of view, about validating <a>, <b>, <script>, <table>, ... rather than [url], [b], [script], [table]?

The original PHP BB coders (or whoever created the [...] syntax) had the idea to use [ and ] instead of < and > because they weren't able to cope with user input, or because they wanted to create a new "language"? Either way, I hate BBCode!


i think bbcode makes your site look more professional... you see phpbb has built up a reputation of it... and if some2 finds it on a non-phpbb site...they might feel like... " ohh this guy'z got bbcode.....hes good !" Razz

i just like the sound of it... bbcode ! Razz
kv
Check the following site. It has code to display php source.

http://uk.php.net/source.php?url=/source.php
rfwrangler
Here is a tutorial on BBcodes and Smilies and how to parse them with PHP.

http://www.phpfreaks.com/tutorials/141/0.php

This should help you I am using this tutorial for a site that I am working on.
the zephyrus
If you use < and >, then you have to check every instance of them, because if you're not careful, the user could inject any arbitrary HTML tags if any of them are un-escaped. With [ and ], you only need to parse out specific tags, every other [ and ] can't really do you harm. I mean, yes, you could leave in all the <b> and <i> and <u> tags and escape the rest, but that's more work.
Related topics
[PhP] News Posting Tutorial (code, actually ^^')
Shutdown Xp Using Your Keyboard! NOt CAD!
Join The “flock”: Another Browser Out To Beat Firefox &
ello
Dreamweaver
La Musique !
Web designing?
Input on my website
my new site directory
Silly anti-social behaviour
What do you prefer? Myspace or Facebook?
javascript: jump field after max length
Waar komt jouw geld vandaan??
[JS] pop up slider.
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.