Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

markyoung1984

Members
  • Joined

  • Last visited

Everything posted by markyoung1984

  1. I have a system whereby I wish to know who is logged in at any given time. The way I believe I can do this is by sending an AJAX request every second or two seconds to the server from anyone connected. A database entry in some kind of "ActiveUsers" table is updated with the new time against the username, or an entry is created if the user is currently not in the table. However, the problem with this method would be that I do not know how to implement a timeout to indicate that a user is logged out (their entry removed from the "ActiveUsers" table). The only way I can currently think of doing this would be to call a stored procedure (via a trigger) every time the "ActiveUsers" table is modified. This procedure would look at all the times for the entries in the "ActiveUsers" table and then remove any entries where the time is over, for example, 5 seconds from the current time. Can anyone suggest an alternative that might be easier or more efficient or both? Thanks in advance for your response. I'm using PHP and MySQL.
  2. I have recently started to use mod_rewrite in Apache and find it very useful. However, when I'm referring to pages in my href links, should I use my re-written names e.g. mysite.com/about or the full URL mysite.com/about.php The about is just a simple example but for things like mysite.com/products.php?category=cams&id=screen would it be better to use mysite.com/products/cams/screen?
  3. Ok thats interesting. How would you hold the HTTP session open? Surely after the server has sent the page the browser drops the connection.
  4. Yeah I thought Ajax (essentially what I said in a round about way!). I'll have a look at the links you sent me, I'm sure they'll be extremely helpful. I'm new to Ajax but keen learn as well as HTML5. You didn't comment on the server side stuff. Would the interaction be with the database like I said or would the server manage interactions/chat using temporary text files stored on the server? I'm not sure which would be easier to be honest. I didn't expect a response so quickly, I'm impressed with this forum
  5. I was on facebook recently chatting and I wandered how on earth it worked. I mean HTTP is stateless and the TCP connection terminates when the page is loaded, so how are messages passed from the browser to the server? I do have an assumption and I'd like to get other people's thoughts on it. I might try Wireshark to see if my assumption is correct. My assumption is below... JavaScript is used in the background to continuously send XMLHTTPRequests (over TCP) to the server. These requests are essentially polling the server to see who is online etc. The server responds with people who are currently online etc. Then there is a database behind this handling all the chat sessions.... Bill sends message to Bob --> Message is sent to server and stored in database --> Bob's browser polls the server --> The server interrogates the database for messages intended for Bob --> Server finds Bill's message in the database and sends it back across the request --> Bob's browser displays Bill's message --> Bill's message in database deleted to save space Does the chat use web workers? They would probably make things easier. Does it NEED web workers? I just don't know. The company I work for are looking to implement some chatting system and I'll probably get one off the shelf but I'd like to know how they work so I can customise it. Can anyone recommend any browser based chat providers? Paid or free. I'd like to know your thoughts. Thanks.
  6. Ok that solves a lot of mystery, although I'm kicking myself for not coming up with the answer myself!! If you can use absolute positioning and the z-index with divs then what is the point in layers? I suppose the div container can serve as a type of layer. Still on the topic, and my last question. There are some sites that open, presumably an absolutely positioned div, a "window" (for want of a better term) to input details etc. When this "window" opens, the rest of the page goes dark and cannot be used by the user. This is something I'd like to use in an online app I'm working on for a company, any idea how this might be accomplished?
  7. Thanks darren. I use firebug already, probably the most useful web development tool ever! I completely forgot about CSS positioning. If I use absolute will this be positioned above all the other elements or do I need to use the z-index property? I have noticed some websites pop up message boxes such as to get user feedback on the design of the website etc. Are these done in the same way?
  8. When you click to create an event in Google Calendar, does this make use of layers, for example when the speech bubble comes up asking for the event details? If it does not make use of layers, then how does it work?
  9. I am trying to use object orientated programming with a database but I fail to see the benefit with some applications. For example: - I use a query to get a list of unique IDs from a database (via an object, which is fine) and this is returned as a 2D array. - I then use a for loop to create a collection of objects of type Topic and pass the ID into the Topic constructor for each iteration. - In each Topic's constructor another connection is made to the database to obtain further Topic information. - I then use functions in the Topic class to get this information from within the topic and output it via HTML. That is making use of objects. My problem is, why don't I just use my original query to get all the information I need via my 2D array and just traverse the array to find and display the data I want? I have been asking myself why don't I just disregard the Topic object and use the array directly, which contains all the information anyway? Could someone comment because I am struggling to comprehend which approach I should use. I do understand the merits of object orientated programming and I do use it in my coding for various tasks but there are just some things, such as the scenario described above, where I ask myself is it worth it? Let me know your thoughts.
  10. I am working for a Polish client and they want an embedded forum in Polish. I know there are free forums out there, but does anyone know of any good ones that can be embedded and are Polish? The only solutions I have so far is either to use an English one or use an iframe to link to a non-embedded Polish one.
  11. I would rather not. The whole point of the exercise is to make my own and gain experience from it. However, could you recommend any open source systems that I could use to get some ideas from?
  12. I have a real problem with processing requests. I am designing an Intranet and website for work. Its a small company so the two projects will give me a lot of experience. However, I have a stumbling block of how to process page requests. For example, to create a new project I would have one request to view the form to input details and another request to process the data on that form, for example project.php?request=create to display the form and project.php?request=processcreate to sort out the data on the form. However, how do I process these in terms of layout and structure? I have come up with the following: - A massive switch statement that direct requests to class functions. This is impractical and hard to maintain. - A series of switch statements in various files that direct requests to class functions. Fairly similar to the above but easier because files can be split into various groups according to what purpose they serve. - A completely class based system, going through a hierarchy of classes, but based on smaller switch statements within class constructors. This is the one I'm thinking of using at the moment. Everything will have one entry point, which will parse the request and pass to the appropriate class constructor. E.g. if the first part of the request contains "project" the project class constructor is called, which then parses other elements in the request and applies the appropriate action. To me this idea is simpler to edit than scrolling through a massive switch statement. I just don't know how to handle the varying requests and have no experience in designing something of this magnitude, although I'll be fine with coding. I'd like to use classes as thats what I'm familiar with from C# and C++. All suggestions are welcome.
  13. I prefer a fixed pixel width layout. It makes things easier as the page will appear the same no matter who is viewing it. First company website I designed has percentage width and I got a few complaints. Pixels are absolute and easier. 1000 pixels is good for me, which is also divisible by 2 and four

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.