Third_Degree
Members-
Posts
281 -
Joined
-
Last visited
Never
Everything posted by Third_Degree
-
You could try an ip or ip range check. But if you're sure you've coded securely against xss, you don't have to bother. Personally, I like hashed, salted cookies. yum...
-
Session fixation. Keep working... Edit: in all honesty though, it's pretty solid. just when a user logs in, anyone can be on their account provided they access the sid.
-
Yes, they potentially could. I think to fix it you'll need to edit session_timeout with ini_set()
-
I'm not sure of your code so this might not work, but why not update the time of log out when the user logs in, then make the cookie(s) expire after whatever time you choose? If the user logs out before the anticipated time, no worries, you just update the table anyway. If your goal here though is to physically remove their logged in page from the browser, i understand why wouldn't want to do this.
-
Yeah, just looks like a quotes issue ', `, " or something. Just show us the full query and I'm sure someone will help you out.
-
let me rephrase my answer str_replace( "\r\n", "\\n", $content ); Ok, ok, I'll elaborate. multiple lines in javascript look like document.write('Hello\nThis is the Second Line'); So if you have a bunch of content generated by a php page, this is what you'd have to do: <?php $content = "hello this is the second line."; $content = str_replace( "\r\n", "\\n", $content ); print ' <script type="text/javascript"> document.write("' . $content . '"); </script>'; ?>
-
str_replace( "\r\n", "\\n", $content );
-
No problem.
-
round()
-
how many years, months, weeks, days, hours, ago from datetime?
Third_Degree replied to onedumbcoder's topic in MySQL Help
php.net/time Read the user comments -
Thanks for introducing me to clearTimeout()!
-
split the number 100 into arrays of numbers that add up to 100
Third_Degree replied to tallberg's topic in PHP Coding Help
http://thumbs.dreamstime.com/thumb_298/12182795953C10uW.jpg There you are Mark. Ah, the good old 633 octillion solutions problem... -
split the number 100 into arrays of numbers that add up to 100
Third_Degree replied to tallberg's topic in PHP Coding Help
tallberg have you gotten your answer? If not, to address you're original question this is what you'd have to do. You need to have a script that first generates all the combinations of two integers that equal 100, then all of the ones with 3 integers , then 4 integers, etc.. all the way up to 100 1's, with each having a different rule you would need to rationalize. If order matters, you're in for a h*ll of a time. If you understand my method, you'll also understand that anyone who did that for you would deserve some cash money and a medal. -
alright, well read up on comparing timestamps. I'm pretty sure there are a few good functions here http://www.php.net/time All you need to do is get the current time, if its not six, get the timestamp for 6 of the current day (something like time( "6:00 pm " . date( 'F d Y' ) )), compare it to the time the page was loaded, and output the wait time. I guess you could get fancy and use ajax to update automatically, in which case a simple GET command is all you need. Tutorials for this at: http://w3schools.com/ajax/ajax_server.asp or http://phpgfx.com/tutorials/?action=read&id=49
-
this is accomplished with .htaccess files. Read up on mod-rewrite. But yes, you will eventually need a simple file like redirect.php with code something like: <?php if ( $_GET["url"] == 'blah' ) die( header( "Location: blah.php" ) ); if ( $_GET["url"] == 'blah2' ) die( header( "Location: blah2.php" ) ); //Etc... ?>
-
A slightly involved code is needed for this but i can get you started. Yeah, you really need only javascript for this. I wrote this clock a while back, it's obviously not what you need exactly, but it'll show you date/time manipulation in js. function clock() { var time = new Date(); var hours = time.getHours(); var mins = time.getMinutes(); var secs = time.getSeconds(); if (secs < 10) { var sec = "0"+secs; } else { var sec = secs; } if (mins < 10) { var min = "0"+mins; } else { var min = mins; } if (hours > 12) { var hour = hours - 12; } else { var hour = hours; } if (hours < 12) { var ap = "AM"; } else { var ap = "PM"; } document.getElementById("time").innerHTML="The time is: "+hour+":"+min+":"+sec+" "+ap; setTimeout("clock()", 1000); } [code]
-
ah, i understand now. um, you could try a long pre-set random list. also, if the same image was appearing over and over, the browser may have cached the file. Just add the lines: header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: pre-check=0, post-check=0, max-age=0');
-
that's a lot of code <?php $avatars = array( "http://www.avatarity.com/avatars/7/78/7865.jpg", "http://www.avatarity.com/avatars/6/66/6687.gif", "http://www.avatarity.com/avatars/4/45/4578.gif", "http://www.avatarity.com/avatars/13/137/13746.gif", "http://i9.tinypic.com/6su42nt.gif", "http://i8.tinypic.com/6ob6qv8.gif" ); shuffle($array); header("content-type: image/gif"); foreach($avatars as $tar) { echo readfile($tar); } ?> I do believe that's all you need. If that's not what you're looking for let me know.
-
I'm sorry for not understanding but when you say half sized, do you literally mean half of the bytes or half the resolution? If it's resolution, just use the code you found without the header() line, and using a second parameter for imagejpeg() (http://www.php.net/imagejpeg if you haven't used this before). If you need more help, I guess I could whip you up some code.
-
cropImage()? Are you using ImageMagick?
-
[SOLVED] yes or no, can this be done in php
Third_Degree replied to Lodius2000's topic in PHP Coding Help
For future reference: http://www.phpfreaks.com/forums/index.php/topic,200925.0.html I'd give it an overall 8.5/10 if you are just working with the background image and php alone. -
You could always try using fsockopen() and using a free smtp server...
-
$liste_tableaux_couleur = explode( ",", $liste_tableaux_couleur ); That might help you out. You can't use array_ functions without an array!
-
Javascript. (Sorry to be brief, but I'm tired)
-
$split = explode( "&", $str); That's the string manipulation you want I think, but I would advise not to be putting such sensitive information through GET.