Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Hello, World!

Name: Anonymous 2010-07-19 15:08

[code]
<?php
$h = "h";
$e = "e";
$l = "l";
$o = "o";
$w = "w";
$r = "r";
$d = "d";

$helloworld = $h+$e+$l+$l+$o+$w+$o+$r+$l+$d;

print $helloworld;

Name: Anonymous 2010-07-19 15:09

[/code]

Name: Anonymous 2010-07-19 15:11

>>2
You forgot to close the PHP tag too.
Not like it would help.

Name: Anonymous 2010-07-19 15:17

?>

Name: Anonymous 2010-07-19 16:07

>>3
Explicitly closing the final PHP block is optional, and BEST PRACTICES advise against it.

Name: Anonymous 2010-07-19 17:27

>>3
I was in a rush when I made the thread. I thought it would be funny to make a really long hello world program.

Also, I was listening to RUSH.

Name: Anonymous 2010-07-19 17:45

>>5
Sweet, let's let any plebian write to the end of a file and have it appear as code instead of data.

Name: Anonymous 2010-07-19 18:16

>>5
It'd be great if I didn't have to terminate my C code with a curly bracket, too.

Name: Anonymous 2010-07-19 18:52

>>7
Ding! Ding! Ding! That's the PHP mission statement.

Name: Anonymous 2010-07-19 21:14

>>7
Like whether or not there's a closing tag is an issue when the intruder has arbitrary write access to a php file like that.

Name: Anonymous 2010-07-19 21:22

<?php

array_map(function($v) { global $$v; $$v = $v; }, str_split('Hello world!'));
echo "$H$e$l$l$o".${' '}."$w$o$r$l$d".${'!'};

Name: Anonymous 2010-07-19 21:31

>>10
What about RFI File Inclusion attacks?

Name: Anonymous 2010-07-19 21:41

>>12
What about them?

Name: Anonymous 2010-07-19 21:52

>>13
It's a way of inserting text into a PHP file without having write access to the file.

Name: Anonymous 2010-07-19 23:47

>>14
So what?

Look, for the record, even in the incredibly unlikely event that you're appending code to a php file before or during parsing, all you'd have to do is add "//<?php\n". Closing tags have no impact on security, period.

Don't change these.
Name: Email:
Entire Thread Thread List