SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2011
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Disallowed Key Characters

    I've been following the tutorial @ http://net.tutsplus.com/tutorials/ph...search_index=9
    unfortunately my url is being returned with disallowed characters,

    Error string: php_echo_site_url(\'site/post_ticket\');_?>Disallowed Key Characters.

    I understand that codeigniter has several XSS filters for security and most of the suggestions I've found for dealing with disallowed characters suggest hacks for turning this off completely or allowing additional characters... my gut feeling is that is not a "best practice". One post sugest it may be the greater than & less than symbols for php. Specifically I need suggestions for the line that sets the URL. Thanks & Happy New Years! (especiallly to those still working on code while every one else is out partying...)

    Code:
    function openNewTkt() {
    		var form_data = {
    		property_manager: $('#property_manager').val(),
    		property_ID: $('#property_ID').val(),
    		property_name: $('#property_name').val(),
    		date_posted: $('#date_posted').val(),
    		value: $('#spinner').val(),
    		ajax: '1'		
    	};
    			$.ajax({
    		url: "<?php echo site_url('site/post_ticket'); ?>",
    		type: 'POST',
    		data: form_data,
    		success: function(msg) {
    			$('#main_content').html(msg);
    			}
    		});
    	return	false;
    }

  2. #2
    SitePoint Zealot imouto's Avatar
    Join Date
    Sep 2004
    Location
    Gotham
    Posts
    184
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Not sure if this will fix your problem, but this CI forum thread mentions using JavaScript's escape function. See here:

    http://ellislab.com/forums/viewthread/132280/

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2011
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks... I read that page early today, but was just trying to get back to it. I think I've exhausted my daily supply of brain juice, I didn't even think of looking through my history till just now.

  4. #4
    SitePoint Enthusiast
    Join Date
    Mar 2011
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is my current attempt using encodeURIComponent to no avail...
    Now I'm getting 500 Internal server error. But the exact same post works in PHP,
    it's just when I use Jquery's ajax I'm having issues.


    Code:
    function openNewTkt() {
    		var uri='http://cutnedge.info/index.php/site/post_ticket';
    		encodeURIComponent(uri);
    		var form_data = {
    		property_manager: $('#property_manager').val(),
    		property_ID: $('#property_ID').val(),
    		property_name: $('#property_name').val(),
    		date_posted: $('#date_posted').val(),
    		value: $('#spinner').val(),
    		ajax: '1'		
    	};
    			$.ajax({
    		url: uri,
    		type: 'POST',
    		data: form_data,
    		success: function(msg) {
    			$('#main_content').html(msg);
    			}
    		});
    	return	false;
    }


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •