Skip to content
This repository has been archived by the owner on Oct 2, 2022. It is now read-only.
/ website-maker Public archive

My final assigment for server side scripting with PHP class. A content management site to create multi page websites in an easy and intuitive way.

Notifications You must be signed in to change notification settings

csc530/website-maker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assignment 2 - Web Dreamscapes

(INACTIVE)

Web Dreamscapes (Live site)
Demo site

Unfortunately there were some major database restructuring and your Test Co. website was lost you'll have to remake it sorry :(

Purpose

This web app is made to allow registered users 'host' their websites. Allowing them to edit the website's name and individual page content. Also, allowing collaboration with other registered users.

Bonus

A small thingI also worked/made/manipulated a string indexed array using php arrays function. (I could have also just used square brackets - [] - for the same result). Can be found on line 40 of edit-webpages.php.

Added customizable styles for each site in the gradient of their background.

I added functionality to have multiple users build multiple websites. Which I believe is additional to the base project of multiple users editing one website. This can be seen most (I believe) in edit-webpages.php. I think this is bonus but a lot was MySQL so idk,

Database stuff

  • I changed how urls are made for accessing certain user sites and pages it uses a newly created creatorID which directly links to their email thus making urls not contain users email but integers relating to their emails. Making it more secure and private for them, that's also the reason why I did it.

Clarification

I left all files in the same level for ease of linking between them with require, etc.

Throughout the project/pages I (try) to make distinction between webpage and website. The difference being

Webpage
An individual page displaying content like this README or a product page on the Walmart website
Website
The overall container for webpage's such as the Walmart website

(I know I was confused making the pages trying to distinguish and add distinction, thought I would just add this just to be safe)

Code

Explaining ubiquitous code throughout website

  • I chose to use !empty(var) opposed to isset(var) because it checks for more valid (in my case) data than just not null
  • I have placed an exit after each header to ensure that no other code is executed after leaving the page
  • For sites that need authentication or refer to the email in the session object no session_start() is needed as it's called in the authentication at the beginning (somewhere) on the page
  • If there is an $error or _GET['error'] I am checking for an error (that I 'threw') to display to the user
  • $_GET['siteTitle'],$_GET['creator'], and $_GET['pageNumber'] are necessary variables to access the correct record in the database for the website or webpage. I choose GET instead of post as I think it's more elegant in the form opposed to having empty hidden inputs containg them and security wise I think it's the same as both values can be edited in developer's options
  • When querying the DB in a try catch block I often have an error beforehand of Network error, please try again. along those lines. This means I don't expect any specific error from the database so that's my catchall for any un-thought of error (which it probably will be)
  • I often switch between " " and ' ' quotes depending if I am/can add a variable directly with double quotes if not I try to use single quotes
  • Some pages include meta.php and authenticate.php this will not cause an error as authenticate in both cases use require_once which it means it will run only once in the page = session_start() is run only once per page
  • the $title variable on top of pages is the tab's title
  • All the pages and php includes are all in the same directory just making navigation easier, unfortunately I didn't have time to change them to be absolute or refactor the pages to be in a more organized directory structure

About

My final assigment for server side scripting with PHP class. A content management site to create multi page websites in an easy and intuitive way.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published