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....?

 

Link to comment
Share on other sites

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....

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.