Jump to content

Xster

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Xster's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I used dreamweaver as a tools for php coding..and Im using php version 4.3.3, Apache 2.0.47(win32) and MySQL as database. I found a problem with php mail() and the error says like this ;- Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set(). How i gonna to settle this bug..? TQ in advance!
  2. em,if you dont mind..pls show me how to do it fenway. TQ~ Xster cheers!
  3. I do some modified and Its runs well. but I need another validations that only accept user to fill in the input box like if the day (Monday to Friday) the actual operating hours is 10:00 to 22:00 and (Saturday and Sunday) is 09:00 to 23:00..give me some idea how to figure this pls..TQ~ This is JavaScript Function function formvalidations(){ var FHour = document.getElementById("timeFrom"); var FMin = document.getElementById("timeFrom1"); var THour = document.getElementById("timeTo"); var TMin = document.getElementById("timeTo1"); if(checkHour(FHour, "Invalid Data Entry in the From Hour selection")){ if(checkMin(FMin, "Invalid Data Entry in the From Minute selection")){ if(checkHour(THour, "Invalid Data Entry in the To Hour selection")){ if(checkMin(TMin, "Invalid Data Entry in the To Minute selection")){ return true; } } } } return false; } function checkHour(elem, helperMsg){ var numericExpression = /^[0-9]+$/; if(elem.value.match(numericExpression)){ if(elem.value >= 08 && elem.value <= 22){ return true; }else{ alert(helperMsg); elem.focus(); return false; } }else{ alert(helperMsg); elem.focus(); return false; } } function checkMin(elem, helperMsg){ var numericExpression = /^[0-9]+$/; if(elem.value.match(numericExpression)){ if(elem.value >= 0 && elem.value <= 59){ return true; }else{ alert(helperMsg); elem.focus(); return false; } }else{ alert(helperMsg); elem.focus(); return false; } } This is html form <form onSubmit="return formvalidations()" method="post"> input type="text" name="timeFrom" size="1" id="timeFrom" maxlength="2"> <input type="text" name="timeFrom1" size="1" id="timeFrom1" maxlength="2"> <input type="text" name="timeTo" size="1" id="timeTo" maxlength="2"> <input type="text" name="timeTo1" size="1" id="timeTo1" maxlength="2"> p/s: Thx for ur attention fenway!
  4. Can someone pls tell me how to fix this codes somekind like if user didnt insert anything to the text box, it pop-ups an prompt error like "Pls insert bla bla bla" and how to create time format validation in JavaScript? any answers would help.. TQ in advance! <html> <head> <title><?php echo $row_rs1['title']; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="../pnec.css" rel="stylesheet" type="text/css"> <script type="text/javascript"> // this section im very confuse function checkForm() { var timeFrom, timeFrom1, timeTo, timeTo1; with(window.document.msgform) { ctime1 = timeFrom; ctime2 = timeFrom1; ctime3 = timeTo; ctime4 = timeTo1; } if(trim(ctime1.value) == '') { alert('Please enter your time from'); ctime1.focus(); return false; } else if(trim(ctime2.value) == '') { alert('Please enter your time from'); ctime2.focus(); return false; } else if(trim(ctime3.value) == '') { alert('Please enter your time to'); ctime3.focus(); return false; } else if(trim(ctime4.value) == '') { alert('Please enter your time to'); ctime4.focus(); return false; } else { ctime1.value = trim(ctime1.value); ctime2.value = trim(ctime2.value); ctime3.value = trim(ctime3.value); ctime4.value = trim(ctime4.value); return true; } } </script> </head> Welcome, <?php echo "".$_SESSION['username'];?>!</td> <?php if(!isset($_POST['submit'])) { ?> <form action="" method="post" onSubmit="return (checkForm();"> <table width="98%" height="301" border="0" cellpadding="10" cellspacing="0" bordercolor="#FFFFFF"> <!--Step 3 : Select Time--> <tr> <td style="border-width:1px; border-color:#A8B2C6; border-style:solid;" class="body" colspan="2"> <tr> <td width="15%" class="body-facilities">From:</td> <td class="body-facilities"> <input type="text" name="timeFrom" size="1" maxlength="2"> : <input type="text" name="timeFrom1" size="1" maxlength="2"> <sup style="color:#FF0000">eg: 08:00</sup> </td> </tr> <tr> <td class="body-facilities">To:</td> <td class="body-facilities"> <input type="text" name="timeTo" size="1" maxlength="2"> : <input type="text" name="timeTo1" size="1" maxlength="2"> <sup style="color:#FF0000">eg: 23:00</sup></td> </tr> <tr> <td colspan="2" align="right"><input type="submit" name="submit" value="Next" onClick="checkForm();"> <input type="reset" name="reset" value="Reset"> <input type="hidden" name="fac_id" value="<?php echo $fac_id;?>"> </td> </tr> </table> </form> <?php } ?> </td> </tr> </table>
  5. Xster

    Matching times

    No. How to setup? I want the PHP to check for the errors (eg : no input or wrong time format) and put them all in an array, if there are some errors it should redirect back to the previous form (written in html and php) and display the errors, if there are no errors it should link to the confirmation page before the data save into database. Is there any way to do that effigy? I already sent my php code before..hope you can show me how to setup..
  6. Xster

    Matching times

    [code]<form action="" method="post">[/code] why effigy?
  7. Xster

    Matching times

    effigy, Im not quiet sure..but still I need your attention.. what Im looking is,when I click button 'next' then its shows prompt msg something like "Invalid Entry" (if user didnt insert numbers into the box) pls forgive me if Im ask for stupid questions because Im freaking new bout this PHP.
  8. Xster

    Matching times

    effiegy... do u know which line should I put your code according to my php code? mine does not work and still got same problem...
  9. Xster

    Matching times

    Btw, this link... [url=http://www.badongo.com/pic/433848]http://www.badongo.com/pic/433848[/url] suppose to show you the image of my php.. hope this will help... p/s: effigy: i want my form accepting only [b]numbers[/b]...if you see mine still accepting any data entry such as letter,symbol or none (means nothing to put inside the box) please put the line if you got any ideas..thk u
  10. My time form suppose to accept the [b]numbers[/b] written as (eg: 01 for hours and 02 for minutes) i've tried this regex code on my php code... [b]$legit = ereg("^[0-9]{2,2}$", $time);[/b] and here's my php code... [code]<?php if(!isset($_POST['submit'])) { ?> <form action="" method="post"> <table width="100%" cellpadding="10" cellspacing="0" border="0"> <!--Step 3 : Select Time--> <tr> <td style="border-width:1px; border-color:#A8B2C6; border-style:solid;" class="body" colspan="2"> <div style="font-size:18px; color:#007E8C; font-weight:bold;"> <font color="#cccccc">3. </font>Select Time</div><br> </td> </tr> <tr> <td width="15%" class="body-facilities">From:</td> <td class="body-facilities">&nbsp;<input type="text" name="timeFrom" size="1" maxlength="2">&nbsp;:&nbsp;<input type="text" name="timeFrom1" size="1" maxlength="2">&nbsp; <sup style="color:#FF0000">eg: 08:00</sup> </td> </tr> <tr> <td class="body-facilities">To:</td> <td class="body-facilities">&nbsp;<input type="text" name="timeTo" size="1" maxlength="2">&nbsp;:&nbsp;<input type="text" name="timeTo1" size="1" maxlength="2">&nbsp; <sup style="color:#FF0000">eg: 23:00</sup></td> </tr> <tr> <td class="body-facilities"><sub>Operating Hour:</sub></td> <td class="body-facilities"><sub><?php echo $row_rs['fac_wkdayS'];?>&nbsp;to&nbsp;<?php echo $row_rs['fac_wkdayE'];?>&nbsp;(Monday to Friday)</sub><br> <sub><?php echo $row_rs['fac_wkendS'];?>&nbsp;to&nbsp;<?php echo $row_rs['fac_wkendE'];?>&nbsp;(Saturday &amp; Sunday)</sub></td> </tr> <tr> <td colspan="2" align="right"><input type="submit" name="submit" value="Next">   &nbsp;&nbsp; <input type="hidden" name="fac_id" value="<?php echo $fac_id;?>"></td></tr> </table> </form> <?php } ?> </td> </tr> </table> </td>[/code] mine does not work... anybody got ideas for more tests I can run to pin down this problem..? u guys rock...!
  11. anyway thx anatak.. i do understand the code that you've given.. but which line should i put the code inside my php code? i put a long with php tags and nothing happened.. and it still run'd like usual.. sorry if i ask silly questions..rite now im trying and still got some error.
  12. Yes! i got it rite..and my server completely connected.. let me share how i recover this problem. if you install mysql under windows system, sometime it will suddenly unable to start the service, i face this issue quite a few times already, finally i found a solution for it, 1st step check the error, under your installation path for mysql, check the data/mysql.err, it the error showing you something like this .. 050213 20:43:37 InnoDB: Starting shutdown… 050213 20:43:40 InnoDB: Shutdown completed; log sequence number 0 1051715 050213 20:43:40 [Note] C:\Web\mysql\bin\mysqld-nt: Shutdown complete this should be the log file having problem! 2nd step remove the ib_logfile0 or ib_logfile1 in the same folder 3rd step restart the mysql … da da da… mysql service is running again thx to wildteen88,fenway and ah knight's blog...
  13. here's my code [code]<?php if(!isset($_POST['submit'])) { ?> <form action="" method="post"> <table width="100%" cellpadding="10" cellspacing="0" border="0"> <!--Step 3 : Select Time--> <tr> <td style="border-width:1px; border-color:#A8B2C6; border-style:solid;" class="body" colspan="2"> <div style="font-size:18px; color:#007E8C; font-weight:bold;"> <font color="#cccccc">3. </font>Select Time</div><br> </td> </tr> <tr> <td width="15%" class="body-facilities">From:</td> <td class="body-facilities">&nbsp;<input type="text" name="timeFrom" size="1" maxlength="2">&nbsp;:&nbsp;<input type="text" name="timeFrom1" size="1" maxlength="2">&nbsp; <sup style="color:#FF0000">eg: 08:00</sup> </td> </tr> <tr> <td class="body-facilities">To:</td> <td class="body-facilities">&nbsp;<input type="text" name="timeTo" size="1" maxlength="2">&nbsp;:&nbsp;<input type="text" name="timeTo1" size="1" maxlength="2">&nbsp; <sup style="color:#FF0000">eg: 23:00</sup></td> </tr> <tr> <td class="body-facilities"><sub>Operating Hour:</sub></td> <td class="body-facilities"><sub><?php echo $row_rs['fac_wkdayS'];?>&nbsp;to&nbsp;<?php echo $row_rs['fac_wkdayE'];?>&nbsp;(Monday to Friday)</sub><br> <sub><?php echo $row_rs['fac_wkendS'];?>&nbsp;to&nbsp;<?php echo $row_rs['fac_wkendE'];?>&nbsp;(Saturday &amp; Sunday)</sub></td> </tr> <tr> <td colspan="2" align="right"><input type="submit" name="submit" value="Next">   &nbsp;&nbsp; <input type="hidden" name="fac_id" value="<?php echo $fac_id;?>">   </td></tr> </table> </form> <?php } ?> </td> </tr> </table> </td> [/code] again how to build and put the regex into this code and which line it was? i appreciate any help...
×
×
  • 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.