PHP help, make include() defalut?

James S.

New member
can u make a deafult setting with include() as opposed to a just one var?
example:
$myfile=$_POST['myfile'];
include("$myfile");
how could i make a deafault, incase if $myfile hasn't been set to avoid error messages?
thanks to all!
here is my code.
the program opens up the code, not the file?

<html>
<head></head>
<body>
<h2>Get er done</h2>
<?php
///by James Lat
if (!isset($_POST['submit'])){
?>
<form action = "<?php echo $SERVER['PHP_SELF']; ?>" method="post">
Load you file: <input name="myfile" size="10">
<input type="submit" name="submit" value="Load">
</form>
<?php
}
?>
<form method="post">
<textarea cols="70" rows="20" name="myfile">
<?php
$myfile=$_POST['myfile'];
include("$myfile");
?>
</textarea>
</form>
</body>
</html>

thansk again:)
 
Back
Top