Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm no expert on web development, and need to find a way to let the browser call a PHP routine on the server with the current document ID as parameter, eg.

http://www.acme.com/index.php?id=1

I then need to call eg. /change.php with id=1 to do something about that document.

Unless I'm mistaken, there are three ways for the client to return this information:

  • if passed as argument in the URL (as above), it will be available as HTTP referrer
  • by including it as hidden field in
  • by sending it as cookie

I suppose using a hidden field is the most obvious choice. Are there other ways? Which solution would you recommend? Any security issues to be aware?

Thank you.


Edit: I needed a way for the client to learn some of the information returned by the server, such as the document ID. Apparently, the right way to solve my problem is by changing the server-side code so that this information is included in hyperlinks/forms included in the HTML page.

share|improve this question
1  
This belongs on stackoverflow.com –  RandomBen Jul 21 '10 at 22:01
3  
StackExchange is like playing ping-pong ;) –  user702 Jul 21 '10 at 22:13
    
@overtherainbow lol, hang on buddy, we're all still getting used to it too. –  rlb.usa Jul 21 '10 at 22:22
    
What does this sentence I then need to call eg. /change.php with id=1 to do something about that document. mean? Is that a link that is clicked? Or a hidden form? Or something on the backend? Question is not very clear. –  artlung Jul 22 '10 at 5:01
    
You're correct on the solution. You can answer your own question if you like. I do agree that this is a bit off-topic (it's a basic web application development question) –  JasonBirch Jul 23 '10 at 0:39
show 1 more comment

1 Answer 1

Seems to me the deportment of the modern web is now in full motion to url-as-arguments.

http://www.acme.com/page1, http://www.acme.com/page2

http://www.acme.com/page/1, http://www.acme.com/page/2

Mod-rewrite can get you there. (Eventually)

share|improve this answer
    
Thanks Thomas for the tip. –  user702 Jul 24 '10 at 21:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.