Jump to content
MakeWebGames

Not sure where to start?


Razor42

Recommended Posts

You must realize, just because you would have said, not many others do, we're used to "Thanks" that's it end of thread (or in some cases problem solved an no feedback: Example). A good rule of thumb, remain insistent on your need for help after suggestions have been posted, that way others still know you need help rather than just look over, see a solution and think okay problem solved.

Anyhow, I do not wish to argue with you, it's clear now you still need help, so the thread needs to remain open.

Link to comment
Share on other sites

You must realize, just because you would have said, not many others do, we're used to "Thanks" that's it end of thread (or in some cases problem solved an no feedback: Example). A good rule of thumb, remain insistent on your need for help after suggestions have been posted, that way others still know you need help rather than just look over, see a solution and think okay problem solved.

Anyhow, I do not wish to argue with you, it's clear now you still need help, so the thread needs to remain open.

I understand where your coming from, and no I do not wish to argue wih you. I respect you as a very good coder and someone often looking to give help. I would have replied with feedback had I have been given the chance to even test what had been given to me, I'm not exactly one of the people you often see on here begging for anwsers to their solutions and offering zero back and having no intention of learning. I do give back, pretty much everything I have coded for MC has been posted on this forum for free. What I am currently working on (the reason for this post) will also be posted on this forum for free. Right now thats out of the way...

 

I took what Sniko told me to do and added it to my coded. Then I went and tested what I had. I have now run into an other error :(...

The error is..

Fatal error: Call to undefined function index() in /home/a1908372/public_html/upload/education.php on line 8

 

The relavent piece of coding is...

<?php
include "globals.php";
print "<h3>School</h3>";
switch($_GET['action'])
{
case "gradecourses": gradecourses(); break;
case "cstart": cstart(); break;
default: index(); break;
}
if($ir['course'] > 0)
{
$cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}");
$coud=$db->fetch_row($cd);
print "You are currently doing the {$coud['crNAME']}, you have {$ir['cdays']} days remaining.";
}
else
{
function index()
{
$q=$db->query("SELECT * FROM grades");
print "Hello and welcome to school. Before doing a course, you must first select a grade....
<table width=75% cellspacing=1 class='table'><tr style='background:gray;'><th>Grade</th><th>Required Courses Complete</th><th>Enter</th></tr>";
while($r=$db->fetch_row($q))
{

$enter="<a href='education.php?gcourses={$r['crGRADE']}'>Enter</a>";
print "<tr><td>{$r['grade_name']}</td><td>{$r['crREQUIRED']}</td><td>$enter</td></tr>";
}
print "</table>";
}
}

 

Unsure why this is as I have defined the function?.

Link to comment
Share on other sites

Perhaps you fulfill this condition.

($ir['course'] > 0)

In which case, the function is never defined.

Take the function out of the if/else statement and then check.

If you want to stop upon fulfilling this condition, put it above the switch statement, and kill the script after your "You're doing a course" message.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...