Announcements Last Post
Announcement : Programming Students at UNISA School of Computing 06/19/2019 02:01PM
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
avatar Do i have to use if/else statements for fixtures.php??
May 02, 2013 12:35PM
Hi,
The tutorial letter says "The fixture list page is named fixtures.php.Here, listing, editing and deleting takes place on the same page(fixtures.php), using if/else statements". The sample code given to us is very confusing and I'm not managing to get it right. Can I do it the same as I the did with the list_players.php, by adding links going to another page? The tutorial letter says "All the functions must work in order for you to pass this module" - so if I get it to work without the if/else statements would that be fine??
avatar Re: Do i have to use if/else statements for fixtures.php??
May 02, 2013 01:00PM
Hi

Mac already answered another student with more or less the same question. The bad news is, I think the test here is to see if we can use logic to do everything on one page, so using other pages is a big no-no. The good news is, Mac told the student you don't have to follow the sample code given, and you can code the page any way you want. So if you find the sample code confusing, at least you can invent your own, but it must be on one page. If you search for the thread I am sure you will find it somewhere.
avatar Re: Do i have to use if/else statements for fixtures.php??
May 02, 2013 01:06PM
Ok thankx, I'll give it a go without the sample code and see how it goes. As long as all the code is fixtures.php and it never redirects to another page it's chilled?
Re: Do i have to use if/else statements for fixtures.php??
May 02, 2013 03:08PM
I am not 100% sure about the statement that it all has to be on one page...
believe as long as it works is true though...
the tricky thing with using another page that redirects you... is that you will need to think of way of displaying this other code...
but is easy enough to do it on same page.
avatar Re: Do i have to use if/else statements for fixtures.php??
May 02, 2013 03:35PM
My problem is setting $update=='yes', $delete=='yes' and so on. How do i get my if statements to excute?? If I can do it using links I'm definately going to do that.
Please help clear this up Mac.
avatar
Mac
Re: Do i have to use if/else statements for fixtures.php??
May 02, 2013 04:11PM
Why target me? This forum is not a one-top solution from me sad smiley What have you done, or should I send you the complete code smiling smiley
avatar Re: Do i have to use if/else statements for fixtures.php??
May 02, 2013 04:38PM
Not targeting, asking.
The reason for asking you is that you are the only one that can answer my question 100%. Can I include links or must it all be on one page? Including links is so much better and organised. All the tutorials and videos lessons I've looked at use links.
Please let me know if I can use links or not.
Thank you
Re: Do i have to use if/else statements for fixtures.php??
May 02, 2013 05:41PM
Hey Daniel.

I don't think If you've managed to code the edit and delete pages without any difficulties, you'll struggle with this one.
Firstly, you need to assign values that comes with the <a href> tag in those variables (e.g $update...) using the $_GET array e.g $update = $_GET['update'];

So in the if condition, you test if whether the variable contains the value 'yes', and if it does, you display the form with values in it .Remember not to put the form in the php code.And you do the same with the other variables,unless if you don't know how to if elseif else statements.

Honestly speaking, I don't think fixtures page is that difficult as many of us think.
avatar
Mac
Re: Do i have to use if/else statements for fixtures.php??
May 03, 2013 07:50AM
DanielCilliers Wrote:
-------------------------------------------------------
> Not targeting, asking.
> The reason for asking you is that you are the only
> one that can answer my question 100%.

Fair enough, but I have asked that this forum is used for collaboration and that student support one another, as Felix is doing here... I need you all to provide support.

I agree with Felix - the fixtures page is not that difficult. Forget about how to program it at first and consider the logic behind it, then program it.
avatar Re: Do i have to use if/else statements for fixtures.php??
May 03, 2013 09:49AM
Hey Felix,
I've programmed the whole page according to the sample code but I'm not sure how to get the variable to contain the value 'yes' or 'update' etc? The edit and delete pages are working hundreds.Whats easy for some isn't always easy for others, so any help would be greatly appreciated.
Re: Do i have to use if/else statements for fixtures.php??
May 03, 2013 03:10PM
Hey Daniel.

What kind of help are you looking for?For us to give you the whole code,no man.You need to struggle,spend sleepless nights coding programs that produce errors or that doesn't run.You still remember COS1511.This is the life of an aspiring programmer.

I think I gave you an example of how to assign the value 'yes' in a variable yesterday...($update = $_GET['update']winking smiley The sample code in the tut letter doesn't imply that the structure of the page must be like that.

You know what I like about programming is that there isn't a single code or solution for one problem.If you don't want to assign 'yes' or 'no' or 'absolutely' to a variable,then your if conditions can be like this e.g if(isset($_GET['update']) == 'yes').

You need to show us what you've done, because we can't afford to help you if you've done nothing besides copying the code in the tut letter.
avatar Re: Do i have to use if/else statements for fixtures.php??
May 03, 2013 04:20PM
Yes i remember COS1511 - awsom subject. I came right thank you Felix, just had to change my code from $_POST to $_GET for the variables (feel stupid for not noticing it before).The whole code would be nice thankx winking smiley Joking aside my questions have been answered, thanks to all.
Re: Do i have to use if/else statements for fixtures.php??
May 03, 2013 04:30PM
You are welcome.

I'm glad you realize that IT isn't a straightforward course like other courses e.g HR...You need to think out of the box.Don't worry man,you'll crack it.
Sorry, only registered users may post in this forum.

Click here to login