Jump to content


Photo

Simple PHP script - need some guidance/help


  • Please log in to reply
1 reply to this topic

#1 tbucknall

tbucknall

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 31 January 2013 - 08:34 PM

Hi all, very very new to php,

Just wondering it i could get anyones help with these steps.
Thanks in advanced.




  • Create a page called lab1.php

  • In lab1.php, create a Form with the following inputs:

    • Dropdown with options from 1 to 10, labeled “Rows:”

    • Another Dropdown with options from 1 to 10, labeled “Columns:”

    • Submit button

  • The form should submit values to “table.php” using the GET method

  • Create a page called table.php

  • In table.php, read the values submitted from lab1.php by referencing the appropriate indexes in
    the $_GET array.

  • In table.php, construct a table that has:

    • The amount of rows entered in part 2a

    • The amount of columns entered in part 2b

    • Your first name in every ODD cell(1,3,5,7...) . Your name can be a string literal
i. Ex: <td>JOHN</td>
7. Add the following styles to the top of the table.php page:
<style> td{
border: 1px solid black; }
</style>

#2 tbucknall

tbucknall

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 31 January 2013 - 08:37 PM

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<form action="#" method="GET">

<input type="hidden" name="firstName" value="Tadd"/>
<input type="hidden" name="lastName" value="Bucknall"/>
<input type="hidden" name="stuID" value="100834575"/>
Rows: <select name="Rows">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
<br />

Columns: <select name="Columns">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
<br />
<input type="text" placeholder="Please enter a color" name="color"/>
<br />
<input type="submit" name="submit" value="Try it"/>
</form>

Edited by tbucknall, 31 January 2013 - 08:37 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com