
Floydian
Members-
Posts
900 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by Floydian
-
Re: strtotime produces wrong time. $rm = "0-".strtotime ("+57600"); I'm not sure I understand that. It looks like you're taking the string 0- and concatenating a timestamp onto that. Is the timestamp you're looking for supposed to be 16 hours ahead of "now"? If so, do this: time() + 60 * 60 * 16
-
Re: Alternative to eval() It sounds like you might benefit from the serialize/unserialize functions. They are safer to use than eval. They are not 100% safe though. As always, safe secure code is more a function of how you use something, rather than if you use something at all. http://us2.php.net/serialize That page has a link to the unserialize function. Hope that helps...
-
Re: Alternative to eval() Alrighty, eval() executes php code contained in a string. Since the ENTIRETY of possibilities of all combination of code can be run through eval, or some other method, your question couldn't be more vague... What are you trying to do there?
-
Re: split variable You're welcome for the help, and glad that worked for ya. Yes, that's exactly how to do that, good job ;) One suggestion: To automatically tell javascript to add an element to the end of an array (similar to PHP's method: $array[] = $next), use this: mrnaArray[mrnaArray.length] This will only work with numeric arrays, of course.
-
Re: split variable stringVariable.slice(startIndex, endIndex); Using that, if you keep adding 3 to startIndex and endIndex, in a loop, you can achieve what you want. Hope that helps...
-
Re: Class Problem Rules regarding setting property values are quite strict. The property can be set in your constructor. Normally, dynamic values for properties would be initialized in the constructor. Hope that helps...
-
Re: Connecting to 2 MySQL databases from the same script. You're welcome ;)
-
Re: Connecting to 2 MySQL databases from the same script. In case one wanted to know how to do that: select users.userid, stats.someStat from main_db.users left join secondary_db.stats on users.userid = stats.userid If you have two tables: users and stats, in the databases: main_db and secondary_db respectively, the above query will get the two tables from the two db's in one query. select column from db.table, db.table That is the generic syntax...
-
Re: Class Problem That's impossible to say without knowing how you instantiate your Database class. Is there a $db variable? If so what scope is it in? Provide a few more details, and we should be able to get ya squared away quick.
-
Re: Connecting to 2 MySQL databases from the same script. If both databases (or however many dbs...) have the same user, then you can append the db name to the table names for "on the fly" access to both dbs. Of course you can select a db to use as well. Hope that helps...
-
Re: adding php to an embed code ? Try swapping out this: $q=$db->query("SELECT playerswflink, videophplink, width, height, allowaccess FROM videos ",$c); $db->fetch_row($q); with this: $q=$db->query("SELECT playerswflink, videophplink, width, height, allowaccess FROM videos ",$c); $r = $db->fetch_row($q); Specifically: set a value for the $r variable. Hope that helps...
-
Re: Actually use xml with ajax Most people I know use a javascript/ajax library that will take the xml and parse it for you, turning it into a javascript object. You would then be able to access all those fields just like any other javascript object.
-
Re: Fluid and Fixed problem Hey shedh, have you tried taking the nagivation and MainContent Area and putting them both into a div? Then you'd only have to deal with getting one div to position next to the sidebar. My guess is, you're side bar needs to come first, with float: right; and width: 200px (or whatever unit) And then the nagivation and MainContent Area container shouldn't need a width at all. It should situate right up to the left of the sidebar and take up the remaining 100% of the space. Hope that helps...
-
Re: Storing And Reading OS/Browser Information Firefox 3.0.10 Windows Vista That is 100% correct (for me). ;)
-
Re: Storing And Reading OS/Browser Information What does your script look like?
-
Re: jQueryUI sortable boxes I made an example that might be helpful to you: http://www.steelbreeze.us/play_ground/o ... es/pg.html Specifically, I've added in a "change" event handler to your code: $(function() { $(".leftColumn, .rightColumn").sortable({ containment: "parent", cursor: "crosshair", // CHANGE EVENT STARTS HERE change: function(event, ui) { // CREATE DEBUG OUTPUT var output = document.createElement('p'); document.body.appendChild(output); output.style.width = '600px'; output.style.margin = '0 auto'; for (var x in event) { output.innerHTML += event[x]; } output.innerHTML += ' ----------------------------------------- '; for (var y in ui) { output.innerHTML += ui[y]; for (var z in y) { output.innerHTML += y[z]; } } output.innerHTML += ' ----------------------------------------- '; // END OF CREATE DEBUG OUTPUT } // END OF CHANGE EVENT }).disableSelection(); }); Hope that helps...
-
Re: Storing And Reading OS/Browser Information You are definitely missing the ".ini" on that file name.
-
Re: jQueryUI sortable boxes Do you have a working example? I'm sure I can help, but it'd be a lot easier seeing the script in action.
-
Re: Storing And Reading OS/Browser Information That's what's up. However it works for ya is fine with me ;) Let us know how it turns out
-
Re: Storing And Reading OS/Browser Information Well if you use their example there, you get an array of data to work with. If you don't know how to work with arrays, you're going to need to study up on PHP 101.
-
Re: Storing And Reading OS/Browser Information Did you check out the page I linked to?
-
Re: Storing And Reading OS/Browser Information As far as I know, $_SERVER['HTTP_USER_AGENT'] is where you'd find OS and User Agent data for users. For a more automatic deal, you should check out this PHP function: http://us3.php.net/manual/en/function.get-browser.php
-
It's nice to have an image to display an image address instead of putting it on the page as text. This script will create an image with your email addy in it. There isn't really much to explain except for the usage of this, but first, the script: <?php function getMyEmail($site) { $emails = array( [email="'[email protected]"]'[email protected][/email]', [email="'[email protected]"]'[email protected][/email]', [email="'[email protected]"]'[email protected][/email]', ); if (!isset($emails[$site])) { return $emails[0]; } else { return $emails[$site]; } } header("Content-type: image/png"); $im = @imagecreate(200, 30) or die("Cannot Initialize new GD image stream"); $background_color = imagecolorallocate($im, 200, 200, 200); $text_color = imagecolorallocate($im, 23, 36, 90); imagestring($im, 4, 5, 5, getMyEmail($_GET['e']), $text_color); imagepng($im); imagedestroy($im); Save this script as something like email.php. Then make an img tag like so: To change the background color, edit this line: $background_color = imagecolorallocate($im, 200, 200, 200); // That's an RGB of 200,200,200 To change the text color: $text_color = imagecolorallocate($im, 23, 36, 90); // RGB of 23,36,90 To change the image size: $im = @imagecreate(200, 30) // width, height To change the font imagestring($im, 4, 5, 5, getMyEmail($_GET['e']), $text_color); // That 4 can be anything from 1 to 5, or higher // (but can only go higher if you loaded your own fonts, which is beyond the scope of this post.
-
Re: How to use sprintf? it depends once you store the string dave\'s in the db, the \ is removed because mysql sees it as a control char and removes it but if you escape it and then echo it back to the user right away, then the user would see the slash
-
Re: [FAQ] sprintf - no, it's not a phone company You're welcome shrek ;)