PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Nov 26, 2014 8:30 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Thu Aug 02, 2012 1:14 am 
Offline
Forum Contributor

Joined: Sat Mar 31, 2012 6:50 am
Posts: 112
hi,i have a problem with .htaccess and ajax :\..

my ajax:
Syntax: [ Download ] [ Hide ]
<script type="text/javascript">
function showUser(str)
{
if (str=="")
  {
  document.getElementById("txtHint").style.visibility='hidden';
  document.getElementById("txtHint").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
        document.getElementById("txtHint").style.visibility='visible';
    document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","rpc.php?q="+str,true);
xmlhttp.send();
}
</script>

...
and my htaccess:
Syntax: [ Download ] [ Hide ]
RewriteEngine On

RewriteRule ^page/(.*)$ page.php?num=$1

...
Can you help me please?
there are a conflict between the .htaccess and the ajax function!


Last edited by mekha on Thu Aug 02, 2012 1:48 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu Aug 02, 2012 1:48 am 
Offline
DevNet Master
User avatar

Joined: Sun Feb 15, 2009 12:08 pm
Posts: 2775
Location: .za
mekha wrote:
i have a problem with

could you perhaps elaborate on the problem that you are having? :)

_________________
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering


Top
 Profile  
 
PostPosted: Thu Aug 02, 2012 1:53 am 
Offline
Forum Contributor

Joined: Sat Mar 31, 2012 6:50 am
Posts: 112
hi man , i edited the thread :)


Top
 Profile  
 
PostPosted: Thu Aug 02, 2012 2:17 am 
Offline
DevNet Master
User avatar

Joined: Sun Feb 15, 2009 12:08 pm
Posts: 2775
Location: .za
thank you for the edit but i was actually hoping for a explanation of what happens ;) is it an issue with redirecting?

_________________
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering


Top
 Profile  
 
PostPosted: Thu Aug 02, 2012 2:28 am 
Offline
Forum Contributor

Joined: Sat Mar 31, 2012 6:50 am
Posts: 112
no,not redirecting...its an box open under the search input that gets from the database string LIKE the value i write in the input....now....in the regular pages:xxxx.php?id... its work great
but in the htaccess
xxxxxx.com/xxxxx/someword
the box that opened doesnt give me the string from the database...but GIVE ME THE HOME PAGE IN THAT DIV :|....i mean: i have a <div>HERE THE RESULTS</div>...in stead of show me the string from the database...i get the home page in that div :|....just in the htaccess


Top
 Profile  
 
PostPosted: Thu Aug 02, 2012 2:51 am 
Offline
DevNet Master
User avatar

Joined: Sun Feb 15, 2009 12:08 pm
Posts: 2775
Location: .za
if you comment out or remove the rule from the .htaccess file, what happens?

_________________
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering


Top
 Profile  
 
PostPosted: Thu Aug 02, 2012 2:54 am 
Offline
Forum Contributor

Joined: Sat Mar 31, 2012 6:50 am
Posts: 112
if i remove the rule from htaccess its work with no problems :\


Top
 Profile  
 
PostPosted: Thu Aug 02, 2012 3:29 am 
Offline
DevNet Master
User avatar

Joined: Sun Feb 15, 2009 12:08 pm
Posts: 2775
Location: .za
This isn't exactly like the problem you are having but it might shed some light on what's causing it. hth
http://stackoverflow.com/questions/5222677/htaccess-causes-problem-with-ajax

_________________
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering


Top
 Profile  
 
PostPosted: Thu Aug 02, 2012 3:53 am 
Offline
Forum Contributor

Joined: Sat Mar 31, 2012 6:50 am
Posts: 112
i tryed all of stackoverflow problems solutions..i didnt succeed... is there some one that can edit me the code above...please?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Google [Bot], PHPHelpNeeded, requinix and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group