Results 1 to 14 of 14

Thread: Adding PHP Code
      
   

  1. #1
    Join Date
    Mar 2008
    Posts
    10

    Default Adding PHP Code

    How do I get the following PHP code to show when I publish?


    <?php
    $SID="364d8dc3-af06-4bb5-acce-b1ac9641df93";
    $IPAddress = urlencode($_SERVER['REMOTE_ADDR']);
    $UserAgent = urlencode($_SERVER['HTTP_USER_AGENT']);
    $Host=urlencode($_SERVER['HTTP_HOST']);
    $PageURL=urlencode($_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING']);
    $URL="http://si.goldencan.com/GetData.aspx?ver=2.0&SID=".$SID;
    $URL=$URL.'&Host='.$Host;
    $URL = $URL.'&PageURL='.$PageURL;
    $URL = $URL.'&IPAddress='.$IPAddress;
    $URL = $URL.'&UserAgent='.$UserAgent;
    include($URL);
    ?>

    I've tried the following

    * Inserting the PHP code into a html box
    * file extension is set to php
    * increasing the size of the html box

  2. #2
    Join Date
    Apr 2006
    Location
    X marks the spot
    Posts
    8,332

    Default Re: Adding PHP Code

    right click on the page and chose page properties and change it to php instead of html

    Karen

    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    02036089024 / United Kingdom
    291916438 / Australia

    ------------------------

    Top 3 Best Sellers

    Web Hosting - Unlimited disk space & bandwidth.

    Reseller Hosting - Start your own web hosting business.

    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)



  3. #3
    Join Date
    Feb 2009
    Location
    Gran Canaria
    Posts
    443

    Default Re: Adding PHP Code

    out of curiosity what is the script for?

  4. #4
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,116

    Default Re: Adding PHP Code

    Quote Originally Posted by travlinman View Post
    out of curiosity what is the script for?
    By the looks of it some type of 3rd party stats software.

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  5. #5
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: Adding PHP Code

    But I doubt you can include a URL in a VH account. The URL wrappers are disabled in most cases for security reasons.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  6. #6
    Join Date
    Mar 2008
    Posts
    10

    Default Re: Adding PHP Code

    The php code is for an affiliate product feed thru GoldenCan

  7. #7
    Join Date
    Mar 2008
    Posts
    10

    Default Re: Adding PHP Code

    I have tried changing the page properties to php under General/file extension

  8. #8
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,116

    Default Re: Adding PHP Code

    Quote Originally Posted by bbullock View Post
    I have tried changing the page properties to php under General/file extension
    And what is happening when you publish the page and load it in your browser? Is it giving an error of some sort?

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  9. #9
    Join Date
    Mar 2008
    Posts
    10

    Default Re: Adding PHP Code

    the page is blank

  10. #10
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,116

    Default Re: Adding PHP Code

    Try this code and let me know what happens

    <?php
    error_reporting(E_ALL);
    $SID="364d8dc3-af06-4bb5-acce-b1ac9641df93";
    $IPAddress = urlencode($_SERVER['REMOTE_ADDR']);
    $UserAgent = urlencode($_SERVER['HTTP_USER_AGENT']);
    $Host=urlencode($_SERVER['HTTP_HOST']);
    $PageURL=urlencode($_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING']);
    $URL="http://si.goldencan.com/GetData.aspx?ver=2.0&SID=".$SID;
    $URL=$URL.'&Host='.$Host;
    $URL = $URL.'&PageURL='.$PageURL;
    $URL = $URL.'&IPAddress='.$IPAddress;
    $URL = $URL.'&UserAgent='.$UserAgent;
    include($URL);
    ?>

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  11. #11
    Join Date
    Mar 2008
    Posts
    10

  12. #12
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,116

    Default Re: Adding PHP Code

    Hmm, all of the page html is not being transfered, it stops at an opening <div> tag, I assume where the php code was inserted.

    Try just uploading a php file with only the code in it. That is not just adding it to a BV file and publishing, just use notepad or something, copy and paste the code into it, save as a .php, and upload that file.

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  13. #13
    Join Date
    Apr 2006
    Location
    X marks the spot
    Posts
    8,332

    Default Re: Adding PHP Code

    Quote Originally Posted by navaldesign View Post
    But I doubt you can include a URL in a VH account. The URL wrappers are disabled in most cases for security reasons.

    Please re read NAVALS post.. most likely this is disabled and will not happen on voda servers.

    Karen

    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    02036089024 / United Kingdom
    291916438 / Australia

    ------------------------

    Top 3 Best Sellers

    Web Hosting - Unlimited disk space & bandwidth.

    Reseller Hosting - Start your own web hosting business.

    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)



  14. #14
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,116

    Default Re: Adding PHP Code

    It should still be displaying some sort of error or notice saying that it is disabled. Just trying to find out the symptoms in order to diagnose the problem.

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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