1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Please Help Me!!

Discussion in 'PHP' started by Neurophase, Jul 29, 2005.

  1. #1
    Hi

    I am trying to set up an rss feed in a php file called: "rssfeeds.php".

    Which is then opened up via SSI in my index.shtml with this code:


    <!-- #include virtual="rssfeeds.php" -->

    All this should be fine, except that my hosting server says they have made some alterations to the way they handle php scripts.

    This is the code for the php page that i was trying to create:


    <?php
    include ("http://www.rssfeedreader.com/rss3/rss.php?url=http%3A%2F%2Fwww.medicinenet.co
    m%2Frss%2Fspecialty%2FDrug_Abuse.xml&newpage=1&chead=&atl=&desc=&auth=&dts=&width=160&
    max=5&tlen=0&rnd=1&bt=0&bs=None&nmb=&ntb=&naf=&nst=&nwd=0&nht=0&dlen=0&bg
    =%23EEEEEE&bc=%23EEEEEE&tc=%23333333&ts=9&tfont=Verdana,+Arial,+Sans-serif&rf=".$HTTP_SERVER_VARS['SERVER_NAME'].$HTTP_SERVER_VARS['PHP_SELF']."&phpout=1");
    ?>


    And this is what my php page says when i try to open it:

    Warning: main(http://www.rssfeedreader.com/rss3/r...=www.ghb-information.com/index.php&phpout=1): failed to open stream: Permission denied in /freeola/users/8/1/sr0339318/htdocs/index.php on line 67

    Warning: main(): Failed opening 'http://www.rssfeedreader.com/rss3/rss.php?url=http%3A%2F%2Fwww.medicinenet.com%2Frss%2Fspecialty%2FDrug_Abuse.xml&newpage=1&chead=&atl=&desc=&auth=&dts=&width=160&max=5&tlen=0&rnd=1&bt=0&bs=None&nmb=&ntb=&naf=&nst=&nwd=0&nht=0&dlen=0&bg=%23EEEEEE&bc=%23EEEEEE&tc=%23333333&ts=9&tfont=Verdana,+Arial,+Sans-serif&rf=www.ghb-information.com/index.php&phpout=1' for inclusion (include_path='.:/usr/local/share/pear') in /freeola/users/8/1/sr0339318/htdocs/index.php on line 67



    Ok, then i went into the help files on my hosting company and looked up the stuff on php. They said this:

    Web Space: PHP Essentials
    UPDATE 7/6/04
    Following a security upgrade, a change has been made to our PHP configuration to switch register_globals OFF. This basically means that statements such as:


    echo $my_variable_name;
    will no longer function correctly. There is a simple resolution to this problem in the form of some code that should be inserted into the top of your page. Here are some examples:

    If the variable you are trying to access is passed via the URL string:


    $my_variable_name=$_GET["my_variable_name"];
    If the variable you are trying to access is passed via a form post operation:


    $my_variable_name=$_POST["my_variable_name"];
    If the variable you are trying to access is a server environment variable:


    $my_variable_name=$_SERVER["HTTP_HOST"];


    SEMrush
    As you'd expect from the UK's best free Internet package, Freeola enables users to take advantage of the superior web scripting and programming language - PHP

    PHP, which stands for "PHP: Hypertext Preprocessor", is an HTML-embedded scripting language which will allow you to create an interactive website without the use of CGI. Guestbooks, 'formmail' and hit counters are just a few things that PHP can handle.

    Like HTML pages, all files are uploaded into your 'htdocs' directory.

    Freeola's servers currently support PHP 4.3.7.

    The PHP 4 manual can be found right here


    Displaying the Date and Time:
    You can display the local date and time on your webpage using PHP. Simply copy and paste the following red PHP code into your webpage where you would like the date and time to be diplayed:

    <?php echo date("D M d, Y H:i:s"); ?>

    The date will display like this:
    Fri Jul 29, 2005 19:26:32

    Don't forget that you must give the page a .php ending for PHP to work correctly (e.g. 'mypage.php')

    Including Another File Into Your Web Page
    An 'include' is a way of embedding information from a single file into another file. This is particularly useful for multiple web pages which need to show the same piece of information. Once set up you then only need to change one file to change that information across all of your pages.

    A PHP 'include' statement looks like this:

    <?php include("pagename.php"); ?>

    You simply insert his code into your web page(s) exactly where you want the information from the source page to appear. Lets say you have a web site and on every page you show a 'quote of the day'. The quote would be saved in a separate file (say 'quote.php') as plain text and then you could use the following code on every web page where you want the quote to appear. Example:

    Today's quote is: <?php include("quote.php"); ?>

    The source file can even contain HTML code if required. Includes can save you time and effort when it comes to updating your web site so it's well worth a look for anybody wanting similar content on more than a few pages on their web site.

    The file that contains the PHP 'include' statement must have a .php extension. The source file can have any name with or without a file extension (e.g. filename.php', 'filename.html', 'filename.txt' or just 'filename').



    I'm utterly confused! But im sure i need to make some changes to the php code so that it complies with the changes to my server.


    Please can someone help me?

    It will be greatly appreciated.


    Thanks

    James
     
    Neurophase, Jul 29, 2005 IP
    SEMrush
  2. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,220
    Likes Received:
    778
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try a real simple PHP script like this:

    
    
    echo $HTTP_SERVER_VARS['SERVER_NAME'].$HTTP_SERVER_VARS['PHP_SELF'];
    
    
    PHP:
    Yuo are denied permission probably because the above two variables are passed on to the medicinet site empty hence refusing you a copy of the feed.

    With the above script you can isolate the problem if that indeed is the problem.
     
    T0PS3O, Jul 29, 2005 IP
  3. Neurophase

    Neurophase Guest

    Messages:
    116
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Not following you??
     
    Neurophase, Jul 29, 2005 IP
  4. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,220
    Likes Received:
    778
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Did you try the code I gave you? Did it output anything or errors?
     
    T0PS3O, Jul 29, 2005 IP
  5. Neurophase

    Neurophase Guest

    Messages:
    116
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Neurophase, Jul 29, 2005 IP
  6. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,220
    Likes Received:
    778
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Can you post line 67 and surroundings on index.php?

    If I open this link of yours, I do get error-free output (although it outputs PHP as plain text which is strange).
     
    T0PS3O, Jul 29, 2005 IP
  7. Neurophase

    Neurophase Guest

    Messages:
    116
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #7
    <tr>
    <td height="104" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="5">
    <tr>
    <td width="158" bgcolor="#EEEEEE"><p>
    <p align="center">
    <?php include("http://www.rssfeedreader.com/rss3/rss.php?url=http%3A%2F%2Fwww.medicinenet.com%2Frss%2Fspecialty%2FDrug_Abuse.xml&newpage=1&chead=&atl=&desc=&auth=&dts=&width=160&max=5&tlen=0&rnd=1&bt=0&bs=None&nmb=&ntb=&naf=&nst=&nwd=0&nht=0&dlen=0&bg=%23EEEEEE&bc=%23EEEEEE&tc=%23333333&ts=9&tfont=Verdana,+Arial,+Sans-serif&rf=".$HTTP_SERVER_VARS['SERVER_NAME'].$HTTP_SERVER_VARS['PHP_SELF']."&phpout=1"); ?>
    <script type="text/javascript"><!--
    google_ad_client = "pub-5681912155165564";
    google_ad_width = 160;
    google_ad_height = 600;
    google_ad_format = "160x600_as";
    google_ad_type = "text_image";
    google_ad_channel ="";
     
    Neurophase, Jul 29, 2005 IP