Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   How do i post code in replies? (https://www.warriorforum.com/programming/375608-how-do-i-post-code-replies.html)

ussher 4th May 2011 09:11 PM

How do i post code in replies?
 
If i post some php code in the starter thread it comes out like this:


PHP Code:

<?php
$fruits 
= array(
 
'apple',
 
'orange',
 
'pear'
);

foreach(
$fruits as $fruit){
print 
"the fruit is: $fruit";
}

but if i do the same thing in a reply all the variables that are prefixed with $ get stripped out.

How do i post code in replies in the warrior forum?

ussher 4th May 2011 09:12 PM

Re: How do i post code in replies?
 
same thing in a reply:

PHP Code:

<?php
 
= array(
 
'apple',
 
'orange',
 
'pear'
);

foreach( as ){
print 
"the fruit is: ";
}


Nail Yener 5th May 2011 12:08 AM

Re: How do i post code in replies?
 
I gave up posting PHP codes on this forum a while ago. It doesn't work as it should and I don't know why. I contacted support but I couldn't find a solution.

ussher 5th May 2011 12:46 AM

Re: How do i post code in replies?
 
makes it a _lot_ harder to be helpful, especially in the programming section. :(

Nail Yener 5th May 2011 12:52 AM

Re: How do i post code in replies?
 
Quote:

Originally Posted by ussher (Post 3828303)
makes it a _lot_ harder to be helpful, especially in the programming section. :(

My solution to that is to put the code into a simple text file and upload it to my personal website and give the link in the post where I want to mention the code.

ussher 5th May 2011 03:37 AM

Re: How do i post code in replies?
 
That is very generous of you. I think ill use the IRC common method of throwing code into a pastebin like:

Pastebin.com - #1 paste tool since 2002!

test to see if it works:
[PHP] does this work for the warrior forum? - Pastebin.com

Nail Yener 5th May 2011 03:41 AM

Re: How do i post code in replies?
 
Quote:

Originally Posted by ussher (Post 3828815)
That is very generous of you. I think ill use the IRC common method of throwing code into a pastebin like:

Pastebin.com - #1 paste tool since 2002!

test to see if it works:
[PHP] does this work for the warrior forum? - Pastebin.com

Yes, I know about that site and the code works just fine, but personally, I wouldn't depend on a third party site for this case as you wouldn't know when they will come and go and change their linking structure, etc.

ussher 5th May 2011 04:08 AM

Re: How do i post code in replies?
 
Agreed. The best solution would be to paste it into here. but for whatever reason that doesn't seam to be an option.

Take a look at this thread to see my lame attempt to try to get the code into this forum:
http://www.warriorforum.com/programm...eal-links.html


All times are GMT -6. The time now is 03:34 AM.