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 3681096
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:39:13+00:00 2026-05-19T03:39:13+00:00

A total newbie question…. I am developing a Joomla template and in this I

  • 0

A total newbie question….

I am developing a Joomla template and in this I want to make provision to load the assets (Images, JavaScript and CSS) from a remote location or locally.

I am using the following code for the same:

<?php

class MyclassName {

function CDNPath(){
return $this->getParam("cdn-path","templates/myTemplate/cdn");
}

}
?>

Now in this I want to call the value for $cdn_path via user-input. I am able to get the path but it is removing the '/' marks. Please see the example below:

The correct path to CDN is http://mydomain.com/cdn

It is suppose to read as:

<link rel="stylesheet" href="/joomla/http://mydomain.com/cdn/css/template.css" type="text/css" media="screen" />

whereas it is reading as:

<link rel="stylesheet" href="/joomla/http:mydomain.comcdn/css/template.css" type="text/css" media="screen" />

The breakup for this joomla is the root directory of joomla and http://mydomain.com/cdn/ is the user input

Two challenges:

  1. it is removing all the '/' characters from the user-input.

  2. It is adding the Joomla Root 'joomla' to the begining of the path.

Am I coding wrong? If yes then what is the correct syntax.

Please feel free to suggest any new approach if you feel will be better than this.

Kindly help.

  • 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-19T03:39:14+00:00Added an answer on May 19, 2026 at 3:39 am

    If you are getting the input via post (im not sure how you are taking input from user. )
    so you can try something like this to add slashes :

    <?php
    //create array to temporarily grab variables
    $input_arr = array();
    //grabs the $_POST variables and adds slashes
    foreach ($_POST as $key => $input_arr) {
    $_POST[$key] = addslashes($input_arr);
    }
    ?> 
    

    if its array..

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

Sidebar

Related Questions

Total newbie question, but I cant figure out what im doing wrong. I want
I know this is a total newbie question, but the answer may not be
I'm a total newbie and want to start with php. I know some javascript
This is a total newbie question, but I wonder if someone could assist with
I'm a total newbie to programming in cocoa for the mac so this question
I know this is a total newbie question, but I happen to be a
Total newbie question but this is driving me mad! I'm trying this: myInt =
this is going to be a total newbie question but I can't really do
This is a total newbie question, so thanks in advance. I'm trying to get
Warning. This is a total newbie question for Groovy.. I'm from a Java background

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.