Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. They're there because there are cases when they are necessary. For example: var str = "He's called "Johnny"";var str = 'He's called "Johnny"';
  2. Where's the code that's making sure you're logged in? Something with session_start() in it.
  3. The meta tags would just need to be "keywords" and "description" I don't think there's a "title" meta tag. USe the <title></title> tags for a page title.
  4. There's the get_type() function
  5. name is based on the parameter given to the function, it is given a value when the function is called. document.cookie is a string composed of key=value pairs separated by semi-colons ; The function breaks the cookie string into pieces and gets the value from the one where the key is the same as the name that was passed to the function.
  6. I believe their main purpose was to be used for documents that are going to be printed. When I tested units on my screen I noticed that a centimeter in CSS is actually 9 millimeters on my screen.
  7. What code have you written? If there's a specific part you have a problem with when trying to write code then you can ask about it. Of course I could do this exercise, but it's your homework, not mine.
  8. One problem I see is that you've put 'this.value' between quotes, that means you're actually passing the string "this.value". But that's not the real problem. In order to figure out your problem you're going to have to print_r($_POST) to see what values it's getting.
  9. I believe he's looking for a different script than the Google analytics one. There's supposed to be a file "waypasscool.com/sonicscript.js" somewhere.
  10. The delay would be because the browser is sending a new HTTP request, there will always be a delay unless you have a really fast internet connection.
  11. Google may take a while before indexing your site, changes don't occur immediately. You should wait a few days or even a couple of weeks.
  12. URLs only use forward slashes, backslashes work on your local computer likely because it's running Windows. Links should look like any of the following: <a href="http://domain.com/path/file.html">Full URL</a><a href="/path/file.html">Path from domain root</a><a href="path/file.html">Path from current location</a><a href="file.html">Path from current location</a>
  13. You can't print any content before sending a header. No echo, no HTML. Headers have to be sent before any other content. There's no point in printing anything either, because once you redirect the page is gone.
  14. div elements are blocks by default, so display: block would work.
  15. Ingolme

    else if ( if (

    It's hard to tell what you mean. If you want to check for two conditions: } else if(condition1 && condition2) { You can have if statements inside other if statement blocks, but if you can reduce it to a logical operation in a single condition it's better: } else if(condition1) { // Some code if(condition2) { // . . . }}
  16. Unfortunately, I don't see any code attached to your posts.
  17. The URLs don't work for me and you haven't shown any code to work with. What language is the code written in?
  18. If the header isn't being sent then that means that the condition is not evaluating to true. SESSION variables aren't saved when you call the location header because the script hasn't finished running before leaving the page. To save the variables before sending a location header use session_write_close()
  19. Actually, the same problem is occurring because you have another "from" in the query. SELECT id, to, from,
  20. FROM is an SQL keyword, so you'll have to wrap it in backticks: `from`='$log_username'
  21. Each client is on a different page, in a completely different environment. The Javascript that is executing on one user's computer is a completely different program than the one running on another user's computer. You only need to program the interface for one user. It is the one interface that all the users visiting your page will use.
  22. Let's see... Sessions won't be necessary if you build it properly. First you have a lobby screen: A user can choose to create a game or join an existing game. Each user should be uniquely identified. To do this, as soon as they visit the page for the first time PHP should send them the identifier which they'll send back on every request. Once one user has created a game and another user has joined the game can begin. Every 5 seconds or so you send an AJAX request to see if the other player moved, if it's the current player's turn then it will only need to send a request when the player moves. Once the game is over the server needs to make sure that both players have been notified of it before eliminating all the data. It's not a simple task, really. There are lots of details to think of both on the client side and the server side.
  23. Each client performs any amount of HTTP requests. It's up to the server code to identify the client and create a relation between two different clients.
  24. Well, that's one way to do it, but the query wouldn't work like that. You have to loop through all the query results, adding on each iteration: // Assuming PDO is being used for the database query$sum = 0;while($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $sum += $row['value'];}echo $sum;
  25. HTTP doesn't take simultaneous connections into account.
×
×
  • Create New...