Jump to content

massive

Members
  • Posts

    40
  • Joined

  • Last visited

    Never

Everything posted by massive

  1. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] You don't need to include the input button. If we can't figure out how you marked up your forms, then we should be called amateurs and thrown to the wolves. That being said, [b]did you include values and names for the options?[/b] I've done stupid stuff like that before. [/quote] are you referring to the drop-down menu? if thats the one...Yes i did include "value" in the options <option [b]value[/b]="NR5">NR5</option> <- are you referring to this one...? thanks
  2. Hi guyz, i have trouble in updating my data using drop-down menus...im trying to upgrade a subscribers ServiceType....but its seems i have so problems... i don't know whats wrong with it here is a part of my script: -------script for querying--------- [code] <?       if((!isset($_GET['id']) || trim($_GET['id']) == ''))         {             die('Missing record ID!');         }     $connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die('Unable to connect!');     mysql_select_db(DB_NAME) or die('Unable to select database');     $id = $_GET['id'];     $q = "SELECT username, ServiceType FROM subscription WHERE username = '$id'";     $w = mysql_query($q) or die("Error in query: $q. " . mysql_error());        if(isset($_POST['change']))     {              $query  = "UPDATE subscription SET ServiceType = '" . $_POST['service'] . "' WHERE username = '$id'";     $result = mysql_query($query) or die("Error in query: $query. " . mysql_error());      }   if($result)   {       header("Location: updatesuccess.php");   } ?>    [/code] -----html drop down menu declaration---------- [code] <select name="service">           <option>-----------</option>           <option value="NR5">NR5</option>           <option value="NR10">NR10</option>           <option value="NR15">NR15</option>           <option value="NR20">NR20</option>           <option value="NR25">NR25</option>           <option value="NR30">NR30</option>           <option value="NR40">NR40</option>           <option value="NR50">NR50</option>           <option value="NR60">NR60</option>           <option value="NR80">NR80</option>           <option value="NR100">NR100</option>           <option value="NR120">NR120</option>           <option value="R10">R10</option>           <option value="R20">R20</option>           <option value="R30">R30</option>           <option value="R40">R40</option>           <option value="R50">R50</option>           <option value="R60">R60</option>           <option value="R80">R80</option>           <option value="R100">R100</option>           <option value="R120">R120</option>         </select> [/code] ------here is the submit button declaration-------- [code] <input type="submit" name="change"  value="Upgrade"> [/code] hmmm i'm quite puzzled...wondering where did i go wrong pls help...thank you
  3. Hi guyz, i have trouble in updating my data using drop-down menus i don't know whats wrong with it here is a part of my script: -------script for querying--------- [code] <?       if((!isset($_GET['id']) || trim($_GET['id']) == ''))         {             die('Missing record ID!');         }     $connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die('Unable to connect!');     mysql_select_db(DB_NAME) or die('Unable to select database');     $id = $_GET['id'];     $q = "SELECT username, ServiceType FROM subscription WHERE username = '$id'";     $w = mysql_query($q) or die("Error in query: $q. " . mysql_error());        if(isset($_POST['change']))     {              $query  = "UPDATE subscription SET ServiceType = '" . $_POST['service'] . "' WHERE username = '$id'";     $result = mysql_query($query) or die("Error in query: $query. " . mysql_error());      }   if($result)   {       header("Location: updatesuccess.php");   } ?>    [/code] -----html drop down menu declaration---------- [code] <select name="service">           <option>-----------</option>           <option value="NR5">NR5</option>           <option value="NR10">NR10</option>           <option value="NR15">NR15</option>           <option value="NR20">NR20</option>           <option value="NR25">NR25</option>           <option value="NR30">NR30</option>           <option value="NR40">NR40</option>           <option value="NR50">NR50</option>           <option value="NR60">NR60</option>           <option value="NR80">NR80</option>           <option value="NR100">NR100</option>           <option value="NR120">NR120</option>           <option value="R10">R10</option>           <option value="R20">R20</option>           <option value="R30">R30</option>           <option value="R40">R40</option>           <option value="R50">R50</option>           <option value="R60">R60</option>           <option value="R80">R80</option>           <option value="R100">R100</option>           <option value="R120">R120</option>         </select> [/code] ------here is the submit button declaration-------- [code] <input type="submit" name="change"  value="Upgrade"> [/code] hmmm i'm quite puzzled...wondering where did i go wrong pls help...thank you
  4. problem solved i used: if(isset($_POST['submit']) instead of: if($_POST['submit'])
  5. [div align=\"left\"]Still can't solve it in editing/updating an information..... T_T, So here is the actuall code i've been working on: Here is the querying for updating...just copy and paste it to see it more clearly for debugging...tnx [code] <?       if((!isset($_GET['id']) || trim($_GET['id']) == ''))         {             die('Missing record ID!');         }     $connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die('Unable to connect!');     mysql_select_db(DB_NAME) or die('Unable to select database');     $query2 = "SELECT username, ServiceType FROM subscription WHERE username = '$id'";     $display = mysql_query($query2) or die("Error in query: $query. " . mysql_error());          $query = "SELECT *, CONCAT(lname, ', ', fname) AS name FROM subscriber  WHERE username = '$id'";     $result = mysql_query($query) or die("Error in query: $query. " . mysql_error());          if($_POST['update']){     $connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die('Unable to connect!');     mysql_select_db(DB_NAME) or die('Unable to select database');     $change  = "UPDATE subscriber SET birthdate = '$bdate', taxid = '$tax', email = '$email', homeaddress = '$haddress', homephoneno = '$hphoneno',                 homefaxno = '$hfaxno', businessname = '$businessname', businessaddress = '$baddress', businessphoneno = '$ophoneno',                 businessfaxno = '$ofaxno', zipcode = '$zip', cellphoneno = '$cellphone' WHERE username = '$id' ";     $revised = mysql_query($change) or die("Error in query: $change. " . mysql_error());     }                    ?> [/code] ------------------Here is the HTML code ------------------- [code] <form action="<? echo $_SESSION['PHP_SELF']; ?>" method="POST"> <table width="750" border="0" cellspacing="0">   <tr>     <td width="221"><div align="center"><font face="Tahoma, Verdana, Arial"><img src="mainlogo.JPG" width="177" height="109"></font></div></td>     <td width="525" bgcolor="#CCCCCC"><img src="pic_side.jpg" width="525" height="200"></td>   </tr> </table> <hr align="left" width="750">   <font face="Tahoma, Verdana, Arial"> </font>   <? if(mysql_num_rows($result) > 0)                   {                     while($row = mysql_fetch_object($result)) {?>   <table width="750" border="0" cellspacing="0">     <tr>       <td><font size="-2" face="Tahoma, Verdana, Arial">DATE OF APPLICATION: (YYYY         - MM - DD)</font></td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td><font face="Tahoma, Verdana, Arial">         <input name="dateapplication" type="text" value="<? echo $row->dateapplication?>" size="13" readonly="true">         </font></td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td width="15%"><font size="-2" face="Tahoma, Verdana, Arial">LAST NAME:</font></td>       <td width="11%"> </td>       <td width="23%"><font size="-2" face="Tahoma, Verdana, Arial">FIRST NAME:</font></td>       <td width="4%"> </td>       <td width="43%"><font size="-2" face="Tahoma, Verdana, Arial">MIDDLE NAME:</font></td>       <td width="4%"> </td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td width="20%"><font face="Tahoma, Verdana, Arial">         <input name="lname" type="text"  value="<? echo $row->lname ?>" readonly="">         </font></td>       <td width="6%"> </td>       <td width="20%"><font face="Tahoma, Verdana, Arial">         <input name="fname" type="text"  value="<? echo $row->fname ?>" readonly="">         </font></td>       <td width="7%"> </td>       <td width="21%"><font face="Tahoma, Verdana, Arial">         <input name="mname" type="text"  value="<? echo $row->mname ?>" readonly="">         </font></td>       <td width="20%"> </td>       <td width="0%"> </td>       <td width="0%"> </td>       <td width="6%"> </td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td width="26%"><font size="-2" face="Tahoma, Verdana, Arial">  </font></td>       <td width="27%"><font size="-2" face="Tahoma, Verdana, Arial">  </font></td>       <td width="47%"><font size="-2" face="Tahoma, Verdana, Arial">  </font></td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td width="20%"><font size="-2" face="Tahoma, Verdana, Arial">BIRTHDATE:(YYYY-MM-DD)</font></td>       <td width="6%"> </td>       <td width="23%"><font size="-2" face="Tahoma, Verdana, Arial">GENDER:</font></td>       <td width="4%"> </td>       <td width="43%"><font size="-2" face="Tahoma, Verdana, Arial">CIVIL STATUS:</font></td>       <td width="4%"> </td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td width="20%"><font face="Tahoma, Verdana, Arial">         <input name="bdate" type="text"  value="<? echo $row->birthdate ?>" size="13">         </font></td>       <td width="6%"> </td>       <td width="20%"><font face="Tahoma, Verdana, Arial">         <input name="gender" type="text"  value="<? echo $row->gender ?>" readonly="">         </font></td>       <td width="7%"> </td>       <td width="21%"><font face="Tahoma, Verdana, Arial">         <input name="stats" type="text"  value="<? echo $row->civilstatus ?>" readonly="">         </font></td>       <td width="20%"> </td>       <td width="0%"> </td>       <td width="0%"> </td>       <td width="6%"> </td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td><font size="-2" face="Tahoma, Verdana, Arial">  </font></td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td width="26%"><font face="Tahoma, Verdana, Arial" size="-2" color="#000000">CORPORATE/PERSONAL         TAX ID NO. (IF FILIPINO)</font></td>       <td width="74%"><font face="Tahoma, Verdana, Arial" size="-2">E-MAIL:</font></td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td width="20%"><font face="Tahoma, Verdana, Arial">         <input name="tax" type="text"  value="<? echo $row->taxid ?>">         </font></td>       <td width="6%"> </td>       <td width="31%"><font face="Tahoma, Verdana, Arial">         <input type="text" name="email" value="<? echo $row->email ?>">         </font></td>       <td width="12%"> </td>       <td width="5%"><font face="Tahoma, Verdana, Arial">  </font></td>       <td width="20%"> </td>       <td width="0%"> </td>       <td width="0%"> </td>       <td width="6%"> </td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td width="26%"><font size="-2" face="Tahoma, Verdana, Arial">  </font></td>       <td width="74%"><font size="-2" face="Tahoma, Verdana, Arial">  </font></td>     </tr>   </table>   <table width="750" border="1" cellspacing="0" bgcolor="#eeeeee">     <tr>       <td nowrap><font size="2" face="Tahoma, Verdana, Arial"><strong><font size="-2">         PERSONAL/INDIVIDUAL</font></strong></font></td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td><font size="-2" face="Tahoma, Verdana, Arial">HOME ADDRESS:</font></td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td width="48%"><font face="Tahoma, Verdana, Arial">         <input name="haddress" type="text"  value="<? echo $row->homeaddress ?>" size="84" maxlength="80">         </font></td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td><font size="-2" face="Tahoma, Verdana, Arial">  </font></td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td width="24%"><font size="-2" face="Tahoma, Verdana, Arial">HOME PHONE         NUMBER:</font></td>       <td width="2%"> </td>       <td width="69%"><font size="-2" face="Tahoma, Verdana, Arial">HOME FAX NUMBER:</font></td>       <td width="5%"> </td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td width="20%"><font face="Tahoma, Verdana, Arial">         <input name="hphoneno" type="text"  value="<? echo $row->homephoneno ?>">         </font></td>       <td width="6%"> </td>       <td width="20%"><font face="Tahoma, Verdana, Arial">         <input name="hfaxno" type="text" value="<? echo $row->homefaxno ?>">         </font></td>       <td width="23%"> </td>       <td width="5%"><font face="Tahoma, Verdana, Arial">  </font></td>       <td width="20%"> </td>       <td width="0%"> </td>       <td width="0%"> </td>       <td width="6%"> </td>     </tr>   </table>   <table width="750" border="1" cellspacing="0" bgcolor="#eeeeee">     <tr>       <td width="38%"> <div align="left"><font size="2" face="Tahoma, Verdana, Arial"><strong>           <font size="-2">COMPANY/CORPORATION</font> </strong></font></div></td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td><font size="-2" face="Tahoma, Verdana, Arial">BUSINESS/OFFICE NAME:</font></td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td width="48%"><font face="Tahoma, Verdana, Arial">         <input name="businessname" type="text"  value="<? echo $row->businessname ?>" size="84" maxlength="80">         </font></td>       <td width="52%"> </td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td><font size="-2" face="Tahoma, Verdana, Arial">  </font></td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td><font size="-2" face="Tahoma, Verdana, Arial">BUSINESS/OFFICE ADDRESS:</font></td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td width="48%"><font face="Tahoma, Verdana, Arial">         <input name="baddress" type="text"  value="<? echo $row->businessaddress ?>" size="84" maxlength="80">         </font></td>       <td width="52%"> </td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td width="24%"><font size="-2" face="Tahoma, Verdana, Arial">OFFICE PHONE         NUMBER:</font></td>       <td width="2%"> </td>       <td width="49%"><font size="-2" face="Tahoma, Verdana, Arial">OFFICE FAX         NUMBER:</font></td>       <td width="25%"> </td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td width="20%"><font face="Tahoma, Verdana, Arial">         <input name="ophoneno" type="text"  value="<? echo $row->businessphoneno ?>">         </font></td>       <td width="6%"> </td>       <td width="20%"><font face="Tahoma, Verdana, Arial">         <input name="ofaxno" type="text"  value="<? echo $row->businessfaxno ?>">         </font></td>       <td width="7%"> </td>       <td width="21%"><font face="Tahoma, Verdana, Arial">  </font></td>       <td width="20%"> </td>       <td width="0%"> </td>       <td width="0%"> </td>       <td width="6%"> </td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td width="26%"><font size="-2" face="Tahoma, Verdana, Arial">ZIP CODE:</font></td>       <td width="27%"><font face="Tahoma, Verdana, Arial" size="-2">CELLPHONE         NO.: </font></td>       <td width="47%"> </td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td width="20%"><font face="Tahoma, Verdana, Arial">         <input name="zip" type="text"  value="<? echo $row->zipcode ?>">         </font></td>       <td width="6%"> </td>       <td width="20%"><font face="Tahoma, Verdana, Arial">         <input name="cellphone" type="text"  value="<? echo $row->cellphoneno ?>">         </font></td>       <td width="7%"> </td>       <td width="21%"><font face="Tahoma, Verdana, Arial">  </font></td>       <td width="20%"> </td>       <td width="0%"> </td>       <td width="0%"> </td>       <td width="6%"> </td>     </tr>   </table>   <table width="750" border="1" cellspacing="0" bgcolor="#eeeeee">     <tr>       <td width="38%"> <div align="left"><font size="2" face="Tahoma, Verdana, Arial"><strong><font size="-2">SUBSCRIPTION           TYPE</font></strong></font></div></td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr> <? $lrow = mysql_fetch_object($display) ?>       <td width="11%"> <font size="-2" face="Tahoma, Verdana, Arial">SERVICE TYPE:</font></td>       <td width="24%"><font face="Tahoma, Verdana, Arial">         <input name="service" type="text"  value="<? echo $lrow->ServiceType ?>">         </font></td>       <td width="65%"><font size="-2" face="Tahoma, Verdana, Arial">  </font></td>     </tr>   </table>   <table width="750" border="0" cellspacing="0">     <tr>       <td><font size="-2" face="Tahoma, Verdana, Arial">  </font></td>     </tr>   </table>   <table width="750" border="1" cellspacing="0" bgcolor="eeeeee">     <tr>       <td> </td>     </tr>   </table>   <p>   </p>   <table width="750" border="0" cellspacing="0">     <tr>       <td> <div align="right"><font face="Tahoma, Verdana, Arial">                    <input type="submit" name="submit" value="Update">           </font></div></td>     </tr>     <? } ?>   </table>   <? }?> </form> </body> </html> [/code][/div]
  6. still won't work....(T_T) could you give me a sample of your script in editing information...?or anyone else?...its about 2 weeks now and i still can't figure it out...whats the problem with it...?tnx...
  7. hi hitman ^^ , when i change my if(!$_POST['update']) to this if($_POST['update']) the disappearing thing was gone ^^...but it can't still update an information...i've made a small version of the page here it is: [code] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>edit information</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?                    if(!$_POST['submit']) {           $connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die('Unable to connect!');        mysql_select_db(DB_NAME) or die('Unable to select database');        $query = "SELECT lname, fname FROM subscriber WHERE username = '$subscriber'";        $display = mysql_query($query) or die("Error in query: $query. " . mysql_error());               if($_POST['update']) {        $query = "UPDATE subscriber SET lname = '$lname', fname = '$fname' WHERE username = '$subscriber'";        $new = mysql_query($query) or die("Error in query: $query. " . mysql_error());               } ?> <p>&nbsp;</p> <form action="<? echo $_SERVER['PHP_SELF']; ?>" method="post"> <table width="750" border="0" cellspacing="0">   <tr>     <td width="395">&nbsp;</td>     <td width="351"><div align="right">username:           <input name="subscriber" type="text">         <input type="submit" name="Submit" value="Submit">       </div></td>   </tr> </table> <p>&nbsp;</p> <? if(mysql_num_rows($display)) {?> <table width="750" border="0" cellspacing="0">               <? while($row = mysql_fetch_object($display)) {  ?>   <tr>     <td width="238">last name:       <input name="lname" type="text" value="<? echo $row->lname  ?>"></td>     <td width="508">firstname:       <input name="fname" type="text" value="<? echo $row->fname ?>"></td>   </tr>   <? } ?> </table> <p>   <input type="submit" name="Submit2" value="Update">   </p> <? } ?> </form> <? } ?> <p>&nbsp; </p> </body> </html> [/code]
  8. Hi guyz...i'm having a hard time editing my subscribers information....everytime i press the 'UPDATE' button their information disappears everytime i try to view their information again.. (T_T) heres what happen... let's say i tried to change his/her phone number...then i press update then when i view it their phoneno's disappears...even their last names and first names automatically disappears...i got pisted off then i clicked the update button like 2 to 4 times then the edited phoneno numbers suddenly appears but the firstnames and lastnames really disappeared as if my UPDATE button was program for DELETE....i click again it disappears.....kind of spooky huh?....guyz i really need your help can anybody give their prefered script in editing information...tnx your help will be appreciated :) here's my script (please give me anonther alternative in editing information.... T_T) [code]$connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die('Unable to connect!');     mysql_select_db(DB_NAME) or die('Unable to select database'); if(!$_POST['update']){     $bdate = $_POST['bdate'];     $tax = $_POST['tax'];     $email = $_POST['email'];     $haddress = $_POST['haddress'];     $hphoneno = $_POST['hphoneno'];     $hfaxno = $_POST['hfaxno'];     $businessname = $_POST['businessname'];     $baddress = $_POST['baddress'];     $ophoneno = $_POST['ophoneno'];     $ofaxno = $_POST['ofaxno'];     $service = $_POST['service'];     $zip = $_POST['zip'];     $cellphone = $_POST['cellphone']; $change  = "UPDATE subscriber SET birthdate = '$bdate', taxid = '$tax', email = '$email', homeaddress = '$haddress', homephoneno = '$hphoneno', homefaxno = '$hfaxno', businessname = '$businessname', businessaddress = '$baddress', businessphoneno = '$ophoneno', businessfaxno = '$ofaxno', zipcode = '$zip', cellphoneno = '$cellphone' WHERE userid = '$id' "; $revised = mysql_query($change) or die("Error in query: $change. " . mysql_error()); } ?>[/code] -----html--------------------------------- <form action="<? echo $_SESSION['PHP_SELF']; ?>" method="POST">
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.