Topic: More Php help needed

I am familiar with java and html so some things are simular so anyways im looking through index.php of punbb v1.1.5 and saw some code and i was wondering what they mean...

1. "\n"
2. "\n\t\t\t\t\t\t"
3. pun_htmlspecialchars

2

Re: More Php help needed

Items 1 and 2 format the output by putting the markup on new lines and indenting it with tabs (the fact that I answered this post will give Rickard a good laugh)

Re: More Php help needed

\n = newline
\t = tab
pun_htmlspecialchars is a function in punbb that turns possible html code into text e.g. < becomes <

Re: More Php help needed

newera70 wrote:

I am familiar with java and html so some things are simular so anyways im looking through index.php of punbb v1.1.5 and saw some code and i was wondering what they mean...

1. "\n"
2. "\n\t\t\t\t\t\t"

Hey, just for HTML output formatting. So you could remove them safely smile

[no signature]

Re: More Php help needed

you can but its not a good idea cos then you get huge lines in the html they are there to make the html readable

Re: More Php help needed

vnpenguin wrote:
newera70 wrote:

I am familiar with java and html so some things are simular so anyways im looking through index.php of punbb v1.1.5 and saw some code and i was wondering what they mean...

1. "\n"
2. "\n\t\t\t\t\t\t"

Hey, just for HTML output formatting. So you could remove them safely smile

I wasn't asking if it was safe to remove them I was just asking because im new to php and I am trying to make a website layout and a mod for my forum and i wanted to know what they did cuz there the only things i wasnt familiar with.... also is there anyone that knows a site with a list of php commands and a description of what they do? thank you Connorhd and Paul for taking the time to explain this....

Re: More Php help needed

www.php.net top right corner has every function, examples discussion its amazing wink

Re: More Php help needed

Connorhd wrote:

www.php.net top right corner has every function, examples discussion its amazing wink

Ya lol i found that right after i made the post.... I thought of idea to protect code but im not sure if it would work... heres what i was thinking could I convert everything to hex so when they click view source it would only be hex and they couldnt steal your code? i thought of this when i saw a post at php.net heres the post...

In an attempt to dodge spam bots I've seen people (including myself) hex encode their email addresses in "mailto" tags. This is the small chunk of code I wrote to automate the process: 

<?php 
function hex_encode ($email_address)    { 
       $encoded = bin2hex("$email_address"); 
       $encoded = chunk_split($encoded, 2, '%'); 
       $encoded = '%' . substr($encoded, 0, strlen($encoded) - 1); 
       return $encoded;    
} 
?> 

so for example: 
<a href="mailto:<?=hex_encode("pedram@redhive.com")?>">email me</a> 

would produce the following address: 
%70%65%64%72%61%6d%40%72%65%64%68%69%76%65%2e%63%6f%6d 

-pedram 

Re: More Php help needed

but then how would people email you? does it still work? and if it does then it wouldn't stop spambots would it...

10 (edited by newera70 2004-12-18 22:47)

Re: More Php help needed

i donno i never tried it thats not a post i made... anyways im not talking about the email thing thats not what i want it was just a example of what i mean by how if hex coding my html/php/javascript.... will it make code more secure from being ripped? or is it even possible to hex code all of it

Re: More Php help needed

php can't be ripped

Re: More Php help needed

oh yes i forgot about that but javscript and html can so if I hex that do you think that it will work?

Re: More Php help needed

why would you want to? and no it wouldn't work i'm pretty sure