|
|
|
|
![]() ![]() |
May 6 2008, 08:41 AM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 387 Joined: 9-February 08 Member No.: 57,615 |
Currently, I making the registration page for my web-site which will appear to be educational. There is the one things I would like to have it inside the registration page.
Basically, I want to have a field which is called like "University", when, the user clicks on it, it automatically, lists the Universities based on the chosen country. Therefore, there are supposed to be fields like "Country" and "State or City", on which the University or School will be used. Oh, the entries might be: "School", "College" or "University", and based on them as well as the locations, the educational institutions will be presented in the drop-down menu inside the registration page. Thanks. I will help you will help me or just give me some of the concepts towards doing it. |
|
|
|
May 6 2008, 07:00 PM
Post
#2
|
|
|
apt-get moo ![]() Group: [MODERATOR] Posts: 2,055 Joined: 28-May 05 From: Hertfordshire, England Member No.: 7,593 ![]() |
You would need a list of every educational establishment in the world, along with where they are in each country and what type of establishment they are (school, college, university). That data will be very difficult to find, and almost impossible for you to compile yourself.
|
|
|
|
May 7 2008, 11:59 AM
Post
#3
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 387 Joined: 9-February 08 Member No.: 57,615 |
This work will take like ages to complete it. I do not think that there is the manual way to do it!
|
|
|
|
May 16 2008, 11:09 PM
Post
#4
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 387 Joined: 9-February 08 Member No.: 57,615 |
So, nobody did not get the point how I can accomplish it?!
|
|
|
|
May 17 2008, 09:16 AM
Post
#5
|
|
|
apt-get moo ![]() Group: [MODERATOR] Posts: 2,055 Joined: 28-May 05 From: Hertfordshire, England Member No.: 7,593 ![]() |
Like I said, the main problem is getting hold of comprehensive worldwide data for educational establishments. If you can provide us with that data then we might be able to integrate it with your form. Otherwise, we don't really have a lot to work with.
|
|
|
|
May 17 2008, 11:08 AM
Post
#6
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 153 Joined: 12-May 08 From: Somewhere in the Matrix Member No.: 62,045 |
I agree with rvalkass.
In the U.S. there are 3040 universities. List: http://nvo.com/louisvuitton/listofeverycol...versityintheus/ Whole the world there are hundred thousands of universities. Do you have to show dropdown menu. Instead the member can type his university. This is easier then collecting the list of all university in the world. Here there is one problem that member can lie. |
|
|
|
May 17 2008, 08:51 PM
Post
#7
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 387 Joined: 9-February 08 Member No.: 57,615 |
All right. Thanks. So, I need to do it manually. So, can you write some sample code over here?
|
|
|
|
May 17 2008, 10:47 PM
Post
#8
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 153 Joined: 12-May 08 From: Somewhere in the Matrix Member No.: 62,045 |
All right. Thanks. So, I need to do it manually. So, can you write some sample code over here? Some sample codes I have written myself, here. If you want to show dropdown menu use this: selectcountry.php CODE .............. <form name="form1" action="selectcountry.php" method="GET"> Select your country: <select name="country" onChange="form1.submit();"> <option value="">Select your country</option> <option value="USA">United States of America</option> <option value="Turkey">Turkey</option> <option value="UK">The United Kingdom</option> <option value="Germany">Germany</option> <option value="Russia">Russia</option> <option value="China">China</option> ............. //place here all the countries in the world :D (by typing all of them or selecting from a query) ............. </select> <input type="submit" name="submit1" value="List the universities in this country"> </form> <? if ($_GET['country']) { ?> <form name="form2" action="university_selected.php" method="GET"> <? $myconnection1 = mysql_connect($db_host , $db_user , $db_password) or die ("Can not connect database:".mysql_error()); mysql_select_db( $db_name , $myconnection1 ) or die ("Can not select database:".mysql_error() ); $myquery1 = mysql_query("SELECT * FROM university WHERE country=".$_GET['country']." ORDER BY university_long_name ASC",$myconnection1) or die ("Can not select universities:".mysql_error()); if (mysql_num_rows($myquery1)>0) { ?><select name="university_id" onChange="form2.submit();"> <? while ($recordset1 = mysql_fetch_array($query1)) { ?><option value="<? echo($recordset1["university_id"]); ?>"><? echo($recordset1["university_long_name"]); ?></option><? } // while ($recordset1 = mysql_fetch_array($query1)) finishes ?></select> <input type="submit" name="submit2" value="Select this university"> </form><? } //if (mysql_num_rows($myquery1)>0) finishes else { ?>No university has been found in this country or no university has been written for this country<? } // else -2 line finishes } //if ($_GET['country']) finishes ?> ................... You must analyze the selected university in university_selected.php file. If you want to show only two editboxes use the following(this is the easiest): register.php CODE ................. <form name="form1 action="yourfile.php" method="POST"> ................ Type your country: <input type="text" name="country" value=""><br> Type your university: <input type="text" name="university" value=""><br> ................ </form> ................. As I said before, in the second example, the member applicant can say lie. In the first example, I can write the structure of table "university", if you want to. This post has been edited by Erdemir: May 17 2008, 10:51 PM |
|
|
|
May 19 2008, 02:16 PM
Post
#9
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 387 Joined: 9-February 08 Member No.: 57,615 |