Welcome! Log In Create A New Profile

Advanced

Task 2A, 2B and 2C

Posted by vad 
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
vad
Task 2A, 2B and 2C
February 03, 2010 07:29AM
These tasks are successfully completed.

Note:
I had problems with the passing of the parameters from the HTML to the PHP script. This is actually solved by changing the GET to POST in the HTML and then defining the variable/s in the actual PHP script. If a variable is not defined, no value will be accepted in the PHP script, hence no result. In the HTML, the GET serves the purpose of having the parameter displayed which of course violates security issues. I normally use this for debugging.
Re: Task 2A, 2B and 2C
March 01, 2010 06:20AM
Task 2a-c completed, changed the register_global to on in the php.ini file.
avatar
Mac
Re: Task 2A, 2B and 2C
March 01, 2010 06:26AM
register global should not be turned on as it a a security risk.... there is a workaround available and that is in essence the difference bwetween PHP4 and 5.
Re: Task 2A, 2B and 2C
March 03, 2010 09:41AM
Hello Mac,

I have completed 2A,B&C

Added:

error_reporting(E_ALL ^ E_NOTICE);

to turn off the notice errors scripts worked

used $_POST $_GET

not sure when to use them $_POST worked for 2B

& $_GET worked for 2C investigating this.

Thanks
Kashmira
avatar
Mac
Re: Task 2A, 2B and 2C
March 03, 2010 11:41AM
It depends on what your form method is specified as <form method=post or method=get... If it is send with a link <a href=page.php?name=Joan&sname=Potgieter> the it is get.
Also have a look at the information that appears in the URL when you use post and when you use get.
One shows, one not. One a security risk, other one not. One is good for testing - seeing what is passed to the next page.

I would actually like someone to post here their understanding/explanation of what I said above.
Re: Task 2A, 2B and 2C
March 03, 2010 01:07PM
Hi

I get it

the $_GET is used when the form method is GET and this is a security risk as the variable values appear on the URL

whilst the POST method hides the variables and values and php retrieves them with $_POST

Thanks

Kashmira
Tny
Re: Task 2A, 2B and 2C
March 03, 2010 11:50PM
Hi Mac and friends

completed Tasks 2A, 2B and 2C

As an extra I initialized the variable $cost=null outside the function total, then set $cost as global variable within the function total so I could print $cost to the browser. But realized that setting $cost=0 is probably better as the user will input numbers.(we assume they will enter only numbers in the fields of cost.html )
Anonymous User
Re: Task 2A, 2B and 2C
March 05, 2010 02:14PM
Hi

I had a problem with this task with my $_POST
but I have completed it and all looks good
Re: Task 2A, 2B and 2C
March 16, 2010 02:38PM
I Completed Tasks 2A, 2B and 2C successfully.
Re: Task 2A, 2B and 2C
April 08, 2010 04:59PM
completed these tasks.
MDC
Re: Task 2A, 2B and 2C
April 23, 2010 11:01PM
Yes, I know I have a lot of catching up to do, but will be working full blast on PHP for the next month and a bit.

Have done these three tasks.
Sorry, only registered users may post in this forum.

Click here to login