Jump to content

TheNatalShark

New Members
  • Posts

    3
  • Joined

  • Last visited

TheNatalShark's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Okay, I'm trying front to back-end now. As in trying to get the information entered into a form (shapecreationform), which is then posted to shapelcass.php. Simply trying to get the information at this stage to echo, but having enough trouble with that. http://www.aberdonia.com/aberdonia/web-dev/coursework/shapecreationform.php Code for the form: <form method="post" action="shapeclass.php"> <table> <?php $shapes[0] = "first"; $shapes[1] = "second"; $shapes[2] = "third"; $shapes[3] = "fourth"; $shapes[4] = "fifth"; $shapes[5] = "sixth"; $shapes[6] = "seventh"; $shapes[7] = "eighth"; $tableRow = 0; while($tableRow != { echo ' <tr> <th>Select</th> <th>Choose Shape</th> <th>Base Length</th> <th>Height</th> <th>Diameter</th> <th>Side length</th> <th>Colour</th> </tr> <td><input type="checkbox" name="checkboxes[]" /></td> <td> <select name="shapes[]"> <option value="Square">Square</option> <option value="Rectangle">Rectangle</option> <option value="Rhombus">Rhombus</option> <option value="Circle">Circle</option> <option value="Triangle">Triangle</option> <option value="Hexagon">Hexagon</option> </select> </td> <td><input type="text" name="length[]" style="width:50px" /></td> <td><input type="text" name="height[]" style="width:50px" /></td> <td><input type="text" name="diameter[]" style="width:50px" /></td> <td><input type="text" name="sidelength[]" style="width:50px" /></td> <td><input type="text" name="colour[]" style="width:50px" /></td> </tr> '; $tableRow++; } ?> </table> <input type="submit" value="Submit" name="submit" /> </form> Code for shapeclass.php <?php class Shape { //Variables protected $shapeType; protected $colour; //Constructor public function __construct($shapeType, $colour) { $this->shapeType = $shapeType; $this->colour = $colour; } } $length == $_POST["length"]; $height == $_POST["height"]; $radius == $_POST["radius"]; $sides == $_POST["sides"]; for ($k = 0; $k < count($length); $k++) { echo "<p>Length is: " . $length[$k] . "</p>"; echo "<p>The shape has : " . $sides[$k] . "</p>"; echo "<p>The shape has : " . $sides[$k] . "</p>"; echo "<p>The shape has : " . $sides[$k] . "</p>"; echo "<p>The shape has : " . $sides[$k] . "</p>"; } ?>
  2. Which part? Well in principle the same could be asked of any person in education/business that has a question and asks online, no? Just to clarify, I'm not looking for anyone to write any actual code for me to use. Just would like some help understanding what direction I should be looking at, possible online resources or maybe even just some motivational support. Tl;dr, Unfortunately not!
  3. Hey guys, So long story short: I've got an assignment due in two weeks time. I'm going away next weekend so want to finish it before then. Problem is, we haven't covered all the necessary material in class yet, and would be expected to work on it over the final weekend it is due. I have a partner for this, but he is of no use in any IT subject. I would greatly appreciate if anyone could direct me to online tutorials or such, because I don't know how to do the following: construct the form so that the data can be written to a file in a way it can later be read, how to actually write this data to file, how to retrieve and read it. The assignment in short: Develop a form-based Web application that provides the following functionality: o Selection of a shape to develop o Creation of a collection of shapes o Various user queries of your own choice A system developed using object-oriented php which supports inter alia: o Various shapes o A collection of shapes o File I/O The pitiful excuse I have so far gives me this: http://www.aberdonia.com/aberdonia/web-dev/coursework/testing/showshapes.php
×
×
  • 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.