Jump to content

php_developer

Members
  • Posts

    31
  • Joined

  • Last visited

Everything posted by php_developer

  1. what collation to use for storing english and French in phpmyadmin(MYSQL) I am using collation "utf8_general_ci", but some french characters are not stored properly in database e.g. "É" is stored as "É"
  2. Hello, I am using html and javascript to open a child window and want to disable the parent window when the child window is active, below is the code i am using: <html> <head><script type="text/javascript"> var popupWindow=null; function child_open(){ popupWindow =window.open('new.html',"_blank","directories=no, status=no, menubar=no, scrollbars=yes, resizable=no,width=600, height=280,top=200,left=200"); }function parent_disable() {if(popupWindow && !popupWindow.closed)popupWindow.focus();}</script></head><body onclick="parent_disable();" onfocus="parent_disable();"> <a href="javascript:child_open()">Click me</a></body> </html> But this is not working.
  3. go to this link, it may help you
  4. Okay, Now I got the reason... Thank You so much, for Your Support...
  5. Its 5.3.5(xampp)..I realy don't know why is this function not giving me correct result at my localhost.What ever date I am putting in this function, it gives me same result as, "+6015 days". But will it work correctly online (at server, there may be an issue at my localhost)...?
  6. But I am not getting the correct result. Not even for the following code:<?php$datetime1 = date_create('2009-10-11');$datetime2 = date_create('2009-10-13');$interval = date_diff($datetime1, $datetime2);echo $interval->format('%R%a days');?> Do I need to change some date setting at my desktop or is there any php version issue...? Please let me know..
  7. Hello, I am working with date_diff($date1,$date2) function but it is not giving me correct result... I have copied and pasted the following code:<?php$date1=date_create("2013-03-15");$date2=date_create("2013-12-12");$diff=date_diff($date1,$date2);echo $diff->format("%R%a days");?>from : http://www.w3schools.com/php/showphp.asp?filename=demo_func_date_diff but it is not giving me the same result ("+272 days") as the above refference says(shows), rather it gives me "+6015 days", which is wrong. Please let me know, am i going wrong... or is there any other problem
  8. Is it possible to change the window title in a javascript prompt box..?
  9. my this code is working Pretty well for IE8, firefox and chrome. Thank You so much for all your help and support..
  10. Okay... I wrote the span tag as: <span onclick='javascript:window.open("<?php echo $sitelink; ?>/filename.php", "mywindow","directories=0,titlebar=0,toolbar=0,location=0,status=0,menubar=0,scrollbars=no,resizable=no,width=400,height=300")' style="text-decoration:none">Link name</span> So, Should I remove "javascript:" Is onclick an event attribute..?
  11. I used the "span" tag then it start working properly...So the problem was only because of the anchor tag "<a>".. Thank You so much.. ...
  12. <a href='javascript:window.open("<?php echo $sitelink; ?>/filename.php", "mywindow","directories=0,titlebar=0,toolbar=0,location=0,status=0,menubar=0,scrollbars=no,resizable=no,width=400,height=300")' style="text-decoration:none">Link name</a> This is my code, I have issue with. Please check and tell me what is the problem, why is this not working in any browser other than chrome... Or any alternate to it... I do not know anything about console.. Please tell me how can I check the error on console...
  13. window.open() function working properly on chrome but do not work on IE and Firefox, Is there any alternate to this function. Please help...
  14. I want to store the "xmlhttp.responseText" into a global variable so that the response i am getting can be used in another function. xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { validvar=xmlhttp.responseText; alert(validvar); a=validvar; } Actually I want to show the response in a confirm box and if the user click ok only then go to next page or submit the form else in case of cancel the form shuld not be submitted. here a is the global variable. I am storing the xmlhttp.responseText into validvar and then in global variable a. But The global variable remains empty when I access it another function. OR if there is any other way to store the response so that i can use it in another function and in the confirm box..
  15. save the html file with .php extntion first: Then for select box do as follows:<?php $query=mysql_query("select * from table-name where ..."); ?><select name="users" onchange="showUser(this.value)"><option value="">Select a person:</option><?php while($data=mysql_fetch_array($query)){<option value="<?php echo $data['id'] ?>"><?php echo $data['name'] ?></option><?php } ?></select>don't forget to create the connection with database...
  16. For explode() function see : http://www.w3schools.com/php/func_string_explode.aspand for in_array() function see : http://www.w3schools.com/php/func_array_in_array.asp
  17. single equal to sign is an assignment operator.. if you want that your if() condition should check for equality then use double equal to sign as if($result = = $conn->query($query)).
  18. this if condition works in all ways, i.e. if name is null or not so try this one: <script>function myFunction(){var x;var name=prompt("Please enter your name","Harry Potter");if (name!= '') { x="Hello " + name + "! How are you today?"; document.getElementById("demo").innerHTML=x; }else if(name=='') {name='Stranger'; x="Hello " + name + "! How are you today?"; document.getElementById("demo").innerHTML=x; }}</script> When you leave the propt box empty then it will show "Hello Stranger! How are you today?"
  19. Yes... just check the name. If it is null then write .' Hello Stranger How are you today?' as below: if (name==null){x="Hello Stranger ! How are you today?";document.getElementById("demo").innerHTML=x;}
  20. This is nice... But I want to check the file size ("file uploade"), before the form get submitted. Means as we check the file size ( let using php) at server side after it get uploaded... But I want to know that is there any way to get the file size, befor actually submitting the form (i.e. client side validation not at server side )
  21. Hello... I want to know that, is it possible to get the size of a file (while uploading it), before it actually uploaded on server ( in case of a form submission )... Means to get the file size at client side while uploading it, and giving an alert in case if size is larger than the specified size , (as client side validation)...
  22. I think you must retrive the value of CODE in some variable like: $code = CODE; and then use $code in your mysql query like:insert into table (`code`) values ('$code').. May be this will help u...
  23. I have already seen the error but It was not clear with it.. so I asked dear .... ( I know that I didn't give the full code to you... full code may help you to solve the problem.. But my question was just for to check the ajax code.. because I do not know much about ajax... so I thought that I am doing some mistake in ajax... ) But now I got the answer... The problem was in "document.getElementById("txtHint").innerHTML=xmlhttp.responseText;" The innerhtml that I am using is not working in IE6 every thing else is okay... I thought that if every thing is working properly on other browsers then what is the problem with IE6?... I checked each and every line and now I got the answer... Thanks alot for replying and giving time to my Post..
  24. working of ajax...When I select the country from the country select box then time zone for that particular country displayed on another select box ( which I have saved in database )... and Its working properly on all browers except on IE6... Problem...as on IE6 the time zone select box remains empty on selection of any country...So that means its not working... and also... the status bar of brower shows "Error on page" ( at left corner of status bar )...
×
×
  • Create New...