+ Reply to Thread
Results 1 to 12 of 12

 

Thread: PHP Includes

  1. #1
    Registered User

    Status
    Offline
    Join Date
    Jan 2006
    Location
    Sudbury UK
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts


    Hi,

    I am using a very simple php include <?php include('includes/config.php'); ?> at the top of my header (which is also an include) and am getting '' at the top of my page.

    The config.php just contains 5 variables with MySQL login details.

    Has anybody seen this before and if so what am I doing wrong?

    Cheers

    Jason

  2. #2
    In need of a mentor!

    Status
    Offline
    Join Date
    Mar 2006
    Posts
    297
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yep seen it recently helping someone out here.

    If using Dreamweaver start a new document (php) and then cut out all the code from the old and paste it in the new.

    You should find it works perfectly!

    Good Luck

    Mark
    Like Blogs? Heres mine - Not been updated in an Age sorry! :cry

  3. #3
    Registered User

    Status
    Offline
    Join Date
    Jan 2006
    Location
    Sudbury UK
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Mark,

    Thanks for that. I actually had the strange text appearing twice on the page and your suggestion has fixed one of them.

    The other one still persists, although I can get rid of it if I include the config.php file on the top of every individual page rather than in the 'included' header.

    Weird ....

    Cheers

    Jason

  4. #4
    Technophobe Geek

    Status
    Offline
    Join Date
    Jan 2005
    Location
    Cumbria, UK
    Posts
    799
    Thanks
    11
    Thanked 21 Times in 21 Posts
    What browser are you using? Sometimes I find that strange stuff gets into the text file, but finding it can be hard as the characters don't actually show until it appears in a browser.

    Only guess beyond suggested is copy just between the <?php and ?> tags so skipping anything outside of those into a new file. You'll probably find the strange chars are outside those tags otherwise PHP would throw a wobbly about invalid characters.

    Not sure if this will be the config or header file that's got the dodgy chars however.

    Trev

  5. #5
    Registered User

    Status
    Offline
    Join Date
    Jan 2006
    Location
    Sudbury UK
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Trev, I'll give it a go.

    Cheers

    Jason

  6. #6
    Chris Clarkson's Avatar
    PHP never lies...

    Status
    Offline
    Join Date
    Jul 2003
    Location
    Glasgow
    Posts
    670
    Thanks
    7
    Thanked 22 Times in 10 Posts
    Hi,

    from memory a long time ago... I had this issue when uploading files to a server that had been saved in Wordpad. Try saving the files using notepad if this is the case?

    Chris C
    sunshine.co.uk - Cheap Holidays, Hotels and Flights on Paid on Results
    email: chris.c [at] sunshine.co.uk
    Affiliate Area
    bonvoyage.co.uk - Cruise Deals coming soon

  7. #7
    In need of a mentor!

    Status
    Offline
    Join Date
    Mar 2006
    Posts
    297
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry been a busy day! Haven't got back on since I posted until now.

    All I can think of is to do the same procedure for all the files concerned (including the include files), it does sound like a corruption problem.

    Good Luck
    Mark.
    Like Blogs? Heres mine - Not been updated in an Age sorry! :cry

  8. #8
    Registered User

    Status
    Offline
    Join Date
    Jan 2006
    Location
    Sudbury UK
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Cheers everyone for your help and suggestions.

    Mark, I owe you one

    The only file I didn't change yesterday was the config.php include (silly billy). Suddenly thought of it first thing, changed it and now all works a treat.

    Cheers

  9. #9
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Location
    uk
    Posts
    282
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by seekituk View Post
    Cheers everyone for your help and suggestions.

    Mark, I owe you one

    The only file I didn't change yesterday was the config.php include (silly billy). Suddenly thought of it first thing, changed it and now all works a treat.

    Cheers

    so it was a simple file corruption then?
    http://www.nichetaxi.com - takes the hard work out of finding niches for your adsense websites! And its free!

  10. #10
    Registered User

    Status
    Offline
    Join Date
    Jan 2006
    Location
    Sudbury UK
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yep, must be a Dreamweaver issue.

    A few of the pages I had developed in MX on an older PC and the config.php file was one of them.

    Not sure if it maybe just an MX issue as I've never had the problem using v8 (yet).

  11. #11
    In need of a mentor!

    Status
    Offline
    Join Date
    Mar 2006
    Posts
    297
    Thanks
    0
    Thanked 0 Times in 0 Posts
    More than welcome, glad to be of help!

    Mark.
    Like Blogs? Heres mine - Not been updated in an Age sorry! :cry

  12. #12
    Registered User

    Status
    Offline
    Join Date
    Jan 2006
    Location
    Sudbury UK
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In case anybody comes across the same problem, I think I have sussed out how it can happen.

    I was working remotely on a website using Dreamweaver MX and I added a php file to the site. That page then had the ''' displayed, so can only assume it's when you create a php file remotely.

    Cheers

    Jason

+ Reply to Thread


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Gambling "Portal" Websites For Sale: Setup & Ready To Profit
    By cashmirrors in forum Domains & Websites For Sale
    Replies: 0
    Last Post: 20-10-05, 12:23 AM
  2. Anyone anygood with xml, php, mysql and Affiliate Window
    By AnnonnyMouse in forum Affiliate Marketing Lounge
    Replies: 1
    Last Post: 23-09-04, 12:00 PM
  3. PHP - No input file specified. - Problem
    By Barry in forum Programming
    Replies: 1
    Last Post: 02-08-04, 11:57 AM
  4. PHP or Browser Timeout?
    By Barry in forum Programming
    Replies: 6
    Last Post: 28-04-04, 02:04 PM
  5. PHP File Security for Includes
    By bonedome in forum Programming
    Replies: 0
    Last Post: 01-01-04, 09:11 AM

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
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2