Tuesday, April 20, 2010

play with source code

as we know when we run php script then it shows us html page after debugging .
Well we can see actual code also with a single php function.

here is an example . Check it out this simple script.


<?php

if ( isset( $_POST['file'] ) )

show_source( $_POST['file'] ) or print "can not be open \"$file\"";

?>

<html>

<head>

</head>

<body>

<form action="" method="post" enctype="multipart/form-data">


Enter file name:

<input type="text" name="file" value="<?php print $file; ?>">

<input type="submit" name="Submit" value="Submit">

</form>


</body>

</html>

1 comment: