Jump to content

sagnik

Members
  • Posts

    478
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by sagnik

  1. Thanks for your help, sir. It helped me a lot, but not like that I wanted to. I know, I couldn't describe the thing clearly. I'm trying last time to describe the problem:

    $q=mysqli_query($con, "SELECT * FROM posts");
    while($r=mysqli_fetch_array($q)){
    //When first row is fetched echo the first row
    //When second row is fetched echo the second row
    }
    
    And for your previous suggestion, do you mean to do that, I've to use paging? Like paging does, for example, shows 5 contents per page, I've to show 1 row per page and use jQuery for auto-paging?

     

    In short, I don't want my users to wait until all rows are displayed.

  2. Ok, thanks... But I've wanted to show rows as MySQL fetches rows in a while loop as MySQL doesn't fetches all rows at once so I've wanted to display the row as soon as it ready instead of waiting for MySQL to fetch all rows. You take Facebook as an example, Facebook displays the posts as soon as it ready and at the bottom of page it shows a loading image.

  3. Sir, here is the register/index.php

    https://pastebin.com/AneB6n3Q

    You can see that I've written session_start() at line 2 then I've included the header.php in line 3.

    And one more thing, when I've copied the text from index.php to paste it in Pastebin, I saw that, a space is added before "<?php" like " <?php" in line 1. I don't understand that, is the space really exist in my code or the space adding when I'm pasting the code as the space is not showing in my code editor (Notepad++). If the space exist then it maybe the problem for the warning.

  4. How can I show the contents of MySQL table as it fetches data? For example, I'm retrieving data using jQuery-ajax, before sending request to the PHP show an ajax loader and in PHP, if in a table has 4 rows and I'm retrieving the data in a while() block, as MySQL fetch first row show the data in the page using jQuery and continue to show the loader and after retrieving all 4 rows hide the loader. How can I do this?

  5. I'm getting a warning in PHP when I'm using session_start().

    The warning says that: cannot start session, headers already sent (output started at /home/sgn/public_html/nm/public_html/members/register/index.php:1) in /home/sgn/public_html/nm/public_html/members/register/index.php on line 2

    And, Cannot send session cache limiter - headers already sent (output started at /home/sgn/public_html/nm/public_html/members/register/index.php:1) in /home/sgn/public_html/nm/public_html/members/register/index.php on line 2

    I couldn't figure out the problem as it says output started at line 1 but in line one has only "<?php" and a unix line break like "<?php[LF]" and in line 2 "session_start()", no spaces, no echo/print.

  6. I've a class named "SGSocial". I'm sending data by ajax to a file and calling to a function of SGSocial from the file. But the problem is, ajax takes too much time to retrieve data. And PHP gives "Fatal error: Maximum execution_time exceeds in sgsspl.php on line 399" . Here is the link to all the files related to the problem: https://www.dropbox.com/sh/1pf51ff5zmohqi9/AADDiRDV2pgdCBm8o0FJ8EMEa?dl=0

    Can anyone help me to figure out the problem??

  7. For the location, yes for me and my friend's location will be same. But for IP, how can be same for both of us? He will be browsing from a different ISP or network and I will be browsing from a different. And for Proxy, VPN, TOR, I don't think he will use any of them.

    But yeah, sometimes I use VPN (when I'm in a mobile network), because cPanel sometimes gives an error informing that, "Your IP address has been changed, please login again", so I has to use VPN to change my current IP to a static IP address.

  8. How do I compress the files??

     

    And one more thing...

    Suppose, my friend creates an account in Heliohost from his own computer and gives the login credentials to me to manage his website as you already know that he doesn't know anything about web development. And if I manage only his website from his computer only and I neither login to his account from my computer nor login to my account from his computer.

    In short, I will manage only his website from his computer only and my website from my computer only. Is there will be any chance to getting suspended??

  9. But if I let my friend host his website in my account, we both may experience disk space problem as heliohost now offers 1gb disk space after an extension from 512mb. I'm hosting a social networking site and my friend wants to host a classified website so we need storage. If I really have to do it, can I get some extra storage or can I store all the data including "photos, videos, audios, etc." into database?

  10. But the second one is not mine. It's my friend want me to maintain his website because he don't know anything about web design. He wants to create a classified advertisement website and he wants me to develop the website. If he creates an account in heliohost and he gives me his account details to develop and maintain his website, is there any problem?

  11. Sir, my friend wants to host a website in HelioHost. But he don't know anything about web development, so he requested me to operate/maintain his Website. He wants to create a classified website and he wants me to maintain the website as he will take care of advertisements.

    I'm writing this because, I already have a website in HelioHost named "sgnetworks.cu.cc", and I will maintain the website of my friend as well as my own website "sgnetworks.cu.cc" and I don't want neither my own website "sgnetworks.cu.cc" nor my friend's website to be suspended.

  12. Hi, again got a problem.

     

    As the title describing, everything in a function inside a class repeating every value twice. For example, when using 'echo', transferring a value to another function/class. I'm attaching a screenshot of the page. On that page you will see, "HELLO4HELLO4", The two four had transferred from the class-1(where the problem occurs) and printed on the class-2. Class-1 transferring 4 two times to class-2. And also I'm posting the function:

    function setSession($uid){
    		session_start();
    		if(!empty($uid)){
    			$this->uid_md5 = $uid;
    			if($q=db_query("SELECT uid,uid_md5,username,login_cookie,uid_md5,status,suspended,suspension_reason FROM users WHERE uid_md5='".$this->uid_md5."'",$this->db)){
    				if(db_num_rows($q)==1){
    					$r=db_fetch_array($q);
    					$this->uid_md5 = sha1($r['uid_md5']);
    					$this->sessid = sha1($r['uid']).'-'.sha1($this->ip);
    					$this->login_cookie = sha1($r['username']).'-'.sha1($this->ip).'-'.sha1($this->device);
    					if($this->login_cookie == $r['login_cookie']){
    						if($update=db_query("UPDATE users SET uid_md5='".$this->uid_md5."', autologin='0', login_ip='".$this->ip."',login_device='".$this->device."',login_platform='".$this->platform."',login_browser='".$this->browser."',login_ua='".$this->ua."',login_country='".$this->country."',login_state='".$this->state."',login_location='".$this->city."',login_date='".$this->date."',login_time='".$this->time."',login_timestamp='".$this->timestamp."',login_cookie='".$this->login_cookie."' WHERE uid_md5='".$this->uid_md5."'", $this->db)){
    							setcookie('uid','',0);
    							$_SESSION['expires'] = time();
    							$_SESSION['uid'] = $uid;
    							$_SESSION['sessid'] = $this->sessid;
    							if($r['status']==0){
    								$this->nmi->redirectByRefId(3,'do=confirm');
    							} elseif($r['status']==1){
    								$this->nmi->redirectByRefId(2,2);
    							} elseif($r['status']==2){
    								echo "HELLO";
    								$this->nmi->redirectByRefId(4);
    							} elseif($r['status']==3){
    								$this->nmi->redirectByRefId(3,'do=renew');
    							} elseif($r['status']==4){
    								$this->nmi->redirectByRefId(3,'do=status');
    							} elseif($r['status']==5){
    								$this->nmi->redirectByRefId(3,'do=status');
    							}
    						} else {
    							echo '<div class="error">Unable to update database</div>';
    						}
    					} else {
    						setcookie('uid','');
    						unset($_SESSION['expires']);
    						unset($_SESSION['uid']);
    						unset($_SESSION['sessid']);
    						echo '<div class="error">Your login device was changed. Please login again.</div>';
    					}
    				} else {
    					echo '<div class="error">Your login details were changed. Please login again: '.$this->uid_md5.'/'.$r['uid_md5'].'</div>';
    				}
    			} else {
    				echo '<div class="error">Unable to query database</div>';
    			}
    		} else {
    			echo '<div class="error">UID cannot be left empty</div>';
    		}
    	}
    
    Take a look at the screenshot:

×
×
  • Create New...