Welcome! Log In Create A New Profile

Advanced

Topic 5A

Posted by Anonymous User 
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
Anonymous User
Topic 5A
January 16, 2006 08:20AM
This is the thread for problems/comments related to Topic 5A.
Re: Topic 5A
April 11, 2006 08:51AM
I have completed this topic. No problems.
Re: Topic 5A
April 21, 2006 07:33PM
Help! I am having a confused moment.

If the $firstname variable is created based on the name attribute of a form field, why are ‘fname’ and ‘lname’ needed in the echo statement in the hiddenfields.php file? Are fname and lname not going to be empty, as they do not exist in the form.php file, or are $firstname and $lastname supposed to put the contents of name=’firstname’ and name=’lastname’ into these name fields?

My code is as it is listed in the manual, but when I complete the form, the $fname and $lname variables are not printed to the screen. The book categories are though.

When I add print_r($_POST) to the code of the respective hiddenfields files, I get the following outputs:

Array([firstname]=>Wayne[lastname]=>Rothman[age]=>38)


Array([choice]=>Array([0]=>Non-Fiction) [fname]=>[lname]=>winking smiley

What am I missing here?
Re: Topic 5A
April 21, 2006 11:31PM
In the form.php the variables is $firstname and $lastname, but look in the hiddenfields.php, there the values you enter in the form.php are now assign to new variable names $fname and $lname on the new form.

I think it is the best to use one variable name for the same field for in all your forms, but this exercise show us that it is possible to use other names.

Use the $_POST['xx'] for all your variables in both the hidden...php files with the correct names and it will work. smiling smiley
Re: Topic 5A
April 23, 2006 12:21AM
Miekie thanks for the help.

I agree with keeping the same variable across the various pages. It keeps things much simpler.

Topic completed.
Re: Topic 5A
April 24, 2006 03:51PM
Also done.
Re: Topic 5A
April 25, 2006 10:03PM
Done. Slightly confused at first though.

Murphy's Technology Law 7
-- The attention span of a computer
is only as long as its electrical cord.
Re: Topic 5A
April 28, 2006 10:23AM
also done - I also changed the variables to firstname, lastname
Re: Topic 5A
May 02, 2006 11:08AM
Done with topic.
Re: Topic 5A
May 03, 2006 12:05AM
catching up

finished this topic

Sorry, you do not have permission to post/reply in this forum.