Jump to content

sweeti

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sweeti's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This is the way it should come.... U_id:uid1 U_id:uid2 U_id:uid3 Name:name1 Name:name2 Name:name3 Team name:teamname1 Team name:teamname2 Team name:teamname3 coins:coins1 coins:coins2 coins:coins3
  2. You could try something like the following: <?php $uid_data = ''; $name_data = ''; $teamname_data = ''; $coins_data = ''; $cash_data = ''; for($i=0;$i<=25;$i++) { if($i%5==0) { $uid_data .= "<td>uid$i</td>"; $name_data .= "<td>name$i</td>"; $teamname_data .= "<td>teamname$i</td>"; $coins_data .= "<td>coins$i</td>"; $cash_data .= "<td>cash$i</td>"; } } print '<table>'; print "<tr><th scope='row'>U_Id</th>$uid_data</tr>"; print "<tr><th scope='row'>Name</th>$name_data</tr>"; print "<tr><th scope='row'>Teamname</th>$teamname_data</tr>"; print "<tr><th scope='row'>Coins</th>$coins_data</tr>"; print "<tr><th scope='row'>Cash</th>$cash_data</tr>"; print '</table><br/>'; ?> But the output is not coming as i desired.I was getting this out put earlier but not the kind of output i have given u as an example...
  3. Yes the orientation does matter..if it was in my hand i would do it like the way you were suggesting but i have to do it the way i have given here.
  4. What i exactly want is: U_id:uid1 U_id:uid2 U_id:uid3 Name:name1 Name:name2 Name:name3 Team name:teamname1 Team name:teamname2 Team name:teamname3 coins:coins1 coins:coins2 coins:coins3 . .
  5. Please do let me know if you dint get my query.....
  6. The problem is that i am getting result of 5 people's data.Hence i am getting 5 tables displayed one after another. What i want to do is display tables side by side.
  7. I tried a lot of things can you all help me out what to do..
  8. Hey everyone, I have a problem here.Now as u see my data is being displayed one after another in vertical manner.But what do i want to do is the entire table being displayed in same page continuously one after another in horizontal manner.how would i do that? (below a screen shot is given how my table looks like.) <code> <?php for($i=0;$i<=25;$i++) { if($i%5==0) { ?> <table> <tr> <th scope="row">U_Id :</th> <td><?php echo 'uid'; ?></td> </tr> <tr> <th scope="row">Name :</th> <td><?php echo "name"; ?></td> </tr> <tr> <th scope="row">Teamname :</th> <td><?php echo "teamname"; ?></td> </tr> <tr> <th scope="row">Coins :</th> <td><?php echo 'coins';?></td> </tr> <tr> <th scope="row">Cash:</th> <td><?php echo 'cash'; ?></td> </tr> </table> <br/> <?php //echo "$i<br/>"; } } ?> </code>
  9. Hey everyone.. I cleared the earlier doubt i have a new doubt in the same system.. <code> public function login($uname, $pass,$remember=false) { $result =$this->db->query("SELECT * FROM tbl_userauth"); $result->execute(); $resl=$result->fetchAll(PDO::FETCH_ASSOC); if ($resl[0]['username'] !=$uname || $resl[0]['password']!=$pass) { return $this->error("User not Found"); } else { $userID=$resl[0]['userid']; $_SESSION['userid']=$userID; $uname=$resl[0]['username']; $_SESSION['uname']=$uname; if(isset($_SESSION['userid'])) { header("location:dash.php"); } else { header("location:login.php"); } } </code> No this is my system actually i wanted to do session checking..Rite now when i am logging in the system i am able to log in but the same URL if i copy and paste in another browser i dont have to log in i am already logged in that's not rite Na?? I mean in another browser i should b logging in and then able to access in rite????What am i doing wrong???? PLease guide me through..Thank you..
  10. Im getting a perfectly fine result when me doing mysql but when converting it to PDO i am getting an error..
  11. I had tested with || operator too..I am totally getting an error even when my username and password both right..n i just have one row in my database so....
  12. public function login( $uname, $pass, $remember=false ) { $uname = $this->escape($uname); $password = $pass; $pass = $this->escape($pass); $result = $this->db->query("SELECT `{$this->table['id']}`,`{$this->table['pass']}`,`{$this->table['active']}` FROM ".TBL_USERS." WHERE `{$this->table['user']}` = '$uname' LIMIT 1"); // If user not found if ($result->num_rows == 0) { return $this->error("Username Not Found"); } // If user is found else { $row = $result->fetch_array(); // Compare passwords if(!$this->comparePassword($pass, $row[$this->table['pass']])) { return $this->error("Invalid username/Password"); } // If passwords match but user is not verified if($row[$this->table['active']] < 1) { return $this->error("Account not verified or inactive"); } // If everything goes well, set the userID $this->userID = $row[$this->table['id']]; } } This was the original code in mysql bt i tried to do in PDO in a simplified manner...can you please tell me where i went wrong???????
  13. hey guys i tried doing that but some how the password is not getting validated..with a wrong password to i can log in the system
  14. He means how is your password stored in the database, have you used md5 or sha1 or something else to encrypt it. When you compare the passwords you need to do the same thing so the values are the same or they will not match and hence you have an issue. I am using sha1()..
  15. Then you need to hash it before your comparison. And in whole words? How would you hash it????i am new at php and trying to learn can you please guide me..
×
×
  • 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.