+ Reply to Thread
Results 1 to 2 of 2

Thread: Display a certain php code based on url...

  1. #1

    Display a certain php code based on url...

    Hello,

    Let's say I want to display something (anything) just so I understand how to do it just on the location pages...Let me give an example: I go to this url on my local server:
    Code:
    Only registered members can view the code.
    and I want to put a message just for the united states like US Classifieds section, how can I do that for any location, including states and cities?

    Here's the closest I was able to find:

    PHP Code:
    Only registered members can view the code
    Not sure if this will work though. Figures, it will not be changing based on the flynax location (ex: url) but the servers location using that method. I need to display something based on the url: So for example:

    united-states - Display Welcome to US Classifieds
    canada - Display Welcome to Canada Classifieds
    puerto-rico - Display Welcome to Puerto-Rico Classifieds

    OR

    flordia - Display Welcome to the Florida Classifieds
    ontario - Display Welcome to the Ontario Classifieds
    san juan - Display Welcome to the San Juan Classifieds

    OR

    tampa - Display Welcome to the Tampa Classifieds
    toronto - Display Welcome to the Toronto Classifieds
    san juan - Display Welcome to the San Juan Classifieds


    Brian
    Last edited by Brian Jester; May 6, 2018 at 08:54 PM.

  2. #2
    Hello Brian,

    Yes, you can use this code but it is hard-code
    And it is normal when you want to use it for a few locations but for 100 or more locations it will not be a good method.
    And instead of 'echo "your text";' I suggest you assign text to smarty and use in smarty where you need. And if you have some languages I suggest you use text through lang variable.
    Viktor,
    Flynax technical department,
    Best wishes.

+ Reply to Thread