Jump to content

RussellReal

Members
  • Posts

    1,773
  • Joined

  • Last visited

Everything posted by RussellReal

  1. in your html if it shows your images with a relative path "images/whatever.jpg" the file will be requested relative to the directory which holds the html file you're currently viewing if your index.html is in http://yourdomain.com/foo/index.html then the images will try find themselves in http://yourdomain.com/foo/images/bar.png but in index.html all you're going to find is src="images/bar.png" because it is relative to your index.html (hence, relative url) I suggest you move all of your images into "images/"
  2. RewriteRule ^\/(.*)\/(.*)\/.*$ user.php?u=$1&interface=$2 example url: mydomain.com/russellreal/pm/
  3. IE6, and I believe 7, do not natively support event.preventDefault. You're probably right, so use the return false and event.prevent default together.
  4. change $_POST to $_GET, $_POST is for post form data, and $_GET is for url variables.
  5. do you have shell access? whatever the extension is, you shouldn't need to download the source manually unless you're going to compile php with it.. just use: pecl install <extension name> if you do not have the pecl command you may need to update pear use: pear update PEAR if you're on shared hosting you PROBABLY don't have shell access, so it should be easy enough to contact your provider and put in a ticket for them to install the extension. if you're doing this on your home computer, and it is windows, you simply need to drop the .dll in the extensions folder, and add the extension line to the php.ini file.. I'm not sure how to do it for any other OS besides windows for home use, as I only run Windows. I hope I helped.
  6. #1, you're not realizing that document.getElementById() isn't the most effective method in the world, it is most likely going to scan all elements, everytime you call that method, unless ofcourse it is indexed, but in any event its still alot of looping to do. You're better off simply naming your elements that the snake is on "colorMe", you can have multiple elements with the same name.. That simplifies everything in the long run... Then it costs the browser only 1 big loop, to fetch all the "colorMe" elements, then your smaller loop, to actually color them.. it should dramatically improve performance.
  7. the form isn't named login, there is no "name" field, however, name is also an attribute which can be placed on all elements which means that you shouldn't name your FIELD "name", which will lead to (almost guaranteed) cross browser issues. for best results, just issue an ID and use document.getElementById();
  8. what you're referring to as "copy past scripts" is not really that, its regular old javascript, which is getting injected into the page, called "JavaScript Injection", or simply "JSI".. This is technically a form of maliciousness, but it can only affect whatever is on the page at this moment, it can, however, trick the browser into referring the user to another page which requires referrers to match up, that amongst other things like ad blocking, AJAX Referrer spoofing.. Using somebody else's JSI could lead to: stealing sensitive information from cookies and password forms, snooping on the content of the page, credit card theft, amongst other things, especially with browsers like chrome automatically filling in credit card information on focus and selection of a credit-card related field.. but to get back on point about your question, can you make this? Sure, if you know anything about javascript.. The only real rule you need to remember about javascript injection.. Is. Rule: If anything you put in the url, returns any data to the "JavaScript:" portion of the url, it will then try and redirect you to that page.. An example of BAD JSI E.X.: javascript:(Math.random()*11); that will send you to a page: "10" which will most likely be a blank page.. or page not found GOOD JSI (lol, how ironic is that phrase) E.X.: javascript:void(var x = 11, var y = Math.random() * x, alert("Random * "+x+" = "+y)); void() will always return nothing..
  9. event.preventDefault(); should work for you.. however, you could also on the onClick="" do this: onClick="return AJAXMonth()" but event.preventDefault is more or less cross browser..
  10. it depends on what exactly you're looking to do, if you're looking to pull ALL the results with the object data = '7' well then you're probably best running it in a separate query like: SELECT * FROM events WHERE object_ID = '7' If you only want 1 specific event ID, the object_IDs that equate to 7 will still be pulled regardless, so 2 separate queries are actually inefficient, what you can do, however, (which may be going overboard, unless you're pulling a massive amount of information) you could pull the data from the database and store it in memory (temporary tables) and load the entire sum of the results into that table, then filter out your results as you see fit from the temporary table.. Temporary tables makes accessing the information ALMOST as quick as accessing the information stored in lets say a php variable. Which could offer a performance boost is the amount of results you're pulling is ALOT.. If you're only pulling an average amount of results.. like 30 or 40, your best bet would be to handle it close to the way you're handling it right now, but if you want to STORE them till the end.. you could when you encounter an object_ID 7 result, you can simply store that row in an array, and after the main loop, execute another loop, looping through the storing array, and print them @ the bottom.. I can't rly give you a definite answer as I don't quite understand what you want to do in general. Hope I helped.
  11. wouldn't that be bad? If user 1 uploads a file called 'timber.png', then user 2 uploads an image called 'timber.png' would you handle them seperately? I'd assume you would, just curious though.. What you would do in any event, You'd save the original file name in the database, aswell as the renamed file name. Example table would be: id (int) | uploader (int) | uploaded (datetime) | file_name (text) | file_name_new (text) | file_size (text) | description (text) when the new file is uploaded, you'd run a query through the database like so: SELECT id, file_name_new FROM uploads WHERE uploader = '{$user->id}' AND file_name = '{$oldFileName}' if that returns a result, set in your php the value of 'file_name_new' from your database, store it in a variable for later.. unlink the old file which matches the name "file_name_new", then upload the file.. using the variable you stored.. once the upload is complete you will make another call to the database UPDATE uploads SET uploaded = NOW() WHERE id = '{the id from the query above}' and that should be it mostly
  12. well you could do it.. $hasImage = ((stripos($content,'<img') > -1)? true:false); or.. $hasImage = ((preg_match('/<img/i',$content))? true:false);
  13. why not use javascript for this? but, are you pulling this information in via like an include or file_get_contents.. basically what I'm asking, do you have access to the content before it is output? if so you can use preg_match to see if there is "<img" in the content.. if you don't have access to the content, than your best bet would be javascript.
  14. I know that its possible to have multiple sessions open at a time, but how would you handle both along side eachother.. From my understanding, session_start will fill the $_SESSION superglobal with the contents of the session_file.. My current goal is to open up an application session (global session across all clients) to sorta "share" information between them, I know I could simply use MySQL or a series of text files with the same logic as MySQL concatenated indexs.. But I wanna try something new here.. The application session will be accessible to every client who connects to the specified application.. they will also need to be able to open their PERSONAL session file, simultaneously, therefore I wish to be able to modify variables in sessionfile1 and sessionfile2 together.. I know I could do this by opening one session file, gathering the information, opening the user file, leaving it open, and whenever I need to edit something in the application file, I'd close the user file and open the session file, but that seems a lil drastic.. Any information let me know.. Thanks! P.S. I do understand that the application session will place a file lock on that session once a client has the session open for writing, I plan on the whole transaction between session1 and session2 to be very brief.. then I will close the application session and leave open the user session..
  15. There was nothing wrong with my original solution. But, oh well, your proposed logic would work as well, except you implemented it wrong. You parenthesis are not correct. The above code says if (year is divisible by 400 OR 4) AND NOT divisible by 100) then it is a leap year. The AND clause negates the 400 condition (a year cannot be divisible by 400 and not be divisible by 100). You want something like this: IF ( (Year div by 400) OR ( (Year div by 4) AND (Year NOT Div by 100) ) = leap year ((!(yearVal%400) || (!(yearVal%4) && (yearVal%100))) ? 29 : 28); The logic I used was: If ( (Year div by 4) AND ( (Year NOT Div by 100) OR (Year Div by 400) ) = Leap year Which, if you compare my original code with the code I just corrected for your logic, are both exactly the same number of characters. I just think my solution is easier to read. Besides, using something like !(yearVal%4) to test if the year is divisible by 4 seems counter intuitive since you are using a NOT to return a true condition. according to wikipedia's calculation pseudocode my script will not trigger the if statement if it is NOT A LEAP YEAR, and if it is divisible 100 after divisible by 400 fails.. if you check out my proposed code in the console, it works perfectly, I was just noting that the pseudocode proposed by wikipedia doesn't match to yours exactly, and simply asking what the difference is lol
  16. ahhhh I seeee, I was wondering why the modulo 400 was in there, I was like, theres 100, 400, 4, they'd all work just off 4 if it was that simple but the gregorian calendar needs updating pretty badly, coz as it stands every 4 years we're actually GAINING like 45 minutes or so.. anyways, I also wikipedia'd it, and this is what I've come up with, and so I've written my interpretation.. ((!(2012%400) || !(2012%4)) && (2012%100)?29:28) which seems a little different from what you've written, so I ask, what am I not seeing here?
  17. PROBABLY, as I've said it my prior post, IE 5,6,7,8 all don't support html5
  18. I believe this is why flash was invented, you can draw a motion path along the tracks, and have your train just follow the motion tween around the tracks, you know, and it'd only be like, 4 or 5 lines of code to handle the stops.. but if it must be done in html/js (I haven't really used html5 much) but I believe you could probably use a canvas, but that isn't very good for IE users, you'd have to create a second version of it, in svg, but they've got some cross browser libraries that mimic canvas in IE (http://code.google.com/p/explorercanvas/) but if you don't wanna go the canvas route, you'd have to go strictly html/js, which could get tricky as you'd probably need to rotate the train to follow the tracks around turns, which again, isn't supported widely amongst most browsers (but, neither is HTML5!).. You could get away with it with 4 images.. left right up down.. and swap out the images as it gets to a turn.. and you could make the animations with jquery relatively easy, just get a list of goTo co-ordinates, create the animation in jquery to move the train from current X,y (where it is before the animation) to the next nearest straight line end point (end X,Y), swapping images as you get to turns.. this would be absolutely hell if the track is round instead of rectangular.. but then again, jquery/html/canvas/svg all together, could make it almost seamless.. if you created a canvas (with the svg crossover library from google) just big enough for 1 image of the train... you can than re-draw the canvas with the rotated image in it, to perfectly contour to the track when needed.. even mathematically if it is a perfect circle.. and then with jquery, you animate it.. presto! but, however you decide to go about it, lemme know.
  19. (yearVal%4==0 && !(yearVal%100%4))?29:28 sry :$ I just saw some long ass inline-if so I had to shorten it, ocd D:
  20. If you haven't told anybody, but you've hired people, how does that work out exactly? But in any event, I suggest you stick to your guns, push forward, and make the site happen.. To be honest, look at youtube, you think google would have bought it? even if they put a $10 pricetag on it, before it was ever live? What youtube is, basically, and all that google bought it for, was brandability, they saw tons of money in advertising on a website with alot of traffic, google had their own video site, still do somewhat.. For anybody to pay for your application, you're gonna need a working model of it, at the very least.. if you feel like its such a good idea, consider an investor, and the great thing about it, is you split profit with the investor (after you draw your own salary), if you don't make any money, the investor doesn't make any money.. I'd be happy to help *hints at my signature*..
  21. <td style="display:none";><?php $row['dst'];?></td> <td style="display:none";><?php $row['dstchannel'];?></td> <td style="display:none";><?php $row['duration'];?></td> <td style="display:none";><?php $row['billsec'];?></td> <td style="display:none";><?php $row['billsec'];?> I may be wrong, but that could be a syntax error right there, try doing <?=$var;?> or <?php echo $var; ?> btw, your db class kinda reminds me of the one I made a while back just throwing that out there. furthermore, you don't need to re-initialize a new connection object everytime you want to run a seperate query, if you want to do this to keep results from one query, you could simply store the mysql resultset resource in a different variable.. opening more than 1 database connection is inefficient and unnecessary.. is your error reporting turned on?
  22. You shouldn't spoof your visitor's emails, you should put the email in the reply-to, but you should create an email from YOUR domain name, like: alerts@yourDomain.com, to send emails, because most times when you send an email from your webserver with a different domain name, it goes straight to junkmail, sometimes not accepted at all..
×
×
  • 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.