Jump to content


Photo

Make a link a POST value...? *SOLVED*


  • Please log in to reply
5 replies to this topic

#1 pocobueno1388

pocobueno1388
  • Members
  • PipPipPip
  • Advanced Member
  • 3,369 posts
  • LocationPalm Beach, Florida

Posted 07 September 2006 - 11:54 PM

Is there any way you can turn a link such as:
<a href="page_name.php">Blah</a>

Into a $_POST value? What I am trying to do is secure my users shop.php script. Users are able to put items up for sale into a shop, and they can edit the prices when they click on the picture of the item. I am trying to disable other users from being able to update items in shops that arn't theres. The only way I can do that is to clear all the $_GET values in the URL. Or if there was a way to hide the $_GET  values in the URL to everyone, yet I was able to get the values from them, that would work fine, but I have never heard of that.

When they click on an item to edit, I am using the $_GET information to pull out the information in the database. The item they click on is obviously an image link, so I would like to change the URL of the link so I don't have to put $_GET values in the URL for other users to change. Usually I can block people out of things like this, but I didn't plan enough before I started coding and got trapped...so there is no way to keep people away from others items with the GET values in the URL.

I know I could just make an submit button that can bring them to the edit page, but I want to keep the page as clean as possible, and I already have a couple of buttons. If this can't be fixed, I will just have to do that.

Any help will be very appreciated.

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 08 September 2006 - 12:03 AM

Make the image the submit button for a form that contains a hidden input whose value is the item number or whatever.
Legend has it that reading the manual never killed anyone.
My site

#3 pocobueno1388

pocobueno1388
  • Members
  • PipPipPip
  • Advanced Member
  • 3,369 posts
  • LocationPalm Beach, Florida

Posted 08 September 2006 - 12:22 AM

How would I make the image a submit button?

#4 TEENFRONT

TEENFRONT
  • Members
  • PipPipPip
  • Advanced Member
  • 338 posts

Posted 08 September 2006 - 12:26 AM

<INPUT TYPE="image" SRC="" HEIGHT="" WIDTH="" BORDER="" ALT="">
Teenfront.co.uk : Free Teen Chat -  FunkySmileys.co.uk : MSN Smileys -  ArcadeMonkey.co.uk : Free Flash Games
8Baller.co.uk : Free Multiplayer Pool [url=http://8Baller.co.uk]

#5 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 08 September 2006 - 12:29 AM

<form method=" ... whatever ..." method="post">
<input type="hidden" name="product_id" value="<?php echo $product_id;?>"/>
<input type="image" name="submit" src="<?php echo $the_product_image_name_and_path;?>" border="0"/>
</form>

The product_id and image name will comes from your database (I guess)
Legend has it that reading the manual never killed anyone.
My site

#6 pocobueno1388

pocobueno1388
  • Members
  • PipPipPip
  • Advanced Member
  • 3,369 posts
  • LocationPalm Beach, Florida

Posted 08 September 2006 - 12:33 AM

Thanks guys XD I appreciate it. I wasn't aware that an input type could be 'image'.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users