Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Tom
@moT01
@OrangeKulture the brownies seemed intermittent - they were still given out - but camperbot was being stingy
Nate Mallison
@NJM8
@lestairon I would set a variable to either "f" or "c" and then have the button click check the status of that variable. If 'f' convert temp to c and update html, if 'c' convert to f and update html.
supercalifragilisticthisbesuchacodekid
@ICodedGod
Hey lads
I'm in quite a desperate need of a whizkid
Tom
@moT01
whats the problem
Tiago Correia
@tiagocorreiaalmeida
we all here :D just ask
Tom
@moT01
that's not me - but i might be able to help
Casper Beyer
@caspervonb
Ask instead of asking to ask ;)
Kaz Baig
@kbaig
^^^^^^^^^^^^^^^^^^^^^^^^^
Casper Beyer
@caspervonb
Everyone's always multitasking, it's like that one team member on slack going "hey u there?", "hey u there?" all day :P
supercalifragilisticthisbesuchacodekid
@ICodedGod
haha
Kaz Baig
@kbaig
Being here is a 'keep web skills sharp in case you need it' activity at work. I could tell you I'm here and then go afk right before you ask the question
supercalifragilisticthisbesuchacodekid
@ICodedGod
I'll get to my problem in a second, it's giving me eternal pain in the face
I have a script that isn't working
at all
Casper Beyer
@caspervonb
Did you try turning it on and off again?
supercalifragilisticthisbesuchacodekid
@ICodedGod
Yes, I even checked if it's plugged in...
Power on and everything
Here is what it's supposed to do:
When a user on the website selects a language, the property listings on that site should be displayed in the currency attached to that.
In stead, it does fuck all
Casper Beyer
@caspervonb
My mindreader 3000 seems to hit a firewall or something, source ;)
supercalifragilisticthisbesuchacodekid
@ICodedGod

if(isset($_POST['get_option'])){
$_SESSION["price"] = $_POST['get_option'];
$to_Curr =$_POST['get_option'];
}elseif(isset($_POST['select_lang'])){
$select_lang = $_POST['select_lang'];
switch ($select_lang) {
case 'Norsk':
/'Norsk bokmål' || /
$to_Curr = 'NOK';
$_SESSION["current_lang"] = 'nb';
break;
case 'Español':
$to_Curr = 'EUR';
$_SESSION["current_lang"] = 'es';
break;
case 'Svenska':
$to_Curr = 'SEK';
$_SESSION["current_lang"] = 'sv';
break;
case 'English':
$to_Curr = 'GBP';
$_SESSION["current_lang"] = 'en';
break;

default:
$to_Curr = 'NOK';
$_SESSION["current_lang"] = '';
break;
}
//echo $to_Curr;
$_SESSION["price"] = $to_Curr;
//print_r($_SESSION);
}

Kaz Baig
@kbaig
uhhh thats hard to read
Casper Beyer
@caspervonb
triple ticks for code blocks, markdown style
supercalifragilisticthisbesuchacodekid
@ICodedGod
and now, as you are about to give the answer, I will see the problem
yea it's AJAX
Kaz Baig
@kbaig
You mean PHP?
Tom
@moT01
you need to go edit that so people can read it -- three ticks (`) then new line (shift+enter) then code then new line and then three ticks again
Kaz Baig
@kbaig
Well if that's PHP, should prob try the back end room
Unless someone happens to know it here
supercalifragilisticthisbesuchacodekid
@ICodedGod
if(isset($_POST['get_option'])){
$_SESSION["price"] = $_POST['get_option'];
$to_Curr =$_POST['get_option'];
}elseif(isset($_POST['select_lang'])){
$select_lang = $_POST['select_lang'];
switch ($select_lang) {
case 'Norsk':
/*'Norsk bokmål' || */
$to_Curr = 'NOK'; 
$_SESSION["current_lang"] = 'nb';
break;
case 'Español':
$to_Curr = 'EUR'; 
$_SESSION["current_lang"] = 'es';
break;
case 'Svenska':
$to_Curr = 'SEK'; 
$_SESSION["current_lang"] = 'sv';
break;
case 'English':
$to_Curr = 'GBP'; 
$_SESSION["current_lang"] = 'en';
break;

default:
$to_Curr = 'NOK';
$_SESSION["current_lang"] = '';
break;
}
//echo $to_Curr;
$_SESSION["price"] = $to_Curr;
//print_r($_SESSION);
}
sorry
Messed up there
haha
Bjorn van de Peut
@bjorno43
'''
CamperBot
@camperbot
:bulb: to format code use backticks! ``` more info
Bjorn van de Peut
@bjorno43
So what's the question?
supercalifragilisticthisbesuchacodekid
@ICodedGod
Well
Here is what it's supposed to do:
When a user on the website selects a language, the property listings on that site should be displayed in the currency attached to that.
Why doesn't it? :/
Casper Beyer
@caspervonb
  1. You aren't sending anything back
supercalifragilisticthisbesuchacodekid
@ICodedGod
Oh god.. there is more that 1
Casper Beyer
@caspervonb
From what you've pasted anyway
Bjorn van de Peut
@bjorno43
I have no idea. That code alone isn't enough to be able to answer that question. You're setting up some session variables. But you need to keep in mind that sessions can only be set before headers are sent to the browser. After that, you can change the sessions variables with an Ajax script all you want, but it won't actually update the headers
supercalifragilisticthisbesuchacodekid
@ICodedGod
@bjorno43 You make a solid point
supercalifragilisticthisbesuchacodekid
@ICodedGod
Ah! thou handsome individuals. I have the solution :smile:
Thanks for the efforts
Bjorn van de Peut
@bjorno43
@ICodedGod I would also advise you to use empty() instead of isset(). Simply because isset only verifies if a variable exists. It doesn't care if the value is empty or null. Empty will verify if a variable exists and if there's data in it
Of course you'll have to use if(!empty() (if NOT empty). Otherwise it'll return false while it should return true, ghehe
supercalifragilisticthisbesuchacodekid
@ICodedGod
Oh that's a good one