如何在 Cakephp 中创建 GET 表单
所以我想要的是。拥有一个表单,当我单击“提交”时,它会提供
http://www.mywebsite.com/testing?text='testing'&number=1234564
与 Kannel不同的
http://www.mywebsite.com/testing/key:value
输出,并且它仅适用于 GET 表单。
更新
现在 Kannel 在 GET post 中工作,正如我提到的。但正如泰勒所说。它应该在幕后工作,这样就不会有人只使用短信功能并发送他们想要的任何内容。
这是它的工作原理,假设用户名是 tester,密码是 foobar(它在 smskannel.conf 文件中),这两行在 kannel 配置并在后台运行时发送短信(本地)
$url = "http://localhost:13013/cgi-bin/sendsms?username=tester&password=foobar&to=0127715667&text='This is the Message'";
$urloutput=file_get_contents($url);
So what i want is . to have a form that when i click submit, it gives me output like
http://www.mywebsite.com/testing?text='testing'&number=1234564
not the usual
http://www.mywebsite.com/testing/key:value
it's for Kannel , and it only works with GET forms.
Update
Now Kannel works in GET post as i mentioned. but as Tyler said. it should work behind the scene so that no one just use the SMS feature and send whatever they want.
here is how it works, assuming the username is tester and password is foobar ( it's in the smskannel.conf file ) , these two lines send the sms when kannel is configured and running in the background ( Locally )
$url = "http://localhost:13013/cgi-bin/sendsms?username=tester&password=foobar&to=0127715667&text='This is the Message'";
$urloutput=file_get_contents($url);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您确定要允许您网站上的任何表单直接通过 Kannel 吗?
我建议将表单作为 POST 提交到您的应用程序,在操作中构建 URL,然后使用 Kannel 执行您想要执行的操作。 (我对Kannel不是很熟悉)
Are you sure you want to allow any form on your site directly pass through Kannel?
I would suggest submitting the form to your application as a POST, constructing the URL in the action, and then doing whatever it is you want to do with Kannel. (I'm not very familiar with Kannel)
你尝试过这个吗?
要转到另一个网站:
echo $form->create(Null, array('type' => 'get', 'url' => 'http://www.google.com/search'));
Did you try this?
To go to another website:
echo $form->create(Null, array('type' => 'get', 'url' => 'http://www.google.com/search'));