Jump to content

[SOLVED] Mod Rewrite Messing Up My Ajax Link


limitphp

Recommended Posts

I'm using the ajax function that was in the tutorial on this site.

 

When I click on the ajax link from a pagination page that has been mod rewritten, like:

http://localhost/page2/

http://localhost/page3/

etc...

it messes up my ajax link.

I think this is the line in the ajax function particularly that needs to be modified:

MyHttpRequest.open("get", url_encode(file + query_string), true);

 

file in this case is the php page...like vote.php

only it thinks its

http://localhost/page2/vote.php

 

is there a way to modify this to make javascript get it right?

like this:

http://localhost/vote.php

 

thanks

 

on edit:

here is where I put the link in my index page:

<A HREF="javascript: MyAjaxRequest('voteCount<?php echo $greckle_vote_count?>','voteMessage<?php echo $greckle_vote_count?>','vote.php?songID=<?php echo $recordVote[songID]."&artistID=".$recordVote[artistID]?>')" CLASS="greckle-vote">vote</A>

 

maybe I could change the bolded part and pass the entire domain address....?

 

Add / to the front?

 

'/vote.php?.......

 

Unfortunately that didn't work.

 

I tried putting in the whole siteurl: http://localhost/vote.php

but that gave me a "Forbidden You don't have permission to access /http://localhost/vote.php on this server." error.

 

So, basically, right now, MyHttpRequest.open is probably trying to send the url request to localhost/page2/vote.php

 

maybe I'm overlooking something here....

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.