Welcome! Log In Create A New Profile


Topic 5A

Posted by mauritz 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
avatar Re: Topic 5A
September 14, 2009 07:03PM
Hidden fields are fun... I kinda forgot to define the variables (shows what happens when you skip a few weeks between chapters).

5A done and dusted.

"Cleverly disguised as a responsible adult."
Re: Topic 5A
September 22, 2009 08:02AM
Done with 5A
avatar Re: Topic 5A
September 22, 2009 01:36PM
Finally done... theoretically pretty tricky but in practise, it's a breeze
Re: Topic 5A
September 28, 2009 02:58PM
Done... Awesome but abit tricky
Anonymous User
Re: Topic 5A
September 29, 2009 03:57PM
Done with this one.

echo "<input name='fname' type='hidden' value='$firstname'>";
echo "<input name='lname' type='hidden' value='$lastname'>";

it is important to note that in lines 3 and 4 we are declaring two hidden input fields and at the sametime
assigning some values to them. These values are coming from our variables declared in lines 1 and 2 respectively.
avatar Re: Topic 5A
September 30, 2009 01:43PM
Done 5A, found this task not to hectic...
Re: Topic 5A
October 01, 2009 06:08PM
OK Done I understand the role input type hidden in html form
Re: Topic 5A
October 02, 2009 03:41PM
5A Done.
Re: Topic 5A
November 06, 2009 05:56PM
5A Form.php

<form method=post action='hiddenfields.php'>
<b>WebBooks.com Reader Survey</b> <br>
What is your first name?<br>
<input name='firstname' type='text'> <br>
What is your last name? <br>
<input name='lastname' type='text'> <br>
What is your age? <br>
<input name='age' type='text'>
<br> <input type='submit'>


<form method=post action="hiddenfields2.php">
<b>WebBooks.com Reader Survey</b> <br>
Select all of the subjects that reflect your reading tastes: <br>
<input name='choice[]' type='checkbox' value='Fiction'>Fiction <br>
<input name='choice[]' type='checkbox' value='Non-fiction'>Non-fiction <br>
<input name='choice[]' type='checkbox' value='Theater'>Theater <br>
<input name='choice[]' type='checkbox' value='Computing'>Computing <br>
<input name='choice[]' type='checkbox' value='Science'>Science <br>
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
echo "<input name='fname' type='hidden' value='$firstname'>";
echo "<input name='lname' type='hidden' value='$lastname'>";
<input type='submit'>


<b>WebBooks.com Reader Survey</b> <br>
<?php $fname = $_POST['fname'];
$lname = $_POST['lname'];
$choice = $_POST['choice'];
echo "Thanks for responding to the survey $fname $lname <br>\n";
echo "<b>These are your favorite book categories:</b>";
echo"<br>"; for ($i=0; $i<count($choice); $i++) {
echo "$choice[$i]<br>";
Sorry, only registered users may post in this forum.

Click here to login