Need basic help using PHP.
Posted: Mon Dec 18, 2006 6:32 pm
feyd | Please use
it calls for index.txt, but it will only call for that specific file, i dont know how to make it detect whats in the browser.
I'm guessing you'd have to put in the parenthesis of the pathinfo the function, but im not sure how to do that. Any help is greatly appreciated.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I am fairly new to PHP. I am taking a Java course, and alot of PHP seems similar to Java.
I would like to make a include command which includes the name of the file at the end of the page, for example
if the user goes to index.php?goto=downloads.php
it calls for downloads.php.
So far i have this much:Code: Select all
<?php
$path_parts = pathinfo('/www/htdocs/index.txt');
echo $path_parts['dirname'], "\n";
echo $path_parts['basename'], "\n";
echo $path_parts['extension'], "\n";
echo $path_parts['filename'], "\n"; // since PHP 5.2.0
?>
<?php include($path_parts['basename'])?>I'm guessing you'd have to put in the parenthesis of the pathinfo the function, but im not sure how to do that. Any help is greatly appreciated.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]