doujizhong8352 2013-08-09 21:18
浏览 37

在Joomla 2.5中将“使用URL重写”设置为“是”后,自调用PHP表单不起作用

I have a self calling PHP form in a Joomla article. This article is then linked with a Menu item.

<form class="form-inline" name="test" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" onsubmit="return validateForm()" method="post" >

Before using "Use URL rewriting" the PHP form was working fine. i.e "Use URL rewriting" was set to NO.

After setting the "Use URL rewriting" to Yes the PHP self calling form doesnt submit. When the submit button is pressed, the browser throws the user to the homepage.

I want to use "Use URL rewriting"->Yes as it makes the website SEO friendly while also using the PHP self calling form. Is there a way to do both ?

Thank you in advance.

  • 写回答

1条回答 默认 最新

  • dpub33855 2015-01-21 22:23
    关注

    I was able to do this using $_SERVER['SCRIPT_URL'], but is possible that other $_SERVER array elements could do the trick too, such as $_SERVER['REQUEST_URI'], $_SERVER['REDIRECT_URL'] and $_SERVER['REDIRECT_SCRIPT_URL'].

    If not help, add this to your code

    var_dump($_SERVER);

    to show all the array elements and looking for the right ones.

    评论

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题