Thanks for you help, it is working now :D

Take care


"Kent Johnson" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hansan wrote:
>> Hi.
>>
>> Sorry forgot to post a "non-working" example
>>
>> That could be
>> print "<a href=script.py?id=", variable,  "'>", "some text"  <input 
>> type=hidden name="eventid" value='''+str(variable_name)+'''>'''</a>"
>>
>> I know that it isnt very creative, but I am having a hard time getting 
>> html to work together with python.
>>
>> When the link "some text" is clicked I want to send both the first 
>> variable called variable and the second one(variable_name) to the script 
>> (script.py)
>
> As Hal pointed out you need to put both variables into the link. Also, you 
> should be url-encoding your values using urllib.quote_plus(); otherwise 
> variable values containing characters like &= will cause trouble. So for 
> the link I would use
>
> from ulrlib import quote_plus
> link = "<a href='script.py?id=%s&eventid=%s'>" % 
> (quote_plus(str(variable)), quote_plus(str(variable_name)))
>
> Then you may need urllib.unquote_plus() on the reading end depending on 
> the server.
>
> Kent 


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to