Hi

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hariv
    New Member
    • Sep 2006
    • 2

    #1

    Hi

    in a shopping cart application ,when a article is selected ,ratings and comment can be given,Right now i have permission for the user's only can give ratings and comments ..Now i have to give permission to all the users who are not not logged in also must be able to give the ratings ..

    How can i do it
  • steven
    New Member
    • Sep 2006
    • 143

    #2
    Originally posted by hariv
    in a shopping cart application ,when a article is selected ,ratings and comment can be given,Right now i have permission for the user's only can give ratings and comments ..Now i have to give permission to all the users who are not not logged in also must be able to give the ratings ..

    How can i do it
    Simply remove the check to see if the visitor is a customer or not?

    Or perhaps change the code so the function isn't only accessible as a logged in user.

    It's really quite impossible, however, to give a definitive answer without knowing anything about the code or the way it works. If you wrote it, you should have a better idea than anyone about how it works. If not, then read through the code and find out what's limiting the use of the function to logged in users only. It's probably something really simple.

    Comment

    • hariv
      New Member
      • Sep 2006
      • 2

      #3
      Originally posted by steven
      Simply remove the check to see if the visitor is a customer or not?

      Or perhaps change the code so the function isn't only accessible as a logged in user.

      It's really quite impossible, however, to give a definitive answer without knowing anything about the code or the way it works. If you wrote it, you should have a better idea than anyone about how it works. If not, then read through the code and find out what's limiting the use of the function to logged in users only. It's probably something really simple.
      ------------------------
      Thanks for u r reply::

      This is the code that i have done for saving the rating and comments for the user..i have to change it now ,so as to give permission to all the user who are alll not logged in

      global $con;
      $artnr = $_REQUEST['artikel_nr'];

      if(!empty($_REQ UEST['rating']) && !empty($_REQUES T['prod_comments'])){
      $userid = $_SESSION['tusernr'];
      $rating = $_REQUEST['rating'];
      $comment = $_REQUEST['prod_comments'];
      $approve = 'N';
      $check_result = db_exec($con,"s elect * from artikel_rating where user_id=".$user id." and r_artnr=".$artn r."");
      $numrows = db_numrows($che ck_result);
      if($numrows>0){
      }else{
      $ins_qry = "insert into artikel_rating( r_artnr,user_id ,rating,comment s,approve) values('".$artn r."',".$userid. ",'".$rating."' ,'".$comment."' ,'".$approve."' )";
      db_exec($con,$i ns_qry);

      }
      }

      Comment

      Working...