Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6631645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:34:31+00:00 2026-05-25T22:34:31+00:00

I want to deliver an URL using Post in HTML/PHP with codeIgniter. So I

  • 0

I want to deliver an URL using Post in HTML/PHP with codeIgniter. So I output my URL’s BASE64-Encoded in a hidden field because the URL is crawled from Googles response Page and nearly any character can be in the URL. As I’ll only use my website on a local server (it’s a SEO tool for my company), I want to enable any character in POST data. I already tried it with $config['permitted_uri_chars'] = '';, but that did not work. I got a ‘Disallowed Key Characters’ error because the Base64 string contains a =.

I’m using CodeIgniter 2

Edit:

Fivell’s answer was right, thanks. So, for interested people, I took the code from Fivell’s link above and wrote a small class for CodeIgniter. To do this, add a file named Base64 to your application/libraries folder and insert this code:

<?php

class Base64 {

    function url_encode($url) {
        $data = base64_encode($url);
        $data = str_replace(array('+','/','='),array('-','_',''),$data);
        return $data;
    }

    function url_decode($url) {
        $data = str_replace(array('-','_'),array('+','/'),$url);
        $mod4 = strlen($data) % 4;
        if ($mod4) {
            $data .= substr('====', $mod4);
        }
        return base64_decode($data);
    }

}

?>

then, you can use it in any controller by loading the library via $this->load->library('base64); and en- or decrypt the url via $this->base64->url_encode($url) or $this->base64->url_decode($url)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:34:32+00:00Added an answer on May 25, 2026 at 10:34 pm

    http://www.php.net/manual/ru/function.base64-encode.php#63543

    I think that the problem is standart base64 encoding/decoding in php which is not url safe

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to deliver music/mp3 using a flash player but I'd
I have made a java project and want to deliver it to a client
If the requirements are changing frequently and you want to deliver your code in
as google does not deliver what i want to know, i try to ask
want to know why String behaves like value type while using ==. String s1
I am running StyleCop (which btw I completely recommend if you want to deliver
I want that Apache and Pinax only deliver Attachments to authenticated users. I found
we want to develop a product and deliver it to several customers. Now we
I want to disable the html cache for 1 item so it is always
I am working on a Java project that I want to deliver to my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.