Jump to content

Search the Community

Showing results for tags 'intro programming'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hey everyone im new to the forum, Okay so I need some help and maybe snippets on helping me achieve creating a program. The goal of this is to create a game which has the user guess which U.S. President corresponds to a randomly chosen term in office. A term (in office) constitutes a time range in which the U.S. President was the same. It turns out that the range of years of the term corresponds to a single President, but not vice-versa, because there is one U.S. President who had two terms. Generate the random term with this statement: $term = $terms[ mt_rand( 0, count($terms)-1 ) ]; so this is what i have. NOTE: THE OTHER PROGRAM'S PHP FILES ARE MADE. <?php require_once "include/Session.php"; $session = new Session(); if (!isset($session->valid)) { require_once "login.php"; exit(); } require_once "include/presidents.php"; // this is the list of the terms $terms = array_keys($term_presidents); // this is the list of all names (duplicates removed), sorted by last name $presidents = array_unique(array_values($term_presidents)); usort($presidents, "byLastName"); /* DO NOT MODIFY THE ABOVE LINES !!!!! */ $params = (object) $_REQUEST; print_r($params); /* Remaining Php handler code goes here */ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"/> <title>Average Calculator</title> <style type="text/css"> body { padding: 20px; } #logout { position: absolute; top: 40px; right: 40px; } /* Add more style rules */ </style> </head> <body> <a id="logout" href="logout.php">Log out</a> <h2>President Guess Game</h2> <form action="program.php" method="get"> <button type="submit" name="reset" >New Game</button> </form> <!-- Add form and presentation code --> </body> </html>
×
×
  • 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.