HTML and Java Q, Different content for different countries??

 

Results 1 to 28 of 28
Just a quick question. I am trying to use html codes under the <head> tag ...
  1. #1
    elecsho is offline Power Member
    Join Date
    Apr 2012
    Posts
    516
    Thanks
    430
    Thanked 110 Times in 72 Posts

    Exclamation HTML and Java Q, Different content for different countries??

    Just a quick question. I am trying to use html codes under the <head> tag that would be different according to each country. I will be using this java script plugin take a look:
    Code:
    http://www.geoplugin.com/examples
    .

    If you know how please show an example here. So what I am trying to do for example is: If a visitor is from the US show html code #1. Otherwise show html code #2.

    Help is very appreciated!




  2. #2
    elecsho is offline Power Member
    Join Date
    Apr 2012
    Posts
    516
    Thanks
    430
    Thanked 110 Times in 72 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    come on someone please help

  3. #3
    hao's Avatar
    hao
    hao is offline Regular Member
    Join Date
    Oct 2011
    Location
    = open('philippines.txt')
    Posts
    334
    Thanks
    272
    Thanked 160 Times in 100 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    Check this thread, there's a geo redirect script there.

    http://www.blackhatworld.com/blackha...formation.html

  4. #4
    Crapper's Avatar
    Crapper is offline Junior Member
    Join Date
    Sep 2011
    Posts
    121
    Thanks
    22
    Thanked 14 Times in 14 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    You can just use the sample code provided in the url you gave. I have replaced some stuff so it looks like this. I've not tested it but I think this should work.


    PHP Code:
    <?php 

    $geoPlugin_array 
    unserializefile_get_contents('http://www.geoplugin.net/php.gp?ip=' $_SERVER['REMOTE_ADDR']) ); 

    if ( 
    $geoPlugin_array['geoplugin_countryName'] == 'US' 
    {  
    // do your stuff for US}

    else{    // do stuff for other country's} 

    ?>
    Last edited by Crapper; 01-24-2013 at 10:10 AM.

  5. The Following User Says Thank You to Crapper For This Useful Post:

    elecsho (01-24-2013)

  6. #5
    elecsho is offline Power Member
    Join Date
    Apr 2012
    Posts
    516
    Thanks
    430
    Thanked 110 Times in 72 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    Quote Originally Posted by Crapper View Post
    You can just use the sample code provided in the url you gave. I have replaced some stuff so it looks like this. I've not tested it but I think this should work.


    <?php$geoPlugin_array = unserialize( file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $_SERVER['REMOTE_ADDR']) ); if ( $geoPlugin_array['geoplugin_countryName'] == 'US' ) { //let's use a different base currency
    // do your stuff for US}else{// do stuff for other country's}?>
    Thank you for this. But I suck at coding how can I use html code in the "Do your stuff for US here"

  7. #6
    Crapper's Avatar
    Crapper is offline Junior Member
    Join Date
    Sep 2011
    Posts
    121
    Thanks
    22
    Thanked 14 Times in 14 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    There are many ways to go. But you have to explain wat you want to do. Give a example of the US part you want to show and the Other Country part. And what is your source ? Are you getting the text from a database or is it all just plain html ?

  8. #7
    elecsho is offline Power Member
    Join Date
    Apr 2012
    Posts
    516
    Thanks
    430
    Thanked 110 Times in 72 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    Quote Originally Posted by Crapper View Post
    There are many ways to go. But you have to explain wat you want to do. Give a example of the US part you want to show and the Other Country part. And what is your source ? Are you getting the text from a database or is it all just plain html ?
    Okay this is exactly what I am trying to do. I am using content locker pro. I want to show different lockers according to the country. So if visitor is from the us, Use html code #1 which is for locker #1. Otherwise use html code #2 which for content locker #2.

  9. #8
    Crapper's Avatar
    Crapper is offline Junior Member
    Join Date
    Sep 2011
    Posts
    121
    Thanks
    22
    Thanked 14 Times in 14 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    If I'm not mistaken, content locker pro has that build in. I think you can set it in the admin panel.
    I'm not sure because I don't have content locker pro. Maybe someone who owns content locker pro can tell you or maybe they have a support forum.

    Otherwise maybe this would help (not the most elegant solution but it should work):


    PHP Code:
    <?php 
    $geoPlugin_array 
    unserializefile_get_contents('http://www.geoplugin.net/php.gp?ip=' $_SERVER['REMOTE_ADDR']) ); 
    if ( 
    $geoPlugin_array['geoplugin_countryName'] == 'US' ) {?>
    //paste the code (html) from your content locker for US below this text and before <?}else{?>

    <?}else{?>
    //paste the code (html) from your content locker for Other Country's below this text and before <?}?>

    <?}?>
    Let me know if that's working

  10. The Following User Says Thank You to Crapper For This Useful Post:

    elecsho (01-24-2013)

  11. #9
    elecsho is offline Power Member
    Join Date
    Apr 2012
    Posts
    516
    Thanks
    430
    Thanked 110 Times in 72 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    Quote Originally Posted by Crapper View Post
    If I'm not mistaken, content locker pro has that build in. I think you can set it in the admin panel.
    I'm not sure because I don't have content locker pro. Maybe someone who owns content locker pro can tell you or maybe they have a support forum.

    Otherwise maybe this would help (not the most elegant solution but it should work):


    PHP Code:
    <?php 
    $geoPlugin_array 
    unserializefile_get_contents('http://www.geoplugin.net/php.gp?ip=' $_SERVER['REMOTE_ADDR']) ); 
    if ( 
    $geoPlugin_array['geoplugin_countryName'] == 'US' ) {?>
    //paste the code (html) from your content locker for US below this text and before <?}else{?>

    <?}else{?>
    //paste the code (html) from your content locker for Other Country's below this text and before <?}?>

    <?}?>
    Let me know if that's working
    I dont know if it is working. How can I use this code on a free blog. Lets say I host this script on my own domain and want to use it on blogger.

  12. #10
    elecsho is offline Power Member
    Join Date
    Apr 2012
    Posts
    516
    Thanks
    430
    Thanked 110 Times in 72 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    oh and I did not find this option in clp. Geo-targeting is only for the offers not for the whole lockers

  13. #11
    Crapper's Avatar
    Crapper is offline Junior Member
    Join Date
    Sep 2011
    Posts
    121
    Thanks
    22
    Thanked 14 Times in 14 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    Well I think, for safety reasons, you cannot use php code in blogger. I think what you want is not possible with php. Maybe with javascript. But than you have to write a custom script for this. I'm not very good at javascript, so I cannot really help you with that.

    php code is a server based language which means that the code is processed on the server. After that it can output it's results to the user (browser)

    However, you can use this code on any free hosting site that allows you to add your own files.
    For example www.000webhost.com

    p.s. I have never used this hosting service

  14. #12
    Crapper's Avatar
    Crapper is offline Junior Member
    Join Date
    Sep 2011
    Posts
    121
    Thanks
    22
    Thanked 14 Times in 14 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    Yes, you right.
    That makes sense
    Quote Originally Posted by elecsho View Post
    oh and I did not find this option in clp. Geo-targeting is only for the offers not for the whole lockers

  15. #13
    elecsho is offline Power Member
    Join Date
    Apr 2012
    Posts
    516
    Thanks
    430
    Thanked 110 Times in 72 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    Quote Originally Posted by Crapper View Post
    Well I think, for safety reasons, you cannot use php code in blogger. I think what you want is not possible with php. Maybe with javascript. But than you have to write a custom script for this. I'm not very good at javascript, so I cannot really help you with that.

    php code is a server based language which means that the code is processed on the server. After that it can output it's results to the user (browser)

    However, you can use this code on any free hosting site that allows you to add your own files.
    For example www.000webhost.com

    p.s. I have never used this hosting service
    I know blogger was just an example. I mentioned that I will host the script on my own server or I will use weebly to upload the php file. But what is the html code to load this script when using something like weebly or 000webhost

  16. #14
    Crapper's Avatar
    Crapper is offline Junior Member
    Join Date
    Sep 2011
    Posts
    121
    Thanks
    22
    Thanked 14 Times in 14 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    I think it's kinda hard to do this. This is because of safety issues. You have to upload the files from content locker pro to each website you want to use it on. I'm sorry but that's the only thing I can think of. Maybe someone else has a other idea about this ?

  17. #15
    elecsho is offline Power Member
    Join Date
    Apr 2012
    Posts
    516
    Thanks
    430
    Thanked 110 Times in 72 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    Quote Originally Posted by Crapper View Post
    I think it's kinda hard to do this. This is because of safety issues. You have to upload the files from content locker pro to each website you want to use it on. I'm sorry but that's the only thing I can think of. Maybe someone else has a other idea about this ?
    No no you dont understand. All I am asking is how to use the script you gave me on a free hosting like weebly.

  18. #16
    Crapper's Avatar
    Crapper is offline Junior Member
    Join Date
    Sep 2011
    Posts
    121
    Thanks
    22
    Thanked 14 Times in 14 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    Well if you can use php on weebly than you could just paste the code between the body tags <body> </body> on a certain page.

    By the way, do you know anything about html ?
    Because if you don't this may be all to overwhelming and you better follow a basic html course online or if you don't have the time, pay someone to do this for you.

  19. The Following User Says Thank You to Crapper For This Useful Post:

    elecsho (01-24-2013)

  20. #17
    elecsho is offline Power Member
    Join Date
    Apr 2012
    Posts
    516
    Thanks
    430
    Thanked 110 Times in 72 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    Quote Originally Posted by Crapper View Post
    However, you can use this code on any free hosting site that allows you to add your own files.
    How can I use the code by uploading it. Because I can't put php code directly in weebly.

  21. #18
    Crapper's Avatar
    Crapper is offline Junior Member
    Join Date
    Sep 2011
    Posts
    121
    Thanks
    22
    Thanked 14 Times in 14 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    Than you need to have access to the server via ftp. But I don't think you can do that on weebly.
    Try 000webhost
    After signing up you have access to ftp. In the control panel you can see your ftp credentials

  22. #19
    elecsho is offline Power Member
    Join Date
    Apr 2012
    Posts
    516
    Thanks
    430
    Thanked 110 Times in 72 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    Quote Originally Posted by Crapper View Post
    Than you need to have access to the server via ftp. But I don't think you can do that on weebly.
    Try 000webhost
    After signing up you have access to ftp. In the control panel you can see your ftp credentials
    okay but what will be the html code.

  23. #20
    Crapper's Avatar
    Crapper is offline Junior Member
    Join Date
    Sep 2011
    Posts
    121
    Thanks
    22
    Thanked 14 Times in 14 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    Well I cannot tell you that because I don't have content locker pro. So I don't know what content locker outputs, if you know what I mean

  24. #21
    elecsho is offline Power Member
    Join Date
    Apr 2012
    Posts
    516
    Thanks
    430
    Thanked 110 Times in 72 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    Quote Originally Posted by Crapper View Post
    Well I cannot tell you that because I don't have content locker pro. So I don't know what content locker outputs, if you know what I mean
    No I meant the html code to load the script if I already had uploaded it to the website?
    Last edited by elecsho; 01-24-2013 at 12:03 PM.

  25. #22
    Crapper's Avatar
    Crapper is offline Junior Member
    Join Date
    Sep 2011
    Posts
    121
    Thanks
    22
    Thanked 14 Times in 14 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    I don't know what script you mean exactly. You should paste the last php code I gave into the page you want. Then add the html code of content locker pro where I told you. (look at the code)

  26. #23
    elecsho is offline Power Member
    Join Date
    Apr 2012
    Posts
    516
    Thanks
    430
    Thanked 110 Times in 72 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    Quote Originally Posted by Crapper View Post
    I don't know what script you mean exactly. You should paste the last php code I gave into the page you want. Then add the html code of content locker pro where I told you. (look at the code)
    There is no direct way to paste the code in weebly. But if I save the code as php and upload it is there a way to use it?

  27. #24
    Crapper's Avatar
    Crapper is offline Junior Member
    Join Date
    Sep 2011
    Posts
    121
    Thanks
    22
    Thanked 14 Times in 14 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    I'm confused now on what your doing. I thought you were looking at 000webhost ?
    Maybe you can pm me some code of content locker pro, because otherwise I think this is not going to work....

  28. #25
    elecsho is offline Power Member
    Join Date
    Apr 2012
    Posts
    516
    Thanks
    430
    Thanked 110 Times in 72 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    Quote Originally Posted by Crapper View Post
    I'm confused now on what your doing. I thought you were looking at 000webhost ?
    Maybe you can pm me some code of content locker pro, because otherwise I think this is not going to work....
    Ah man.. we were almost there. Guess I need to find a way to do this in javascript. No need to show you clp code as it is a basic html code. Because all I was trying to do is use an html code to load the script because weebly only allows me to add html code and pasting the php script would not work but java is allowed in weebly.

    So I was thinking I could use an html code that would do the following:
    Use php script from URL:"blahblahblah.com/yourscript.php"

    Because right now I made a landing page and all so I cant move 000webhost

  29. #26
    Crapper's Avatar
    Crapper is offline Junior Member
    Join Date
    Sep 2011
    Posts
    121
    Thanks
    22
    Thanked 14 Times in 14 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    Mmmmm.....
    To refer to a script on a other document, you need php code. There is no code in html that will allow you to include a other page. I'm not sure if javascript can do this. In php you would do it like this:

    <?
    include("mypagetoinclude.php");
    ?>

    By the way Javascript and Java are two very different coding lanuages

  30. The Following User Says Thank You to Crapper For This Useful Post:

    elecsho (01-24-2013)

  31. #27
    elecsho is offline Power Member
    Join Date
    Apr 2012
    Posts
    516
    Thanks
    430
    Thanked 110 Times in 72 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    Quote Originally Posted by Crapper View Post
    By the way Javascript and Java are two very different coding lanuages
    Yeah I guess there is no way to do it without javascript. And yes I meant javascript not java.

    Thanks for taking the time to help me anyways!

  32. #28
    Crapper's Avatar
    Crapper is offline Junior Member
    Join Date
    Sep 2011
    Posts
    121
    Thanks
    22
    Thanked 14 Times in 14 Posts

    Default Re: HTML and Java Q, Different content for different countries??

    No problem. I hope you can solve your problem....


Similar Threads

  1. Anyone Up? - Need Need HTML/Java Help Bad $$
    By thetvnun in forum Hire a Freelancer
    Replies: 0
    Last Post: 09-30-2011, 06:04 AM
  2. [WTH] need html/java guru or someone who can solve this!
    By thetvnun in forum Hire a Freelancer
    Replies: 0
    Last Post: 09-28-2011, 02:35 AM
  3. Help w/ basic HTML/CSS/PHP/Java?
    By SpellZ in forum BlackHat Lounge
    Replies: 2
    Last Post: 01-29-2010, 02:48 PM
  4. html/php/java gurus?
    By thesickest in forum Making Money
    Replies: 6
    Last Post: 09-12-2009, 06:32 PM

Tags for this Thread

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
  •  




BlackHatWorld on Twitter BlackHatWorld on FaceBook


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108