如何在使用Ajax表单提交后呈现php变量 [英] How to present php variable after form submit using Ajax

查看:52
本文介绍了如何在使用Ajax表单提交后呈现php变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是阿贾克斯的新手..


这是缩短网址的时间。


提交表格后,我需要做那些东西,简短的'URL。我在单独的页面上,使用php POST。


当该脚本完成并生成缩短的URL ,我需要向用户提供。 (我们将ti作为php变量,让我们说$ shorturl。)


我知道可以使用Ajax提交没有页面重新加载的表单,但是我可以'弄清楚如何从处理表单的页面获取php变量,并将其呈现给用户。


所有这一切都没有刷新页面,当然。 />

有谁能告诉我怎么做?

解决方案

shorturl)。


我知道可以使用Ajax提交没有页面重新加载的表单,但我无法弄清楚如何从处理表单的页面获取php变量,并将其呈现给用户。


所有这一切都没有刷新页面,当然。


任何人都可以告诉我该怎么做?


@ londres9b


你首先需要一个关于Ajax的基本教程,以理解不刷新的概念页面。


我看过教程..


据我所知,服务器有可能发送'

I''m new in Ajax..

It''s for a URL Shorten.

Upon form submit, I need to do that stuff, to short'' the URL.. And I do that on a separate page, using php POST.

When that script is done and the shortened URL is generated, I need to present that to the user. (We have ti as a php variable, let''s say $shorturl).

I know that it is possible to submit forms without page reloading using Ajax, but what I can''t figure out is how to get a php variable from the page that processed the form, and present it to the user.

All this without refreshing the page, of course.

Anybody can tell me how to do this?

解决方案

shorturl).

I know that it is possible to submit forms without page reloading using Ajax, but what I can''t figure out is how to get a php variable from the page that processed the form, and present it to the user.

All this without refreshing the page, of course.

Anybody can tell me how to do this?


@londres9b
You first need a basic tutorial on Ajax to understand the concept of "not-refreshing" the page.


I have looked to the tutorial..

As far as I understand, it is possible for the server to send the ''


这篇关于如何在使用Ajax表单提交后呈现php变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆