Re: [PHP] www. not working
Jim Lucas wrote: If you are running Apache, you do realize that all of this can be done in Apache instead of PHP right? .htaccess example: # Power-up the rewrite engine: RewriteEngine on # Redirect all non-www traffic: RewriteCond %{HTTP_HOST} ^mysite\.com [NC] RewriteRule ^/?(.*)$ http://www.mysite.com/$1 [R=301,L]\ I like to always redirect to www or non-www... not both. I have read that this is good for SEO and/or SE's. Cheers, Micky -- Wishlist: http://tinyurl.com/22xonb Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help with multi dimensional arrays
Looks like you are missing a comma on line 3. James Lockie wrote: I get a syntax error on strlen. $newTypes = array(); $newTypes[0] = array(); $newTypes[0][0] = Starting with $newTypes[0][1] = strlen( $newTypes[0][0] ); -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help with multi dimensional arrays
Micky Hulse wrote: Looks like you are missing a comma on line 3. Doi, meant semi-colon, not comma... Lol. Also, when I get PHP errors, if not obvious, I check the previous line also... If says something like error on line 7 I will look at both line six and seven. Of course, depends on error message. Yadda yadda... I still feel like a dork for saying comma. Hehe, Cheers M -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP short tags: Questions
Hi, I am trying to describe why php short tags failed to work on a server... here is my simplified explanation: it had to do with the server settings... The short_open_tag directive in php.ini was set to 0. Do you think that is an ok way to describe the problem to a technically literate non php coder? Additionally, is there a good reference on the net that explains the differences between short open tags and normal open tags? Main negative things I have read about short open tags: 1. Not as portable. 2. Security risk/less secure. 3. Will conflict with XML tags. 4. Other? Thanks! Cheers, M -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP short tags: Questions
Hi Chris, thanks for the quick reply. I appreciate your help. Chris wrote: Sure. Thanks. :) 1 3 definitely. No idea how it's a security risk. Ah, great. Thanks for clarification. I probably mis-read the info about it being a security risk. Have a great day, Cheers, Micky -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP short tags: Questions
Hey Richard, thanks for the reply. I appreciate it. :) Richard Lynch wrote: http://php.net/ Yikes! I guess it was one of those RTFM question/answers! Lol. :D #2 sounds awfully bogus to me... Yeah... Hmm, now I am starting to wonder where I heard/read that. Maybe it was a co-worker. I am glad I asked here for clarification. 1 and 3 sure ought to cover it though. Yep yep. Sounds good to me. Good enough reasons to think twice about using short tags. Also, FYI for those interested, a list member mentioned (off-list) that shorthand tags are considered by many to be deprecated and have been on the verge of removal from the PHP language a few times in the past. Interesting stuff. :) Thanks again Richard and all. Cheers, Micky -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The Official OT Name Tedd's Grandson Thread
Congrats Tedd! :) Cheers, Micky -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Rules of Engagement
Tom Ray [Lists] wrote: Well I think my only issue with it is that this is a group discussion ...snip... to the list by default. I agree with Tom. I ussually hit reply, and take a few seconds to delete all the emails except the list email -- not very hard. :) -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT- why is network solutions more than godaddy?
I use and love http://www.namecheap.com/ 8.88$, plus whois guard. The control panel is great. Fast customer service. Also, I personally would avoid mixing host and registrar. Cheers, M -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] variables
Augusto Morais wrote: I want create a variable based in another variable. Example: Maybe this will give you some ideas?: http://us3.php.net/manual/en/language.variables.variable.php Good luck! Cheers, Micky -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Randomly rotate image on page load? File under: Image Manipulation
tedd wrote: You make a great points. As the old lady said, as she kissed the cow To each their own. :-) Sounds good to me. Like you said, things like this are very interesting. Nice site btw. I really like the simplicity of the logo, and very cool idea to make the tree change with the seasons. :) Thanks for your input. Thanks all for shedding some light on the topic. I am excited to try some unique and different things with PHP image manipulation capabilities. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] #comment, (* comment *), -- Any good alternatives to !-- HTML comments? --
Hi, Hopefully this is not a completely stupid question, but... Any alternatives to using HTML comments in an XHTML 1.0 Strict docutment? For example, I could do this: XHTML XHTML XHTML ?=# Comment goes here.? XHTML XHTML XHTML That might work for some situations... Any other alternatives? I would like to find a way of adding comments to an XHTML PHP page that is quick and easy. TIA. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] #comment, (* comment *), -- Any good alternatives to !-- HTML comments? --
Micky Hulse wrote: Any other alternatives? I would like to find a way of adding comments to an XHTML PHP page that is quick and easy. Ah, nevermind... I should have never posted this question. This solved my problem (IE duplicate char bug): !--[if !IE]Put your commentary in here...![endif]-- I was trying to think of ways to include comments in my html templates that did not involve actual html comments. Anyway, after posting, I realized that PHP would not really do the trick... More info here if anyone interested: http://www.positioniseverything.net/explorer/dup-characters.html Sorry for spamming list. I have not had much sleep lately. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Comment form spammer
Hi, Recently, a client of mine was getting a ton of spam email from a site called hotbox.com. I updated her form to one with more spam security, but she is still receiving junk email. Anyone feel like sharing code snippets that will help beef-up spam protection for a contact script? Do you all enable a CAPTCHA system? Here is what I am currently using in my contact form script to protect from spam: # Error text: $no_go = 'Forbidden - You are not authorized to view this page!'; # First, make sure the form was posted from a browser. # For basic web-forms, we don't care about anything other than requests from a browser: if(!isset($_SERVER['HTTP_USER_AGENT'])) { die($no_go); exit(); } # Make sure the form was indeed POST'ed (requires your html form to use action=post): if(!$_SERVER['REQUEST_METHOD'] == POST) { die($no_go); exit(); } # Host names from where the form is authorized to be posted from: $auth_hosts = array(site1.com, site2.com); # Where have we been posted from? $from_array = parse_url(strtolower($_SERVER['HTTP_REFERER'])); # Test to see if the $from_array used www to get here. $www_used = strpos($from_array['host'], www.); # Make sure the form was posted from an approved host name: if(!in_array(($www_used === false ? $from_array['host'] : substr(stristr($from_array['host'], '.'), 1)), $auth_hosts)) { //log_bad_request(); header(HTTP/1.0 403 Forbidden); exit(); } # Attempt to defend against header injections: $bad_strings = array(Content-Type:, MIME-Version:, Content-Transfer-Encoding:, bcc:, cc:); # Loop through each POST'ed value and test if it contains one of the $bad_strings: foreach($_POST as $k = $v) { foreach($bad_strings as $v2) { if(strpos($v, $v2) !== false) { log_bad_request(); header(HTTP/1.0 403 Forbidden); exit(); } } } # Made it past spammer test, free up some memory and continue rest of script: unset($k, $v, $v2, $bad_strings, $auth_hosts, $from_array, $www_used); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Comment form spammer
Quick note to Kevin Waterson: Hehe, I think all this talk about spam sent my response to your reply into your spam filter... I got a bounce back. Thanks for help though... let me know if there is any way I can re-send the email without a bounce-back. Richard Lynch wrote: If you are not already, PLEASE make sure that any headers you pass in to mail(), including the to, subject, and headers args (1, 2, and 4 args) do *NOT* have any newlines in the user-input data. Sounds good to me. Thanks for pointing that out. I just found this link: *Form Post Hijacking* http://www.anders.com/projects/sysadmin/formPostHijacking/ Looks like the above article mentions the same thing and proposes this as a fix: $_POST['email'] = preg_replace(/\r/, , $_POST['email']); $_POST['email'] = preg_replace(/\n/, , $_POST['email']); This is another good one: *Email Injection* http://www.securephpwiki.com/index.php/Email_Injection Cuz if you ain't doing that, you're not just letting them spam your client, but also letting them inject spam to ALL OF US! Don't do that. :-) Man, spammers suck! I just had someone take over my own domain a couple weeks ago... thank god for Spam Assassin and Cpanel! :D I also just trash anybody trying to send HTML enhanced (cough, cough) email through the website form -- You KNOW only a spammer is going to sit there and type HTML into an email form on a website. if (strip_tags($body) != $body) { die(spammer); } Ahh, good point. So, with the above line, you are saying: If the message body stripped of all html tags is not equal to the message body, then kill the script? Ah, makes perfect sense... a great way to test for html spam. Thanks for sharing! :D Do you all enable a CAPTCHA system? I did on one site that was just getting pounded -- Actually it was a guestbook with site-owner approval, so the junk never went public, but that didn't stop the automated spammers from trying anyway, and the client sure didn't want to scroll through hundreds of posts to find the one real one. Sigh. Man, that sucks. SMFing spammers. They really are annoying. I *hate* CAPTCHA for various reasons, but I was stuck for any other solution that would stop the junk... Yeah, I would prefer to not setup a CAPTCHA too (although, I would like to learn how to script one)... hopefully implementing your (and everyone else's) great suggestions will really make my script hard to spam. Thanks Richard, I really appreciate... you are always very helpful and your advice is top-notch. :) Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Comment form spammer
Micky Hulse wrote: Recently, a client of mine was getting a ton of spam email from a site called hotbox.com. I updated her form to one with more spam security, but she is still receiving junk email. Hi all, thanks for the great responses (on/off list). I just realized that the spammer is not actually using the form to submit the spam, they are using the script directly... duH! When I updated the form, I did not change the name or remove the old script... so she kept receiving tons of spam. I just commented-out all of the PHP in the old script and added one line: die(#%$#@ off!); Now that that is fixed, time to impliment all of your suggestions for making my script better. Thanks all for pointing-out the security holes and coding mistakes. :: pats all who helped on back :: You guys/gals rock! Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Comment form spammer
Micky Hulse wrote: I just commented-out all of the PHP in the old script and added one line: die(#%$#@ off!); Actually... is there anything more I can do at this point to fight back? Can I use something better than die()? Or, is it best just to let them figure it out and go away? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [ATTN: Kevin W] Comment form spammer
Ack, your email provider thinks my email is spam... not sure why. I got a bounce-back with this link: Permanent Failure: 553_5.3.0_[EMAIL PROTECTED]'s domain].net..._REJECT:550_Spam_filter_activated_see_http://[kevin's domain].net/spam/ Sorry to hit the PHP list, but I really wanted to thank you for your help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Comment form spammer
Richard Lynch wrote: You can tie up their connection, wasting your connection... If it were my own site, I might think about doing something like wasting my connection... I suppose you could do: header(Location: 127.0.0.1); and then they'd be trying to surf to their own computer, if they are following re-directs in their hack attempt... Though odds are really good they are watching for that. Oooh, good call. Interesting idea. I was thinking about doing something with a header redirect, but I also did not want to do anything too crazy - mostly because it is not my sight. Bottom line: Nope, probably not much you can do. More's the pity. Yep. I think I will just leave it at die(); Many thanks for the input. Cheers! :D Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Comment form spammer
Richard Lynch wrote: I rolled my own, because I thought it would be a useful learning experience. Sounds like what I am thinking. :) And, I kinda sorta documented it. Well, I put the source up on-line anyway. :-) So here's one crude hack way to do it, if you just want the basics of how it's done: http://voodookings.net/eyesonly_example.htm Kick-butt! Thanks for sharing. :D After you pass the CAPTCHA, it links to source. The connect.inc file is not available, as it has database password in it, but other than pg_connect() there is nothing interesting in there anyway. ... Note that if you are already using SESSIONs, then you could just toss the $token in $_SESSION -- I, however, was not, and did not want to start issuing cookies just for the CAPTCHA to work. Hehe, sounds like what I am thinking... I really do not even want to touch her site much as I am working on a re-design now and probably going to use a CMS to manage content. But, I will still be using the contact form, so all you your (and others) help is greatly appreciated. The web2 dictionary is Webster's older dictionary, now in the public domain, and is installed on my server by the webhost -- so presumably is readily available. Nice, was not aware of that dictionary, googling now. :) I also intentionally added zero noise to my CAPTCHA -- though you obviously can make the PNG as complicated as you like. I figure if the spammers want to OCR the CAPTCHA, I'm just gonna take the damn guestbook down. Lol, ya... that is kinda where I am coming from. If my client does not solve her probs after I fix-up the contact form script, then I will suggest she just asks folks to use an email program and manually contact her. Did I mention spammer suck already? Well, at least they are good motivators. Thanks Richard, you rock! Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] b4nl() - What, Why, Where...
b4nl($foo); Could not find info on php.net maybe I did not look hard enough. Tia, Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] b4nl() - What, Why, Where...
Hi Chris. Chris wrote: It's not a php function. Assuming you're on *nix or *bsd, you can grep your source code for it: grep -ilr 'function b4nl' * Your text editor may also have a search function that will do something similar. Ahhh... strange. I think I have seen a few PHP scripts that use it. Explains the lack of info though, thanks for the help - much appreciated. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Emphasizing first letter of string?
Hi, It is getting late, and I do not think I am thinking clearly... What would be the best way to wrap em/em tag around the first letter of a string? I know it has to be a combination of str_replace() and substr(), but due to my level of sleepiness I am having a lot of trouble working this one out... Basically, if a config variable == true I want my script to loop through an array of strings and emphasize the first letter of each string. Make sense? Sorry, I am pretty sleepy... Hmmm, I am betting I will discover the answer as soon as I send this email. :D Anyway, any help would be great! Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Emphasizing first letter of string?
Yeah, I do need sleep... Thanks guys for the posts... exactly what I was looking for. Oh, and I did come-up with something similar right after posting: if($configs['access_key'] === true) { $pages[$i][0] = substr_replace($pages[$i][0], 'em'.$pages[$i][0]{0}.'/em', 0, 1); } Thanks again to both of you for the help. :D :: presses send :: :: pushes power button :: :: closes eyes :: zzZZzzZZzz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Emphasizing first letter of string?
Stut wrote: I could be mistaken, but I seem to remember reading somewhere that using that syntax to access characters in a string has been removed from PHP6. I suggest you use $string[0] instead. (Yes, I am sleep-typing!) Hi Stut, Ah, thanks for bringing that up... Changing this: $pages[$i][0]{0} To this: $pages[$i][0][0] Testing now. Thanks. :) Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [solved] Emphasizing first letter of string?
Thanks to you folks, this works even better: if($configs['access_key'] === true) { foreach($pages as $key = $string) { $pages[$key][0] = 'em'.$string[0][0].'/em'.substr($string[0], 1); } } Many thanks, :) ... Now I can sleep. :D Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [solved] Emphasizing first letter of string?
tedd wrote: Not meaning to wake you, but you might consider removing markup from presentation via css. If so, checkout: http://www.w3schools.com/css/css_pseudo_elements.asp Ah, good point! Lol. Looking into that now... all I want is basic access-key support/styling. Thanks for the tip. :) Much appreciated. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Comparing strings... need advice. :)
Hi, I am looking for the most secure/efficient way to compare these two strings: /folder1/folder2/folder3/folder4/ /folder1/folder2/folder3/folder4/file.php Basically I am trying to setup as many security features as possible for a simplistic (home-grown/hand-coded) CMS... This appears to work: $haystack = '/folder1/folder2/folder3/folder4/someFileName.php'; $needle = '/folder1/folder2/folder3/folder4/'; if(substr_count($haystack, $needle) === 1) echo yea; Before making changes to someFileName.php I want to make sure it is within the allowed path ($needle). I would appreciate any advice. Even RTFM is cool. :D Many TIA, Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Comparing strings... need advice. :)
Stut wrote: First of all make sure you are sending both strings through realpath (http://php.net/realpath) to remove any symbolic links and relative references. Then you can compare the two strings. The way you're doing it will work but it's probably not very efficient. This is what I use... $valid = (strcmp($needle, substr($haystack, 0, strlen($needle))) == 0); Awsome! Thanks for the info. Reading-up on realpath right now. I appreciate the tips/example code. :) Have a great day/night. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Comparing strings... need advice. :)
Wow, thanks for all the great information folks (Stut, Ivo, Rob, and David.) I really appreciate all of the top-notch advice and expert information. :D Looks like I have a lot to think about... Currently, I hard-code the paths to the folders that house the files I want my CMS to edit (via a config file.) The script then iterates through the directory and adds all files of a specific type to a dropdown menu. The user can then choose one of the files to edit and load that file into a textarea... After changes are made, the content/code gets saved back to the same file/location. I do have an uploads folder, but it is in a different location on the server. I do not allow the user to create new files (I would have to do that manually)... it is a /very/ basic CMS. Anyway, looks like I have some great info to work with. Thanks again everyone for sharing your expertise. Much appreciated all. Have an excellent day. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Comparing strings... need advice. :)
Hi Robert, Robert Cummings wrote: How are these saved files then imported into the content? Are they included or do you retrieve the contents using something like file(), file_get_contents(), or fread() and then echo it? If you are using Currently I am using readfile() (plus some other security checking) to display the contents of the edited files. I setup my script to only allow specific file types (txt, html, htm). include or require on a file whose contents are based on web input content then you are opening up a can of security worms since anyone with access tot he CMS could embed PHP code in the content and do anything for which the webserver has permissions. Thanks for pointing that out. Now that you mention it, I should probably re-work my code to use a different method of page inclusion. I am pretty concerned about security breaches... what are your thoughts on readfile()? Would you suggest I use file(), file_get_contents(), or fread() instead? Thanks for the help Robert, I really appreciate your time. :) Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Comparing strings... need advice. :)
Robert Cummings wrote: Readfile works great, it's the same as file_get_contents() and then Ah, good to hear. :D issuing an echo. You may want to also stored content generated by web users outside of the web tree. There may not be any issue with how you [...] with PHP tags and accesses it directly from their browser... boom, same security hole. Ah! Yes, good idea. :) I think I will work this in to my script/system. Like I said, I am very concerned about security. I would have used a pre-built CMS like Textpattern or Wordpress, but the server I am on does not have database support. :( Anyway, many thanks for the tips Rob and all! You guys/gals rock! Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Comparing strings... need advice. :)
Ivo F.A.C. Fokkema wrote: Ah, thanks. Misunderstood the question, then. Thought just checking if it's a file in that directory was what's needed. You were right. :) I did not plan on looking-in anything other than one or two hard-coded folder locations. But, it is good to know the details. ;) Thanks again for the help... Time for me to hit the hay. I have een geeking-out for way too long today. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Texture and wrap
tedd wrote: http://xn--ovg.com/pframes Whoa, nice work Tedd! :) Very cool. Gives me some fun ideas... thanks for sharing. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4 OOP, re-using a object?
Hi, I am slowly learning how to use classes properly... quick question: # Create the object: $doSplash = new RandomSplash(); // Create the object. Shouldn't I be able to call that object like below, throughout my page: ...HTML... ?php $doSplash-randomize('css'); ? ...HTML... ?php $doSplash-randomize('xhtml top'); ? ...HTML... ?php $doSplash-randomize('xhtml bot'); ? ...HTML... Sorry, this is probably a noob question... I am pretty good at using functions, but classes are still new to me. Any help, even a RTFM link, would be really appreciated. :) Have a great day! Cheers, Micky -- Wishlist: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 4 OOP, re-using a object?
Micky Hulse wrote: Any help, even a RTFM link, would be really appreciated. :) Hi all, A fellow list member gave answered my question off-list and pointed me here: http://www.php.net/oop Going to (re)read... It has been a while since I last worked with classes. :) I asked because I was getting an error with my code... I thought it was how I was calling it. Anyway, have a great day, Cheers, Micky -- Wishlist: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 4 OOP, re-using a object?
Christopher Weldon wrote: What's the error, and how do you have the class and functions defined? Hi Christopher, thanks for asking. :) Actually, it was one of those silly, right in front of my face, logic errors... class RandomSplash { var $alphabet = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'); function randomize($what) { switch($what) { case 'css': $data = $this-$alphabet; ... ... ... } } See the error? $data = $this-$alphabet; should've been: $data = $this-alphabet; At first I thought it was how I was calling the class... all works now though. :) Thanks for asking. Let me know if you see a better way to do the above though, I am pretty new to using classes, but I am pretty handy when it comes to functions. :D Thanks, Cheers, Micky -- Wishlist: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Ajax and PHP: XMLHTTP
?=$_SERVER['PHP_SELF']? Can I replace the above with some sort of XMLHTTP request? Googling now... thought I would ask here first. Any good links to tuts that might cover that sort of thing? Kinda thinking about plugging some Ajax into a random image php script. TIA. :) Cheers, Micky -- Wishlist: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: Ajax and PHP: XMLHTTP
Hi all, thanks for responses, I appreciate it. :) Miguel Guirao wrote: What do you exactly want to do? Oh, I wanted to call a php function on my page that changes some CSS. I was hoping I could change my CSS on the fly without having to reload page... but after doing more research, I think that a page refresh is best way to go. All the Ajax/PHP examples i have seen deal with elements on page (in this case i have PHP script in head that changes my css)... Still new to Ajax and XMLHTTP... I know how to handle JS, but I am way more comfortable with PHP. Not too many examps on the web that show some good techniques for calling PHP functions to manipulate CSS that I could find. I am also not a big fan of plugging-in a huge Ajax scripting library(ies) for something as simple as calling a PHP script to manipulate CSS. I would prefer simple on the JS end of things and make it more about PHP without a page refresh. :D Lol, hope that makes sense... In a bit of a rush - headed out door to work. :) You guys are right though, I should probably ask on the JS listserv. Many thanks for your time. Cheers, Micky -- Wishlist: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 4 OOP, re-using a object?
Hi Curt, thanks for the feedback/input and your time. :) Curt Zirzow wrote: It would have been more relevant to supply the problem along with the solution. Definitely. Sorry about that. Sometimes I post questions to forums/lists without thinking things through more thoroughly... Hehe, I half blame that on sleep deprivation and half on ADD. Lol, or something. :) I will be sure to take your advice into account for my future posts to this and other lists. Thanks again. Have a great day. Cheers, Micky -- Wishlist: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Yahoo! HackDay
Rasmus Lerdorf wrote: More info on it at the following links: http://yuiblog.com/blog/2006/09/22/yahoo-devday-schedule/ http://nate.koechley.com/blog/2006/09/22/hookytime-yahoo-developer-day-hack-day-on-sept-29th-and-30th/ http://del.icio.us/chadd/yhackday This too: http://www.techcrunch.com/2006/09/22/more-details-on-yahoo-hack-day/ Shit, sounds fun. Wish I could go! :( -- Wishlist: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [OFF] A note on replying to this list
Chris wrote: While it's annoying I think it's going to be one of those things you have to live with. Or switch email apps. Thunderbird is pretty good about threading list emails. Can you configure your email app to read something other than the Subject for threading? -- Wishlist: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 3d modeling-php
Not sure of your project requirements, but you might want to think about Director/Havok/Shockwave... http://www.adobe.com/support/director/3d_basics.html -- Wishlist: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] heredoc
I think I have come across situations where heredoc is the most useful/best solution... although, I can not remember any specific examples... I would hate to see it deprecated... I find it very useful from time to time. :) -- Wishlist: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] preg_replace_callback(), how to pass function argument/param?
Hi, This is probably simple to answer for most of ya'll, but... preg_replace_callback($f, 'mah_processTags', $text); Besides the matches, how would I pass function args/param to mah_processTags()? For example, I would like to do something like this: preg_replace_callback($f, 'mah_processTags($arg1)', $text); function mah_processTags($matches, $arg1) { ... } Is this even possible? I just want to pass-in $arg1 along with the matches. :) Possible? Many thanks in advance!!! Cheers, Micky -- Wishlist: http://tinyurl.com/22xonb Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_replace_callback(), how to pass function argument/param?
Casey wrote: preg_replace_callback($f, 'mah_processTags(\'$0\', $arg1)', $text); Does this work? Awww, does not seem to work. :( But maybe I need to dink with the code a bit more... I would like to avoid setting a global here. :D Thanks for the help Casey! I will let you know if I get it working. I may just have to think of a different approach here. Cheers, Micky -- Wishlist: http://tinyurl.com/22xonb Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_replace_callback(), how to pass function argument/param?
Casey wrote: Hmmm. I've searched around, and it seems that only a global would work :/ Thanks for the help Casey! I really appreciate it. :) Yah, I think I will use a global for now... Until I can think of an alternative coding approach. Have a good one! Cheers, Micky -- Wishlist: http://tinyurl.com/22xonb Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_replace_callback(), how to pass function argument/param?
Casey wrote: What does mah_process_tags do anyway? XD Ah, hehe... Oh, basically I am trying to write a plugin for the Textpattern CMS: http://textpattern.com/ processTags() is a core TXP function... Basically, it parses any TXP template tags (txp:function_name atts=foo /). Long story short, I am am modifying the processTags() function so that it looks for class methods when parsing template tags, vs. looking for regular functions. Thanks again Casey! I really appreciate your help. :) Cheers, Micky -- Wishlist: http://tinyurl.com/22xonb Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mod_rewrite q's: syntax?
Hi all... sorry if this is OT for PHP list... Maybe a reply off-list? I just wanted to share my .htaccess file in the hopes that I can hone/fool-proof-a-tize it as much as possible via your feedback and suggestions. Here is what I got so far... I start by turning-on error reporting, then I am converting all non www traffic to www traffic, and I finish things up by removing index.php from the site url... [code] -- # Turn-on PHP error messaging: php_value display_errors 1 php_value error_reporting 2047 # Power-up the rewrite engine: RewriteEngine on # Redirect all non-www traffic: RewriteCond %{HTTP_HOST} ^mydomain\.com$ RewriteRule ^.*$ http://www.mydomain.com%{REQUEST_URI} [R=permanent,L] # Remove index.php from url: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+) index.php/$1 [L] -- [/code] What I want to do: I would like to use mod_rewrite to forward all requests for http://www.mydomain.com (or http://mydomain.com) to www.mydomain.com/folder/file.php Questions: 1. How is my code looking so far? Any potential pitfalls that you can see? 2. Can I combine the conditions and rules into one, more compact, script? 3. Any suggestions on how I would go about adding-in a rule/condition to redirect users to com/folder/file.php as stated above? Many TIA, Sorry if OT. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mod_rewrite q's: syntax?
-Original Message- From: Chris [mailto:[EMAIL PROTECTED] Do you need to do it with a mod_rewrite? if not, you can do it easily in php: header('location: folder/file.php'); exit(); in index.php. Unfortunately, yes... I am using a CMS, and my current setup is forcing me into using the more complicated mod_rewrite. Well, not that it is a bad thing... seems like mod_rewrite is more search-engine/bot friendly. Thanks for the tip though, I really appreciate your time. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mod_rewrite q's: syntax?
Well, I added this to the end of my .htaccess: # Set the index page: RedirectMatch ^/$ http://mydomain.com/folder/folder/index.php Seems to work well, but I am still concerned about pitfalls/optimization/consolidation... er, perfection? ;) TIA, Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mod_rewrite q's: syntax?
-Original Message- From: Joe Wollard [mailto:[EMAIL PROTECTED] I'm not an expert on the topic by any stretch of the imagination, but I seem to recall reading that it's best to move everything into httpd.conf for performance reasons. You may want to investigate that, but otherwise I don't see anything wrong with what you're doing. Sounds good to me, thanks so much for you help. Reading about httpd.conf now. Have a great day/week/month/year/... Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mod_rewrite q's: syntax?
Hi Richard, Doing it on only the URLs *you* think of typing doesn't count. Those pesky real users can come up with some really interesting URLs to type... :-) Lol, I was thinking that might be a problem. Thanks for all the great tips, I really appreicate your help. Great info... I am looking forward to learning more about the information you presented. Btw, anyone have any good tips for setting-up outlook to format list emails better? I just got a PC and am coming from the Mac world (Mail app was pretty simple compared to all the Microsoft bells and whistles)... Have a good one, Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mod_rewrite q's: syntax?
-Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Abandon Outlook and use Eudora, or Pegasus, or webmail, or ANYTHING other than Outlook? :-) LOL! Yeah, I do not know what I was thinking in the first place... Eudora sounds good to me. :D Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Good Answers
Good thread. Great points. I always thought this Sitepoint thread was very helpful: http://snipurl.com/qafg Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Good Answers
Ligaya Turmelle wrote: here is the link for the improved newbie doc - http://zirzow.dyndns.org/php-general/NEWBIE Might be nice to see a link to the NEWBIE information in the footer of the PHP list emails... know what I mean? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] preg_replace learning resources? Regex tuts? Tips? (and yes, I have been rtfm)
Hi all, I have been rtfm on preg_replace, and I am a bit turned-off by how complex reg-exing appears to be anyway, I would like to spend some time learning how I would convert a file full of links that look like: A HREF=/viewentry.asp?ID=343323PT=PERSONALITIES TARGET=_topFake Link 1/A A HREF=/viewentry.asp?ID=328474PT=PERSONALITIESFake Link 2/A A HREF=/viewentry.asp?ID=340492PT=PERSONALITIESFake Link 3/A A HREF=/viewentry.asp?ID=339795PT=PERSONALITIESFake Link 4/A And make them look like this: a href=http://www.site.com/viewentry.asp?ID=343323amp;PT=PERSONALITIES; target=_blankFake Link 1/a a href=http://www.site.com/viewentry.asp?ID=328474amp;PT=PERSONALITIES; target=_blankFake Link 2/a a href=http://www.site.com/viewentry.asp?ID=340492amp;PT=PERSONALITIES; target=_blankFake Link 3/a a href=http://www.site.com/viewentry.asp?ID=339795amp;PT=PERSONALITIES; target=_blankFake Link 4/a Basically, I would like to make the links/code xhtml transitional, make the links absolute, add quotes where needed, convert to amp;, and make them open in a blank window... it would be cool to trash everything except for the url and link description (in other words, if any of the links have, for example, TARGET=_top, it would just ignore and grab only what I want from source file Any good links to tutorials and/or resources that teach one how to scrub urls with PHP and regex? Many TIA! Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_replace learning resources? Regex tuts? Tips? (and yes, I have been rtfm)
Micky Hulse wrote: Any good links to tutorials and/or resources that teach one how to scrub urls with PHP and regex? Ah, missed this in the comment section of the manual: http://www.tote-taste.de/X-Project/regex/index.php Looks like a good place to start. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_replace learning resources? Regex tuts? Tips? (and yes, I have been rtfm)
Ryan A wrote: http://weblogtoolscollection.com/regex/regex.php HTHs...Cheers, Yeah, looks like a great resource, thanks! :) Cheers, m -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_replace learning resources? Regex tuts? Tips? (and yes, I have been rtfm)
Koen Martens wrote: You might be better off then by parsing the html file with DOM: http://nl2.php.net/manual/en/ref.dom.php Whoa, that is cool, I had no idea this was something PHP could do! Thanks for the links. :D Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_replace learning resources? Regex tuts? Tips? (and yes, I have been rtfm)
Kevin Waterson wrote: Try this quicky http://phpro.org/tutorials/Introduction-to-PHP-Regular-Expressions.html Sweet, good links all. Thanks for sharing! :) Have a great day. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Simple blog software... Simple but clean code... suggestions?
Hi, I am looking for a very simple blog software... I would prefer something that functions well with CSS and is standards compliant. I am getting tired of setting-up the bigger full-featured blogging packages for small/quick/simple sites. It would be nice to know what others people prefer. TIA. :) Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple blog software... Simple but clean code... suggestions?
Dave Goodchild wrote: Use WordPress - clean, css-based, standards-compliant. You can set up a basic site very quickly. If you want me to walk you through an example contact me off list ( [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]). I set up two installations, www.abuddhistpodcast.com http://www.abuddhistpodcast.com and www.mediamasters.co.uk/dg/insp http://www.mediamasters.co.uk/dg/insp, in less than a day. Right on! :) Thanks for the suggestion, and I really appreciate your offer of help - Hopefully I will be able to get things up-and-running without any need to bother anyone with noobie questions. Hehe... Sounds like the right direction to head. Many thanks Dave. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Simple blog software... Simple but clean code... suggestions?
Barry wrote: Well if you have that often this case, i would prefer you code one for yourself. Oh, for sure. I completely agree... For the longest time (i.e. the college years) I was against using other peoples blog software or scripts... I would have never learned anything about PHP if it was not for my choice to take the long route(s) and program what I could myself. Hehe, does that make sense? Lol. Now-a-days (i.e. the starving freelance multimedia designer years), when I am pressed for time, I have no other choice than to bite the bullet and install something like (for example) Expression Engine. Not sure where I am going with this. Lol, thanks for the response though, I really appreciate the motivation. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple blog software... Simple but clean code... suggestions?
Dave Goodchild wrote: www.abuddhistpodcast.com http://www.abuddhistpodcast.com and www.mediamasters.co.uk/dg/insp http://www.mediamasters.co.uk/dg/insp Cool sites btw! Good work. :) Cheers, M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] templating
Miles Thompson wrote: Don't forget, PHP itself is a templating language. Just do a standard page, with includes for headers and footers, menus, and content. If he wants to change colour, then load a different stylesheet for a given page or content section. This way he can use the tool that's right in front of him, he's not adding another layer, he does not have to learn another language - the template system written in PHP, and he hones his PHP skills. I agree. I think this would be the best solution for a simple site. Good point about honing PHP skillz. As far as a CMS goes, textpattern is pretty dope. Simple to setup, free, and it has a kick-butt template system. Gl, Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cool your jets [WAS: Re: [PHP] working on a template system...]
Lol! Omg, you guys make reading my email so much more fun! Cheers! Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Sad PHP Poem
Ryan A wrote: Its a mis-spelling of two words taken out of context, its actually sock her and meant for Hillary Clinton Hehehe, n1! :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Shopping Carts
Michael B Allen wrote: Any ideas? I plan on using this one for my next shopping-cart project: http://www.cubecart.com/site/home/ CubeCart is an eCommerce script written with PHP MySQL. With CubeCart you can setup a powerful online store as long as you have hosting supporting PHP and one MySQL database Looks pretty good to me... A plus for me is the base template - layout looks mostly CSS-based (tables used only where needed.) Also is free if you keep the logo/link back to CubeCart website (~60$ otherwise.) Another, that I have used, is: http://www.zen-cart.com/ Zen Cart™ truly is the art of e-commerce; a free, user-friendly, open source shopping cart system. The software is being developed by group of like-minded shop owners, programmers, designers, and consultants that think e-commerce could be and should be done differently. I have not used ZC for a few versions, so I am sure it has improved... I did not think it was the greatest at templating and customizing the backend was a bit of a chore... but the community support is really good. Hth, Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Randomly rotate image on page load? File under: Image Manipulation
Hi, I have not done much Googling yet... thought I would ask here before I spend a bunch of time searching for some guidance... What would be the best function set for on-the-fly image manipulation (specifically image rotation?) Is it easily done? Possible? Worth the trouble? Any links and/or guidance would be appreciated (hopefully the answer is not a blatantly obvious RTFM.) :) Many thanks in advance, Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Randomly rotate image on page load? File under: Image Manipulation
Chris wrote: It is. http://www.php.net/image There's even a function to do the rotations for you http://www.php.net/manual/en/function.imagerotate.php OMFG... I am such a schmuck! :: Bangs head on keyboard :: JK:Luhey; fdksahuioreufkjL: KHgfuidksja; fkdlsaah; lkhfkldjhsaljk fdsaU^TYGHBJFhjfdj ... Um, time for me to turn off puter and get some sleep. Thanks for pointing that one out... :: blushes :: Night! :) Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Randomly rotate image on page load? File under: Image Manipulation
Hi, Hehe, looks like I did not hit the hay just yet... too much geeking to do! Chris wrote: It's always interesting to see so many interpretations of the one thing :) Yeah, no doubt! I found this on AlistApart: http://www.alistapart.com/articles/randomizer/ Took me a few mins to figure out that thy author was talking about *random image display* and not *image manipulation* Personally I think Rotation should mean rotating a single image on an axis. Lol... I need some sleep. Thanks all for the responses, I really appreciate all of your help(s). :: tear comes to eye :: I love you guys/gals! Cheers, M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Randomly rotate image on page load? File under: Image Manipulation
tedd wrote: Not as I see it. The first definition in the dictionary is seldom the only correct definition. Good point... Not to be contrary, but: What about when you are speaking in terms of computers, and specifically images? Seems like if the subject is images on the computer, rotation falls more closely to rotating on an axis and not changing of images. For example, I was driving down the road the other day, and I saw temporary road construction sign that said Road Const ahead. Now, my first thought was Constant as in C++. But, wait, this is not programing, this is driving, and they must mean Construction. As a graphic designer maybe I have some bias... I when I use Photoshop I do not think of Rotation as moving images from the front of the stack to the back of the stack (if I have a bunch open)... Rotation clearly means (in the PS world) rotating an image on an axis. Now, in terms of a slide-show, rotation makes some sense, but IMHO I think word is improperly used. :) Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Randomly rotate image on page load? File under: Image Manipulation
Jay Blanchard wrote: While we are splitting hairs, slideshow would only be applicable if the images continued to change without page reloading. LOL, good point! Hehee. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Randomly rotate image on page load? File under: Image Manipulation
Jay Blanchard wrote: The other day I saw a temporary road construction sign that said Slow Men Working and it gave me pause Reminds me of: Do you come from a land down under? Where women glow and men plunder? Can't you hear, can't you hear the thunder? You better run, you better take cover. The word 'rotation' is being improperly used, because when one swaps images he or she does not turn them on their sides, unless one wishes to. Image swapping is a much better term, but not really For sure. Photo Slideshow or just Slideshow makes the most sense to me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP running as CGI? How to set x.php as index page?
PHP gurus I need your help! I worked on a small site for a client who uses a host that I think has PHP running as or under CGI (not much experience with this type of setup personally.) Long story short, this host really sucks... they are very restrictive... I guess understandably so, but it is frustrating from a developer perspective -- for example, no .htaccess to edit... is this because of the CGI setup (assuming yes)? Well, my question: Anyone know of a way to set a non index.php page as the index? Normally I would use the .htaccess file to do this, but unfortunately the server blows-up when one is uploaded. Can I drop a CGI script into my cgi-bin folder to do similar .htaccess things? For example, I would love to make sure all my non-www (http://domain.com) traffic is routed to http://www.domain.com -- I could easily do this with my .htaccess file... Can that, or setting a default index page, be done with a CGI script(s)? Should I RTFM? :D Many thanks in advance... sorry if noob questions. :) Cheers, Micky -- Wishlist: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP running as CGI? How to set x.php as index page?
Micky Hulse wrote: PHP gurus I need your help! Hmm, looking on the web it appears as though CGI will not help me with my .htaccess probs... Sorry to bother you all with my silly questions. :) I will contact the host on Monday to see if they offer any work-arounds. Have a great day all. Cheers, Micky -- Wishlist: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP running as CGI? How to set x.php as index page?
Joker7 wrote: I would suggest you change host as this one seem very restrictive or ask your host to edit the .htaccess file for you ;( Hi Chris, thanks for the reply. :) Yeah, I actually talked to client today, and they are fed-up with host too... sounds like they want to make a switch asap. On top of being too developmentally restrictive, they are also very expensive. Thanks for help -- have a great day/night. Cheers, Micky -- Wishlist: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP running as CGI? How to set x.php as index page?
Hi Mike, thanks for the help, I really appreciate your time. :) Michael Weaver wrote: It's not a PHP trick, but it should work for you, even with restrictions. Definitely a good option. Actually, that is close to what I am doing now: ?php #header(Refresh: 0; URL=http://www.domain.com/start.php?page=home;); /* Old technique. */ require('http://www.domain.com/start.php?page=home'); /* Current technique. */ ? I chose to use require() for SEO purposes... I think Google tends to frown upon header redirects and/or refreshes... but require() has become slightly problematic for other reasons... I think the bottom line is that this host sucks... need to make a switch. :D Thanks for the tip, I greatly appreciate your help. Cheers, Micky -- Wishlist: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MD5 bot Question
Tijnema ! wrote: You can't stop me :) http://86.86.80.41/dev/debug/tedd.php It's cracked again :) Maybe use flash for this... harder to crack? (Of course, Flash will open door to other problems.) Sorry, coming in on this late. Good work Tedd! Very interesting. M -- Wishlists: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MD5 bot Question
tedd wrote: ...snip... that's the reason for the alt attribute. Thanks for clarification! :) You are doing some great work with captchas... I also really like your audio captcha experiments. Keep up the great work! Cheers, Micky -- Wishlists: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dreamhost! PHP as CGI!???
I think I just read that PHP is ran as CGI on Dreamhost... this does not sound good. Can anyone confirm? What do you all think? Good? Bad? I have dealt with one other server that did this (PHP as CGI) and I hated it! I just bought a years worth of hosting... I have a trial period so I think I can still cancel. Should I stick with it or find a host that runs PHP under Apache? Please advise. (FYI: Using Expression Engine for CMS/blog -- I read that it is recommended to use EE with PHP not as CGI.) Many thanks in advance! Cheers, Micky -- Wishlists: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dreamhost! PHP as CGI!???
Micky Hulse wrote: I think I just read that PHP is ran as CGI on Dreamhost... this does not sound good. Can anyone confirm? Found this: http://php.dreamhosters.com/ I guess I am just wondering what your thoughts are when it comes to running PHP as CGI? Good/Bad? Maybe I should not worry about it? Off-list replies are cool with me if this is a little OT. Thanks! M -- Wishlists: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dreamhost! PHP as CGI!???
Hi Tijnema! Thanks for the quick reply, I really appreciate the help. :) Tijnema ! wrote: Google tells me that it is an optional feature to run PHP as CGI, default it is running under apache. Atleast that's what i found for dreamhost. Ah, from what I am reading, it sounds like that used to be the option, and may still be a feature for older users... but (from what I understand, which is not much) PHP 5 is CGI only: DreamHost currently allows several PHP configurations. In the user Control Panel you can choose between PHP4 and PHP5 running as a CGI application (with optional FastCGI support). While it's no longer officially supported you currently still have the possibility to have PHP running as an Apache module (mod_php). Finally you have the option to compile your own custom PHP with the exact version of PHP you wish and with any module you require. http://php.dreamhosters.com/ Hmmm, I guess it sounds like I can setup things to use the Apache module, but they make it sound so evil: If one of those is a show-stopper for you, you can easily switch to running PHP as an Apache module and not CGI, but be prepared for a bunch of potential security and ease-of-use issues! http://blog.dreamhosters.com/kbase/index.cgi?area=2933 Looks like I have a ton of reading to do... Unfortunately I am more of a designer than I am a system administrator... so not sure if messing with PHP on my DH account is worth the headache. :( I have just had bad experiences in past with PHP as CGI... Not fun. Lol, well... Thanks Tijnema! I really appreciate your help on this one. ;) Have a great day/night! Cheers, M -- Wishlists: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dreamhost! PHP as CGI!???
Hi Richard! Thanks for the help, I really appreciate your time and advice. :) Richard Davey wrote: If you've got access to your account with them, you can confirm it yourself. Check the output of a phpinfo(). Ah, lol. Good call: Server API: CGI/FastCGI Virtual Directory Support: disabled Configuration File (php.ini) Path: /etc/php5/cgi/php.ini Looks like CGI to me, no? Sorry, server stuff is not my forte. Not *that* terrible at all, but if you've only been with Dreamhost for a few days you've got far worse things to experience yet IMHO (shoddy uptime, shoddy servers, shoddy network, etc) Lol, funny you should mention that... Within a few days of getting an account, my server went down with a bunch of other folks... I guess it was a DOS attack or something. www.pair.com runs PHP 4 as an Apache Module, and are a superb host (I've used them since 1996) - but even better in the next few weeks they rollout PHP 5.2.1 as standard on all servers. Can't wait :) Oooh, excellent. Actually, I had other folks suggest Pair too. Only reason why my client and I picked DH was the price. I guess I get what I pay for. Hmm, pair may be worth the extra $$. Do you think the Webmaster plan is decent for a small but soon-to-be growing site? http://www.pair.com/services/web_hosting/webmaster.html THanks again Richard! I greatly appreciate the help. ;) Cheers, M -- Wishlists: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dreamhost! PHP as CGI!???
Tijnema ! wrote: I'm using www.dapx.com for my www sites. Setup is a pain in the ass there, it can take a few days before you get a reply. But once you got it, it's a really nice host. Nice speed, really 99.9% uptime, and not much limited stuff :) safe_mode is even turned off :) Ah, thanks for the tip-off. Looking at what they offer now. I wish I had asked here first before buying hosting for a year from DH. Thanks again Tijnema. ;) Cheers, M -- Wishlists: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dreamhost! PHP as CGI!???
Richard Davey wrote: It will be the first of many :) Yikes! Definitely gonna make the switch. Cheap it may be, but I need reliable too! Oh and hey... you'll soon experience the sporadic will it or won't it nature of their Control Panel loading too. I always loved that one. Doh! Yeah. Not really sure if I like the proprietary CP... I guess I am used to using Cpanel. :D Abso-frigging-lutely. Yep yep. I hear that. :( It will cope with your needs *easily* and the best thing about them - they can scale-up your account at any time, to whatever you need, as you grow. Some HUGE sites are hosted comfortably on Pair. Even php.net ;) Ahhh, cool! Good to hear. ;) Thanks again for the help Richard, I appreciate your time and expertise. Have a great day/night! Cheers, M -- Wishlists: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dreamhost! PHP as CGI!???
Miles Thompson wrote: Have a look at www.hub.org. They host PostgreSQL world wide, you get a virtual machine, not a virtual host, and they are v. helpful in setting up software. Ahhh, nice! Thanks for the tip. Looking at what they offer now. It is going to be a close call between several. All seem to offer good stuff! Lol. I hate picking hosting. Thanks again Miles! Have a great day/night. Cheers, M -- Wishlists: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dreamhost! PHP as CGI!???
Richard Lynch wrote: You could confirm what you have on YOUR setup with: ?php phpinfo();? faster and with more assurance of correctness than any mailing list answer. Yeah! Hehe. I feel like such a noob. I can not believe I did not think of that first. Lol. Here is what phpinfo() had to say: Server API: CGI/FastCGI Virtual Directory Support: disabled Configuration File (php.ini) Path: /etc/php5/cgi/php.ini And I just got this response from DH today: ... Yes...I hate to be the bearer of bad news, but we are running php as CGI. ... Very nice of them to respond so fast... Very friendly reply. Seems like a great host if you are not as concerned about up-time/down-time and are on a tight budget. It works fine for me, but I'm only using DreamHost as the back-end of an N-tier audio server for a web-site that doesn't actually live on dreamhost. Ahh. I see. Actually, dreamhost is only the primary, and there's a fail-safe roll-over to another box if dreamhost goes down. (again) Ahhh, hehe. Good call on the backup server. I have never built a big enough site to where I needed a backup server just in case. Probably a very good idea though. :) Thanks fo ryou reply Richard, I greatly appreciate the help! Cheers, M -- Wishlists: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dreamhost! PHP as CGI!???
Hi Sebe, thanks for help. Sebe wrote: yeah or `php -v` via cmdline. Great! Thanks for tip on that one. ;) by the way, isn't PHP w/FastCGI faster than using apache module? A, really? DH does offer FastCGI support. Hrmmm. So many things to consider! Lol. Thanks again Sebe! Cheers, M -- Wishlists: http://snipurl.com/vrs9 Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Template class: Simple question
Hello, I have a couple classes that generate navigation and a few other dynamic xHTML template-based things... What is standard practice for calling your template classes? In other words: Is it good practice to create the class object for every page view, or is there a better way to cache the object? I am using PHP 4.x. Any good tips and/or tutorials out there that cover this type of thing? Basically I am trying to get away from using includes and/or simple function calls. Sorry if silly question... I am kinda new to classes and how best to use them. TIA! Cheers, Micky -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template class: Simple question
Micky Hulse wrote: What is standard practice for calling your template classes? In other words: Is it good practice to create the class object for every page view, or is there a better way to cache the object? I am using PHP 4.x. Ack! Just found this great thread on Sitepoint: http://www.sitepoint.com/forums/showthread.php?t=468429 Hehe, I wrote my email to the PHP list before checking my Sitepoint xml feed. Seems like the above thread has given me my answer. Thanks all! Sorry to bug the list. Cheers, Micky -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Script feedback: insert string into another string
Hi, I pieced-together a script that will insert a string into another string at a set interval of words... See here: http://www.ambiguism.com/sandbox/truncate/truncate.php [Click the view source link to view source.] :D Basically, I need a setup a page where my client can paste an article, automate the insertion of a template tag (in this case: {page_break}) and then copy/paste into the blog/cms. My goal for this script was to make it easy for the CMS to create word-balanced pages. Long story short, I got what I think will be an acceptable script... but I would love to get feedback. What do you think? What can I improve? What am I doing wrong? The script does not need to be super-robust, but would love to hear what the PHP gurus have to say. ;) Many thanks in advance! Cheers, Micky -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Script feedback: insert string into another string
Tijnema! Thanks for the quick reply! I really really really appreciate the help. :D Tijnema ! wrote: Nice idea, but it seems that it isn't working correctly. I did this example: ?php for($x = 0; $x 100; $x++) { $string .= abc; } echo break_up($string, 10, ||); ? With your break_up function. It results this: ...snip... While i expected this: .../snip... Ahh! Great way to test this! I thought I noticed a problem, but did not put two-and-two together due to the huge string I was using... The way you simplified things really made that error clear. Thanks for the help on this! :) And i found where the problem is, it is this line: $num += $num; // Set next number flag to look for. This works only for one time, but after that, it doubles whole time, so in above example, $num would go like this: 10 20 40 80 Doh! Great catch! I should have printed that var out... Hehe, I am such a noob! So to fix, replace this part of the code: ...snip... with this: ...snip... That's it. Woot! Looks good to me. I moved the script to a new location with a more fitting name: http://www.ambiguism.com/sandbox/insert/insert.php Your test code is at bottom of that page. ;) Nice, I am stoked! Thanks again for the help, I owe you one. :D Have a great day/night, Cheers, Micky -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Script feedback: insert string into another string
Just FYI, I did some slight upgrades/updates to the code... Seems to be working pretty good now. :) http://www.ambiguism.com/sandbox/insert/insert.php Thanks again Tijnema! Cheers, Micky -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Script feedback: insert string into another string
Tijnema! You rock! Another great catch. :) Tijnema ! wrote: ...snip... the eregi function. So like this: if(eregi('[0-9A-Za-zÀ-ÖØ-öø-ÿ]', $array[$i])) { becomes: if(eregi('[0-9A-Za-zÀ-ÖØ-öø-ÿ]', strip_tags($array[$i]))) { That would fix it :) Just updated the code. (Hehe, tis hard to catch those zzZZzz's when my mind is thinking in code.) http://www.ambiguism.com/sandbox/insert/insert.phps Has anyone told you that you are a very good beta tester! :D I hope I did it right... Looks like I may still be having the same problems (word count = 2, and separator = | |: | |Vestibulum urna. h6Test | |header/h6 Nam egestas | |rhoncus nisl. Hmmm, going to stare at this code for a bit... Many thanks again for your help -- it really helps having that second pair of eyes. I will post again if I significantly update the code. ;) Thanks Tijnema! I really appreciate your time, help, and expertise. Cheers, Micky -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Script feedback: insert string into another string
Tijnema ! wrote: Didn't find anymore bugs yet, maybe later... if i find one i'll let you know :) Thanks again Tijnema! I just read the not from Richard Looks like I might have wasted your time on this one. :( I just woke up... going to test wordwrap() You know, I saw that in the manual a day or so ago, and it sounded like what I needed, but all the examples talked about how it breaks long words -- not what I needed... But now I see that there is a way to easily turn that feature on/off! Shux. I have a feeling that, with the help of Tijnema, I just re-invented wheel. I will be back shortly with a test page. :D Thanks, Micky -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Script feedback: insert string into another string
Micky Hulse wrote: Shux. I have a feeling that, with the help of Tijnema, I just re-invented wheel. Wait! wordwrap() default behaviour is to count characters, not words. wordwrap — Wraps a string to a given number of characters using a string break character I think that is why I initially avoided this function... but reading through the manual comments now. BBS. THanks, M -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Script feedback: insert string into another string
Brad Sumrall wrote: But! I am now noticing that the main page provides cookies called _utma _utmb _utmc _utmz Hmmm Wha? Never thought of that. It looks like wordwrap() may not be what I am looking for (though, still researching)... Either way, I am curious to hear what you would do to make this script more secure? Allowing cookies sounds like a security hole... Any suggestions for beefing-up my security would be spectacular! :) Thanks, M -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Script feedback: insert string into another string
Micky Hulse wrote: Allowing cookies sounds like a security hole... Any suggestions for beefing-up my security would be spectacular! :) Ahhh, would that have anything to do with XSS? http://www.php.net/manual/en/function.htmlentities.php I thought striptags() would take care of such problems... but it sounds like I need to filter my strings with htmlentities... no? Thanks again for the help Brad and all, I really appreciate everyones help and guidance... This is for a pro-bono job, so I am trying to use every opportunity to try an learn new things (pro-bono means more freedom.) Have a great day all! Cheers, Micky -- Wishlists: http://snipurl.com/1gqpj Switch: http://browsehappy.com/ BCC?: http://snipurl.com/w6f8 My: http://del.icio.us/mhulse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php