Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7534861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:08:25+00:00 2026-05-30T06:08:25+00:00

I am performing a simple AJAX() request using Jquery (Google hosted 1.7.1 jquery.min.js code)

  • 0

I am performing a simple AJAX() request using Jquery (Google hosted 1.7.1 jquery.min.js code)

The code is pretty simple:

            $.ajax({
            type: "POST",
            url: "../inc/ajax_msgread_sendPM.php",
            data: "fromuserid=<?php echo $fromuserid; ?>&pmSubject=<?php echo urlencode($pmSubject); ?>&pmBody=" + pmReply,
            success: function(data){
            $("#showSuccess").show("fast");             
            $("#resultResponse").html(data);
            }
        }); 

The mod_rewrite .htaccess for this document is:

RewriteRule ^messages/read/([^/]+)/([^/]+)/?$ /msgread.php?usernam=$1&keynode=$2 [QSA,L]

When I view the $resultResponse for some reason the Ajax keeps wanting to turn $1 into ‘inc’ so any unrelated (or related) mySQL queries using $_GET["usernam"] from the URL ends up returning ‘inc’

Why is this happening? There is no relation between my script and the mod_rewrite. There are no variables named “usernam” or “1” on the script (or anywhere on the site).

Firebug gives no help.

Advice please?

UPDATE:

I see where the problem is coming from.. in the ajax jquery code:

url: “../inc/ajax_msgread_sendPM.php”,

the “inc” keeps getting set as the username because of its location based on the mod_rewrite rules… I need to somehow exclude this from mod_rewrite… just not sure how to solve this problem

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T06:08:26+00:00Added an answer on May 30, 2026 at 6:08 am

    As long as current url for your page is

    www.domain.com/messages/read/username/NQ
    

    and you use relative path – it is being rewritten to

    www.domain.com/messages/read/username/inc/ajax_msgread_sendPM.php
    

    which is definitely not what you want. The simplest solution would be to change the ajax endpoint url to:

    url: "/inc/ajax_msgread_sendPM.php",
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, this is following on from my previous question reguarding performing a simple ajax
I'm having a problem when using the jquery .each() and .ajax() functions together. I'm
I have a very simple scenario where I want to POST the form using
I am building an ajax form using the MVC Ajax Helpers: http://msdn.microsoft.com/en-us/library/dd505013.aspx The code
Possible Duplicate: Performing simple arithmetic in MySQL statement or in PHP code Im wondering
When performing many inserts into a database I would usually have code like this:
before i start of with anything i know that jQuery and Ajax are the
Simple experiment has shown that JDK7 compiled HashMap<Integer, Integer> uses many threads when performing
I'm dealing with physical entities, such as time, speed and distance, and performing simple
Ok, so I need to open a dialog (jQuery UI) before performing the actual

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.