Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. The easy was was to move it to a folder outside of the root.
  2. Since the root folder is accessible by almost anyone I don't think you want to store anything sensitive in there. Passwords s/b outside of the root which means above it or beside it where one has to use something other than html.
  3. What you are trying to say is you want someone to do your work for you? That's another forum where you can hire someone to do that kind of 'help'. Here we help the programmer solve his issues - if it is explained clearly and the related code is shown to us so that we can modify it if necessary. And as Barand is telling you, you are going to have to figure out how to look at and modify your database definitions. Since you couldn't show that info to us yesterday I guess today's task is going to be impossible.
  4. You are not able to do that? Are you kidding? You provided 300+ lines of code you wrote and yet you can't look up your database layout for us?
  5. And STILL you haven't provided what is asked for. Tsk Tsk.
  6. you have lost probably your best source for help by NOT answering Barand's questions. He (and I) would like to see your table structures and the relationships (which certainly are not all one-to-one) but you won't show them. There no arrays in a database.
  7. What do you mean by 'class position' and 'subject' position? Are you saying you want to use CSS to place objects in certain places on a screen?
  8. That line you are using could be written as: echo "<a href='StatementEntry.php?ID=$ID' title='The tooltip here'>$ViewDate</a>"; And this line works fine for me. And as I asked earlier - is that what you are looking for us to help with (see my earlier.)
  9. Kicken: I was going to offer the 'title' attribute but wasn't sure that was all the the OP was looking for. Still waiting....
  10. You want something to show up onscreen when one hovers over it. You are showing the ViewDate value onscreen but you want a different date to popup during the hover. I don't understand what else you want to happen. PS - you want a div that is only 4px high? That's pretty small.
  11. I'm gonna guess that it is your way of styling the table elements. Add some CSS to your output and stop using old formats for styling. One mail system may not be honoring the way you are trying to style your tables. You are using some out-dated ways of doing things. Do your styling on the tags instead of each element of your table. AND - are you sending the emails with html formatting enabled?
  12. You really shouldn't be using @ signs
  13. Since I don't see any kind of php code to access a db I suppose you might get more attention if you posted this on a forum for Codeignitor instead of generic php.
  14. You only need one button to do a file upload. That a bit of php to get the file and save it somewhere on your server/host. You will not be saving it in a database though. Not recommended. Designate a folder for where to place these files and then save the filename in the database, using a static path in your code to reference it when needed. When things change you only have to do a bit of file reorganizing to move all of them to wherever you need to put them and then change the static path in your code to point there instead of having to update all the database records with a new path.
  15. Happy that I was able to contribute. Don't forget to turn off error checking before putting into production.
  16. Why do you set the cookie twice and do it differently each time? I see one of them is still telling you that it's not working but the other one you did not alter to use an if to test the result. Those error messages about output being alread sent. That could also be the error messages I'm having you output once we resolve this issue.
  17. Well we already know that setcookie as you are calling it is not working. Fill out the rest of the parms and try that AND DO IT THE WAY i TOLD YOU USING AN IF STATEMENT TO TEST THE RESULT.
  18. Are you ever seeing the form? You keep saying nothing is happening but if my tracking messages are showing something else has to be too.
  19. I give up. I asked you to add 2 lines at the top. Why did you not do that but tell me that "nothing received"? If you can't follow simple simple directions I"m wasting my time. Have fun.
  20. YOU POST IT HERE! You posted it already once. I re-posted it with my edits. You made changes but without seeing what you did I can't move forward. So POST it.
  21. Show Us The NEW code so we can be sure
  22. When you put your login file..... Does that mean you used the one EXACTLY as I gave it to you? You didnt' get any echo'ed messages indicating how far it ran? Impossible. All of those error messages are telling you a line number that has the error on it. Look at one and try to figure out what is wrong with that line. Looks like an undefined array or array element to me. And that means something is not being shown to you as an error which is causing all of these errors. Add these 2 lines after the session_start line in the code I gave you for login.php error_reporting(E_ALL); ini_set('display_errors', '1');
  23. Made some cleanups and corrections. This is so much more than a "login" script. In fact I don't see it actually logging in someone but rather just showing a page if the username is known and it doesn't seem to do a login. It also has multiple html errors such as no doctype tag, nor head not html and the js code seems to be not in the head area at all. <?php // login.php session_start(); ob_start(); include 'db.php'; extract($_REQUEST); // POOR CODING SHOULD USE GET OR POST AND NOT REQUEST echo "in login.php at line ".__LINE__."<br>"; $data =" "; if(@$usernamee) // BAD PRACTICE USING THE @ SIMPLY HIDES ERRORS AND YOU SHOULD NOT IGNORE THEM. FIX THE CODE AND REMOVE THE @ // WHY THE 2 E'S IN THE VARIABLE NAME??? { $pwd = hash('sha256', $password); $sql = "SELECT * FROM tbl_admin WHERE username=? AND password=?"; // SHOULD NAME THE COLUMNS YOU WANT AND NOT USE * $stmt = $link->prepare($sql); $stmt->bind_param("ss", $usernamee, $pwd); $stmt->execute(); $result = $stmt->get_result(); // WHAT IS GET_RESULT? IS THAT A MYSQLI FUNCTION INSTEAD OF A FETCH? if(mysqli_num_rows($result)>=1) { $_SESSION['username']=$username; // WHERE DID THIS VARIABLE GET CREATED?? header("Location: index.php"); // SHOULD HAVE AN EXIT AFTER ANY REDIRECT (WHICH IS THIS) } else $data = "Invalid Login ID"; } echo "in login.php at line ".__LINE__."<br>"; $sql = mysqli_query($link,"SELECT * FROM tbl_admin"); // SHOULD NAME THE COLUMNS YOU WANT AND NOT USE * $res = mysqli_fetch_assoc($sql); $_SESSION['company'] = $res['company']; ob_end_flush(); include 'inc/head.php'; $code=<<<heredocs <body class="crm_body_bg"> <section class="main_content dashboard_part large_header_bg" style="padding: 0;"> <div class="main_content_iner "> <div class="container-fluid p-0"> <div class="row justify-content-center"> <div class="col-12"> <div class="dashboard_header mb_50"> <div class="row"> <div class="col-lg-6"> <div class="dashboard_header_title"> <h3>{$res['company']} - Login</h3> </div> </div> </div> </div> </div> <div class="col-lg-12"> <div class="white_box mb_30"> <div class="row justify-content-center"> <div class="col-lg-6"> <div class="modal-content cs_modal"> <div class="modal-header justify-content-center theme_bg_1"> <h5 class="modal-title text_white">Log in</h5> </div> <div class="modal-body"> <div class="text-center text-muted mb-4"> <small> heredocs; echo $code; echo "in login.php at line ".__LINE__."<br>"; if($data != " ") { echo "<div class='alert alert-warning' role='alert'> <span class='alert-icon'><i class='ni ni-like-2'></i></span> <span class='alert-text'><strong>Warning! </strong> $data</span> </div>"; } $code=<<<heredocs </small> </div> <form role="form" action="" method="post"> <div class="form-group"> <input class="form-control" placeholder="Username" name="usernamee" type="text"> </div> <div class="form-group"> <input class="form-control" placeholder="Password" name="password" type="password"> </div> <button type="submit"class="btn_1 full_width text-center">Log in</button> </form> </div> </div> </div> </div> </div> </div> </div> </div> </div> </section> <script src="js/jquery-3.4.1.min.js"></script> <script src="js/popper.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/metisMenu.js"></script> <script src="vendors/scroll/perfect-scrollbar.min.js"></script> <script src="vendors/scroll/scrollable-custom.js"></script> <script src="js/custom.js"></script> </body> </html> heredocs; echo $code; The guy who wrote this did not follow normal practice. He is using extract to retrieve the inputs from your form's POST array instead of actually referencing them as what they are - elements of the $_POST array created when a form is submitted. This is noted in the official php manual as "bad practice" and highlighted there. I don't now what is supposed to be happening here but I assume you do. So read thru it and try to understand what is going on and see if it makes sense. Note my comments about the things that looking at. I will not even try to figure out the logic and leave that to you. And if you don't now PHP you may be out in the cold.
  24. Post the login script here. Be sure to show the name so we can keep track of your code.
  25. Of course it stops that is what an exit does. So I think you are saying that the login script is dying on you. Well, add some echos in there to see what is happening. That is how you debug.
×
×
  • 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.