FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Need help with This ASAP!





Relentless
Hi, Can sombody help me recode this?

Code:
$username = "<?php include("../username.txt"); ?>";


Gives off the error:
Quote:
Parse error: syntax error, unexpected '.' in


I have also tried:
Code:
$username = "<?php include('../username.txt'); ?>";


Gives off no error but does not quote the username.txt


I will be logged into the forum untill the is resolved...

I am will to pay Frih$ for working result.


Advanced Thanks
Dan..
sonam
Code:
$username = include("../username.txt");


Sonam
Relentless
sonam wrote:
Code:
$username = include("../username.txt");


Sonam


Thanks i will try it out when I can upload it,

Server 2 has gone down again GRR

Do you know of any browsers or a way to instal php locally on my laptop?

I'm running XP SP2 if that helps...

Dan..
Relentless
Well it worked but displyied the wrong thing???
Here is my PHP

Code:
$username = include("../username.txt");

// Define the full path to your folder from root
$path = "/MYROOT/MYPHP/$username/FOLDER/";


I need the contents in username.txt to display where you see $username.

Instead when I view it, It prints "/MYROOT/MYPHP/1/FOLDER/"

Confused...

Dan...
sonam
I am not sure am I understand you. Can you give us more information what do you want to do. I have feeling how you are doing some unnecessary work. But, try this:

Code:
$username = file_get_contents("../username.txt"); 
$path = "/MYROOT/MYPHP/$username/FOLDER/";


Sonam
rvec
Relentless wrote:
sonam wrote:
Code:
$username = include("../username.txt");


Sonam


Thanks i will try it out when I can upload it,

Server 2 has gone down again GRR

Do you know of any browsers or a way to instal php locally on my laptop?

I'm running XP SP2 if that helps...

Dan..
Try to search for WAMPP in this forum.
Relentless
Ok It works thanks very much...

Do you want any Frih$?

-------------------------
sonam
No thanks. Have enought. Wink

Sonam
thnn
I personally perfer Xampp on windows. It provides a installer that installs everything for you, and custom pages to do security and other such things, plus a nice control panel.

http://www.apachefriends.org/en/xampp.html
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.