Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Senior Member tekp's Avatar
    Join Date
    Jan 2004
    Location
    A small village near a small city near a small cit
    Posts
    918
    Member #
    4667
    Liked
    1 times
    PHP Code:
    <?
     
     $pagedetails 
    = array("section" => "home",
                          
    "section" => "Welcome!");
     
     include(
    'includes/config.inc.php');
     include(
    $sitedetails['root'] . 'includes/page/top.inc.php');
     
    ?>
    Gives this in the browser:

    "home", 'section' => "Welcome!"); include('includes/config.inc.php'); include($sitedetails['root'] . 'includes/page/top.inc.php'); ?>
    I.e, it cuts off after the closing quotes on the first key of the array ("section")... why is this? :S

    I recently installed the latest version of Apache and PHP using the installers downloaded from their websites... and the problem arose since I did this.

    Any ideas? :/
    tekp :cheeky: tekponline.com

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    View the page source. Is the actual PHP there?
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Yeah, it's probably showing the entire PHP code and the browser's just displaying part of it because it interprets the first bit (between <>) as an HTML tag.

    Chances are, your file isn't being parsed as PHP.

  5. #4
    Senior Member tekp's Avatar
    Join Date
    Jan 2004
    Location
    A small village near a small city near a small cit
    Posts
    918
    Member #
    4667
    Liked
    1 times
    Oh yeah, I never even realised that, even when viewing the source! Yeah the PHP is in the source, so any ideas why it's not parsing it as PHP? :/

    Edit: the Apache Service Monitor says Apache is running fine and has PHP/5.2.0 in the status bar...
    tekp :cheeky: tekponline.com

  6. #5
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Have you let Apache know that it should parse .php files as PHP?

  7. #6
    Senior Member Steax's Avatar
    Join Date
    Dec 2006
    Location
    Bandung, Indonesia
    Posts
    1,207
    Member #
    14572
    And have you put it in your localhost folder?

    I had this exact problem too, when I was new to PHP. I was eager to learn what I had read about in a book, so I quickly tried to jot down some code. I went balistic for the next 3 hours, until I noticed I should have put them in the apache/localhost folder..
    Note on code: If I give code, please note that it is simply sample code to demonstrate an effect. It is not meant to be used as-is; that is the programmer's job. I am not responsible to give you support or be held liable for anything that happens when using my code.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:06 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com