The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
Dev Shed Forums
> Programming Languages
> PHP Development
Need a php code to display Gp of ten courses using function
Discuss Need a php code to display Gp of ten courses using function in the PHP Development forum on Dev Shed. Need a php code to display Gp of ten courses using function PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
Dev Shed Forums Sponsor:
February 9th, 2013, 07:36 AM
Registered User
Join Date: Feb 2013
Posts: 5
Time spent in forums: 1 h 6 m 6 sec
Reputation Power: 0
Need a php code to display Gp of ten courses using function
My texfield names inclube: ['name'] ['department'] ['regnos'] ['com111'] ['com112'] ['com113'] ['com101'] ['math111'] ['math112'] ['math113'] ['gns127'] ['otm126']
Comments on this post
ptr2void
disagrees: Do your own damn homework, slacker!
February 9th, 2013, 03:02 PM
Post what you have tried and explain what doesn't work. We won't do your homework for you but we will point you in the right direction.
__________________
There are 10 kinds of people in the world. Those that understand binary and those that don't.
February 10th, 2013, 04:08 AM
Registered User
Join Date: Feb 2013
Posts: 5
Time spent in forums: 1 h 6 m 6 sec
Reputation Power: 0
I have tried and isnt working. My code is: <?php
$name=$_POST['name'];
$regnos=$_POST['regnos'];
$department=$_POST['department'];
$com111=$_POST['com111'];
$com101=$_POST['com101'];
$com112=$_POST['com112'];
$com113=$POST['com113'];
$math111=$_POST['math111'];
$math112=$_POST['math112'];
$math113=$_POST['math113'];
$gns127=$_POST['gns127'];
$otm126=$_POST['otm126'];
function grade($grade1){
if($grade1>=70 and $grade1<=100)
{
$grade1="4*4.0";
}elseif($grade1>=70 and $grade1<=74)
{
$grade1="4*3.75";
}elseif($grade1>=65 and $grade1<=74)
{
$grade1="4*3.50";
}elseif($grade1>=65 and $grade1<=69)
{
$grade1="4*3.0";
}elseif($grade1>=60
and $grade1<=64)
{
$grade1="4*2.75";
}elseif($grade1>=50 and $grade1<=54)
{
$grade1="4*2.50";
}
return $grade1;
echo $com111." " .grade($com111). "<br>";
echo $com112." " . grade($com112). "<br>";
echo $com113. " " . grade($com113). "<br>";
echo $com101. " " . grade($com101). " <br>";
echo $math111." " . grade($math111). "<br>;
echo $math112." ". grade($math112). "<br>";
echo $math113." " . grade($math113). "<br>";
echo $gns127." " . grade($gns127). "<br>";
echo $otm126." ". grade($otm126). "<br>";
?>
The program is giving me undefined index in all my $_POST entries. Plz i nid serious help. Tanxs nd God bless!
February 10th, 2013, 04:14 AM
Registered User
Join Date: Feb 2013
Posts: 5
Time spent in forums: 1 h 6 m 6 sec
Reputation Power: 0
Have tried it
Dude,i have tried it and it is giving me undefined index
February 10th, 2013, 04:37 AM
pollyanna
Join Date: Jul 2012
Location: Germany
Dude, then obviously you aren't POSTing anything to your script. How do you run your script? What's the exact content of $_POST?
You need to make an HTML form with a field for each "name", "regnos", "department" etc. And this form has to be sent to your script.
February 10th, 2013, 06:43 AM
Registered User
Join Date: Feb 2013
Posts: 5
Time spent in forums: 1 h 6 m 6 sec
Reputation Power: 0
Tanxs 4 ur help
Brother,plz i still can't get wot u mean. Plz can u help me re-write d code? Tanxs 4 ur help nd may God bless You
February 10th, 2013, 07:48 AM
Let's start at the beginning. In order for $_POST to have any data in it, you need to submit it with a form. Post the HTML of your form.
Note: Please enclose your code in [ PHP ] tags. See the sticky at the top of this forum. Edit your original post.
February 10th, 2013, 09:38 AM
Registered User
Join Date: Feb 2013
Posts: 5
Time spent in forums: 1 h 6 m 6 sec
Reputation Power: 0
I have goten my form
I have designed my form very well and all is remaining is to create my procesingpage wich is the coding and afta which i add d action 2 my form. My textfied name includes:
name
regnos
department
com101
com112
com111
com113
math111
math112
math113
gns127
otm126
Plz help me with d right code
February 10th, 2013, 09:45 AM
Not very well as far as I can see. There is no form.
February 10th, 2013, 10:08 AM
pollyanna
Join Date: Jul 2012
Location: Germany
Man, sometimes it's like we were f*cking interrogators, who have to beat secret information out of people...
Comments on this post
gw1500se
agrees: I'm about to give up on this OP and let someone else with more patience try it. No idea why the OP
refuses to provide relevant information.
ptr2void
agrees: No patience for help vampires here either.
Developer Shed Advertisers and Affiliates
Thread Tools
Search this Thread
Display Modes
Rate This Thread
Linear Mode
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off