Jump to content

scorpio22

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by scorpio22

  1. hi everyone, i am working on a project, where when a user registers, he would be provided with a link which he can give to anyone and ask them to register. once this new user, uses that link to register, he will be automatically assigned certain points, that was set by the manager while he was registering. i do want to use the POST, GET functionality, because the points value will be clearly seen on the hyperlink and if edited would give the user unlimited points. i want to know if there is any way i can encrypt it or provide a hyperlink is such a format that any user who logs in with that link will get the points set by that manager. how can i achieve this? i am using php and mysql.
  2. Is there any way to check if a textbox or a dropdown list has been changed like is textchanged function in C#. I have a page with 3 textboxes and 2 dropdown lists and i want to execute a query if any textbox or dropdown list is changed. How can i achieve this???
  3. ok... any other possible way to achieve what i am trying to do??? a message box or alert that you are not allowed to view this and move back to the previous page.
  4. how can i raise an alert box and then at the same time redirect it the user to his homepage?? here is the code i tried... it is not raising an alert but is redirecting. if($_SESSION['access_level'] != "admin") { echo '<script language="javascript">alert("You do not have access to this page")</script>'; header('location: ../user/user.php'); exit(); } if i comment header, then is showing me the message box and exiting. any method to get a notification that the user has no access to this page and redirect to user.php
  5. Yes i have set a session once a user logs in and now i have set a variable access_level to it and checking if the user is admin or not. I have fixed that issue, thanks to you. But my question is can multiple users log in at the same time and have the same variable $_SESSION['username'] as their session or will it lead to a clash of sessions when there are multiple users logged in at the same time?
  6. Thanks schilly, i can do that. I have set Username as a session when a user logs in. so based on that session i can find out the username and find out if he has admin access or not. But when i upload it to a website, then there will be multiple users accessing the website at the same time, in that case, having only one session will it be overwritten or something like that??? if admin and user log in at the same time, then what will the session variable be? or is the session dependent only on the local system from which the user is accessing?
  7. is there no other way to achieve this, because there are so many pages in the admin (obviously because admin has access to everything), so i was wondering if there was any other simple solution???
  8. I have developed a website, where i have 2 access levels, users and admin. on the server, i have admin folder with all admin stuff and user folder with all user stuff. based on the username,password combination from login page, i am redirecting the user to appropriate location. Everything is fine, but when user logs in and if he changes or types into the address bar, the pages from the admin folder then he is able to access them. How do i prevent this from happening? like if the user is redirected to User.php and he changes the address to Admin.php he is getting access to all the admin stuff from there on. I want to know how i can prevent a user from entering the Admin folder and all its pages completely, even by changing the address bar. Thanks.
  9. hey mate, the same solution is what i am using, i just modified things the way things should be according to my project, but the logic is the same.
  10. Hello everyone. I have a php webpage, where there are textforms, dropdown list and stuff. There is Activity field in the database. Whatever activities that i do on the webpage, like modifying the text in the textbox, or changing a value for a dropdown list, these need to be automatically entered into the activity text in the database. Like this it happens only for one page. Like for example, if i change a project name field and change status to 'Important' from 'Normal', then it needs to make an entry into the Activity field like: On date:yyyy/mm/dd Project name has been changed to 'New Project' and status has been changed to 'Important'. I think this can be achieved with stored procedures or i might be wrong. I would really appreciate if someone could write down a sample code or help me in making this possible.
  11. Thanks jacsdev. I made some modifications on my code and your logic works perfectly fine. Thanks a lot
  12. hello guys, i have a problem with a query. I have a table actions which has no primary key. any one particular record can be identified by the combination of actionID, taskID and ProjectID which are the other fields in actions table. Here is an example of the possible situations of entries in the actions table(so that you get an idea of what i am talking about) ActionID 1 for taskID 1 of ProjectID 10-000 ActionID 2 for taskID 1 of ProjectID 10-000 ActionID 1 for taskID 2 of ProjectID 10-000 ActionID 1 for taskID 2 of ProjectID 10-001 ActionID 2 for taskID 2 of ProjectID 10-001 ActionID 3 for taskID 1 of ProjectID 10-000 ActionID 1 for taskID 1 of ProjectID 10-002 ActionID 1 for taskID 2 of ProjectID 10-003 When i am creating a new action for taskID 1 of ProjectID 10-000, then what i am doing is i am scanning the all the ActionIDs of the taskID 1 of ProjectID 10-000, ordered by ActionID and incrementing the last obtained ActionID by 1 to generate a new ActionID for the new action. Now suppose the entries of ActionID for taskID 1 of ProjectID 10-000 in the database are 1,2,5,6,8,10,15,16, then according to my logic, the newly generated ActionID would be 17, but that is not what i want. I want the newly generated ActionID to be 3, because 3 is not present in the ActionID field of taskID 1 of ProjectID 10-000 combination . In the above example, if i delete ActionID 2 for taskID 1 of ProjectID 10-000 and then when a new action is added to the same combination of taskID and ProjectID, i want the newly generated ActionID to be 2 and not 4 which is what i am getting from my logic. Can anyone help me with this???
  13. Hello everyone, I am a newbie to php. I have been learning it and it is going well. I have a php webpage, where there are textforms, dropdown list and stuff. There is Activity field in the database. Whatever activities that i do on the webpage, like modifying the text in the textbox, or changing a value for a dropdown list, these need to be automatically entered into the activity text in the database. Like this it happens only for one page. Like for example, if i change a project name field and change status to 'Important' from 'Normal', then it needs to make an entry into the Activity field like: On date:yyyy/mm/dd Project name has been changed to 'New Project' and status has been changed to 'Important'. I think this can be achieved with stored procedures or i might be wrong. I would really appreciate if someone could write down a sample code for me regarding this.
×
×
  • 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.