开发者

How can I rewrite URL in my case

I have read related Q&A's for this is question, but still I am confused on this, can somebody help me on this?

What I am doing: my url is : www.mysite.com/home.php I have two files: home.php and get_data.php, in home.php i am calling get_data.php with the use of jquery. the code for jquery is:

$(document).ready(function(){
                   $("#btn_submit").bind('click', function(){
                   $.get('/get_data.php?tnm='+$('#tnm').val(), '', function(data){
                $('#get_info').htm开发者_开发百科l(data);
        });
    }); });

Here #tnm is name of the textbox & #get_info is the id of div tag. I am accessing $_GET['tnm'] in get_data.php. What I want is: When I search username with : www.mysite.com/username, I should get that user's result accordingly. How can I rewrite the url for this? Please help! Please feel free for any details.


I am wondering why you are trying to use .HTACCESS for Ajax calls, any way http://httpd.apache.org/docs/2.0/misc/rewriteguide.html is the best place :)


Please try this plugin it can be useful. jquery.address

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜