Jump to content

takeiteasy

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Everything posted by takeiteasy

  1. Thanks obsidian for your help, but is there a code that will count the number of words while u type in the textbox? that means we do not need to click the count word button n we'll know the number of words.
  2. hmm...so can u all help me on the javascript coding? thanks alot!
  3. Thanks chigley for your help, but i'm quite new to php...so i dont really know how to adapt my current code with the 1 u gave me..can u pls guide me. thanks!!
  4. Hi all! i need some help here, hope some of u can help! Can someone help me with generating the number of word counts for the following code? That means when i type the words in the textbox, another textbox will show the number of words typed. i'm using php code. Information <b>(max of 50 words):</b> <tr> <td class="td_normal" colspan="2"> <input class="td_normal" type="text" size="50" name="content2" '; if ($FormXEmployerObj) $str.='value="'.$FormXEmployerObj->get(content2).'"'; $str.='> <br> Current Word Count:<tr> <td class="td_normal" colspan="2"> <input class="td_normal" type="text" size="2" name="content3"'; if ($FormXEmployerObj) $str.='value="'.$FormXEmployerObj->get(content3).'"'; $str.='> </td> </tr> Thanks!!
  5. Can i ask what are the differences between PHP 4 and PHP5? and Which is the commonly used version of PHP? TIA!
  6. Hi all, Just want to ask if there's any codes that when clicked on a link, a small popup window will appear? Thanks alot!
  7. oh. i get it. thanks alot!  ;)
  8. can u further explain on how this code works?thanks
  9. Hi there, Just want to ask if there's any PHP code that can display the data which has just been stored in the database? thanks
  10. hi all, Just wanted to ask if there's any code which will auto restore back the settings of the link color whenever user opens the page.. Like for example, my current code is [code] a:link {text-decoration: none; color: #ffffff; cursor:crosshair} a:visited {text-decoration: none; color: #0000CC; cursor:crosshair} a:active {text-decoration: underline; color: #444444; cursor:crosshair} a:hover {text-decoration: underline; color: #6699FF; cursor:crosshair} [/code] The very first time i open the page, the color is #ffffff, after i visited the links, the visited links become #0000CC. Then the second time i visit the page, the links are still in #0000CC color. But what i wanted is the links to be back to #ffffff color everytime i visit the page again. Has this got to do with the codes? or because of my computer? it has the windows function which it will save the datas which i have entered before.
  11. hi there, i need someone to help me out here, currently, my navigation menu is made up of a few links. I wanted to display a different color for the link which the user is currently viewing, so as to differentiate or to let the user know which part he is in currently. Is there any such of codes?Can give me a sample code? my current code: [code] a:link {text-decoration: none; color: #ffffff; cursor:crosshair} a:visited {text-decoration: none; color: #0000CC; cursor:crosshair} a:active {text-decoration: underline; color: #444444; cursor:crosshair} a:hover {text-decoration: underline; color: #6699FF; cursor:crosshair} [/code]
  12. Hi all, can i ask if there's a code for data validation like for example, i have this [code]Amt. Paid: SG$  <input type = 'text' name='amtpaid' size='10' maxlength='10'>[/code] and in my database, the type is Varchar(10). Currently, it can store any kinds of character, but what i wanted is only numbers and decimals to be stored into the database. So is there any code or way that the system will check if it is only numbers and decimals den it can be added to the database, if not a prompt to inform the user that only numbers can be proceed. TIA!
  13. Thanks alpine for replying. I've tried your solution, and it worked! Thanks alot!! and btw, i can't put quotes within $_POST if i do so, it will have this error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING , when i removed the quotes, everything worked fine..
  14. I have a problem with the search function here, when i entered a valid workerName which is in the database called archive, it returned Record Found. But when i entered an invalid workerName, it also display Record Found. I think my code doesn't check with my database if there's simliar workerName, just display Record Found whenever i press Submit. Can someone help to see where my code goes wrong? TIA! [code] <form method='post' action='<? echo $_SERVER[PHP_SELF]; ?>'> <? if (isset($_POST['submit'])){ $searchresults = mysql_query("SELECT * FROM archive WHERE workerName LIKE '%$_POST[search]%'", $db_connection) or die(mysql_error()); } if ($searchresults == true) { echo " Record Found"; } ?> <TABLE width='770' border='0' align='center' cellpadding='0' cellSpacing='0' style='border:1px solid #9FD2EC'>      <TBODY>        <TR>          <TD height='30'  align='center' valign='middle'> Search By Worker/Passenger Name:<input type='text' name='search' size='20'> <input type='submit' name='submit' value='Submit'> </td> </table> </form> [/code]
  15. oh! thank you so much wildteen88!! This really helps me alot!!
  16. can i ask if there's php code for displaying an alert dialog box?if there is. can anyone teach me how to code please? i'm doing a delete function and i want to prompt the user if they really want to delete the record. here is my delete code [code] if (isset($HTTP_GET_VARS['empRef'])) { $result = mysql_query("DELETE FROM airticketbooking WHERE empRef = '$empRef'",$db_connection) or die(mysql_error()); mysql_close($db_connection); } if($result == true) {       echo " 'Record Deleted' "; } [/code]
  17. I'm urgent for help here! can anyone help me with the codes? Right now, i 'm doing the archive page of my project [code] if (isset($HTTP_GET_VARS['empRef'])) { $result = mysql_query("INSERT INTO archive (empRef, empName, workerName, flightNo, airCompany, ticketType, destination, time, DOD, DOR, receiptNo, quotes, amtpaid, paymentMode, chequeNo, AD,agentQuote, payAgent, remarks)                                       SELECT empRef, empName, workerName, flightNo, airCompany, ticketType, destination, time, DOD, DOR, receiptNo, quotes, amtpaid, paymentMode, chequeNo, AD,agentQuote, payAgent, remarks                                       FROM airticketbooking                                       WHERE empRef='$HTTP_GET_VARS[empRef]'",$db_connection) or die(mysql_error()); [/code] but i have 1 more condition before i want to Insert data into the database, that is to check if there's a same empRef with $HTTP_GET_VARS['empRef'] in the archive table so how do i write the codes? And also after Inserting the data in the archive table, i wan to delete the data in the airticketbooking table, how do i write out the code? TIA!
  18. I have tried this but still not working...can someone help? [code] <?php   $ca = $nets = $cc = ''; ?> <?php if ($paymentMode == 'Cash') { $ca = ' checked'; } else if ($paymentMode == 'Nets') { $nets = 'checked'; } else { $cc = 'checked'; } } ?> <input type='radio'  name='paymentMode' value='Cash' echo $ca;>Cash       <input type='radio' name ='paymentMode' value='Nets' echo $nets;>Nets   <input type='radio' name ='paymentMode' value='Cheque' echo $cc;>Cheque [/code]
  19. i've tried your solution but it still can't work. The radio buttons are still not checked. Any other soultions? Thanks!
  20. In my Add form, i have radio buttons for payment mode consisting of Cash, Credit Card and Cheque. If i select the radio button for Cash, MySQL will add the record as 'Cash' right....but wad if i wan to display the stored record in my Edit form in radio button Cash, Credit Card. Cheque, checked Cash? how do i go about the code?TIA! This is my code in Add form [code] <input type='radio'  name='paymentMode' value='Cash'>Cash       <input type='radio' name ='paymentMode' value='CreditCard'>Credit Card    <input type='radio' name ='paymentMode' value='Cheque'> [/code]
  21. maybe you should try [code] $level=$row[level]; [/code]
  22. Sorry! i'm new to Javascript here and would like somebody to explain to me on how the code below works...[code] <script language="JavaScript"> <!-- function SynchMoves(which) {   var ml=document.form1;   if(which==1) {       ml.select2.selectedIndex=ml.select1.selectedIndex;   }   else {       ml.select1.selectedIndex=ml.select2.selectedIndex;   }     } function submitForm(val){   document.form1.actionType.value=val;   document.form1.submit(); } function valbutton(val1){    var atleastOneRadioSelected=false;    //f = document.forms[0];    f=document.form1;    f1 = document.forms[1];    //alert("The value in the 2nd form is"+f.text.value);    for(i=0;i<f.length;i++){        var e = f.elements[i];        if(e.type=="checkbox" && e.checked){            atleastOneRadioSelected=true;        }    }    //alert("Atleast value "+atleastOneRadioSelected);    if(!atleastOneRadioSelected) {        alert("You must select a record to " + val1);    }else{        //alert("Do you really want to " +val1+"?");        var ans1 = "Do you really want to " +val1+"?";        ans = confirm(ans1);      if (ans == true) {         f.actionType.value=val1;         f.submit();       } else {          return false;      }          //f.actionType.value=val1;          //f.submit();    } } //--> </script> [/code] I'm currently doing a PHP project whereby i have 3 buttons, Edit, Delete and Save in my index form. I have checkbox for checking and when i checked the checkbox, press edit button, it will appear the edit page where it will display the initial records ready for edit. For the delete, i check the box, press delete and it will prompt me to confirm delete...same goes for the save button. But now my problem is when i clicked on the edit button for example, it does not produce the edit.php page with all the nesscary details for edit.So how do i go about this?can someone help?! TIA! [code]   <input type='checkbox' name='checkbox' value='$empRef'>    </td>     <td width='60' bgcolor='$row_color' nowrap>     $empRef [/code]
  23. i tried changing to $_GET[empRef] and i get [a href=\"http://localhost/display.php?pid=09218015\" target=\"_blank\"]http://localhost/display.php?pid=09218015[/a] on the URL adress but on the form, it did not get the information from MySQL and display it out.. Thanks alot Koen Calliauw!! You have solved my problem! Thanks so much!!!
  24. In my index page, i have this hyperlink on the employer name which i clicked and it will bring me to a new form whereby it will display the specifc employer's detailed information. But i can't figure out the code for interacting the index page and the more detailed page. here is my code in the index page. [code] if ($custLoan OR $compLoan !='0') {     echo "<tr>    <td width='20' bgcolor='$row_color' nowrap>     <input type='checkbox' name='empRef' value='$empRef'>    </td>     <td width='60' bgcolor='$row_color' nowrap>     $empRef    </td>     <td width ='120' bgcolor='$row_color'>     [color=#FF6666]<a href=\"display.php?pid=$row[empRef]\"> $empName </a>[/color]    </td>     <td width ='120' bgcolor='$row_color'>      $workerName    </td>    <td width ='80' bgcolor='$row_color'>      $AD    </td>     <td bgcolor='$row_color'>      $$custLoan     </td>    <td bgcolor='$row_color'>      $$compLoan     </td>     </tr>"; [/code] and my code in the more detailed page. [code] if (isset($HTTP_GET_VARS['pid'])) {  //Display Information   $query ="SELECT * FROM airticketbooking where empRef='$HTTP_GET_VARS[pid]'";   $db_query = mysql_query ($query, $db_connection) or die (mysql_error()); echo "Employer RefID: $_POST[empRef]"; }[/code] when i clicked on the hyperlink in index page, it onli shows "Employer RefID:" but not the $_POST[empRef]. Don't know if i wrote the correct way..please help! Thanks in Advance!
  25. Hey! thanks so much! i managed to solve it!! so happy!
×
×
  • 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.