SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Addict
    Join Date
    May 2004
    Location
    USA
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How would you do this?

    I'm giving away a website and I've finished writting the portion of coding that will allow the end user to upload it to their server from our site.

    I'm still sorta stuck on a way to let them customize the configuration pages though.

    In the config file we have things like:

    $pagename = "yourname"; ?>
    $googleid = 'yourpublisherid'; ?>

    Since all the files I give them will be on thier server I'll be directing them to custom.php or something like that.

    I'd planned to put in variables like XXXXpagename for that variable and have the custom.php replace the the values entered from a form and then delete itself on a redirect.

    I guess my biggest concern is that this will not work on some servers - do you think it's going to be a problem?

    Will I have a problem

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Why don't you customize it before uploading it to their server?

  3. #3
    SitePoint Addict
    Join Date
    May 2004
    Location
    USA
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There would be multiple people downloading things at the same time. When I've tried to customize the config.php previous to upload it's caused some issues.

    Trying to find a better way - just not sure what to do That's why i'm asking.

    Basically I have a folder of php files and images they i'm allowing them to upload directly to thier server- and I have to customize either one file before it get's transfered or let them do it after the transfer.

  4. #4
    SitePoint Evangelist -T-'s Avatar
    Join Date
    Jun 2002
    Posts
    444
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    customize it and give it a random name, renaming it after it's been uploaded is no biggie. I take it for granted you use ftp to upload. Just have a tempdir that keeps the config files. I would use their domainname as a filename or something simalar. Then you just have to remember which config file goes to which server, which is a simple job using sessions
    chrome is a wrapper that combines a browser with spyware

  5. #5
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    personally i would just make them edit the file by hand before they upload it.

    but if you must automate the editing, provide a web based form for them to fill in thier values before you let them download the config file from your website.

    use the values they submit to customize the config file. you shouldnt have any issues with multiple users downloading thier config file. you wouldnt even save this custom file, just output it to them only. for example

    PHP Code:
    <?php
    echo '<?php
    $foo = "' 
    $_POST['foo'] . '";
    $bar = "' 
    $_POST['bar'] . '";

    '
    ;
    ?>

  6. #6
    SitePoint Addict
    Join Date
    May 2004
    Location
    USA
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can I use something like ftp_rename to rename a file on a remote server - basically do this.


    Upload all files from my server to thiers using web based ftp client.

    Write "random-config.php" and upload it.

    Then use ftp_rename to rename it...........

    If so - I'm good I think.

  7. #7
    SitePoint Evangelist -T-'s Avatar
    Join Date
    Jun 2002
    Posts
    444
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    chrome is a wrapper that combines a browser with spyware

  8. #8
    SitePoint Addict
    Join Date
    May 2004
    Location
    USA
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks T - I'd found that - Appreciate the help all.


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
  •