0 Users appreciate this thread.
GuitarBoy (2014-06-30 14:38:11)Yeah. PHP's absolute paths are pretty silly, but understandable since you're managing not just a site but an entire webserver.
For x10Hosting, I ALWAYS use absolute paths starting from my home directory.
Ex. /home/cpanelUsername/public_html/
^THAT is the PHP equivalent of HTML's "/".
http://m.ajango.org - Ajango
New social networking website coming this year! Check for updates frequently!
Ajango Forum Thread
New social networking website coming this year! Check for updates frequently!
Ajango Forum Thread
CoolApps (2014-07-05 15:59:26)You can use $_SERVER['DOCUMENT_ROOT'] with the include() function to be able to access from the root of the webserver directory.
BTW Specs, if the PHP code is closed, you don't need to reopen it and then close it again.
What I mean is this:
<?php
echo 'Marmite';
?>
<?php
echo ' is';
?>
<?php
echo ' terrible.';
?>
Should be this:
<?php
echo 'Marmite is terrible.';
?>
Or:
<?php
echo 'Marmite '.'is '.'terrible.';
?>
Basically, don't put the unnecessary lines of code in.
2014-07-05 23:13:48
Newer account: NodePoint
Log in to submit a comment
Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)
New registered users today: 7
Newest registered user: ElegantVulpes
even more fun
[code=*php]<?php
// usermenu.php
$usermenu = function(){
if($islogged == true){
return "html shet for logged-in users";
} else {
return "html shet for guests, probably a login form and a link to a sign-up page";
};
};
?>[/code]
then on every page u want ur user menu
[code=*php]
<?php
include('/usermenu.php'
?>
<?php echo $usermenu; ?>
[/code]