469,352 Members | 2,140 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,352 developers. It's quick & easy.

command to update a web page

Hello All,
I have a python script which sends out email once a particular
condition is met. Now I want to extend the functionality and make this
script update a php web page with the same contents as those of the
emails it sends out.
What module /commands can help me acheive this?
Thanks.

Jul 19 '05 #1
4 1315
You probably just want to use ftplib to upload the new
page to the website. You will, of course, need to create
the new page from the information provided by whatever
condition triggered it prior to uploading to the server.

Alternatively you could update some information in a
MySQL database and have your php web page access that
information every time it refreshes. The database
would need to be hosted at the website (but most ISPs
now give you free MySQL anyway).

Sort of depends on how often this happens, how complex
the php page is, etc. as to which is best method.

Larry Bates
at*****@yahoo.com wrote:
Hello All,
I have a python script which sends out email once a particular
condition is met. Now I want to extend the functionality and make this
script update a php web page with the same contents as those of the
emails it sends out.
What module /commands can help me acheive this?
Thanks.

Jul 19 '05 #2
ncf
I can't begin to know too much about this subject, but Python has a
builtin httplib module which might be interesting to you. There is also
a ftplib if that is how you want to do it. Python's documentation seems
to have adequate examples on how to use the two modules.

-Wes

Jul 19 '05 #3
ncf
Ugh. Correction.

I can't begin to *act like* I know too much about this subject, ...

Jul 19 '05 #4
Thanks
I used the httplib module to establish and test a connection now the
next step is to login supplying a username and password.
Any examples of these available somewhere
This is what i have so far
import httplib, urllib
conn = httplib.HTTPConnection("xxx.xx.xx.xxx")
conn.request("GET", "/index.php")
response = conn.getresponse()
print response.status, response.reason
data = response.read()
conn.close()

Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Samantha Smit | last post: by
reply views Thread by NETDeveloper | last post: by
18 posts views Thread by Alan Z. Scharf | last post: by
3 posts views Thread by John Blair | last post: by
4 posts views Thread by siaj | last post: by
4 posts views Thread by DEWright_CA | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.