Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by houssam_ballout

  1. Hello,I had this issue in mysql:I had made a query which select data from 3 tables, using UNION command, and its getting the results, when I want to display the results in a php page , I need to know the table that each record had been retrieved from, how can I do it?Thanks in advance
  2. I meant, when I select an item from the dopdown it will show 2 textboxes, and when I select another dropdown it will hide those 2 textboxesThanks
  3. Is there any example available to help me
  4. Hello,i had the following scenario in which I need your help: I had a drop down box: <option value="client-all.php">1</option><option value="supplier-all.php">2</option><option value="koshofat.php">3</option> <input type="button" onClick="location=document.koshofat.URL.options[document.koshofat.URL.selectedIndex].value;" value="go" class="button2"> its good for 1, 2 , but I need to show 2 textboxes when the user select 3 and hide them when user select different than 3 (After that when he click submit, I will get the values through POST variables), I need your help in scripting my issue? Thanks in advance
  5. Here it is, problem now, is that when I write 4-5 or 4-5- I need to autocomple the year with the current year: var dtCh= "-";var minYear=1900;var maxYear=2100;function isInteger(s){ var i; for (i = 0; i < s.length; i++){ // Check that current character is number. var c = s.charAt(i); if (((c < "0") || (c > "9"))) return false; } // All characters are numbers. return true;}function stripCharsInBag(s, bag){ var i; var returnString = ""; // Search through string's characters one by one. // If character is not in bag, append to returnString. for (i = 0; i < s.length; i++){ var c = s.charAt(i); if (bag.indexOf© == -1) returnString += c; } return returnString;}function daysInFebruary (year){ // February has 29 days in any year evenly divisible by four, // EXCEPT for centurial years which are not also divisible by 400. return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );}function DaysArray(n) { for (var i = 1; i <= n; i++) { this = 31 if (i==4 || i==6 || i==9 || i==11) {this = 30} if (i==2) {this = 29} } return this}function isDate(dtStr){ var daysInMonth = DaysArray(12) var pos1=dtStr.indexOf(dtCh) var pos2=dtStr.indexOf(dtCh,pos1+1) var strDay=dtStr.substring(0,pos1) var strMonth=dtStr.substring(pos1+1,pos2) var strYear=dtStr.substring(pos2+1) strYr=strYear if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1) if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1) for (var i = 1; i <= 3; i++) { if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1) } month=parseInt(strMonth) day=parseInt(strDay) year=parseInt(strYr) if (pos1==-1 || pos2==-1){ alert("The date format should be : dd-mm-yyyy") return false } if (strMonth.length<1 || month<1 || month>12){ alert("Please enter a valid month") return false } if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){ alert("Please enter a valid day") return false } if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){ alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear) return false } if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){ alert("Please enter a valid date") return false }return true}function ValidateForm(){ var dt=document.getElementById("ADate");var currentTime4 = new Date()var month4 = currentTime4.getMonth() + 1var day4 = currentTime4.getDate()var year4 = currentTime4.getFullYear()var finalDate4 = ( day4 + "-" + month4 + "-" + year4 );if(dt.value == ''){ dt.value = finalDate4; }if (isDate(dt.value)==false) { dt.focus() return false } return true}/*function ValidateForm(){ var dt=document.frmSample.txtDate if (isDate(dt.value)==false){ dt.focus() return false } return true }*/
  6. I had the code for the validation dd-mm-yyyy but the auto complete is missing & when the field is empty is also missing!Thanks
  7. Hello,I need the help on the following in order to validate date on my form (validation is onBlur): - validation on form date format: dd-mm-yyyy , when I go to next field, if the date field is empty, it will be filled with today's date, and I write 9-3 and go to next field it will automatically write 9-3-2013 (where is 2013 is the current year), finally, if the date is not valid then user can't go to another field, focus must be go back to date field. Help is much appreciated. Thanks in advance
  8. Hello,I had a html form that I want to let enter key to act as TAB key in html form. Thanks in advance
  9. Hello,I need your help on the following:I had a page that I want to make it password protected using Javascript which is fine, but I want to be able to change the password when I login to that page, is that possible? Thanks
  10. Hello,I was looking at : http://www.w3schools.com/sql/sql_join_full.aspBut I want to display unique records, how can I achieve this?Thanks
  11. Hello,I had this case:Text is stored in mysql table in the means of html, i.e. it contains <p> ,<br /> .... I want to display it on a php page, I had 2 questions: I want to display the first 400 characters, then the second 300 each on different <div> , so I need to save them each on different variable? and what about html tags?Thanks
  12. Hello,I need help with the following:I had a dynamic variable in this form:XXXX-Y-A-B (which is called ID) XXXX is always fixed (character)Y is also a single characterA is an integerB is an integer I am quering a database that had list of that IDs , and I need to know the value of A each time (A could be 1, 2, 3, 11, 200....)Any help?Thanks
  13. Look at this example under confirm:http://labs.abeautifulsite.net/archived/jquery-alerts/demo/I need help in making it in <a href=""></a>also, my current code makes look from the database, so in the current code, with the <input type="button" id="confirm_button"> it will work with on button only.Thanks
  14. Hello all,I was searching for a javascript in which I can change the confirm box title, I had found this http://www.abeautifulsite.net/blog/2008/12/jquery-alert-dialogs/but I need help how to make it on a hyperlink, as in my page, I had <a href="test.php?action=del&id=1>Delete</a>the above link works perfect with button, how can I make it work on a href so that when I click on the Delete text, I get the confirmation with Yes , Cancel option, when clicked Cancel, it will do nothing and Yes will delete the record
  15. Hello,I had a normal page which contains some link that will issue a popup window. I want to refresh the main page when the pop page being closed, any help?Thanks in advance
  16. Hello all,I am using this script to upload file to FTP through php code, but its giving me FTP upload has failed!Can you help?Thanks <html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head> <body><form action="upload.php" method="post" enctype="multipart/form-data" name="form1" ><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="14%">server name </td><td width="75%"><input name="server" type="text" id="server">Write in the format "ftp.servername.com" </td><td width="11%"> </td></tr><tr><td>user name </td><td><input name="username" type="text" id="username"></td><td> </td></tr><tr><td>password</td><td><input name="password" type="password" id="password"></td><td> </td></tr><tr><td>File name </td><td><input type="file" name="file"></td><td> </td></tr><tr><td><input type="submit" name="Submit" value="Upload"></td><td> </td><td> </td></tr></table></form></body></html> "upload.php" <html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head> <body><?php$ftp_server=$_POST['server'];$ftp_user_name=$_POST['username'];$ftp_user_pass=$_POST['password'];$source_file=$_FILES['file']['name'];// retrieve name of the file to be uploaded$destination_file=$source_file;// make a connection to the ftp server$conn_id = ftp_connect($ftp_server); // login with username and password$login_result = ftp_login($conn_id , $ftp_user_name , $ftp_user_pass); // check connectionif((!$conn_id)||(!$login_result)){echo "FTP connection has failed!" ;echo "Attempted to connect to $ftp_server for user $ftp_user_name" ;exit;}else{echo "Connected to $ftp_server, for user $ftp_user_name" ;} // upload the file$upload = ftp_put($conn_id,$destination_file,$source_file,FTP_ASCII ); // check upload statusif(!$upload){echo "FTP upload has failed!" ;}else{echo "Uploaded $source_file to $ftp_server as $destination_file" ;} // close the FTP streamftp_close($conn_id);?></body></html>
  17. Hello,I had this issue:I had users which had trial users 10 days, so after 10 days passed, I don't want the user to login. So I was thinking of doing a php file which will query for the expired users, send them an email & disable access to login.my question is: Am I thinking right? If yes, how can I enable running of php files daily. If no, then how should I go for this?Thanks in advance
  18. Hello,I had created a form for users to upload their resumes (only word documents & 1 MB allowed as size), then email it after its been successfully uploaded.Any help?Thanks in advance
  19. Hello,I had page that display results dynamically from the database, I need to export that html table to pdf.Any help?Thanks
  20. Hello,I had a html website with flash in it, how can I put a pic and after 6 seconds that pic is gone and the flash is shown?Thanks in advance
  21. Hello,I had a php script that creates an excel file. now I need help sending this excel file as an attachment using php mail.Any ideas?Thanks in advance
  22. Hello,I need help to export or create an excel file through php. The data are being collected from mysql table.Thanks in advance
  23. Hello all,I had a php script that list content of a folder. I am working with WAMP, the script is at : wamp/www/scriptwell, if I put the images in this folder, it will work perfect, but I need to put the pics in C:\myFolder\picshow can I call that directory from within a php?Thanks in advance
  • Create New...