Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: On register create new directory and copy files

  1. #11
    Join Date
    Oct 2006
    Posts
    183
    Thanks
    0
    Thanked 11 Times in 11 Posts

    Default

    Parse error: parse error, unexpected '=' in /homepages/37/d91075885/htdocs/domain/subdomain/file.php on line 2

    /homepages/37/d91075885/htdocs/domain/subdomain/file.php would be it?

    I blocked out things wiht domain and subdomain because the domain is my last name and subdomain is my first name making my site firstname.lastname.us

  2. #12
    Join Date
    Oct 2006
    Posts
    183
    Thanks
    0
    Thanked 11 Times in 11 Posts

    Default

    no my subdomain is somehting my dad gave me solely for the purpose of my php testing, he had me make him a php script for his work and in return he gave me the subdomain for testing.

  3. #13
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Quote Originally Posted by motormichael12
    /homepages/37/d91075885/htdocs/domain/subdomain/
    That would be one of the directories. Is that directory the one that the new users will have their directory created, or is it the one that has the files to be copied? You will need to find both for the script to work.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  4. #14
    Join Date
    Oct 2006
    Posts
    183
    Thanks
    0
    Thanked 11 Times in 11 Posts

    Default

    /homepages/37/d91075885/htdocs/domain/subdomain

    once again marked out... but thats wiht the command you gave me.

    Thanks for all your help, if I have any more questions I will post them.

  5. #15
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Sounds like a plan.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  6. #16
    Join Date
    Oct 2006
    Posts
    183
    Thanks
    0
    Thanked 11 Times in 11 Posts

    Default

    I am oging to have question later, maybe oyu can answer it now possibly...

    First of all, what is the difference between include('file) and require('file)

    and if I set up a file to be included can I have like a variable before the include and have it work?

    like:
    PHP Code:
    $variable 'this here'
    include('file.txt')
    (or require) 
    then file.txt is just "$variable"

    will that make the text appear as "this here"?

  7. #17
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    I'm not sure I quite follow you one the variable part. As far as include and require, there is no difference except the way they handle errors. include produces a warning while require produces a Fatal Error.

    If you made a PHP code like this:

    PHP Code:
    <?php

    $variable 
    'this text';

    include(
    'file.txt');

    echo 
    '<br>'.$variable;

    /* if there is any text or php statements in the file.txt, it will echo that. Otherwise it will just add whatever is in it. */
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  8. #18
    Join Date
    Oct 2006
    Posts
    183
    Thanks
    0
    Thanked 11 Times in 11 Posts

    Default

    the variable part, can you define variables for text before the include, then anyhting in the included file will change?

    if oyu have

    $test = 'pie'
    require(file.txt)

    then file.txt data is set as "I like $test"

    will the outcome be "I like pie" or "I like $test", like iwll it use the variable even though the variable is in an included file and not the original file?

  9. #19
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    If you did that, then the .txt file would have to have php in it (so you would have to change the extensions from txt to php unless you have your server set up to parse txt as php [which is rare]) Otherwise it would only produce "I like $test". Look at the following example (taken from php.net)

    vars.php

    PHP Code:
    <?php

    $color 
    'green';
    $fruit 'apple';

    ?>
    test.php

    PHP Code:
    <?php

    echo "A $color $fruit"// will produce "A"

    include 'vars.php';

    echo 
    "A $color $fruit"// will produce "A green apple"

    ?>
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  10. #20
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Oh another way you could do it is like so:

    test.php

    PHP Code:
    <?php

    $test 
    "This is a test";

    include(
    'file.php');

    ?>
    file.php

    PHP Code:
    <?php

    echo 'I have written the following: '.$test;

    ?>
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •