Jump to content

php_developer

Members
  • Posts

    31
  • Joined

  • Last visited

Posts posted by php_developer

  1. 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.

  2. 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..

  3. 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

  4. <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>
    my this code is working Pretty well for IE8, firefox and chrome. Thank You so much for all your help and support.. :rolleyes:
  5. 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..?

  6. <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...

    also check for errors in the console, I imagine if it's not working then there's at least a chance there are some.
    I do not know anything about console.. Please tell me how can I check the error on console...
  7. 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..

  8. 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...

  9. if (name!=null)
    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?"
  10. This looks like exactly what you need http://w3shaman.com/comment/202 TAG: Progress bar
    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 )
  11. 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)...

  12. ding ding ding ding! maybe that's a hint you should try and find out what the error is...?
    I have already seen the error but It was not clear with it.. so I asked dear :Pleased: ....
    Show your entire code and double-click on the error icon to figure out what it's telling you is the problem.
    ( 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.. :rolleyes:
  13. What happens when you run the code? Is there an error message, does the alert box show? Saying "it doesn't work" doesn't give us any information to help solve the problem.
    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...