-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
Wonderful..?
-
You mean to show a kind of away status after a period of time? Bind your handler to the "onmousemove" event of the BODY.
-
Only XHTML is case-sensitive.
-
When I read that I thought you were meaning the purely JavaScript method. Yours is in-fact still mixed HTML and JavaScript.
-
While you've provided plenty of useful information, you've not actually asked a question. We're happy to help with any problem you have, but laying a specification down and hoping for us to basically walk you through the whole implementation isn't going to get you anywhere. Try and be specific with your questions so that we have something to go off..
-
In what way is it not working?
-
This should get you going: http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/
-
I have tried to make a javascript function that should submit the form its triggered from You're not making much sense. You want to .. trigger the submit event of a form, when it's submitted? if the function is called from form thats named updateform, it should submit that form when pressing on a link Where does the link come into it? Which link(s) should trigger the submit? You need to be more clear.
-
What if someone is visually impaired and needs to increase the font-size?
-
You're best off using Flash to be honest. Browsers lack[ed] any kind of standard for how to handle playing audio files, and it basically ended up in a big mess. That is up until HTML5 of course, but you can't depend on your user having an up-to-date browser. Most JavaScript solutions use a Flash player in the background though..
-
An SWF file is not an Image. images[15] = new Image(); images[15].src = "image15.swf"; That's the object equivalent of: <img src="image15.swf"> There's a very popular JavaScript plug-in you can use called SWFObject, that makes embedding flash objects far easier. Using that you don't need to worry about browser compatibility issues or standards compliance, and it provides a simple API for working with in JS. That said, I rarely ever use Flash so I'm not at all experienced with it. I've just read it's good...
-
I haven't actually used JS window pop-ups in a while - these days it's all about "modal" pop-ups - so can only speculate that it's the browser preventing you from doing that.
-
Haven't you answered your own question there?
-
Some basic questions about PHP to talk about...Please.
Adam replied to makuc's topic in Miscellaneous
When you construct the Date object you pass in the time stamp from PHP, the server time, so that it's set to the exact same time as the server. Then if you increment the object's time every second it would always be equal to the server. Working clock's are very.. Gimmicky though. There's a reason why you don't see them very often. -
As Kira mentioned, the reason why the images don't show up instantly is because the browser hasn't download them yet. Until that 'mouseover' event occurs, the browser knows nothing about them. JavaScript 'image pre-loading' is the technique of creating an Image object (an object representation of an image tag) outside of the DOM-tree, and setting the src property so that the browser downloads it, even though it's not actually used. When the mouseover event then occurs, the browser has already (or is likely to have by that point) downloaded the image and has it cached, ready to switch with the original. These days though that's a fairly dated technique. CSS is perfectly capable of pre-loading images and even altering hover states using the :hover pseudo-class (you've probably used it before for links). In-fact there's probably more users about that will support a CSS implementation than JS now-a-days. The best way is to only use a single image (cutting out any pre-loading concerns) and manipulate the mark-up/CSS to only show part, or parts, of it at a time. Have a look about on Google for some CSS-based techniques, is my advice basically.
-
Some basic questions about PHP to talk about...Please.
Adam replied to makuc's topic in Miscellaneous
Your logic about passing the time stamp into the JavaScript is correct, and widely used. I don't follow this though: Why would you need to ping back the server with the new time, or what ever you hand in mind? You got the time from the server, it's been x seconds since the last request, the server time will have advanced x seconds also. Maybe I don't understand what you're actually trying to achieve..? -
1. You're not actually querying the database for the data? You're missing out a step entirely. Read up on the mysql_fetch_* functions (mysql_fetch_assoc for example). Also when you define your two SQL statements, you're overwriting the first one with the second: $qry = "SELECT site_title, site_slogan, footer_text FROM settings"; $qry = "UPDATE settings SET site_slogan = '$site_slogan' WHERE site_title = '$site_title'"; You need to use a different variable for each and query them separately. 2. mysql_query returns true/false on INSERT/UPDATE/etc type statements, indicating whether the query was successfully executed. A true return here though does not mean any rows in the table were actually affected by the statement, just that it was executed okay -- which is what I think the case is here. Generally false will only ever be returned if there's an error. What you should use is (not necessarily to the letter of course): $result = mysql_query($qry,$con) or trigger_error('MySQL error: ' . mysql_error(), E_USER_ERROR); That will execute the function, and if it returns false trigger an error. Using trigger_error is a good habit to get into it, as you can customise the level of errors to report later on -- think about production environments where you don't want PHP errors to be shown to the user, but you do in development. Remember though that will only indicate that the query was executed successfully. You can check how many rows were affected using mysql_affected_rows. If it's 0 you know you have a logic problem, but if it's more you know it's updated something (which your WHERE condition should guarantee you update the correct row(s)). If you get an error triggered, you know it's a syntax problem. Looking at your code though I'm a little unsure of the flow; when should you update the row and when should you select?
-
Warning: Cannot modify header information - headers already sent by
Adam replied to elgaxton's topic in PHP Coding Help
I meant I was being sarcastic, not you. You must have had some knowledge that's encoded though, given that you apparently have the "ionCube" decoder software on your server? Anyway, the manual has some very clear examples of how to use output buffering. What you should aim to do is start the output buffer, run the encoded PHP, capture the output, and clear the buffer. I'm not sure what you'll want to do with the actual content, as I have absolutely no idea what it does. Have an experiment and see what you can do. If you run into problems, then come back here. -
Warning: Cannot modify header information - headers already sent by
Adam replied to elgaxton's topic in PHP Coding Help
(...Sense the sarcasm) How can we tell you if it's encoded? Given whoever gave you that code has paid for it to be encoded to prevent you tampering with it, you're only solution is to use an output buffer to capture whatever output it's kicking out. -
Warning: Cannot modify header information - headers already sent by
Adam replied to elgaxton's topic in PHP Coding Help
Seriously.. You want us to tell you what's happening within some encoded PHP code? -
You need to set the value property, not text. The reason you're not getting a JS error is because you're creating a new property.
-
Please explain what you mean by "value"..?
-
Group changes into commits that are relevant, part of the same change or at a point where it would make sense. If you write your entire application and then commit, you loose the ability to rewind back to previous states during the development process. If you commit too often, well there's not really a massive down-side to this, but you'll waste plenty of time doing so. It's a good idea to commit fairly regularly though, to make the most of Git's features. "can you take the hash of any commit and use some git voodoo to rebase a specific file to that commit?" You can checkout a single file at a particular commit with: git checkout <commit> <file> Then to go back to the current (HEAD) commit: git checkout HEAD <file> Or you can use reset to reset all files (any changes you've made, staged or not, will be lost) back to the state they're in at HEAD: git reset --hard HEAD You can rebase a whole branch onto another specified commit, merge another branch, cherry-pick commits on to your branch, etc, etc. Git has a lot of powerful features, it just takes time to pick them up.
-
Read up on AJAX.