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

Posts: 2,535
Location: Western Maryland
Trades: 0
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, 07:40 PM
aog
Skilled Talker

Posts: 62
Location: Norway, Bergen
Trades: 0
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, 08:32 PM
Republikin's Avatar
Defies a Status

Posts: 3,190
Trades: 3
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, 08:34 PM
aog
Skilled Talker

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

Posts: 2,535
Location: Western Maryland
Trades: 0
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, 08:47 PM
aog
Skilled Talker

Posts: 62
Location: Norway, Bergen
Trades: 0
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, 11:12 AM
scottfree's Avatar
Extreme Talker

Posts: 234
Location: Hamburg
Trades: 0
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 11:17 AM..
scottfree is offline
View Public Profile Visit scottfree's homepage!
 
Old 10-02-2004, 11:22 PM
vivekar's Avatar
Webmaster Talker

Posts: 549
Trades: 0
Is it possible to highligt ASP code also?

by using [asp] [/asp] tags
__________________
Note: Submit your website in Allthewebsites Directory and find Google PageRank of any URL.
vivekar is offline
View Public Profile Visit vivekar's homepage!
 
Old 10-02-2004, 11:47 PM
kisk's Avatar
Extreme Talker

Posts: 161
Location: skynet
Trades: 0
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-03-2004, 12:45 AM
Christopher's Avatar
Iced Cap

Posts: 3,113
Location: Toronto, Ontario
Trades: 0
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, 09:45 PM DIVs are the key
simptech's Avatar
Skilled Talker

Posts: 81
Location: Cape Coral, Florida, United States
Trades: 0
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, 09:46 PM
simptech's Avatar
Skilled Talker

Posts: 81
Location: Cape Coral, Florida, United States
Trades: 0
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, 07:44 PM
Novice Talker

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

Posts: 3
Trades: 0
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, 10:24 PM Re: How Do I Post My PHP, HTML or Other Code?
Christopher's Avatar
Iced Cap

Posts: 3,113
Location: Toronto, Ontario
Trades: 0
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 Search this Thread
Search this Thread:

Advanced Search

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

BB 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.15920 seconds with 13 queries