
pancgom
Members-
Posts
15 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
pancgom's Achievements

Newbie (1/5)
0
Reputation
-
Gentlemen this works...but the problem that i have is.... This form is just a part of a bigger form....the entire form set has a session id....that is if a user logs in say Mr.Jujubi he will see all the fields that needs to be entered for his records to be stored. he enters it and then as soon as he submits his records the data is sent to the database and at the same time the data that he just entered is displayed in the fields that he just used to key in his details which he can edit and submit again for updation to the database... The problem is all the text boxes work...but not the drop downs..can some please tell me how the code will be for this...
-
The data first inserted into the database when the user chooses his options...then when the page is submitted the values are shown in the select boxes that he just used to enter the details and submit
-
Hi, I have this form which has got all these drop down boxes which has values built in the html form, once selected they are all sent to the database table to be stored only when the authentication is done and for that record only. I am also using the same form to retrieve information from the database and display back to the form. The problem is i am not able to display data retrieved from the database into the drop down boxes. Can someone please help me the code please. Thanks much for the help. <?php include 'init.php'; if (!is_authed()) { header("Location: http://xxxx/wewewe/wee.ph"); exit; } $ID = $_SESSION['ID']; $results = mysql_query("SELECT * FROM `WorkExperience` WHERE ID=$ID"); $row = mysql_num_rows($results); if($row == 0) { mysql_query("INSERT INTO `WorkExperience` (ID) VALUES ('$ID')"); } if($_POST['save'] || $_POST['next']) { $CountryOfEmployment = $_POST['CountryOfEmployment']; $CommencementDate = $_POST['CommencementDate']; $CommencementMonth = $_POST['CommencementMonth']; $CommencementYear = $_POST['CommencementYear']; $query = "UPDATE `WorkExperience` SET CountryOfEmployment='$CountryOfEmployment', CommencementDay='$CommencementDay', CommencementMonth='$CommencementMonth', CommencementYear='$CommencementYear' WHERE ID=$ID"; mysql_query($query); } if($_POST['next']) { header("Location: gotonextpage.php"); exit(); } $query = "SELECT * FROM `WorkExperience` WHERE ID=$ID"; $results = mysql_query($query); $data = mysql_fetch_array($results); $CountryOfEmployment = $data['CountryOfEmployment']; $CommencementDay = $data['CommencementDay']; $CommencementMonth = $data['CommencementMonth']; $CommencementYear = $data['CommencementYear']; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <TITLE>Graduate Admission System (Research Programme)</TITLE> <link href="CSS/GraduateProgram.css" rel="stylesheet" type="text/css"> </head> <body bgcolor="#FFFFFF" topmargin="0"> <br> <br> <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post" name="pg6.php"> <TABLE border=0 ALIGN="center" cellpadding = 3 cellspacing = 0 width="1000" style="border:1px solid #999999;"> <TR> <td width="68%" align="left" class="BodyText"> Country of Employment : </td> <td width=68% align="left" class="BodyText"> <select name="CountryOfEmployment" class="BodyText" style="color: 000000 ; font-weight: bold" value="<?=$CountryOfEmployment?>" id="CountryOfEmployment"> <option> <option >AFGHANISTAN <option >ALBANIA <option >ALGERIA <option >AMERICAN SAMOA <option >ANDORRA <option >ANGOLA <option >ANTIGUA <option >ARGENTINA <option >ARMENIA <option >AUSTRALIA <option >AUSTRIA <option >AZERBAIJAN <option >BAHAMAS <option >BAHRAIN <option >BANGLADESH <option >BARBADOS <option >BELARUS <option >BELGIUM <option >BELIZE <option >BENIN <option >BHUTAN <option >BOLIVIA <option >BOSNIA <option >BOTSWANA <option >BRAZIL <option >BRITISH NATIONAL OVERSEAS <option >BRUNEI <option >BRUNEI PR <option >BULGARIA <option >BURKINA FASO <option >BURUNDI <option >CAMBODIA <option >CAMEROON <option >CANADA <option >CAPE VERDE <option >CENTRAL AFRICAN REP <option >CHAD <option >CHILE <option >CHINA <option >COLOMBIA <option >COMOROS <option >CONGO <option >COOK ISLANDS <option >COSTA RICA <option >CROATIA <option >CUBA <option >CYPRUS <option >CZECH REPUBLIC <option >DENMARK <option >DJIBOUTI <option >DOMINICA <option >DOMINICAN REP <option >EAST TIMOR <option >ECUADOR <option >EGYPT <option >EL SALVADOR <option >EQUATORIAL GUINEA <option >ERITREA <option >ESTONIA <option >ETHIOPIA <option >FIJI <option >FINLAND <option >FRANCE <option >FRENCH GUIANA <option >FRENCH POLYNESIA <option >GABON <option >GAMBIA <option >GEORGIA <option >GERMANY <option >GHANA <option >GREECE <option >GRENADA <option >GUADELOUPE <option >GUAM <option >GUATEMALA <option >GUINEA <option >GUINEA-BISSAU <option >GUYANA <option >HAITI <option >HONDURAS <option >HONG KONG <option >HUNGARY <option >ICELAND <option >INDIA <option >INDONESIA <option >IRAN <option >IRAQ <option >IRELAND <option >ISRAEL <option >ITALY <option >IVORY COAST <option >JAMAICA <option >JAPAN <option >JORDAN <option >KAZAKHSTAN <option >KENYA <option >KIRIBATI <option >KUWAIT <option >KYRGYZSTAN <option >LAOS <option >LATVIA <option >LEBANON <option >LESOTHO <option >LIBERIA <option >LIBYA <option >LIECHTENSTEIN <option >LITHUANIA <option >LUXEMBOURG <option >MACAU <option >MACEDONIA <option >MADAGASCAR <option >MALAWI <option >MALAYSIA <option >MALAYSIA PR <option >MALDIVES <option >MALI <option >MALTA <option >MARSHALL ISLANDS <option >MARTINIQUE <option >MAURITANIA <option >MAURITIUS <option >MEXICO <option >MICRONESIA <option >MONACO <option >MONGOLIA <option >MOROCCO <option >MOZAMBIQUE <option >MYANMAR <option >NAMIBIA <option >NAURU <option >NEPAL <option >NETHERLANDS <option >NETHERLANDS ANTILLES <option >NEW CALEDONIA <option >NEW ZEALAND <option >NICARAGUA <option >NIGER <option >NIGERIA <option >NIUE ISLAND <option >NORTH KOREA <option >NORTHERN IRELAND <option >NORWAY <option >OMAN <option >OTHERS <option >PAKISTAN <option >PALAU <option >PALESTINE <option >PANAMA <option >PAPUA NEW GUINEA <option >PARAGUAY <option >PERU <option >PHILIPPINES <option >PITCAIRN ISLAND <option >POLAND <option >PORTUGAL <option >PUERTO RICO <option >QATAR <option >REUNION <option >ROMANIA <option >RUSSIA <option >RWANDA <option >SAO TOME AND PRINCIPE <option >SAUDI ARABIA <option >SENEGAL <option >SEYCHELLES <option >SIERRA LEONE <option >SINGAPORE <option >SINGAPORE PR <option >SLOVAK REPUBLIC <option >SLOVENIA <option >SOLOMON ISLANDS <option >SOMALIA <option >SOUTH AFRICA <option >SOUTH KOREA <option >SOUTH YEMEN <option >SPAIN <option >SRI LANKA <option >ST. LUCIA <option >ST. VINCENT <option >STATELESS <option >SUDAN <option >SURINAME <option >SWAZILAND <option >SWEDEN <option >SWITZERLAND <option >SYRIA <option >TAIWAN <option >TAJIKISTAN <option >TANZANIA <option >THAILAND <option >TOGO <option >TOKELAU ISLANDS <option >TONGA <option >TRINIDAD AND TOBAGO <option >TUNISIA <option >TURKEY <option >TUVALU <option >UGANDA <option >UKRAINE <option >UNITED ARAB EMIRATES <option >UNITED KINGDOM <option >UNITED STATES <option >URUGUAY <option >UZBEKISTAN <option >VANUATU <option >VENEZUELA <option >VIETNAM <option >WALLIS AND FUTUNA <option >WESTERN SAHARA <option >YEMEN ARAB REPUBLIC <option >YUGOSLAVIA <option >ZAIRE <option >ZAMBIA <option >ZIMBABWE </select></td> </TR> <TR> <td align="left" bgcolor=#E8E8E8 class="BodyText"> Commencement Date(day/month/year) : </td> <td width=68% align="left" bgcolor=#E8E8E8 class="BodyText"> <select name="CommencementDate" class="BodyText" style="color: 000000 ; font-weight: bold" value="<?=$CommencementDate?>" id="CommencementDate"> <option> <option >01 <option >02 <option >03 <option >04 <option >05 <option >06 <option >07 <option >08 <option >09 <option >10 <option >11 <option >12 <option >13 <option >14 <option >15 <option >16 <option >17 <option >18 <option >19 <option >20 <option >21 <option >22 <option >23 <option >24 <option >25 <option >26 <option >27 <option >28 <option >29 <option >30 <option >31 </select> / <select name="CommencementMonth" class="BodyText" style="color: 000000 ; font-weight: bold" value="<?=$CommencementMonth?>" id="CommencementMonth"> <option> <option >01 <option >02 <option >03 <option >04 <option >05 <option >06 <option >07 <option >08 <option >09 <option >10 <option >11 <option >12 </select> / <select name="CommencementYear" class="BodyText" style="color: 000000 ; font-weight: bold" value="<?=$CommencementYear?>" id="CommencementYear"> <option> <option >1968 <option >1969 <option >1970 <option >1971 <option >1972 <option >1973 <option >1974 <option >1975 <option >1976 <option >1977 <option >1978 <option >1979 <option >1980 <option >1981 <option >1982 <option >1983 <option >1984 <option >1985 <option >1986 <option >1987 <option >1988 <option >1989 <option >1990 <option >1991 <option >1992 <option >1993 <option >1994 <option >1995 <option >1996 <option >1997 <option >1998 <option >1999 <option >2000 <option >2001 <option >2002 <option >2003 <option >2004 <option >2005 <option >2006 <option >2007 <option >2008 </select></td> </TR> </TABLE> <br /> <div id="div"></div> <div align="center"> <p><br> <input name="next" type="submit" class="BodyText" id="Proceed" value="Proceed to Next Section"> <input name="save" type="submit" class="BodyText" value="Save Changes"> <input name="reset" type="reset" class="BodyText" id="reset" value="Clear Form"> <input name="logout" type="submit" class="BodyText" value="Logout"> </div> </form> </p> <p align="center">7/12<br> </p> </BODY> </HTML>
-
Hi, I have this form which has page1Form.php as a self processing form and there is another page2Form.php which needs to be shown once the page1Form.php is submitted. The problem i have is the form works when i submit the information entered it is also appended to the database but it does not show the page2Form.php...can some one please help me with how do i submit information to the database at the same time go to the page2Form.php to fill in more details. Thanks. <?php session_start(); ?> <head> <title>sddsdd</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link href="CSS/GraduateProgram.css" rel="stylesheet" type="text/css"> <script type="text/javascript"> <!-- function MM_validateForm() { //v4.0 if (document.getElementById){ var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors+='- '+nm+' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; } } if (errors) alert('The following error(s) occurred:\n'+errors); document.MM_returnValue = (errors == ''); } } function MM_goToURL() { //v3.0 var i, args=MM_goToURL.arguments; document.MM_returnValue = false; for (i=0; i<(args.length-1); i+=2) eval(args+".location='"+args[i+1]+"'"); } //--> </script> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <?php $db_host = "localhost"; $db_user = "xxxx"; $db_pwd = "xxxx"; $db_name = "xxxx"; mysql_connect($db_host, $db_user, $db_pwd); mysql_select_db($db_name); ?> <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post" > <table width=1000 border="0" align="center" cellpadding=3 cellspacing="0" style="border:1px solid #999999;"> <tr> <td height="30" colspan="2" valign="middle" bgcolor="#FF933" class="BodyTextHeaders">User Login / Registration</td> </tr> <?php if (!isset($_POST['submit'])) { ?> <tr> <td width=200 valign="middle" bgcolor="#E8E8E8" class="BodyText"><strong>Username :</strong></td> <td width="786" valign="top" bgcolor="#E8E8E8" class="BodyText"> <input name="Username" type="text" class="BodyText" id="Username" value="Enter email address" size="50"></td> </tr> <tr> <td width=200 valign="middle" class="BodyText"><strong>Password :</strong></td> <td valign="top" class="BodyText"><p> <label></label> <input name="Password" type="password" id="Password" size="50"> </p></td> </tr> <tr> <td valign="middle" bgcolor="#E8E8E8" class="BodyText" ><strong>Password Assistance Question :</strong></td> <td valign="bottom" bgcolor="#E8E8E8" class="BodyText" ><p> <input name="PasswordQuestion" type="text" id="PasswordQuestion" size="50"> </p></td> </tr> <tr> <td valign="middle" class="BodyText"><strong>Password Assistance Answer :</strong></td> <td valign="bottom" class="BodyText"><p> <input name="PasswordAnswer" type="text" id="PasswordAnswer" size="50"> </p> </td> </tr> <tr> <td valign="middle" bgcolor="#E8E8E8" class="BodyText"> </td> <td valign="top" bgcolor="#E8E8E8" class="BodyText"><p><a href="#">Forgot Password</a> | <a href="#">Help</a></p> <p>Please keep your Password confidential. You will need it to access the following online facilities related to this application :</p> <ul> <li >Online Status Enquiry</li> <li >Online Change of Contact Details</li> <li >Online Reply to CQT Offer</li> </ul></td> </tr> </table> <p align="center"> <input name="submit" type="submit" class="BodyText" onClick="MM_validateForm('Username','','RisEmail','Password','','R','PasswordQuestion','','R','PasswordAnswer','','R');return document.MM_returnValue" value="Next"> <input name="submit" type="submit" class="BodyText" value="Submit" onClick="MM_validateForm('Username','','RisEmail','Password','','R','PasswordQuestion','','R','PasswordAnswer','','R');return document.MM_returnValue" > <input name="reset" type="reset" class="BodyText" value="Clear Form"> </p> </form> <?php } else { $Username = $_POST['Username']; $Password = $_POST['Password']; $PasswordQuestion = $_POST['PasswordQuestion']; $PasswordAnswer = $_POST['PasswordAnswer']; mysql_query("INSERT INTO `PersonnelDetails` (Username, Password, PasswordQuestion, PasswordAnswer) VALUES ('$Username', '$Password', '$PasswordQuestion','$PasswordAnswer')"); header ("Location: pg1.php"); } ?> <p align="center">1/12</p> </body> </html>
-
No Thanks. Figured out myself by now, i should be ok. Thanks Much for the concern.
-
Maybe i said it wrong by saying that i have been trying. I needed help didnt want you to write the code for me exclusively. Thanks Much.
-
I have a table (mySQL) in which there is data which contains name, empID, department. Now i have a form built in PHP which has the name, empID and department fields, this form is used to retrieve information from the table mentioned above and display. the name field is a drop down menu list (combo box) which lists all the names in the table drawn from the database. Upon selecting a name the corresponding details to that particular name such as empID and Department should display in the respective fields in the php retrieval form. How do i retrieve and display names in the combo box and how to display the other information in the fields corresponding to the name is my question?. Can i have the code for that please... i have been trying to do this for long with different things maybe i am new i am not able to even figure out what is going on...please help...
-
Hi Guys, This is probably the most silliest of questions, i am still learning php and mysql :-| . I have this code below which brings up data from the database and displays it, what i want to do is to give the table headers a bgcolor how do i insert it, i get a parse error when i try to introduce a bgcolor.. Can anyone help. <table border="1" bordercolor="black" cellpadding="2" cellspacing="0" width="550"> {php} $db_username=; $db_password=; $db_name=; mysql_connect($db_connect,$db_username,$db_password); mysql_select_db($db_name); $record_set=mysql_query("SELECT * FROM dDdDdD"); for($c=0; $c<mysql_num_fields($record_set);$c++){ print "<th>".mysql_field_name($record_set,$c)."</th>"; } while($record=mysql_fetch_row($record_set)){ print "<tr>"; for($c=0; $c<mysql_num_fields($record_set);$c++){ print "<td>".$record[$c]."</td>"; } print "</tr>"; } {/php} </table>
-
Super..thanks a ton...it worked just as i would want it to...
-
Can you point me to the most simplest one that can be found and inserted..
-
Hi Guys, I am looking for some help in adding a calendar to a form that i am building. Its much like a calendar when you book air tickets.. click on a calendar like icon and a pop up window opens select date year and month the details get into the form field. Can someone give me pointer on how to do it please. Thanks much.
-
Thanks a million Malevolence...i am a new bie to php and learning it still. I had an urgent need of this form though simple but me completely clueless. I understand the other 2 they just wanted me to learn which i am. Atleast i know i can get help is some form. Again thank you thank you thank you guys.
-
Hi Guys, I am trying to build a form in php to insert data into mysql database. The fields can be name, staff number, department for a start. Can some one please give me a script to do this and also to display the data from the database on to a php page. Any help much appreciated. Please help. Thanks Guys.
-
hi guys, I very new to PHP. I am trying to create a php page which should retrieve images from a images folder and the image has to be voted with the results showing immediately when the vote for this image button is clicked. There are over 50 images which are called from the folder and all the images are on the same page with a voting button in the adjacent column. The result has to be a number showing how many times the logo has been voted. Below is the code so far.. pretty basic...i need some help here guys...... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Logo Polling Page</title> </head> <body> <?php $T="65"; for($i=1;$i<$T;$i++) echo "<table width='746' border='1' cellpadding='0' cellspacing='5' bgcolor='fff'> <tr> <td width='250' height='150' valign='middle' align='center'> <img src='/images/$i.jpg' width='250' height='200'> </td> <td align='center'> <input input type='Submit' name='vote' id='vote' value='vote'> </td> </tr> </table>" ;?> </body> </html>