Question: ```
#include<stdio.h>
#define SIZE 3
int main() 
{
char *arr[5];
for(i = 0; i < 5; i++) {
arr[i] = (char *)malloc(SIZE * sizeof(char));
scanf("%s",arr[i]);
}
for(i = 0; i < 5; i++) {
printf("%s",arr[i]);
}
return 0;
}

```

In the above code i am scanning more than 3(SIZE) characters but it is working fine.what is the issue?

Answer: 
Remove `single quotes` from your above statement. 

```
    <script>window.location.href="<?php echo base_url(); ?>/index.php/user/view_cart/viewCart";</script>

```

In Condigniter, you can redirect a page using UrlHelper class.

```
    class MyController extends CI_Controller
    {
        public function index()
        {

        }

        public function aFunc()
        {
            $this->load->helper('url');
            redirect('/anotherController/action/', 'refresh');
        }

```
JS file cannot process PHP. Instead you can try this changing JS to PHP file and try this:

Rename your js file from:

```
<script src="yourExternalJsFile.js"></script>

```

To:

```
<script src="yourExternalJsFile.php"></script>

```

And in your php file include your script like this like this:

```
<?php header("Content-type: application/x-javascript");?>
    window.location.href="'<?php echo base_url() ?>'/index.php/user/view_cart/viewCart";

```