blueman378 Posted September 28, 2007 Share Posted September 28, 2007 ok i am trying to declare this variable: $owner = "$_SESSION['reguname']"; but it in itself is causing problems can anyone tell me why? th error is faultCode0faultStringParse error:syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/vol2/byethost13.com/b13_1013561/mydoodle.byethost13.com/htdocs/register.php on line 47 it is part of the code that does this : /**make the user folder*/ mkdir ("/home/vol2/byethost13.com/b13_1013561/mydoodle.byethost13.com/htdocs/users/".$_SESSION['reguname'], 0777); echo "Folder ".$_SESSION['reguname']." created \n"; /** make the user page*/ fopen ("/home/vol2/byethost13.com/b13_1013561/mydoodle.byethost13.com/htdocs/users/".$_SESSION['reguname']."/index.php", 'w', 0777); echo "file created \n"; /** write to the file */ $your_data = "<?php $owner = "$_SESSION['reguname']"; include('../../userindex.php'); ?>"; // Open the file and erase the contents if any $fp = fopen("/home/vol2/byethost13.com/b13_1013561/mydoodle.byethost13.com/htdocs/users/".$_SESSION['reguname']."/index.php", "w"); // Write the data to the file fwrite($fp, $your_data); // Close the file fclose($fp); echo "page code wrote \n"; $_SESSION['reguname'] is assigned its value earlier on. , once this problem is solved if i need it i will ask my other question. thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/71029-2-in-1-variabe-questions/ Share on other sites More sharing options...
L Posted September 28, 2007 Share Posted September 28, 2007 try this $owner = $_SESSION['reguname']; Quote Link to comment https://forums.phpfreaks.com/topic/71029-2-in-1-variabe-questions/#findComment-357128 Share on other sites More sharing options...
blueman378 Posted September 28, 2007 Author Share Posted September 28, 2007 thanks, but it still shows the exact same error Quote Link to comment https://forums.phpfreaks.com/topic/71029-2-in-1-variabe-questions/#findComment-357131 Share on other sites More sharing options...
blueman378 Posted September 28, 2007 Author Share Posted September 28, 2007 ok i got it to work now just had to play around with the quotes its: $your_data = '<?php $owner = $_SESSION["reguname"]; include("../../userindex.php"); ?>'; now my second question is it states : $owner = $_SESSION["reguname"]; now how would i go about making it so that rather than acctually writing that out, it writes out the value of $_SESSION["reguname"]? thanks Quote Link to comment https://forums.phpfreaks.com/topic/71029-2-in-1-variabe-questions/#findComment-357134 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.