Example #1
0
<?php

///////////////////////////////////////////////////////////////////////
//NAME: DAVID POULOS
//CLASS: COSC2328
//ASSIGNMENT 5-2
//DATE: OCTOBER 10, 2014
//////////////////////////////////////////////////////////////////////
require "classfun.php";
printDocHeading("start.css", "Assignment 5");
print "<body>\n";
print "<div class ='heading'>";
print "<h3> David's Madlib Mashup </h3>\n";
print "</div>\n";
print "<div class='content'>\n";
//PAGE LOGIC//
//print_r($_POST); //used for testing purposes
if (empty($_POST)) {
    showStoryChoice();
} else {
    if ($_POST['submitStory']) {
        storySubmissionForm();
    } else {
        if ($_POST['submitInfo']) {
            displayMadlib();
        }
    }
}
print "</div>";
printDocFooter();
//////////////////////////////////////////////////////////////////////////
Example #2
0
<?php

# in class example 1 for learning how to create
#  a simple webpage generated (output) by php
#  August 2014
# cosc 2328
require "./classfun.php";
# gets functions we will use
## call a method to output the document's page heading
printDocHeading("./start.css", "David Poulos");
# now begin output of our html content
print '<!--  body of document starts here  -->' . "\n" . '<body>' . "\n" . '<div class="heading">' . "\n" . '<h2> David Poulos COSC 2328 :  Exploring the InterWebs  </h2>' . "\n" . '</div>' . "\n" . '<div class="content">' . "\n" . '<!--  float left starts here -->' . "\n" . ' <div class="floatleft">' . "\n" . '  <h3> My Major: </h3>' . "\n" . '   BA in Computer Science' . "\n" . '  <h3> My Hobbies: </h3>' . "\n" . ' <ul> ' . " \n" . ' <li> Gaming   </li>' . "\n" . ' <li> Running  </li>' . "\n" . ' <li> Reading  </li>' . "\n" . ' <li> Sleeping </li>' . "\n" . ' </ul>' . "\n" . ' <h3> Cosc 2328 Assignments: </h3>' . "\n" . ' <a href="asg2.php"> Assignment 2 </a>' . "\n" . ' <h5> Some helpful links: </h5>' . "\n" . ' <a href="http://validator.w3.org"> html validator </a>' . "\n" . '  <br /><br />' . "\n" . ' <a href="http://w3schools.com/html/default.asp"> html reference </a>' . "\n" . '  <br /><br />' . "\n" . ' <a href="http://w3schools.com/css/default.asp"> css reference </a>' . "\n" . '  <br /><br />' . "\n" . ' <a href="http://myweb.stedwards.edu/laurab/cosc2328/"> cosc 2328</a>' . "\n" . ' <br /><br/>' . "\n" . ' <a href="http://www.smashingmagazine.com/2008/11/18/15-helpful-in-browser-web-develtopment-tools/ "> useful tools </a>' . "\n" . ' <br /><br/>' . "\n" . ' <a href="http://w3.org/standards/webdesign"> webdesign reference</a>' . "\n" . ' </div>' . "\n" . '<!--  end of float left  -->' . "\n" . '<!--  start new float left  -->' . "\n" . ' <div class="floatleft">' . "\n" . ' <div class="border">' . "\n" . ' <br />' . "\n" . ' <h3> Favorite Holiday: Halloween</h3>' . "\n" . ' <br />' . "\n" . '     <img src="../images/david.jpg" alt = "Halloween Me"/>' . "\n" . '   </div>' . "\n" . ' </div>' . "\n" . '<!--  end of float left  -->' . "\n" . '<div class="clear"></div>' . "\n" . '<p class="footer">' . "\n" . ' St. Edward&apos;s University .:. COSC 2328 - Web Programming .:. Fall 2014' . "\n" . '</p>' . "\n" . '</div>' . "\n" . '<!--end of content -->' . "\n" . '</body>' . "\n" . '</html>' . "\n";
Example #3
0
<?php

//Name: David Poulos
//Date: 9/19/14
require "classfun.php";
printDocHeading("asg4.css", "My Personal Blog");
print "<div class ='content'>\n";
print "<h3> David's Web Blog </h3>\n";
print "</div>\n";
print "<div class='asg4'>\n";
if (empty($_POST) || $_POST['cancel']) {
    showAddAndClear();
    showBlog();
} elseif ($_POST['submitAdd']) {
    addEntryForm();
} elseif ($_POST['addEntry']) {
    processAddEntry();
    showAddAndClear();
    showBlog();
} elseif ($_POST['submitClear']) {
    askConfirm();
} elseif ($_POST['submitClearConfirmed']) {
    clearBlog();
    showAddAndClear();
    showBlog();
}
print "</div>\n";
//end of opening div
printDocFooter();
//shows any entries that might
//have been saved to the blog
Example #4
0
<?php

//=============================================================================
//= NAME: DAVID POULOS							      =
//= DATE: OCTOBER 21, 2014						      =
//= ASSIGNMENT: 7	    			   			      =
//=============================================================================
//=                               ASSIGNMENT 7                                =
//=============================================================================
session_set_cookie_params(300);
// 300 seconds == 5 mins
session_start();
require 'classfun.php';
require 'mydb.php';
printDocHeading("style7.css", "Assignment 7");
print "<div class='heading'>";
print "<h2> Assignment 7 - Image Database </h2></div>";
print "<div class='content'>";
// are we logged in?
$valid = $_SESSION['validUser'];
if ($valid != 1) {
    if (empty($_POST) || $_POST['returnHome']) {
        // nothing posted or start over
        showLoginForm();
    } else {
        validateLogin();
    }
}
if ($_SESSION['validUser'] == 1) {
    if ($_POST['logout']) {
        doLogout();
Example #5
0
<?php

//NAME: DAVID POULOS
//DATE: SEPT. 12, 2014
//example script that uses a form for
//inputting the user's name and phone number
//reports back location of area code or unknown location
//checks that all fields are filled in.
//expects data when form is submitted as GET
//theName - person's name
//theArea - area code
//phone1 - first 3 digits of phone #
//phone2 - last 4 digits of phone #
require "classfun.php";
printDocHeading("asg3style.css", "Example Php Using Get");
print "<body>\n";
print "<div class='heading'>\n";
print "<h2>Phone Number  Area Code Locationator </h2>\n";
print "</div>\n";
print "<div class='content'>\n";
if (empty($_GET)) {
    showForm();
} else {
    checkForm();
}
print "</div>\n";
//end of opening div
printDocFooter();
//function that displays form to user, uses default arguments
//1st arg for name, 2nd arg is areaCode, 3rd first part phone number
//4th last part of phone number
Example #6
0
<?php

// Sam Duncan
// cosc2328
// October 7st, 2014
require "../phpStuff/classfun.php";
printDocHeading("../styleSheets/mad-style.css", "Mad-Lib Stories");
print "<body>\n<div class='content'>\n";
print "<h2>Mad-Lib Stories</h2>\n";
//printAll();
if (empty($_POST)) {
    showStoryChoiceForm();
} else {
    if ($_POST['submitStoryChoice']) {
        checkStorySubmission();
    } else {
        if ($_POST['subStory']) {
            showSubChoiceForm();
        } else {
            if ($_POST['submitSubChoice']) {
                checkSubSubmission();
            }
        }
    }
}
print "</div>\n";
// end of opening div
printDocFooter();
//function displays a drop down menu that allows user to choose between
//three options for a story to mad-lib.
function showStoryChoiceForm()