Jump to content

Recommended Posts

Hello everyone,

I am very new to PHP (been learning/coding about a month now), and while I am coding my site I have come across a major stumbling block.

I am writing a very basic CMS for my site (and for a couple of friends) but I seem to be having some trouble with the OOP part. How it works is like this:

index.php - checks if files and things exist, if they do it includes them and then includes the file "content_display.php" which handles everything else, like the URL format (index.php?page=login)

content_display.php - need access to the classes but everytime I include these files I get the error "Cannot redefine class MySQL in file ....."

header.php - also needs access to the classes but I get the same error as I do with content_display.php
menu.php - same as header.php
the various mod files (like register.php, login.php) also the same as the other files.

I hope somebody actually understands what I am trying to say, if it would help I can probably release the source for you all so that maybe you might be able to better understand me.

P.S. Sorry if this is in the wrong place.
Link to comment
https://forums.phpfreaks.com/topic/8108-oop-problem/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.