[Python] Recupero parametro GET da url

Cristian Re cristian.re a gmail.com
Mar 7 Ott 2008 10:02:06 CEST


2008/10/7 Lawrence Oluyede <l.oluyede a gmail.com>

> On Tue, Oct 7, 2008 at 9:55 AM, Zanon Samuele <webs86 a gmail.com> wrote:
> > eccolo:
> >
> > [Tue Oct 07 00:53:46 2008] [error] [client 79.28.248.123]   File
> > "stampa_ordine.py", line 174, referer:
> > http://dominio.net/ordini/index.php?ord_id=40
> > [Tue Oct 07 00:53:46 2008] [error] [client 79.28.248.123]     print '<a
> > href="'. output_filename '">PDF ORDINE</a>', referer:
> > http://dominio.net/ordini/index.php?ord_id=40
> > [Tue Oct 07 00:53:46 2008] [error] [client
> > 79.28.248.123]
> ^,
> > referer: http://dominio.net/ordini/index.php?ord_id=40
> > [Tue Oct 07 00:53:46 2008] [error] [client 79.28.248.123] SyntaxError:
> > invalid syntax, referer: http://dominio.net/ordini/index.php?ord_id=40
> > [Tue Oct 07 00:53:46 2008] [error] [client 79.28.248.123] Premature end
> of
> > script headers: stampa_ordine.py, referer:
> > http://dominio.net/ordini/index.php?ord_id=40
>
> Abbastanza chiaro.
>
> print '<a href="'. output_filename '">PDF ORDINE</a>'
>
> Gli apici dopo =" sono illegali. Devi farne l'escape:
>
> print '<a href="\'. output_filename\'">PDF ORDINE</a>'
>
> --
> Lawrence, stacktrace.it - oluyede.org - neropercaso.it
> "It is difficult to get a man to understand
> something when his salary depends on not
> understanding it" - Upton Sinclair
> _______________________________________________
> Python mailing list
> Python a lists.python.it
> http://lists.python.it/mailman/listinfo/python
>


In alternativa

print """<a href="%s">PDF ORDINE</a>""" % (output_filename)
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: http://lists.python.it/pipermail/python/attachments/20081007/f4c0a483/attachment-0001.htm 


Maggiori informazioni sulla lista Python