example url:
Target is not to show .php extension, but content stop working when page/url is open with a slash at the end.
http://ift.tt/1F9Oyt6 - form is working with this url
http://ift.tt/1EnOLSI - form is not working with this url
Folder & files:
|
| /js/custom.js
| /manager/create.php
| /manager/creategetpostdata.php
| /manager/.htaccess
Content on custom.js
$(window).load(function() {
// get post code data
$('.contentfinder').on('keyup', function(e){
var xyz = $(this).closest('.contentRow');
//alert( "success" );
$.post("../manager/creategetpostdata.php", xyz.find('.contentfinder').serialize(), function(response) {
//alert( "success" );
xyz.children('.showPostData').html(response);
xyz.children('.showPostData').show();
});
});
});
input form on create.php file:
<div class="contentRow">
<input type="text" name="inputdata" class="form-control contentfinder" placeholder="" />
<div class="showPostData"></div>
</div>
content on creategetpostdata.php
<?php echo 'hello, what the hell wrong with you. just show content now!'; ?>
content on .htaccess file
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteCond %{THE_REQUEST} \s/+(.+?)\.php\?([^=]+)=([^\s&]+) [NC]
RewriteRule ^ /%1/%2/%3? [R=302,L,NE]
RewriteCond %{THE_REQUEST} \s/+(.+?)\.php\s [NC]
RewriteRule ^ /%1 [R=302,L,NE]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [L]
any help? thanks in advance.
Aucun commentaire:
Enregistrer un commentaire