Welcome! Log In Create A New Profile

Advanced

Practical Page 2

Posted by armandhansen 
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
Practical Page 2
September 12, 2010 08:34PM
Hey Mac

Sorry to bug you with this but just to make sure, (have read it in the previous topics but rather be sure then mess up).
Can we use javascript where necessary (but mainly PHP) and can we use CSS to pimp it out? LOL

Thanks Mac
avatar
Mac
Re: Practical Page 2
September 13, 2010 07:51AM
Yes, but I won't mark it smiling smiley Also, make sure it works - if it does not work, then I cannot test if your page works!
Re: Practical Page 2
October 05, 2010 11:47AM
Hi Mac,

Can I create logins to distinguish between admin users and normal users by setting different access levels?
Can I for example link a logged in student with the edit / delete facility for records linked only to their student ID, and pure simple search functionality for non logged in users as well as a separate admin section if access level tests > '2' I would achieve this through sessions.
I am feeling the need to lay this out for a real world scenario.
Please let me know if this is acceptable.
avatar
Mac
Re: Practical Page 2
October 05, 2010 02:06PM
As answered in other thread...
Re: Practical Page 2
October 05, 2010 02:32PM
Thanks Mac, great news.
I think it will give me a greater of the scope of knowledge so far.
Re: Practical Page 2
October 24, 2010 03:41PM
Hi mac

will we be penalized if we have or insert, update and delete functions as separate pages ? and if we assume that a student can register for more than one course can we make a separate page to insert all that info into the table?
avatar
Mac
Re: Practical Page 2
October 25, 2010 07:35AM
You should try and have them all on one page, but it is ok if you have a delete page that does all the deleting for all the pages.
But you should not have a seperate page to handle multiple registrations, since you can catch these in an array, then loop through the array (with an insert statement in the array loop). So whether the student registers for one or more course is irrelevant if it is caught in an array.
Language: PHP
$array=$_POST[';cname......... //your form had a list with e.g. <input type=.... name=';cname[]';.... $count = count($array); // this counts how many elements the array has, so it can be one for a single course registration for ($i = 0; $i < $count; $i++) { mysql_query("INSERT........ echo "Registration copmpleted" }
avatar
Mac
Re: Practical Page 2
October 25, 2010 07:36AM
Having said that, it does not mean you HAVE to do it this way.
Re: Practical Page 2
October 25, 2010 11:42AM
Mac

With that does that mean that we have to insert the information on course_student table when we insert into the student_reg table? what i mean by that is do we have it on the student_reg insert or can we get the user to insert the data later in a separate page?
avatar
Mac
Re: Practical Page 2
October 25, 2010 12:39PM
Where do you get this sentence?
At the student_reg insert. In general one registers personal information, and then register for courses (or products or what have you) but remember this course is at code level - not at functionality level.
Re: Practical Page 2
October 25, 2010 02:19PM
Hi Mac

Sorry it seems i misunderstood where to put the code but just to make sure where would we run the code that inserts into the course_student table?
avatar
Mac
Re: Practical Page 2
October 26, 2010 06:26AM
You can put it in an if/else statement on the registration page
Language: PHP
if($submit){ //insert into db } else { //show registration form }
or you can do the insert on another page. But the 1st option is leaner.
Sorry, only registered users may post in this forum.

Click here to login