Welcome! Log In Create A New Profile

Advanced

smile Lets talk php

Posted by gcobani 
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
avatar smile Lets talk php
February 05, 2013 01:02PM
Language: PHP
<?php session_start(); // start up your PHP session! ?>
What is session?
How to register a session?
How to use them and why should we use these functions?

gbakamela [77234715]
smile Re: Lets talk php
February 11, 2013 12:06PM
Still learning more about (parentheses).

<?php

$first_number = 112
$second_number =140
$third_number = 10

//using parentheses to force php

$sum_total = ($third_number + $second_number) * $first_number;

print($sum_total)

?>
Php forms
February 11, 2013 12:24PM
I just started working on forms and I'm facing a few challenges understanding the METHODS and Action. Someone can explain it to me the way they understand it ill be grateful.
avatar
Mac
smile Re: Re: Lets talk php
February 11, 2013 12:57PM
77960009 Lean Wrote:
-------------------------------------------------------
> Still learning more about (parentheses).
>
Please use the formatted code button to post code...
avatar
Mac
Re: Php forms
February 11, 2013 01:02PM
77681533 HUGH Wrote:
-------------------------------------------------------
> I just started working on forms and I'm facing a
> few challenges understanding the METHODS and
> Action. Someone can explain it to me the way they
> understand it ill be grateful.

Two useful explanations:
http://www.tizag.com/phpT/postget.php
http://www.tutorialspoint.com/php/php_get_post.htm

In short, the method defines how the information collected by the form is sent to the next page for processing. POST it is hidden, and GET is it visible in the URL in the browser
The ACTION says to which page it must be sent.
avatar Re: Php forms
February 11, 2013 01:11PM
METHODS are fuctions that called to perform certain action e.g.
Language: PHP
<?php function myGreeting($firstName){ echo "Hello there ". $firstName . "!<br />"; } ?>

and for the forms are used to get or post or submit data e.g
Language: PHP
<form action="process.php" method="get"> <select name="item"> ... <input name="quantity" type="text" />
This HTML code specifies that the form data will be submitted to the "process.php" web page using the POST method. The way that PHP does this is to store all the "posted" values into an associative array called "$_POST". Be sure to take notice the names of the form data names, as they represent the keys in the "$_POST" associative array.

gbakamela [77234715]
smile Re: Lets talk php
February 12, 2013 09:59PM
I'm currently on the PHP switch statement. Hope i'm not too behind. smile
smile Re: Lets talk php
February 13, 2013 11:21PM
Can some one explain this to me, why this curly brackets from the ISSET has to cover the whole PHP code from the <head> part?
cause the firs one facing right is on top but the last one facing left is on the bottom. Hope you understand my question.


Language: PHP
if (isset($_POST[';Submit';])) {   $username = $_POST[';username';];   if ($username = = "letmein") { print ("Welcome back, friend!"); } else { print ("You';re not a member of this site"); } }
avatar
Mac
smile Re: Lets talk php
February 14, 2013 07:42AM
The isset checks is the form was submitted, and if it was, then { the rest of the code as received from the form is run.} inside the isset brackets. That makes sense if you think about it.

If the code is indented like this then it is clearer

Language: PHP
if (isset($_POST[';Submit';])) {   $username = $_POST[';username';];   if ($username = = "letmein") { print ("Welcome back, friend!"); } else { print ("You';re not a member of this site"); } }
smile Re: Re: Lets talk php
February 14, 2013 10:14AM
I all makes sense now, Thanks!
Re: Php forms
February 17, 2013 07:32AM
These are very nice website
Re: Php forms
February 18, 2013 09:52AM
Ja... just to add on that the method for your form tag must be post if you going to use $_POST constant and get if you going to use $_GET... also you can use $_REQUEST for both post and get methods... the different between POST and GET is, for GET the posted data can be seen on your URL and POST cannot be seen... so for security reasons always use post for your method... that's a good practise.... e.g. process.php?quantity=somevalue&username=letmein (GET) and process.php (POST)....

also there is a bug on the code above on the if statement....

Language: PHP
if ($username = = "letmein") { print ("Welcome back, friend!"); }

it must be:
Language: PHP
if ($username == "letmein") { print ("Welcome back, friend!"); }

Notice the "==" there must never be space between the "=" sign... I hope you got that bug... just clarifying for other who can't see that... and you can also use "===" which is very strict when it comes to the data type... so if you have for example....

Language: PHP
$var1 = "10"; $var2 = 10;   if ( $var1 == $var2 ) { // do some thing echo "{$var1} is the same as {$var2} using == "; }   if ( $var1 === $var2 ) { // do some thing echo "{$var1} is the same as {$var2} using === "; }   // The answer will be the first if statement answer.... // So the === is very strict when it comes to data type so $var1 was supposed to be 10 not "10" then both the if statements could have worked // so if you really want to check for equality and the type of the data if its a string, integer or other data types you must use ===

But otherwise cool.....
smile Re: Lets talk php
February 18, 2013 01:11PM
I was able to finish this exercise successfully without an error.

Exercise
Add two text boxes and a Submit button to a HTML form. Invite the user to enter a first name and surname. When the button is clicked, print out the person's full name. Don't worry about what is in the text boxes after the button is clicked.

Exercise
Using the same form as the previous exercise, display the first name and surname in the textboxes, instead of printing them out.

Exercise
Suppose your web site has only 5 users. Create a HTML form to check if a visitor is one of the 5 users. Display a suitable message.

spinning smiley sticking its tongue outthumbs up
avatar smile Re: Lets talk php
February 26, 2013 09:49AM
this week I encounter some error or warning called Undefined index : pagelogin in C:\inetpub\wwwroot\prcatice\login.php line 6
Language: PHP
// connetion <?php include("../config.php"); ?> <?php $Username = $_POST[';username';]; $Mypassword = $_POST[';password';]; $comment= $_POST[';comment';]; // send the data to the database ?>
so i tried to put @ symbol infront of the $Username which will result on no error output
Language: PHP
@ $Username = $_POST[';username';];
is this this a right solution to undefined index if not what is the solution? After this i got new error looking like this
Language: SQL
mysql_num_rows() expects parameter 1 TO be resource, BOOLEAN given IN
Now i'm stucked

gbakamela [77234715]
smile Re: Re: Lets talk php
February 26, 2013 10:32AM
Hi, the information you've provided it's not sufficient. The problem lies on your MySQL function where you calling mysql_num_rows() - it takes in a resource as a parameter not a boolean, that means you passed in incorrect parameter. Your parameter returns a boolean according to my understanding it must be a resource... what are you trying to do, provide us with your query or the code that calls the function mysql_num_rows(), then we can try to help you... cool
smile Re: Lets talk php
February 26, 2013 10:56AM
Another thing is the '@' sign is only used to suppress warning and notices after development phase, not errors... you must fix errors/bugs when you in development phase don't just put the @ sign just to ignore the bug... that will catch you later because you will get strange results (bugs) and not what you expected.... So the @ is used after development, just so that the user can't see the notice or warnings.... But I recommend that you write code that never uses this '@' sign... it's very much possible to have code that doesn't contain '@' sign..... Cool..
avatar
Mac
smile Re: Lets talk php
February 26, 2013 12:02PM
Undefined index errors appear on some servers where the configuration is correctly set up to force you to code properly, although it is a minor issue which you can suppress in the config file of php.

Simply test if the variable exists like this before using it

Language: PHP
if(isset($_POST[';username';])) { $username=$_POST[';username';]; // do what you want to do
avatar smile Re: Lets talk php
February 26, 2013 07:42PM
here is my code and i still have problem
Language: PHP
<?php // turn on buffering, no output ob_start(); session_start(); include("../scripts-pvt/config.php"); $tbl_name="members"; //table name //Define 4myusername and $password if(isset($_POST[';myusername';])) { $username=$_POST[';myusername';];   //@$myusername=$_POST['; myusername';]; //$mypassword=$_POST['; mypassword';]; if(isset($_POST[';mypassword';])) $mypassword=$_POST[';mypassword';]; $mypage=$_SESSION['; page';]; } // to protect MySQl injection (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); //http://php.net/manual/en/function.mysql-real-escape-string.php $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql= "SELECT * FROM $tbl_name WHERE Members_Username=';$myusername'; and Member_Password=';$mypassword';"; $result = mysql_query($query) or die(mysql_error()); //Mysql _num_row is Counting table $count = mysql_num_rows($result); //if the result matched $myusername and $password, table row must be 1 row if($count==1){ //Register $myusername, $mypassword and redirect to file "login_success.php" echo $page; $_SESSION['; myusername';] = $myusername; $_SESSION['; mypassword';] = $mypassword; header($mypage); } else{ echo"wrong username or password"; } //turn off buffering ob_end_flush(); ?>
output
Notice: Undefined variable: myusername in C:\inetpub\wwwroot\practice php\member login\checklogin.php on line 18

Notice: Undefined variable: mypassword in C:\inetpub\wwwroot\practice php\member login\checklogin.php on line 19

Notice: Undefined variable: query in C:\inetpub\wwwroot\practice php\member login\checklogin.php on line 24
Query was empty

gbakamela [77234715]
avatar
Mac
smile Re: Lets talk php
February 27, 2013 08:24AM
Firstly, you used $query - the query is $sql, so correct is:

Language: PHP
$sql= "SELECT * FROM $tbl_name WHERE Members_Username=';$myusername'; and Member_Password=';$mypassword';"; $result = mysql_query($sql) or die(mysql_error());

Also, you can combine functions

Language: PHP
$username = mysql_real_escape_string(strip_slashes($_POST[';username';]));

With regards to the undefined notices - you define

Language: PHP
$username=$_POST[';myusername';]; //but furtherdown you use $myusername = stripslashes($myusername);

Do not nest the issets

Language: PHP
if(isset($_POST[';myusername';])) { $myusername=$_POST[';myusername';]; }   if(isset($_POST[';mypassword';])) { $mypassword=$_POST[';mypassword';]; }
smile Re: Re: Lets talk php
February 27, 2013 08:46AM
OK.. let me try to get this right.... first you have your for which looks like this:

Language: HTML
<form action="checklogin.php" method="post"> <input type="text" name="myusername" /> <input type="password" name="mypassword" /> </form>

so in the checklogin.php you must use the input name to get the post values....

Language: PHP
if ( isset( $_POST[';myusername';] ) ) $myusername = $_POST[';myusername';]; if ( isset( $_POST[';mypassword';] ) ) $myusername = $_POST[';mypassword';];

Notice you first if statement it has an opening brace but no closing brace.... so your if it's incorrect....

Language: PHP
//Define 4myusername and $password if(isset($_POST[';myusername';])) { $username=$_POST[';myusername';];   //@$myusername=$_POST['; myusername';]; //$mypassword=$_POST['; mypassword';]; if(isset($_POST[';mypassword';])) $mypassword=$_POST[';mypassword';]; $mypage=$_SESSION['; page';]; }

It must be: (Please read the comments I've inserted)

Language: PHP
//Define 4myusername and $password if(isset($_POST[';myusername';])) { $username=$_POST[';myusername';]; // So you declared the ';myusername'; post value as $username not $myusername..... that';s why you get an Undefined variable myusername }   //@$myusername=$_POST['; myusername';]; //$mypassword=$_POST['; mypassword';]; if(isset($_POST[';mypassword';])) { $mypassword=$_POST[';mypassword';]; // You getting an Undefined variable mypassword because of your incorrect if statement braces $mypage=$_SESSION[';page';]; // Notice there';s no space '; page'; but ';page'; }

The the query...:

Language: PHP
// User $query or $sql and stick to one $query = "SELECT * FROM {$tbl_name} WHERE Members_Username={$myusername} and Member_Password={$mypassword}"; // Assuming that in the members table you have the cols ';Member_Username'; and ';Member_Password'; with uppercase   $result = mysql_query($query) or die(mysql_error()); // This is fine (but in your case you must use $sql not $query) Undefined $query because you declared you query as $sql   $count = mysql_num_rows($result); // Then this should now work

OK your:

Language: PHP
if ( $count == 1 ) { // If you are using the header() function you must not echo any code above it won';t work // And your session variable please remove the space before the post input name e.g. $_SESSION['; myusername';] = $myusername; $_SESSION['; mypassword';] = $mypassword;   // MUST BE: $_SESSION[';myusername';] = $myusername; $_SESSION[';mypassword';] = $mypassword; }

This might not exist... but I guess you declared it somewhere:

Language: PHP
// $_SESSION[';page';];

OK conclusion hope I didn't forget that much.... Obviously you where copying a pasting somewhere that's why you can't make sense or see what's incorrect.... like the $query variable.. So if you ever in your coding like get an Undefined variable Notice.... that's the simplest of all because it gives you the undefined name and line number, so just trace and see where you defined it, if not define it.... another thing it would help to use if-else so that if the variable is not set then it can be declared in the else block and assigned to an empty string for example.... add please label your variables with good names so $misname can be $username as you did.... And please read the comments I've added to help you with the bugs... thanks for showing us you code... hope my explanation works... cool happy PHP Programming smiling smiley

Please feel free to ask again when you stuck.... great way to learn is to make mistakes, then ask if you lost and learn from that..... cool
smile Re: Re: Re: Lets talk php
February 27, 2013 08:52AM
Oh... one your SQL query statements let try keep all the keywords or SQL keywords uppercase, not really that important but some SQL engines are case sensitive and it's a good SQL scripting or programming rule to follow..... cool

so in your query:
Language: PHP
// User $query or $sql and stick to one $query = "SELECT * FROM {$tbl_name} WHERE Members_Username={$myusername} and Member_Password={$mypassword}";


will be (notice the AND):
Language: PHP
// User $query or $sql and stick to one $query = "SELECT * FROM {$tbl_name} WHERE Members_Username={$myusername} AND Member_Password={$mypassword}";
avatar smile Re: Lets talk php
February 27, 2013 09:33AM
spinning smiley sticking its tongue outthanks guys and i managed to fix it just after posting the script on the forum and query is the one was really giving me a hustle thanks again now its all clearedspinning smiley sticking its tongue outthumbs up

gbakamela [77234715]
smile Re: Re: Lets talk php
February 27, 2013 09:57AM
Cool...lekke thumbs up
smile Re: Lets talk php
March 01, 2013 02:47PM
What does "<BR>" do?
Language: PHP
while($start<11){ $answer = $start * $times; print($start."times".$times."=".$answer."<BR>"); $start++; }
smile Re: Re: Lets talk php
March 01, 2013 02:52PM
Hi, <BR> sometimes written as <br /> or <br> it's an HTML break tag.... it's similar to the enter key on you keyboard... it's a new line or go to the new line.
avatar
Mac
smile Re: Lets talk php
March 01, 2013 03:48PM
Ahem....

Admission requirements
Pre-knowledge on the development of static Web based applications (HTML).

You are fortunate to have received an answer from a very keen fellow student.... because I would not smiling smiley That said, feel free to post here, but consider an answer a lucky packet!

The intention is not being stingy, but I have to follow posts from 1000 students across 4 courses.... so I need to delineate.

I therefore suggest you Google for "HTML crash course".

http://webhelp.org/html/
http://www.edwebproject.org/htmlintro.html

Do not now retreat into a shell smiling smiley
smile Re: Lets talk php
March 04, 2013 07:05AM
Hello all....I hope and trust u all had good weekend...I also sincerely hope as you go through these lessons you are having the end in mind in building that perfect web application, I completed chapters 1 to 6 and m about to begin chapter 7,hope m not too far behind. before I proceed I made small college registration form to demonstrate my own understanding of what weve been studyn, its running perfectly but kindly run the code below and advise me on the following . NB: save your form as " am_regform.php ".

Language: PHP
<html> <head> <title>login form</title> <?PHP   if (isset($_POST[';Submit';])) { $Firstname = $_POST[';Firstname';]; $Surname = $_POST[';Surname';];   print ("......ICT College REGISTRATION FORM.......");   } echo "<div>\n"; echo " <br /> \n";     $male_status = ';unchecked';; $female_status = ';unchecked';; if (isset($_POST[';Submit';])) {   $selected_radio = $_POST[';gender';];   if ($selected_radio == ';Male';) {   $male_status = ';checked';; print ("YOUR NAME : Mr "."$Firstname"." $Surname"." "); echo "<div>\n"; echo " <br /> \n"; print ("GENDER : "); print ("$selected_radio"); echo "<div>\n"; echo " <br /> \n"; } else if ($selected_radio == ';Female';) {   $female_status = ';checked';; print ("YOUR NAME : Ms "."$Firstname"." $Surname"." "); echo "<div>\n"; echo " <br /> \n"; print ("GENDER : "); print ("$selected_radio"); echo "<div>\n"; echo " <br /> \n"; }   else { $Firstname =""; $Surname =""; } echo "<div>\n"; echo " <br /> \n"; print("LANGUAGES CHOSEN ARE: "); echo "<div>\n"; echo " <br /> \n";   $ch1 = ';unchecked';; $ch2 = ';unchecked';; $ch3 = ';unchecked';; $ch4 = ';unchecked';; $ch5 = ';unchecked';;     if (isset($_POST[';Submit';])) {   if (isset($_POST[';ch1';])) { $ch1 = $_POST[';ch1';];   print $selected_Checkbox;   if ($ch1 == ';Afrikaans';) { print("$ch1"); $ch1 = ';checked';; echo "<div>\n"; echo " <br /> \n"; } }   if (isset($_POST[';ch2';])) { $ch2 = $_POST[';ch2';];   if ($ch2 == ';English';) {   print("$ch2"); echo "<div>\n"; echo " <br /> \n"; $ch2 = ';checked';; } }   if (isset($_POST[';ch3';])) { $ch3 = $_POST[';ch3';];   if ($ch3 == ';Suthu';) { print("$ch3"); echo "<div>\n"; echo " <br /> \n"; $ch3 = ';checked';; } }   if (isset($_POST[';ch4';])) { $ch4 = $_POST[';ch4';];   if ($ch4 == ';Setswana';) { print("$ch4"); echo "<div>\n"; echo " <br /> \n"; $ch4 = ';checked';; } }   if (isset($_POST[';ch5';])) { $ch5 = $_POST[';ch5';];   if ($ch5 == ';Zulu';) { print("$ch5"); echo "<div>\n"; echo " <br /> \n"; $ch5 = ';checked';; } }       $itcourses = array();   $itcourses["msitp"] = "MicroSoft ITP Certification - R7000 "; $itcourses["cisa"] = "CISA ISACA Certification - R5000"; $itcourses["linux"] = "Linux+ Comptia Certification - R2000 "; $itcourses["ccna"] = "Explorer CCNA CISCO Certification - RR4500"; $itcourses["java"] = "Java Sun Certification - 6000 ";         print("OTHER IT COURSES @ ITC COLLEGE"); echo "<div>\n"; echo " <br /> \n";     print $itcourses["linux"]; echo "<div>\n"; echo " <br /> \n"; print $itcourses["cisa"]; echo "<div>\n"; echo " <br /> \n"; print $itcourses["java"]; echo "<div>\n"; echo " <br /> \n"; print $itcourses["ccna"]; echo "<div>\n"; echo " <br /> \n"; print $itcourses["msitp"]; echo "<div>\n"; echo " <br /> \n";     print("......Ts and Cs Apply......Goodbye......"); echo "<div>\n"; echo " <br /> \n"; } } ?> </head> <body> <Form name ="form1" Method ="POST" Action ="am_regform.php"> <FORM name ="form1" Method ="post" action ="am_regform.php">   <INPUT TYPE = "TEXT" VALUE ="Enter Firstname here!" Name ="Firstname"> <INPUT TYPE = "TEXT" VALUE ="Enter Surname here!" Name ="Surname"> <br />   <Input type = ';Radio'; Name =';gender'; value= ';Male'; <?PHP print $male_status; ?> >Male   <Input type = ';Radio'; Name =';gender'; value= ';Female'; <?PHP print $female_status; ?> >Female   <P> <Input type = ';Checkbox'; Name =';ch1'; value ="Afrikaans" <?PHP print "$ch1"; ?> >Afrikaans <P> <Input type = ';Checkbox'; Name =';ch2'; value="English" <?PHP print $ch2; ?> >English <P> <Input type = ';Checkbox'; Name =';ch3'; value="Suthu" <?PHP print $ch3; ?> >Suthu <P> <Input type = ';Checkbox'; Name =';ch4'; value="Setswana" <?PHP print $ch4; ?> >Setswana <P> <Input type = ';Checkbox'; Name =';ch5'; value="Zulu" <?PHP print $ch5; ?> >Zulu <P> <INPUT TYPE = "Submit" Name = "Submit" VALUE = "Click here to submit details">   </FORM> </body> </html>

1. On my array instead of just printing out the array, how can i get the user to enter all the elements of the array and how can he define the number of elements in the array.
2. Kindly explain the best way to print on a new line, and while u at it pleas explain for me the differences in these php codes...<p>, <br>, \n, echo "<div>\n"; and
echo " <br /> \n";
avatar
Mac
smile Re: Lets talk php
March 04, 2013 08:12AM
> On my array instead of just printing out the array, how can i get the user to enter all the elements of the array and how can he define the number of elements in the array.

???? The user can't, the code does ????


> Kindly explain the best way to print on a new line, and while u at it pleas explain for me the differences in these php codes...<p>, <br>, \n, echo "<div>\n"; and
echo " <br /> \n";

HTML... a prerequisite for this course sad smiley

Pre-knowledge on the development of static Web based applications (HTML).

Not meant to discourage you, but we cannot cover HTML issues here.
avatar smile Re: Re: Lets talk php
March 04, 2013 08:23AM
Maybe this HTML cheat sheet, with a lot of the commonly used HTML tags, will help a bit, you could use it as a reference: http://www.webmonkey.com/2010/02/html_cheatsheet/
smile Re: Re: Re: Lets talk php
March 04, 2013 01:55PM
Oooh! Thanks,
smile Re: Lets talk php
March 04, 2013 07:18PM
Functions are like your collection of tools in your tool box.Everytime you want to use them you just call them instead of coding(buying) each and every time
smile Re: Lets talk php
March 06, 2013 01:16PM
Thanks for webmonkey sit, m covered in tht area now, guess php and html are married, otherwise on our final practical project portfolio we will be required to make an application that "Administrators can add, view, edit and delete student and course details" the reason I am asking " On my array instead of just printing out the array, how can i get the user to enter all the elements of the array and how can he define the number of elements in the array" is that I am am having this idea in mind of using these same arrays and of course variable that will prompt the user to create courses and student details. yes i know in my previous example i created them flat in the code, but instead of me defining then within the code like this
Language: PHP
$itcourses = array();   $itcourses["msitp"] = "MicroSoft ITP Certification - R7000 "; $itcourses["cisa"] = "CISA ISACA Certification - R5000"; $itcourses["linux"] = "Linux+ Comptia Certification - R2000 "; $itcourses["ccna"] = "Explorer CCNA CISCO Certification - RR4500"; $itcourses["java"] = "Java Sun Certification - 6000 ";

what is the best way i can create or code such that the administrator can himself create the course code: msitp and course details: MicroSoft ITP Certification - R7000, so far the way how I have understood php to do it is by using the
Language: PHP
<INPUT TYPE = "TEXT" VALUE ="Enter Course here!" Name ="Course">
way. Will this be the best way in inputting values into arrays as well?.Will arrays be the best for this situation? in a nutshell m jus askin how can the user be prompted to enter the size of the array and enter items into the array, hope u understand my question. smile

..&ru..
smile Re: Re: Lets talk php
March 06, 2013 01:58PM
Hi, well we all have our own way of solving a problem... so just come with you own way of solving this problem as long as it's good programming, makes logic and the results are correct then use that... I would approach this situation differently, I will never ask the user to enter the course. I'll just present the available courses, then the user will have to choose from that.... so for your array... I would have a select list with all the courses in your array to choose from.... for example:

Language: HTML
<select name="courses"> <option value="msitp">MicroSoft ITP Certification - R7000</option> <option value="cisa">CISA ISACA Certification - R5000</option> <!-- and so on --> </select>

to choose more than one... it's up to you to figure that out... cool hope that helps...
avatar
Mac
smile Re: Lets talk php
March 06, 2013 02:42PM
Yes, the administrator can add the course using a form. The user can only select a course, which is drawn from the db. Imagine two students being allowed to type the course they wish register for....

#1: MicroSoft ITP Certification
#2: Microsift IPT Certfiction

Now you want you extract info from the db about who has registered for this course? Impossible..... write me that sql query and I will give you a pass right now! So you set the options as administrator. Only info students can add to the db is their personal information.
smile Re: Lets talk php
March 06, 2013 02:59PM
ok thanks, will very much opt to use check boxes for users(students) to select courses, while administrator will be the only one able to enter courses, will keep it simple to single variables for each course than arrays, thanks a mill mac and 77913523 for the clarity.smile

..&ru..
smile Re: Re: Lets talk php
March 06, 2013 03:09PM
Great choice.... check boxes will work good since you can choose 1 or more options.... glad I could help....
smile Re: Lets talk php
March 07, 2013 07:52AM
what if the institution is offering about 50 courses? are you going to have 50 checkboxes?

personally i will use select(drop down) that allows multiple selection, very neat. then you can use arrays and a loop with it. am i making sense?
smile Re: Re: Lets talk php
March 07, 2013 08:20AM
lol... ja you correct.... a lot of checkboxes indeed. But he can combine the two together, have a select box for the study field (e.g. IT, Engineering, etc.) and the checkboxes for the courses themselves.... but still that would be too much checkboxes if in IT we have 20 courses... I would also prefer a select box...
Sorry, only registered users may post in this forum.

Click here to login