09-11-2010, 05:58
|
|
|
חבר מתאריך: 01.11.05
הודעות: 73
|
|
העמוד שמריץ את ה IFRAME
index.py
קוד PHP:
import cgi
from google.appengine.api import users from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app
class MainPage(webapp.RequestHandler): def get(self): self.response.headers["Content-Type"]="text/html" self.response.out.write(""" <html> <head> </head> <body bgcolor="black" text="white"> <table width=85% border=2> <tr> <td width=70%> <iframe src = "login.py" scrolling = "auto" width=100% height=400px>
</iframe> </td> </tr> </table>
</body> </html> """)
application = webapp.WSGIApplication( [('/', MainPage)], debug=True)
def main(): run_wsgi_app(application)
if __name__ == "__main__": main()
והקוד של login.py
הוא לקוח מגוגל, ממש לא שינתי כלום, זה פשוט עמוד שנותן לך לעשות לוגאין לחשבון גוגל.
בכל אופן, נראה ככה:
קוד PHP:
from google.appengine.ext import webapp from google.appengine.ext.webapp.util import login_required from google.appengine.ext.webapp.util import run_wsgi_app from google.appengine.api import users from google.appengine.ext import db
class MyHandler(webapp.RequestHandler):
@login_required def get(self): user = users.get_current_user() self.redirect('welcome.htm') application = webapp.WSGIApplication([('/', MyHandler)], debug=True)
def main(): run_wsgi_app(application)
if __name__ == "__main__": main()
אני יודע שאני מפספס משהו, אשמח אם תעלה על זה..
תודה.
|