Web Design Forum: mod_rewrite and line breaks in variables - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

mod_rewrite and line breaks in variables Rate Topic: -----

#1 User is offline   antom 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 65
  • Joined: 23-October 07
  • Reputation: 0
  • Gender:Male
  • Location:Leeds, UK
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 19 September 2008 - 10:24 AM

Hey,

I have set up a RewriteRule for an AJAX call that I'm doing in one of my current projects - one of the calls I do is to post the content of a textarea to my URL, providing the action to execute and and variables required by that action.

eg.

RewriteRule ^page_name/ajax/([^.(!/)]+)/([^.(!/)]+)/?$ index.php?ajax_action=$1&ajax_vars=$2

I am encoding my variables using Javascript's escape() function before passing things to the AJAX post. However, the above regex will not work for any content containing a line break (encoding %0A), and produces a bad URL request. I'm having trouble finding a suitable regex for this, so wondered if anyone here has found something that will help?

Thanks in advance!
0

#2 User is offline   mikejonesey 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 355
  • Joined: 30-June 08
  • Reputation: 0
  • Location:Brighton, UK
  • Experience:Web Guru
  • Area of Expertise:Designer/Coder

Posted 06 October 2008 - 10:50 AM

Same problem resolved here
0

#3 User is offline   antom 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 65
  • Joined: 23-October 07
  • Reputation: 0
  • Gender:Male
  • Location:Leeds, UK
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 06 October 2008 - 11:22 AM

View Postmikejonesey, on Oct 6 2008, 11:50, said:



Thanks for the link :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users