Welcome! Log In Create A New Profile

Advanced

array.php - Array Functions

Posted by 48732028Lehan 
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
array.php - Array Functions
March 19, 2013 02:01PM
In regard to the array.php assignment page, the instructions state "Using array functions echo back to the user the selections he/she made.", what are these functions supposed to do? Should we use the functions listed on page 104-106 to alter the information sent by the user or just output the created array using a for loop or the print_r function? Also, if we do need to use the above mentioned functions how many do we need to use?
avatar
Mac
Re: array.php - Array Functions
March 20, 2013 08:16AM
Say you have tw check boxes like this:

Language: PHP
<form action=""> <input type="checkbox" name="vehicle" value="Bike">I have a bike<br> <input type="checkbox" name="vehicle" value="Car">I have a car </form>

You need to send "vehicle" as an array, then extract it and present the selections back to the user. How you do that is your choice.
Re: array.php - Array Functions
March 20, 2013 08:36AM
Awesome! Thanks Mac! I thought I did it wrong...
Re: array.php - Array Functions
March 22, 2013 05:50PM
I know how to read data from an input element on a form and use it as a variable in php.
But if I have say an extra textbox that I want to use to display my results, hoW do I get the
results to diSplay on the text box? this all on one php file !

yOU URGENT RESPONSE WILL BE APPRECIATED!

as you can see , deadlines always produce all kinds of errors !
avatar Re: array.php - Array Functions
March 22, 2013 07:03PM
@ Mbux

Try the following:
Language: PHP
<input type="text" name="some_textbox" value="<?php echo $value_to_output; ?>" />

The value of your textbox is the variable that holds the data.
Got it from this link: "http://osprey.unisa.ac.za/phorum/read.php?753,175293";

Regards,
Jared
Sorry, only registered users may post in this forum.

Click here to login