Documents number check and correction if possible.

Discussion in 'PHP' started by Sephy, May 14, 2008.

  1. #1
    Hey folks.

    So here is my problem. I need to create php script where will be checked documents nr.

    For example user x requesting document nr 235, but for real he need 233. I need give out message like this: document nr 235 not found and make "suggestion" to look at 233.

    I hear it kinda can be done vs hamming code, but its can correct only 1 number mistake for example 235 to 234 :confused:. Maybe there is some other method to use at this point?!

    ty for any response :cool:
     
    Sephy, May 14, 2008 IP
  2. yogesh1099

    yogesh1099 Active Member

    Messages:
    459
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    Digital Goods:
    1
    #2
    you cant know for certain that the user is going to request 235 (for you to suggest the user should rather view 233). because computers dont have their brain you need to mention that,like

    if(user_req==235)
    {
    echo "No Such Document, you should rather visit doc nr 233";
    }

    but you can do one thing code the script such that if user requests any other doc he should be prompted to correct the error , but while using php there should be no such problems as yours, I dont know what exactly are you coding which needs user to enter a number and it shows the doc...
     
    yogesh1099, May 14, 2008 IP