Welcome! Log In Create A New Profile

Advanced

Task 4A

Posted by kaajal 
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
Task 4A
April 01, 2007 07:15PM
A little bit confused with this one, as it does work fine.
My name, surname and the 1st checkerbox fiction shows up. But when i hit back and click another checkerbox it shows up as "on".And the array that displays on the top is

Array ( [firstname] => [lastname] => [age] => [choice] => Array ( [0] => on ) )

Has anyone else had a similar problem.

This my code in Thank-you.php

<?php
print_r($_POST);
$firstname=$_POST['firstname'];
$lastname=$_POST['lastname'];
$age = $_POST['age'];
$title = "Thank-you";
include("header.php"winking smiley;
echo "Thanks for responding to this survey $firstname $lastname" ;
echo "<br><br>";
echo "<b>These are your favourite book categories:</b>";
echo "<br><br>";
foreach ($_POST["choice"] as $category) {
echo "$category <br>\n";
}
include("footer.php"winking smiley;
?>
Re: Task 4A
April 03, 2007 02:44PM
Task completed
avatar Re: Task 4A
April 04, 2007 06:43AM
Done!

No Issues here!

Cheers!

A Successful Nature Inspires Other People...
Re: Task 4A
April 06, 2007 09:45AM
Completed
Re: Task 4A
April 06, 2007 12:17PM
Completed
Re: Task 4A
April 08, 2007 02:07PM
Task completed and the form processes successfully.....but I am unable to make sense of the debug errors that I am getting.

I am using Zend and in the debug information window I get

Notice: undefined index for: firstname
Notice: undefined index for: lastname
Notice: undefined index for: age

Debug Warning: php line 12 - Invalid arguement supplied for foreach()

This is confusing me as it works.

My code is as follows;

<?php
$firstname=$_POST['firstname'];
$lastname=$_POST['lastname'];
$age = $_POST['age'];
$title = "Thank-you";
include("header.php"winking smiley;
echo "Thanks for responding to this survey $firstname $lastname" ;
echo "<br><br>";
echo "<b>These are your favourite book categories:</b>";
echo "<br><br>";
foreach ($_POST["choice"] as $category) {
echo "$category <br>\n";
}
include("footer.php"winking smiley;
?>

Can anyone elaborate as to why I am getting debug errors and warnings yet the form is still processing correctly?

Any help would be appreciated.

Thanks.
avatar
Mac
Re: Task 4A
April 11, 2007 08:05AM
google for

zend debug Notice: undefined index for:
Re: Task 4A
April 14, 2007 09:19PM
Done
Re: Task 4A
April 15, 2007 05:30PM
All good, one of the most exciting lessons so far.

Got a bit carried away and added hyperlinks to view the guestbook, button to delete the guestbook and button to return if the details were not right.

Completed. spinning smiley sticking its tongue out
Re: Task 4A
April 24, 2007 11:24AM
completedcool smiley
Re: Task 4A
April 28, 2007 05:33PM
All Good.

smoking smiley
Re: Task 4A
April 29, 2007 06:21PM
Completed.
Re: Task 4A
May 09, 2007 07:01PM
Done
WjS
Re: Task 4A
May 15, 2007 09:08AM
Completed. I had no issues.
Sorry, only registered users may post in this forum.

Click here to login