Closed Thread
How Do I Post My PHP, HTML or Other Code?
Old 07-10-2004, 11:32 PM How Do I Post My PHP, HTML or Other Code?
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
PHP forum members,

It is very common for users having problems with scripts to submit questions related to a script or code they are working on. If you would like to submit your code, use these tags and your code will appear in a colored box and, in the case of PHP, parse it and color code the different structures of your script.

For PHP code, enclose your code in [php ] and [/php ] tags (minus the spaces).

PHP Code:
<?php
$message 
"It'll look absolutely great and be parsed.";
?>
For HTML markup, enclose your segment in [html ] and [/html ] tags (minus the spaces).

HTML Code:
<html>
<head>
    <title>WT Rocks!</title>
</head>
<body>
    <h1>I really love eating chicken!</h1>
</body>
</html>
For all other code, enclose your segment in [code ] and [/code ] tags (minus the spaces).

Code:
    var i = 9;

    for( n=0; n<9; n++ )
    {
        print "Performing some task " + n + " times.";
    }

I hope these instructions will help you post your code in a more attractive and readable manner and ultimately, to get your questions answered more completely.
__________________
—Kyrnt
Kyrnt is offline
View Public Profile Visit Kyrnt's homepage!
 
When You Register, These Ads Go Away!
Old 07-14-2004, 06:40 PM
aog
Skilled Talker

Posts: 62
Location: Norway, Bergen
It is possible for you to make the "windows" that shows the codes auto with or something?
It realy anoys me that I have to scroll from side to side.
aog is offline
View Public Profile
 
Old 07-14-2004, 07:32 PM
Republikin's Avatar
Super Moderator

Posts: 3,191
The scrolling helps to not break the page design. This way the page always stays looking like its supposed and you won't have to scroll the whole page to view not just the code but peoples responses.
Republikin is offline
View Public Profile
 
Old 07-14-2004, 07:34 PM
aog
Skilled Talker

Posts: 62
Location: Norway, Bergen
Ok.
I can agree to that, but perhaps make the text box wider?
aog is offline
View Public Profile
 
Old 07-14-2004, 07:40 PM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
aog,

I am not aware of how to do that -- and you're right, it is a bit annoying -- but it's better than trying to read pasted code which sometimes has comments sprinkled in, etc.

For the complete authority on vB Code (as it is called), see this link:

http://www.webmaster-talk.com/misc.php?do=bbcode

Lots of good information there...
__________________
—Kyrnt
Kyrnt is offline
View Public Profile Visit Kyrnt's homepage!
 
Old 07-14-2004, 07:47 PM
aog
Skilled Talker

Posts: 62
Location: Norway, Bergen
Nice link

Well..
If it can't be done, then it can't be done.
I can live with it as it is, but it whould be cool if it could be fixed.
aog is offline
View Public Profile
 
Old 09-09-2004, 10:12 AM
scottfree's Avatar
Extreme Talker

Posts: 234
Location: Hamburg
I got a really cool little prog which parses the code on the clipboard to add syntax highlighting and then the code just needs to be pasted and Voila! Syntax highlighting.
Here is a little example.

EDIT: Sorry, doesn´t seem to work on this Bulletin, strange because it works at JavaBotique.
Anyway, sorry for the waste of time.
__________________
I think, therefore I am..... I think.

Last edited by scottfree : 09-09-2004 at 10:17 AM.
scottfree is offline
View Public Profile Visit scottfree's homepage!
 
Old 10-02-2004, 10:22 PM
vivekar's Avatar
Webmaster Talker

Posts: 539
Is it possible to highligt ASP code also?

by using [asp] [/asp] tags
__________________
| Submit URL at All the Websites Directory
| Get Certified in Web Design
vivekar is offline
View Public Profile Visit vivekar's homepage!
 
Old 10-02-2004, 10:47 PM
kisk's Avatar
Extreme Talker

Posts: 161
Location: skynet
I know there's a mod/addon out there that will do it as I've seen vbulletin boards out there with [asp] tags ... have yet to find the source tho
kisk is offline
View Public Profile Visit kisk's homepage!
 
Old 10-02-2004, 11:45 PM
Christopher's Avatar
Iced Cap

Latest Blog Post:
PHP and Unicode with UTF-8
Posts: 3,111
Location: Toronto, Ontario
For PHP, vB uses PHP's built in PHP syntax highlighter (highlight_string()). So it's harder to highlight other languages. The most basic and easiest way we could do things is just highlight the text (ie. keywords, etc) like the HTML tag does. I'll write up a mod if I've got time one of these days.
Christopher is offline
View Public Profile Visit Christopher's homepage!
 
Old 03-17-2005, 08:45 PM DIVs are the key
simptech's Avatar
Skilled Talker

Posts: 81
Location: Cape Coral, Florida, United States
Quote:
Originally Posted by aog
It is possible for you to make the "windows" that shows the codes auto with or something?
It realy anoys me that I have to scroll from side to side.
<style type="text/css" media="screen">
<!--
div.codebox {
overflow: auto;
border: 1px solid #cccccc;
background-color: #ffffff;
width: 100%;
height: 300px;
}
//-->
</style>

<div class="codebox">
Your Code Goes Here...
</div>

Pretty handy when you have limited room
__________________
PHPScripts4Free.com
FREE PHP scripts for your website!
simptech is offline
View Public Profile Visit simptech's homepage!
 
Old 03-17-2005, 08:46 PM
simptech's Avatar
Skilled Talker

Posts: 81
Location: Cape Coral, Florida, United States
Apparently I misread the question. Please ignore my previous post
__________________
PHPScripts4Free.com
FREE PHP scripts for your website!
simptech is offline
View Public Profile Visit simptech's homepage!
 
Old 06-20-2005, 06:44 PM
Novice Talker

Posts: 9
Location: Moscow, Russia
How i can post numeric code character entities?
PiterZ is offline
View Public Profile Visit PiterZ's homepage!
 
Old 04-14-2006, 11:00 AM Re: How Do I Post My PHP, HTML or Other Code?
Junior Talker

Posts: 3
Is there a forum for beginners? I want really basic stuff please.
__________________
---- Earn $1,000 Per Day! ----
ricenoodle is offline
View Public Profile
 
Old 04-14-2006, 09:24 PM Re: How Do I Post My PHP, HTML or Other Code?
Christopher's Avatar
Iced Cap

Latest Blog Post:
PHP and Unicode with UTF-8
Posts: 3,111
Location: Toronto, Ontario
ricenoodle, this forum can be used for anything: beginners or advanced.
Christopher is offline
View Public Profile Visit Christopher's homepage!
 
Closed Thread     « Reply to How Do I Post My PHP, HTML or Other Code?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.17838 seconds with 12 queries