Jump to content

RewriteRule blocks form post ($_POST)


bander

Recommended Posts

Expert?

Have problems populating $_POST when RewriteRule is invoked by URL's param. When no param is given in URL, you can post the form and see the vars that are posted with print_r($_POST). If param is send in URL $_POST is empty, very strange!

See the action? Take a look at he following URLs:

http://test.inmo-exclusive.com/    //OK!
http://test.inmo-exclusive.com/eng  //NOT OK!

Here is the code:

.HTACCESS-----
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^([a-z]{3})$ /?lang=$1 [L]
RewriteRule ^([a-z]{3})/$ /?lang=$1 [L]


INDEX.PHP-----
<?php
echo "Your post:";
print_r($_POST);
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form action="" method="post">
    <input name="name" type="text">
    <input name="submit" type="submit" id="submit" value="Submit">
</form>
</body>
</html>

Any help would be appreciated!!
Link to comment
https://forums.phpfreaks.com/topic/34622-rewriterule-blocks-form-post-_post/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.