3

As the title suggests, I'm trying to pass parameters into my cgi script so that when you type in (for example): www.helloworld.com/cgi-bin/world.py?post=101, the script will display that post

I've tried the following:

link = '<a href="world.py?post=%s">test</a>' % postNumber

link = cgi.FieldStorage()
id = link.getvalue('post')
print id

but the value of id is nothing. It's like it's not reading the link properly or something.

Please help!

1
  • "Nothing"? Please print what you are getting and update the question with the response your CGI script is getting. Commented Apr 28, 2011 at 17:04

1 Answer 1

6

How about:

id = link["post"].value
print id
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.