Jump to content

[SOLVED] PHP GET Issue


behzad

Recommended Posts

Hi There.

 

I have Get Issue in URL

 

E.g

 

If I have a url lets say  "www.mydomain.com/page_x.php?passvariable=10"

 

If someone changes the "passvariable=10" To "passvariable=15" as example they go to that record that might not be relevent to them even if they are loged in.

 

Is there a way of validating or avoiding this to happen?

 

I am new to php realy so good explanation could help me better.

 

Thanks

Link to comment
Share on other sites

Hi there

 

Maybe I am not clear in my explanation.

 

The passvariable lets say being a product of some what. Is there a way if the number "value for the passvaiable"  if changed manually from the url string to be avoided?

 

I do not want some to get access to the products lets say from changing the passvariable in address bar of the browser.

 

 

Link to comment
Share on other sites

Well, unless you have these numbers tied to a particular user, then I don't see a way to block someone from doing that. One other way around this would be to pass this variable using a session. This way the person cannot just change the number and gain access to other stuff.

 

 

Nate

Link to comment
Share on other sites

you could use posts instead of gets

 

That would require forms and such. In my opinion those sites that use forms and post vars for EVERYTHING get on my last freaking nerve. You can't refresh a page, and when you try to go back, you get the "post data already sent' message.

 

but that is just my opinion.

 

 

Nate

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.