Jump to content

abdfahim

Members
  • Posts

    535
  • Joined

  • Last visited

Everything posted by abdfahim

  1. I have been searching this for months! I am trying to align all my forum login name, so can I please have my username (login name) changed to abdfahim? I have already changed the display name to that long time back. Thanks
  2. Hi, I want to implement a progress bar. The idea is simple, I have file2.php where I set $_SESSION['progress'] value in each loop. While file2 is working in background, I want to return the $_SESSION['progress'] value in main thread using below functions. But the problem is, it is not working. While fprogress is being called in every second, the value is set only once at the end. Can anybody please help? Thanks, var updateprog; function fprogress() { var progxmlHttp = new XMLHttpRequest(); var progress; var url = "file1.php"; progxmlHttp.onreadystatechange=function(){ if (progxmlHttp.readyState==4 && progxmlHttp.status==200){ progress = progxmlHttp.responseText; document.getElementById("progress").innerHTML ="Progress: "+progress+"% <br><br>"; } } progxmlHttp.open("GET", url, true); progxmlHttp.send(null); } function updateAll(mid) { var xmlhttp=new XMLHttpRequest(); updateprog = window.setInterval(fprogress,1000); xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ window.clearInterval(updateprog); document.getElementById("progress").innerHTML ="progress: 100% <br><br>"; } } xmlhttp.open("POST","file2.php",true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); params = "key=xxx"; xmlhttp.send(params); } file1.php <?php if (!isset($_SESSION)) { session_start(); } echo $_SESSION['progress']; ?>
  3. Hi, Another question. If I want to block direct access to my "includes" folder where I have base PHP files (only PHP files) which are included throughout the site, is it enough I just disable directory listing using following commands in htaccess? Or I should take some more precautions to protect my code? .htaccess Options -Indexes
  4. okay guys .. thanks .. it seems like I had a whole misconception how flash file works in browser ..... Thanks for clearing it up ......
  5. so isn't there any way to protect a folder from direct access (but enable php inclusion)?
  6. thanks both of you ... My server is Apache running on Linux .... I'll definitely use that -Indexes command. For protecting files from download, is there any way except putting them outside webroot? Can't I use htaccess to restrict direct access to those folders? I Googled and found lots of example, but I couldn't properly tweak those to make it perfect for me, as I have no experience in htaccess. The code I tried to do was to redirect to webroot (www.mysite.com) whenever someone try to direct access that directory (www.mysite.com/classes). But I was stuck in 2 kind of scenarios: 1. That directory was protected but the server PHP files also failed to access. Hence I got all those "includes" inside PHP file not working 2. There was infinite loop while redirecting
  7. Hi, I have some flash files and also some PHP files in a folder called "classes" which I inlcuded/embeded in my other PHP files. What I want is nobody can directly go to "www.mysite.com/classes" to protect downloading those files. Also I want to disable file listing when somebody point to any directory. How can I do those?
  8. I want to get the maximum values of the second key of a multidimensional array. Write now I am using the code below, which works. But interested to know whether anybody has any better idea? $arr['a']['2012-08-04']=100; $arr['a']['2012-08-01']=4545; $arr['a']['2012-08-07']=2434; $arr['b']['2012-08-02']=2334; $arr['b']['2012-08-03']=2324; $dt=array(); foreach($arr as $val){ $dt=array_merge($dt,$val); } echo max(array_keys($dt));
  9. Okay, locate your problem. You have extra space in front of user name, hence it is not giving anything. If you write like below, it will work (notice an extra space in username, e.g. NOT 'will it work', rather, ' will it work' SELECT count( * ) FROM charismos WHERE username = ' will it work' You see, you have same problem after 4th row for all data. That's why you are not getting any result after 4th row. To overcome this prob, always use PHP TRIM function when entering data in database
  10. From your query, I can't see any problem. If your table is not confidential and also not too big, may be you can attach the sql export here, then I can load in my machine and check.
  11. Oops, a typo !! Yes, it is ofcourse SourceGuard
  12. May be you can rewrite query like $sql = "SELECT Totrain FROM tablename WHERE TotRain>'20' ORDER BY `ID` ASC, `Year` ASC, `Month` ASC, `dayset` ASC LIMIT 3
  13. Dears, I am wondering why ioncube is almost double price compare to safeguard? ioncube basic has same price (~200USD) but ioncube Cerberus is price 379USD. And if you compare with sourceguard, it has the options matched with ioncube cerberus (MAC/IP/Domain licensing, time based licensing etc.). Anybody has any idea what extra I can get with extra price for ioncube? thanks,
  14. I don't see any problem except those syntax issues in query lines. Try to echo variable $fetch_1 before if loops. $qry_2=mysql_query("INSERT INTO `tbl` (...) VALUES (...)") or die(mysql_error()); $qry_2_Update=mysql_query("UPDATE `tbl` SET `att` = `att` +1 WHERE `id`='".$this->u_tst."'");
  15. isn't this belong to JavaScript forum?
  16. $flatarr = array(); foreach($old_array as $key => $val) { $flatarr = array_merge($flatarr,$val); }
  17. During inserting, you should do like this if(!get_magic_quotes_gpc()){ $name = addslashes($name); }
  18. can you just try using this code to make it basic (again if you want to use GET method anyhow in start.php? <form action="http://mysite.com/start.php?offer_pgid=071691" method="post"> <p><input type="text" style=" width:230px; height:60px; border:2px dashed #D1C7AC; font-size:18px;" name="paypal_email"></p> <p> </p> <input type="image" name="continue" src="images/arw_submit.png" alt="submit" value="Submit"></form> and write following line on top of start.php $_GET['email']=$_POST['paypal_email']; =========OR======= <form action="http://mysite.com/start.php" method="get"> <p><input type="text" style=" width:230px; height:60px; border:2px dashed #D1C7AC; font-size:18px;" name="email"></p> <p> </p> <input type="hidden" name="offer_pgid" value="071691"> <input type="image" name="continue" src="images/arw_submit.png" alt="submit" value="Submit"> </form>
  19. you already are passing variable $_POST['paypal_email'] to start.php, why bother passing $_GET['email'] which is exactly same as $_POST['paypal_email']? if you need anyhow in GET format (which I don't know actually why), just assign in start.php like below $_GET['email'] = $_POST['paypal_email']
  20. looks like we are on the exactly same page .... Mahngiel, do you have a time column to make the hash only usable within a certain time? I've been toying with this in my mind but I'm not wanting to make another column for time. you have 2 choice ... either insert another column in DB for time stamp, but I prefer to embed the expiration time stamp inside that key ......
  21. I personally don't like this security question answer method (because I never could remember those of any of my web accounts). And if the security answer is is too straight forward, then there is no point of having it. So what I did for my designed forums, - when a user click on "forget password" link, it will ask for the email address. - If email address matches, it will create a temporary key in database against that user and send a specific link with hashed (md5) key as argument to his email address. - If he clicked on that link, it matches the key and then asked for a new password.
  22. good that ur problem is resolved .. Nevertheless, I put end semi-colon inside quote ... stupid typing mistake .. echo "<a href=\"?country=".$_GET['country']."&from_language=Russian&into_language=Latvian&submitted=true& page=".$x. "\">".$x."</a>";
  23. not sure about built in function, but another method should be $pagename=explode("/",$_SERVER['PHP_SELF']); echo $pagename[count($pagename)-1];
×
×
  • 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.