Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 22
  1. #1
    Member
    Join Date
    Sep 2003
    Posts
    5

    Default Need help on adding banners to customer site

    Hello,
    I am trying to set up a site that gives out free sites (like Netfirms.com or tripod does) but on a smaller level (all content related free sites aloud) But I want to put my banner on top of their site automatically without having them have to copy / paste the html into their pages.

    Is it possible to do this using an Apache Handler? Mime types?

    I really do not know where to start. Any help will be greatly appreciated.

    Thanks,
    Patrick Flaven
    Flavesta@Yahoo.com

  2. #2
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    Here is what I found somewhere when I was looking for the same thing. Don't remember where though.

    ok, the easiest thing to do is put a .htaccess file in either your root directory or in each folder with this...


    PHP:

    php_value auto_append_file /home/username/public_html/ad.php

    AddType application/x-httpd-php htm

    AddType application/x-httpd-php html


    then create your ad.php file.
    This will make all files with .htm and .html act as if they are .php files.
    At the bottom of each page it will include your ad.php file

    Just remember that it will add it to your root files (your own files) if you put it under your public_html folder rather than their folders, BUT if it is in their folders and they know how to find it, they could delete it.

    change append to prepend to put your file at the top. You can do both which will put your file at the top AND the bottom.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  3. #3
    Member
    Join Date
    Sep 2003
    Posts
    5

    Default

    Thanks for the help! I probably never would have found that out searching by myself... (I'm basically a newbie) I've never use a .htaccess file before so I'm not too familiar but im sure I can find some more info somewhere

    Thanks again
    Pat
    Flavesta@yahoo.com

  4. #4
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    Go to
    http://httpd.apache.org/docs-2.1/en/howto/htaccess.html

    From there you should be able to find what you need to know.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  5. #5
    GOT
    GOT is offline
    Get Proactive! GOT's Avatar
    Join Date
    Apr 2003
    Posts
    898

    Default

    Also, if you chown the file to root and only allow read access, the client will not be able to delete or change it.
    Proactive Server Monitoring and Management
    http://got-management.com

  6. #6
    Member
    Join Date
    Sep 2003
    Posts
    5

    Default

    When making the .htaccess file I put this code in the file

    PHP:

    php_value auto_append_file /home/myusername/public_html/ad.php

    AddType application/x-httpd-php htm

    AddType application/x-httpd-php html

    Then I made the ad.php file through dreamweaver using html code for a banner and it doesn't work, it gets an internal server error. Am I putting the code in correctly, is there something missing here... I have tried many variations and it still will not work?

  7. #7
    GOT
    GOT is offline
    Get Proactive! GOT's Avatar
    Join Date
    Apr 2003
    Posts
    898

    Default

    I just ran a test on this and it worked great. Great tip.

    As to why you are getting an internal server error, I am not sure. I used exactly what you put in your message in my .htaccess file.

    Do you have open_basedire in effect? If so, you are definately going to have problems doing it this way, but it should not return an internal server error, it should give you php warnings/errors.
    Proactive Server Monitoring and Management
    http://got-management.com

  8. #8
    GOT
    GOT is offline
    Get Proactive! GOT's Avatar
    Join Date
    Apr 2003
    Posts
    898

    Default

    Oh, wait, did you put PHP: in your .htaccess file? If you did, that is what is causing it to choke. this should be the content of your .htaccess file:

    php_value auto_append_file /home/username/public_html/ad.php

    AddType application/x-httpd-php htm

    AddType application/x-httpd-php html
    Proactive Server Monitoring and Management
    http://got-management.com

  9. #9
    Member
    Join Date
    Sep 2003
    Posts
    5

    Default

    That was what it was... I removed the PHP from the top and it works great! Finally it all works!! I've tried other forums but I couldn't find any help there, just want to say thanks for the help squirrel and GotHosting!

  10. #10
    Member
    Join Date
    Mar 2003
    Posts
    345

    Default

    If we are using phpsuexec how would we go about getting this to work? With PHPSUEXEC it just produces an internal server error.

  11. #11
    GOT
    GOT is offline
    Get Proactive! GOT's Avatar
    Join Date
    Apr 2003
    Posts
    898

    Default

    If using PHP Suexec, you need to put it in a file called php.ini
    Proactive Server Monitoring and Management
    http://got-management.com

  12. #12
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    Is it possible to add code to the .htaccess file so that the .htaccess file can be in the root (public_html) directory but only add to files in subdirectories? Or is there a line of code that can tell it not to touch specific files?
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  13. #13
    Member
    Join Date
    Nov 2002
    Posts
    45

    Default

    Well, This doesnt works for CGI and SHTML, how to make it work for them.. any idea ???

  14. #14
    Member Roy@ENHOST's Avatar
    Join Date
    Mar 2002
    Location
    Los Angeles California
    Posts
    495

    Default

    It will not work if some smart a** used a php exit() at the end of the file. But I doubt anyone will figure it out....

    Good job squirrel.
    You never fail to amaze me with how much you know about servers.
    = = = = = = = = = = = = = = = = = =
    Cpanel XP Evolution (Add DOZENS of functions to your Cpanel NOW!!!) - 21 Languages, User Friendly Interface, Feature Enabled, Highly Customizable, Create Popup Once window, Language Aware, Flash Tutorials, Theme Changer,Integration with Modernbill,WHM AutoPilot,ClientExec,LPanel&WHOISCart

  15. #15
    Member Roy@ENHOST's Avatar
    Join Date
    Mar 2002
    Location
    Los Angeles California
    Posts
    495

    Default

    One note.

    The page will display an error msg if the ad.php is not present. Is it possible to suppress the errors?
    = = = = = = = = = = = = = = = = = =
    Cpanel XP Evolution (Add DOZENS of functions to your Cpanel NOW!!!) - 21 Languages, User Friendly Interface, Feature Enabled, Highly Customizable, Create Popup Once window, Language Aware, Flash Tutorials, Theme Changer,Integration with Modernbill,WHM AutoPilot,ClientExec,LPanel&WHOISCart

Similar Threads & Tags
Similar threads

  1. Server IP shows customer's site ?
    By 4u123 in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 11-09-2007, 08:04 AM
  2. Replies: 3
    Last Post: 08-13-2007, 11:04 AM
  3. something wrong with uploading banners on ym site
    By RyanG9922 in forum New User Questions
    Replies: 1
    Last Post: 12-31-2004, 02:04 AM
  4. Adding private nameservers for a reseller customer
    By aykfounder in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 11-28-2004, 03:50 PM
  5. Adding a New Domain (for a new customer)
    By norm1153 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 04-06-2003, 12:15 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube