Jump to content

NorKayak

New Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by NorKayak

  1. Thanks guys for all the good infos. 👍😊 Gonna have a look into all that and see what I can come up with.
  2. I know a little about session and cookie but how can I use that to know if a user is actually online and interact with him?
  3. I have a general question. Just need to be put on the right direction. I made that little game I put on a server. Now I wish that 2 persons could play against each other online. So I made a signup/login and I can list all the users against which you would like to play. Now how could I know who is actually online and send him/her an alert when it is his/her turn to play? My first idea was to send emails every time it's a player turn to make a move; but there must be something more elegant to do in-game? I'm having a lot of fun coding that thing and any help would be great 🙂
  4. Yes: <?php ob_start(); session_start(); ?>
  5. Thanks I didn't think about that... I checked and the codes reads: var tempoVar = null; It seems then that the $_SESSION variable is not recognized in the function. Could that have something to do with declaring the variable global? So I tried this: <?php $theName = global $_SESSION['$Sess_Name']; ?> But the browser doesn't accept it...
  6. Ok, I tried. Still not working. The diference is before I had the output "NULL" and now nothing...
  7. Hi; I'm a beginner and I'm getting a big headache figuring how to convert php variables into Javascript variables. I want to use the content of $theName as the value for an input tag. $_SESSION['$Sess_Name'] is loaded with the right data, I verified it. But my function InitField returns always the word NULL. Why is that? Where is the problem? Thank Here is my code: function InitField() { <?php $theName = $_SESSION['$Sess_Name']; ?> var tempoVar = "<?php echo json_encode($theName); ?>"; var myInput = document.getElementById('theSurname'); myInput.value = tempoVar; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.