User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 426,498 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,216 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 497 | Replies: 11
Reply
Join Date: Mar 2008
Posts: 69
Reputation: mrcniceguy is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
mrcniceguy mrcniceguy is offline Offline
Junior Poster in Training

i`m lost!!!

  #1  
May 14th, 2008
i were working offline all the time with wampserver installed in my comp.
but after i loaded it in school server i experienced a problem,
in my web after login in your own profile appears also their is a link were you see other members profile.
My problem is that when you open other profile and tend to open again(myprofile)your own profile which is also as a link after opening another profile.
some of the datas of the other member especialy the last registered member appears on myprofile,while offline i didn`t have such a problem.
How can i overcome this???????????
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2008
Posts: 70
Reputation: Vai is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 5
Vai Vai is offline Offline
Junior Poster in Training

Re: i`m lost!!!

  #2  
May 14th, 2008
Originally Posted by mrcniceguy View Post
i were working offline all the time with wampserver installed in my comp.
but after i loaded it in school server i experienced a problem,
in my web after login in your own profile appears also their is a link were you see other members profile.
My problem is that when you open other profile and tend to open again(myprofile)your own profile which is also as a link after opening another profile.
some of the datas of the other member especialy the last registered member appears on myprofile,while offline i didn`t have such a problem.
How can i overcome this???????????
Someone might be able to help you if they could see the actual problem, line of code,
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 240
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: i`m lost!!!

  #3  
May 15th, 2008
That's strange. Is there any change of version in php/apache ? I can't think of a reason why your script is acting weirdly !
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,458
Reputation: peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough 
Rep Power: 11
Solved Threads: 296
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: i`m lost!!!

  #4  
May 15th, 2008
Schools do not often secure properly other users directories and once you login into system you able to browse other users work, this is just side observation
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Reply With Quote  
Join Date: Mar 2008
Posts: 69
Reputation: mrcniceguy is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
mrcniceguy mrcniceguy is offline Offline
Junior Poster in Training

Re: i`m lost!!!

  #5  
May 15th, 2008
there is no change in php/apache.
i`m suprised because offline it works well.
Reply With Quote  
Join Date: Mar 2008
Posts: 69
Reputation: mrcniceguy is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
mrcniceguy mrcniceguy is offline Offline
Junior Poster in Training

Re: i`m lost!!!

  #6  
May 15th, 2008
This is the script i used to login:



  1. <html>
  2. <head>
  3.  
  4. <title>Welcome|To our site</title></head>
  5. <body bgcolor=black>
  6. <?php
  7. //header( 'refresh: 5; url=http://localhost/website/member.php' );
  8.  
  9. $user=$_POST['user'];
  10. $password=($_POST['password']);
  11.  
  12.  
  13. //connecting to databases
  14. $dbcnx=@mysql_connect('localhost','root','*********');
  15. if(!$dbcnx){
  16. exit('<p>unable to connect to the database'.
  17. ' this time try again later.</p>');
  18. }
  19.  
  20. if (!@mysql_select_db('register')){
  21. exit('<p>unable to locate the REGISTER DATABASE'.
  22. 'AT THIS TIME');
  23. }
  24. //makes sure they filled it in
  25. if(!$_POST['user'] | !$_POST['password']) {
  26. echo "<center><font color=white size=12>Either pass or UserName are not filled<br><a href=peacemaker.php>Go back and try again</a></font></center>";
  27. }else{
  28.  
  29. session_start();
  30. $query = "SELECT *FROM login where (user='$user' and password='$password')" ;
  31. $result=mysql_query($query);
  32. if(mysql_num_rows($result) == 1) {
  33.  
  34. $row=mysql_fetch_array($result);
  35. $id=$row['id'];
  36. $name=$row['name'];
  37. $user=$row['user'];
  38. $email=$row['email'];
  39. $country=$row['country'];
  40. $password=$row['password'];
  41. $location=$row['location'];
  42. $langu1=$row['langu1'];
  43. $langu2=$row['langu2'];
  44. $family=$row['family'];
  45. $education=$row['education'];
  46. $age=$row['age'];
  47. $male=$row['male'];
  48. $female=$row['female'];
  49. $hobbie=$row['hobbie'];
  50. $phone=$row['phone'];
  51. $address=$row['address'];
  52. $web=$row['web'];
  53. $relation=$row['relation'];
  54. $position=$row['position'];
  55. $movies=$row['movies'];
  56. $date=$row['date'];
  57.  
  58. $_SESSION['id']=$row['id'];
  59. $_SESSION['name']=$row['name'];
  60. $_SESSION['user']=$row['user'];
  61. $_SESSION['email']=$row['email'];
  62. $_SESSION['country']=$row['country'];
  63. $_SESSION['password']=$row['password'];
  64. $_SESSION['location']=$row['location'];
  65. $_SESSION['langu1']=$row['langu1'];
  66. $_SESSION['langu2']=$row['langu2'];
  67. $_SESSION['family']=$row['family'];
  68. $_SESSION['education']=$row['education'];
  69. $_SESSION['age']=$row['age'];
  70. $_SESSION['male']=$row['male'];
  71. $_SESSION['female']=$row['female'];
  72. $_SESSION['hobbie']=$row['hobbie'];
  73. $_SESSION['phone']=$row['phone'];
  74. $_SESSION['address']=$row['address'];
  75. $_SESSION['web']=$row['web'];
  76. $_SESSION['relation']=$row['relation'];
  77. $_SESSION['position']=$row['position'];
  78. $_SESSION['movies']=$row['movies'];
  79. $_SESSION['date']=$row['date'];
  80.  
  81.  
  82.  
  83. include "myprofile.php";
  84. }else{
  85. include "login_Bad.php";
  86. }
  87. }
  88.  
  89. ?>
  90. </td></tr></table>
  91. </table>
  92. </body>
  93. </html>
  94.  
  95. and the myprofile.php is here:
  96. <html>
  97. <head>
  98. <?php
  99. header( 'refresh:5; url=http://localhost/website/myprofile.php' );
  100.  
  101. //header("Location: http://localhost/website/myprofile.php");
  102. // header( 'refresh: 5; url=http://localhost/website/myprofile.php' );
  103.  
  104. session_start();
  105. $id=$_SESSION['id'];
  106. $name=$_SESSION['name'];
  107. $user=$_SESSION['user'];
  108. $email=$_SESSION['email'];
  109. $country=$_SESSION['country'];
  110. $password=$_SESSION['password'];
  111. $location=$_SESSION['location'];
  112. $langu1=$_SESSION['langu1'];
  113. $langu2=$_SESSION['langu2'];
  114. $family=$_SESSION['family'];
  115. $education=$_SESSION['education'];
  116. $age=$_SESSION['age'];
  117. $male=$_SESSION['male'];
  118. $female=$_SESSION['female'];
  119. $hobbie=$_SESSION['hobbie'];
  120. $phone=$_SESSION['phone'];
  121. $address=$_SESSION['address'];
  122. $web=$_SESSION['web'];
  123. $relation=$_SESSION['relation'];
  124. $position=$_SESSION['position'];
  125. $movies=$_SESSION['movies'];
  126. $date=$_SESSION['date'];
  127.  
  128. ?>
  129.  
  130. <title>welcome| <?php echo$user?></title></head>
  131. <body bgcolor=black>
  132. <table width=646 height=30 align=center border=0 background=COMD.jpg cellspacing=8 cellpadding=2 >
  133. <TR><td><img src=SOMA.jpg width=601 height=50></td></tr>
  134. </table>
  135.  
  136.  
  137. <table width="646" border="0" cellpadding="2" background="bg-header.jpg" cellspacing="2" ALIGN=CENTER borderclor=red>
  138. <tr valign="top">
  139. <td><br><b><a href=home2.php>HOME</a></b>
  140. </td>
  141. <td><br><b><a href=myprofile.php>MYPROFILE</a></b>
  142. </td>
  143. <td><br><b><a href=comment.php>COMMENTS</a></b>
  144. </td>
  145. <td><br><b><a href=member2.php>MEMBERS</a><b>
  146. </td>
  147. <td><br><b><a href=comedy.php>COMEDY</a></b>
  148. </td>
  149. <td><br><b><a href=photo/index.html>PHOTOS</a></b>
  150. </td>
  151. <td><br><b><a href=music.php>MUSIC</a></b>
  152. </td>
  153.  
  154. <td><br><b> <form action=logout.php method=get><input type=submit value="LOGOUT" ></form></b>
  155. </td>
  156.  
  157.  
  158. </tr>
  159. </table>
  160.  
  161.  
  162. <table width=646 height=20 align=center border=0 bgcolor=gainsboro cellspacing=8 cellpadding=2>
  163. <TR VALIGN=TOP>
  164. <td WIDTH=20 height=10>
  165. <TABLE width=20 bgcolor=lightblue border=1 cellpadding=0 cellspacing=0 align=left height=10 bordercolor=black>
  166. <tr align=top><td ><B><br><a href=myprofile.php>FRIENDS</a></B></td></tr><tr VALIGN=TOP><td><B><br><a href=myprofile.php>MY PHOTO</a></B></td></tr><tr><td><B><br><a href=myprofile.php><NOBR>MESSAGE</NOBR></a></B></td></tr><tr><td><B><br><a href=edit.php>SETTING</a></B></td></tr>
  167. <tr><td><B><br><a href=myprofile.php>MY VIDEO</a></B></td></tr><tr><td><B><br><a href=myprofile.php>REQUEST</a></B></td></tr><tr><td><B><br><a href=myprofile.php><nobr>WHO VISITED</nobr></a></B> </td></tr><tr><td><B><br><a href=invite.php>INVITE</a></B></td></tr></table>
  168. </td><td width=80 align=center><P><b>Helloo!!</b><?php echo"<font size=3 color=brown><b><nobr>$user</b></font>";?></nobr></p><p align=center><img src=man.jpg width=140 height=150></p>
  169. <table width=80 height=10 border=1 cellspacing="1" cellpadding=1 bordercolor=black>
  170. <caption><nobr><b><font color=brown>MORE ABOUT ME</font></b></nobr></caption>
  171. <tr><td valign=top width=200 height=10>
  172. <p><b>Name:</b><?php echo"<font color=blue><b>$name $family</b></font>"; ?></p><p><nobr><b>Email:</b><?php echo "<font color=blue><b>$email</b></font>"; ?></nobr></p><p><b>Address:</b><?php echo "<font color=blue><b>$address</b></font>";?></p><p><b>Language:</b><?php echo"<font color=blue><b>$langu1</b></font>,<b><font color=blue> $langu2</b></font>";?></p><p><b>POSITION:</b><?php echo "<font color=blue><b>$position</b></font>";?></p>
  173. <p><b>Hobbie:<b><?php echo "<font color=blue><b>$hobbie</b></font>";?></p><p><b>Phone:</b><?php echo"<font color=blue>$phone</font>";?></p><p><b>Web:</b><?php echo "<font color=blue>$web</font>";?></p><p><nobr><b>Favorite Music:</b><?php echo "<font color=blue>$music</font>";?></nobr><nobr><b>Favorite Movies:</b><?php echo "<font color=blue>$movies</font>";?></p>
  174. </td></tr>
  175. </table>
  176.  
  177. </td><td><p><font color=yellow><b>Browse with pleasure</b></font></p><p><table width=100 height=100 border=0 cellspacing="1" cellpadding=1>
  178. <tr><td valign=top><b>Gender:</b></td><td valign=top><b>Age:</b></td></tr>
  179. <tr align=><td valign=top align=><?php echo "<font color=blue><b> $male $female</b></font>";?></td><td valign=top><?php echo"<font color=blue><b>$age</b></font>";?></td></tr><tr><td valign=top><nobr><b>location:</b></nobr></td><td valign=top><nobr><b>Nationality:</b></nobr></td></tr><tr><td valign=top><nobr><?php echo"<font color=blue><b>$location</b></font>"?></nobr></td><td valign=top><?php echo "<font color=blue><b>$country</b></font>";?></td></tr>
  180. <tr align=center><td valign=top><nobr><b>Member Since:</b></nobr></td><td valign=top><nobr><b>Relation status:</b></nobr></td></tr>
  181. <tr ><td valign=top><nobr><?php echo"<font color=blue><b>$date</b></font>";?></nobr></td><td valign=top><?php echo "<font color=blue><b>$relation</b></font>";?></td></tr>
  182. </table></p><hr font color=black></hr>
  183.  
  184.  
  185.  
  186. </td>
  187.  
  188.  
  189. </TR>
  190. </table>
  191.  
  192. </body>
  193. </html>
Last edited by peter_budo : May 15th, 2008 at 7:50 am. Reason: Keep It Organized - please use [code] tags
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 240
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: i`m lost!!!

  #7  
May 15th, 2008
Its very difficult to say what is going wrong. Try unsetting the session variables and see if it does any trick.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Mar 2008
Posts: 69
Reputation: mrcniceguy is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
mrcniceguy mrcniceguy is offline Offline
Junior Poster in Training

Re: i`m lost!!!

  #8  
May 15th, 2008
do you mean at the end of my session??
should i put something like this:
session_unset();
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 240
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: i`m lost!!!

  #9  
May 15th, 2008
Umm.. When you visit someone's profile, will his details be added to the session ? If yes, then unset the session variables before using it again. If no, then, I can't think of anything else.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Mar 2008
Posts: 69
Reputation: mrcniceguy is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
mrcniceguy mrcniceguy is offline Offline
Junior Poster in Training

Re: i`m lost!!!

  #10  
May 15th, 2008
when you visit somone`s profile,his Details are not added to the sessions))
this real suprises me and i just noticed that is the last registered person which details troubles.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 5:14 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC