[PHP] FW: No Subject
http://www.coachholidays.co.uk/ramlm/hfoqauyyvomdvio.kaxkucbebccxpzq
[PHP] Re: Help with regex (search/replace) please
@Al, > have you looked at the Pear html_QuickForm2 set? Actually nope, whats it about? just did a google search and found it on the php site but no example code around so dont really have a clue. @Ash, Pastebin! Of course, why didnt i think of that... will do! Actually, just did so that i wouldht have to double post to the list. heres the pastebin url http://pastebin.com/m18b6fb86 I cleaned up a lot of surrounding code so its a bit more readable leaving only the relevant code. Theres one thing quite strange that i have to mention, this code: if($input->getAttribute("type") ==strtolower("radio") && $input->getAttribute("name") ==strtolower("living_in_prague")) works find but if I instead use if($input->getAttribute("type") ==strtolower("radio") && $input->getAttribute("name") ==strtolower("living_in_prague") && $input->getAttribute("value") ==strtolower("0")) OR if($input->getAttribute("type") ==strtolower("radio") && $input->getAttribute("name") ==strtolower("living_in_prague") && $input->getAttribute("value") ==strtolower("0")) OR if($input->getAttribute("type") ==strtolower("radio") && $input->getAttribute("name") ==strtolower("living_in_prague") && $input->getAttribute("value") ==0)) It does not work... even though i KNOW that thats the correct value because i checked the static html page like 10 times... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with regex (search/replace) please
Hey Ash,Bastien! Rather than a regex, you're probably better off using something like DomDocument, where you can iterate over all of the input elements in the document, and check the attributes of each one to check if they match your criteria. @Ash, You're kinda reading my mind... i did do this in domDocument but it didnt work out so well... so now am trying to do this in a diff way. Is it ok if i send you the code via an attachment? it is REA messy code right now though. @Bastien, you're talking client side... i need to do this server side as then i am writing the results to a file which is going to be used as a template in other scripts. Thanks! Ryan
[PHP] Help with regex (search/replace) please
Hey guys, As many of you might know, i totally suck at regex..so would really appreciate some help here. Basically i have a html page with a lot of textboxes,radios,checkboxes etc i need your help in the form of a regex so that when i give it the name and value it gives me the entire code of that checkbox. for example here are 2 checkboxes: so if i want the second checkbox code i was thinking of something like this: $the_name="something2"; $the_value="2"; $fetched=getCheckboxFromHTML($the_name,$the_value); and then if successful the variable $fetched would contain the idea is that i would use the contents of $fetch to add some code before the end just before the greater than symbol, and do a str_replace(). What do you think? Critique of my logic above too is welcome! Thanks! Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with regex (search/replace) please
Hey guys, As many of you might know, i totally suck at regex..so would really appreciate some help here. Basically i have a html page with a lot of textboxes,radios,checkboxes etc i need your help in the form of a regex so that when i give it the name and value it gives me the entire code of that checkbox. for example here are 2 checkboxes: so if i want the second checkbox code i was thinking of something like this: $the_name="something2"; $the_value="2"; $fetched=getCheckboxFromHTML($the_name,$the_value); and then if successful the variable $fetched would contain the idea is that i would use the contents of $fetch to add some code before the end just before the greater than symbol, and do a str_replace(). What do you think? Critique of my logic above too is welcome! Thanks! Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Thinking of moving to .NET because of standalone... any suggestions?
Thanks for the links and advise guys! Of all I found this most interesting as it would run native: >check out http://www.php-compiler.net/doku.php unfortunately I think this project is dead or at best stagnant because the server is slower than a 99 year old on weed and forums link dead. Documentation is badly limited as well. But if someone was used this or is using this, would love to hear from you. Till then am back to checking out the other recommendations and googling. Keep any other advise/links coming ;) they are most appreciated. Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Thinking of moving to .NET because of standalone... any suggestions?
Thanks for the reply Michael, Robert and Jochem, makes sense, a native windows app is going to look more in place than any of the demos and graphics i have seen of GTK. Was also looking at GTK-Builder, unfortunately you really have to hunt for each scrap of new info - which is why I'm guessing open source falls back a bit compared to M$'s offerings. MS shoehorning something into dotnet sounds interesting, will ask my pal google what he can bring up ;) I did read about FLEX but i have pretty much complete php scripts that i want to use in a desktop environment, FLEX wouldnt do for my (present) needs. Will look up WxWidgets and HipHop (somehow i get the feeling i'm gonna be drowned in millions of results that have rap lyrics instead of programming information - should be a test of my patience :-))) Anyone have anything more to add/advise, please do so. Cheers guys! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Thinking of moving to .NET because of standalone... any suggestions?
Hey Guys, Coming from a C and Java background I just loved PHP and have been programming with it for years thanks in a large part to the kind people on this list... present and past (Immediately the name John Holmes comes to mind.. i hope the dude is well) but now I have have to leave PHP or split time between php and .NET for just one reason: .NET offers a way to run programs using the Windows GUI / stand alone executable There always was talk on the list about running php code as standalone, but since I had a long absence from the list sorry if I missed any new updates... but I'm hoping someone can offer a way to run php standalone executable. Before posting I always google, and the main results I have gotten so far is: priado blender and PHP-GTK but no way to kind of drag and drop what you need like visual studio (i dont know how to use it yet, but been reading) or some other visual development tool like visual basic. I need to make a few standalones programs that will run (mostly) on Windows... is there any other way that I have not found that i can use PHP instead of learning something new like .NET? I have resisted going "the microsoft way" for years.. looks like my luck has run out... Thanks, Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DOM TextArea (and dom chart please)
> I think what you are looking for is $input2->textContent in PHP. Hey Andrew (and everyone else was was kind enough to write back) ! Found the solution, this is what i am using (and it works!), and i hope it helps anyone else who finds themselves in the spot i found myself $inputs2 = $dom->getElementsByTagName('textarea'); // Find textareas foreach ($inputs2 as $input2) { if(!$input2->nodeValue || $input2->nodeValue=="") { $input2->nodeValue="it works!"; } } Cheers guys! /R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DOM TextArea (and dom chart please)
>// I have even tried this instead of the above: > >foreach ($inputs2 as $input2) { >if(!$input2->getAttribute("defaultValue")=="") { >$input2->setAttribute("defaultValue","it works!"); >} >} > >but no joy. > >I'm betting its pretty simple but i dont have a "DOM chart" for php, the only >ones i have been able to find via google are for javascript like this one: >http://www.hscripts.com/tutorials/javascript/dom/textarea-events.php > > >and that chart does not help much. Does anyone have a PHP DOM chart or a >resource that i can use to get started using this? > > When I get stuck on things like this, I find print_r() invaluable as it can basically dump out the objects entire contents, so I can see what values it has set. Hey Ash, Thanks for replyng. Where exactly do i use the print_r? and on which variable? Because i have tried it in different places but still no luck..
[PHP] DOM TextArea (and dom chart please)
Hey! i'm just starting with PHP's DOM-XML and need a little help please. Basically, first i am trying to see if a input like a textbox has a 'VALUE=' associated with it, if yes, i leave it be, if no, i add a default value. This *is working* as can be seen by the attached code below. But a bit confused as to how to do the same for a textarea as textarea's do not have a 'VALUE=' attribute. Heres my code: $website_data = file_get_contents('dom_test.html');//load the website data, $dom = new DomDocument; //make a new DOM container in PHP $dom->loadHTML($website_data); //load all the fetched data into the DOM container $inputs = $dom->getElementsByTagName('input'); // Find Sections foreach ($inputs as $input) { //*** this block has the guts of the functionality *** if(!$input->getAttribute("value") || $input->getAttribute("value")=="") { $input->setAttribute("value", "RRR"); } } // * now we come to the textarea bit that is not working * $inputs2 = $dom->getElementsByTagName('textarea'); // Find textareas foreach ($inputs2 as $input2) { if(!$input2->firstChild.nodeValue=="") { $input2->firstChild.nodeValue=="it works!"; } } echo $dom->saveHTML(); ?> +++ // I have even tried this instead of the above: foreach ($inputs2 as $input2) { if(!$input2->getAttribute("defaultValue")=="") { $input2->setAttribute("defaultValue","it works!"); } } but no joy. I'm betting its pretty simple but i dont have a "DOM chart" for php, the only ones i have been able to find via google are for javascript like this one: http://www.hscripts.com/tutorials/javascript/dom/textarea-events.php and that chart does not help much. Does anyone have a PHP DOM chart or a resource that i can use to get started using this? Thanks in advance! Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Kinda 0.T... php site and maintenance
@Bastien, Stuart: Thanks for your input guys, was very useful and appreciate it. cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Kinda 0.T... php site and maintenance
Hey, Thanks everyone for replying, I really appreciate your input. One thing you forgot to mention, how much would it be for "maintenance" per year? Feel free to add anything you think you might have forgotten in your first emails to me. @ Nitsan, "I did some personally sites like that for 2 banks here in Israel." Israel!! Stay safe bro and god bless, you have some real crazies surrounding your country. @Michael Kubler, Not a problem, I like long replies.. by their very nature most of them are more detailed ;) Cheers! R -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) - Original Message From: Nitsan Bin-Nun To: Ryan S Cc: php php Sent: Monday, January 26, 2009 6:39:19 PM Subject: Re: [PHP] Kinda 0.T... php site and maintenance I have just quitted from my partial time job at the company. I did some personally sites like that for 2 banks here in Israel. When I do something like that I usually basing the whole thing on the known blogging platform WordPress, it has a massive power inside of it, the templating system is very easy and gives you the ability to dress it up without any extra knowledge except common sense and a bit of php knowledge, It supports creating galleries (using plugins, etc) and gives you the functionally you usually need when you write a personall website - free access to creating static pages, using wordpress integrated WYSIWYG editor, creating "updates" using the blog posts, etc. I found it very useful so far (I used this platform in 15 websites~) and I think you will find it more than great for your client's job. HTH, Nitsan On Mon, Jan 26, 2009 at 7:09 PM, Ryan S wrote: > Hey, > > Got a question for you guys who make a lot of personal sites. > > I got a US client who wants me to make a personal site, 4-7 "sections" (eg: > about me, photos, whats new etc) > and have to put a yearly maintenance $$ amount... > > I thought i'll make most of the stuff using php rather than plain html so > the client can update different sections without me (eg: whats new, add > pics) > > What do you guys charge for something like this (dont count hosting and > domain fees) > > Thanks! > R > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Kinda 0.T... php site and maintenance
Hey, Got a question for you guys who make a lot of personal sites. I got a US client who wants me to make a personal site, 4-7 "sections" (eg: about me, photos, whats new etc) and have to put a yearly maintenance $$ amount... I thought i'll make most of the stuff using php rather than plain html so the client can update different sections without me (eg: whats new, add pics) What do you guys charge for something like this (dont count hosting and domain fees) Thanks! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Request to bash/jump/screw my code
> Any advise is also most welcome. 'Advise' is a verb. 'Advice' is a noun. No charge. LOL! Thanks! Got caught by the grammar and typo police but no ticket! Must be my lucky day! Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Request to bash/jump/screw my code
Hello everyone, Recently I worked on a rather decent sized project and it just went live yesterday. We cannot really afford a security specialist so would appreciate it if you could hit our site with whatever you want to (just dont take us offline with something like a DDOS please) and tell us if you find any problems. As we cannot afford to pay you for this service all we an say is thank you if you decide to give this a go with a few seconds or a few minutes of your time. It should be fun though as its a jokes section and even has funny images/cartoons and funny vids. The site is at http://ezee.se/funnies/index.php Any advise is also most welcome. Thanks in advance! Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Replacing with f*ck and f*cking
Thanks for all your input guys! > Scunthorpe LOL! Never heard of the place but ...f**k i think i am a geek for finding it funny! Reminds me of quite few people tho... Cheers! R 2008/10/26 Colin Guthrie <[EMAIL PROTECTED]>: > Ashley Sheridan wrote: >> >> What you really need to watch out for is words which you're going to >> censor which might be part of other names. Sex is an obvious one, as it >> appeared in the borough name of my old address: Middlesex. > > I can't believe you didn't use the infamous "Scunthorpe" as your example :p > > Col There was a post on Coding Horror not long ago that brought this one up: http://google.com/search?q=consbreastution http://www.codinghorror.com/blog/archives/001176.html -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ä-ö-ü-ß-Ä-Ö-Ü -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Replacing with f*ck and f*cking
Hey! I'm just trying to replace some of the more bad words with their slightly censored counterparts like so $bad_words = array(/*Well you know the words so am not going to write them here*/); $bad_words_replacements = array("f*ck", "f*cking"); $comment = str_replace("$bad_words",$bad_words_replacements, $comment); My question is this, for just two words its fine to use the above, but a pal tells me that if using a lot of words (eg: 15) and the $comment is big then it can take quite some time and be a bit of a processing strain as well because php first checks the first word from the good list against all the 15 words in the bad list against the comment then moves to the second word etc. Is this really bad processing wise and would you recommend any other way of doing this? The other question i have is, wont "f*ck" catch "f*cking" as well? so should i delete the longer f*cking? I'm not really trying to stop people swearing... just trying to make it not "jump out" so much, this was the poster is happy coz i have not censored him to bits and the reader should be a bit happy coz its a bit decent. Thanks! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] index search
Are you sure LIKE isn't working? I would think LIKE "a%" would work. For 0-9, I would think you can use <= 9 or you can use BETWEEN 0 and 9. Silly me, the reason it was not working was I am so used to %something% and used that instead of something% Anyway, it was a not a useless post for me because the 0-9 part was not solved in my head but a lot of interesting replies as to how to do it. Thanks everyone! /Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] index search
Hey all, Was wondering how this is done, have a bunch of links like so: 0-9 : a : b : c -> till Z these will be linked to the program (so far have done this) but when the user clicks any of those links I want to query the DB for just the first alphabet from the field "title", using LIKE is not working for me because its catching alphabets from the middle of the word as well. Also how to do 0-9? do i have to have 10 if() conditions for that? Ideas and suggestions welcome. Thanks! Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mysql search
> Am hoping someone out there can recommend a better script or maybe share some > of your own code? > > Any help would be appreciated. Do it right... read up on MySQL's fulltext matching. Cheers, Rob. Did some searching based on your tip, got what i was looking for, just didnt know where to start.. and now feeling like the man who was taught how to fish :D Thanks! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mysql search
Hey all, I have two columns in my DB title varchar(254) and jtext text which I would like to search, as the user might enter two or more words I am opting not to use LIKE %search_term% so started searching google, I came across this very promising class: http://code.activestate.com/recipes/125901/ but when i tried to run it I am just getting a blank page, no errors or anything. Am hoping someone out there can recommend a better script or maybe share some of your own code? Any help would be appreciated. Thanks, Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Convert video to FLV like youtube
Hey! Been googleing for a way to convert video to flv just like youtube and came accross the flv SDK kit, unfortunately it seems to only support C++, Delphi and C# Have any of you guys come accross a php script that does this? any links, pointers and code would be appreciated. TIA, R -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Brain dead... write image to file
AGH! Just got up, feel like I have a hangover which is not really fair because I didnt drink so dont deserve one. It really is screwed up, you pull an all nighter and when you get up you look at the code you produced and it just isnt your best work... and the question pops up, why bother? Sorry, a bit of a rant in the middle of my coffee ;) just wanted to thank all of you who replied, I really appreciate it... was way out in the zonked zone when I wrote and asked for help and the fact that some of you actually read that long ass bit of code AND responded shows that there IS hope for humanity, coz there are a lot of good folk still out there. Ok, a bit dramatic... but still not thinking too straight, gotta refill my cup! Thanks and tcare ppl! /Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) - Original Message From: Maciek Sokolewicz <[EMAIL PROTECTED]> To: Ryan S <[EMAIL PROTECTED]> Cc: php php Sent: Wednesday, October 15, 2008 12:25:29 PM Subject: Re: Brain dead... write image to file Ryan S wrote: > Hey all, > > am feeling a bit brain dead, pulled an all nighter and would appreciate some > help as have already wasted over 2hrs on this :( > just not thinking straight. > I got this script off the net, cant even remember where :( its basically to > resize an uploaded image (i have a script that does exactly this that i > created ages ago... but cant find it and if i remember corrrectly that only > resizes jpgs, this one does gifs and pngs as well) > > the way the original guy wrote it is that it writes the uploaded image to the > DB, i'm just trying for it to create a resized image *instead of writing to > the db*. > > The code is below, needless to say, my little block of code to write an the > image to file is not working... would appreciate some help. > > //$conn = mysql_connect("localhost", "username", "password") or > die(mysql_error()); > //mysql_select_db('test', $conn) or die(mysql_error()); > > > if($_FILES['userfile']['tmp_name']){ > resize(); > //$q = "INSERT INTO test VALUES ('', '".$blob_arr['image']."', > '".$blob_arr['thumb']."', '".$blob_arr['type']."')"; > //$aa = mysql_query($q,$conn) or die(mysql_error()); > > /## Start my code try > $uploaddir = 'C:\\wamp\\www\\ezee\\funny\\'; > $filename = $uploaddir.'test.jpg'; > $somecontent = $blob_arr['thumb']; > > if (is_writable($filename)) { > if (!$handle = fopen($filename, 'w')) { > echo "Cannot open file ($filename)"; > exit; > } >if (fwrite($handle, $somecontent) === FALSE) { > echo "Cannot write to file ($filename)"; > exit; > } > > fclose($handle); > > } else {echo "The file $filename is not writable";} > > > > header( "Content-type: ".$blob_arr['type'].""); > } > /## End my code try > > > > function resize(){ > global $blob_arr; > $temp_name =$_FILES['userfile']['tmp_name']; > $userfile_name =$_FILES['userfile']['name']; > $userfile_size =$_FILES['userfile']['size']; > $userfile_type =$_FILES['userfile']['type']; > > $thumb_width=90; > $thumb_height=90; > $image_width=200; > $image_height=200; > > if (!($userfile_type =="image/pjpeg" OR $userfile_type =="image/jpeg" OR > $userfile_type=="image/gif" OR $userfile_type=="image/png" OR > $userfile_type=="image/x-png")){ > die ("You can upload just images in .jpg .jpeg .gif and .png > format!"); > } > $data = fread(fopen($temp_name, "rb"), filesize($temp_name)); > $src_image = imagecreatefromstring($data); > $width = imagesx($src_image); > $height = imagesy($src_image); > if ($thumb_width && ($width < $height)) { >$thumb_width = ($thumb_height / $height) * $width; > } else { >$thumb_height = ($thumb_width / $width) * $height; > } > if ($image_width && ($width < $height)) { >$image_width = ($image_height / $height) * $width; > } else { >$image_height = ($image_width / $width) * $height; > } > $dest_img = imagecreatetruecolor($thum
[PHP] Brain dead... write image to file
Hey all, am feeling a bit brain dead, pulled an all nighter and would appreciate some help as have already wasted over 2hrs on this :( just not thinking straight. I got this script off the net, cant even remember where :( its basically to resize an uploaded image (i have a script that does exactly this that i created ages ago... but cant find it and if i remember corrrectly that only resizes jpgs, this one does gifs and pngs as well) the way the original guy wrote it is that it writes the uploaded image to the DB, i'm just trying for it to create a resized image *instead of writing to the db*. The code is below, needless to say, my little block of code to write an the image to file is not working... would appreciate some help. "); } $data = fread(fopen($temp_name, "rb"), filesize($temp_name)); $src_image = imagecreatefromstring($data); $width = imagesx($src_image); $height = imagesy($src_image); if ($thumb_width && ($width < $height)) { $thumb_width = ($thumb_height / $height) * $width; } else { $thumb_height = ($thumb_width / $width) * $height; } if ($image_width && ($width < $height)) { $image_width = ($image_height / $height) * $width; } else { $image_height = ($image_width / $width) * $height; } $dest_img = imagecreatetruecolor($thumb_width, $thumb_height); $i_dest_img = imagecreatetruecolor($image_width, $image_height); imagecopyresized($dest_img, $src_image,0, 0, 0, 0,$thumb_width, $thumb_height,$width, $height); imagecopyresized($i_dest_img, $src_image,0, 0, 0, 0,$image_width, $image_height,$width, $height); ob_start(); if($userfile_type == "image/jpeg" OR $userfile_type == "image/pjpeg"){ imagejpeg($dest_img); } if($userfile_type == "image/gif"){ imagegif($dest_img); } if($userfile_type == "image/png" OR $userfile_type == "image/x-png"){ imagepng($dest_img); } $binaryThumbnail = ob_get_contents(); ob_end_clean(); ob_start(); if($userfile_type == "image/jpeg" OR $userfile_type == "image/pjpeg"){ imagejpeg($i_dest_img); } if($userfile_type == "image/gif"){ imagegif($i_dest_img); } if($userfile_type == "image/png" OR $userfile_type == "image/x-png"){ imagepng($i_dest_img); } $binaryImage = ob_get_contents(); ob_end_clean(); if(!get_magic_quotes_gpc()){ $binaryThumbnail=addslashes($binaryThumbnail); $binaryImage=addslashes($binaryImage); } $blob_arr['image']=$binaryImage; $blob_arr['thumb']=$binaryThumbnail; $blob_arr['type']=$userfile_type; } if($_POST['submit']){ //$Rs = mysql_query("SELECT * FROM funny_test WHERE id = '".mysql_insert_id()."'") or die(mysql_error()); //$row_Rs = mysql_fetch_assoc($Rs); //header( "Content-type: ".$row_Rs['typ'].""); //echo $row_Rs['thb']; }else{ ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] searching by tags....
Hey, this the first time I am actually working with "tags" but it seems quite popular and am adding it on a clients requests. By tags I mean something like wordpress' implementation of it, for example when an author writes an article on babies the tags might be baby,babies, new borns, cribs, nappies or a picture of a baby can have the tags baby,babies, new born, cute kid, nappies the tags are comma separated above of course. The way i am doing it right now is i have sa an article or a pic saved in the db as article_or_pic_address text the_tags varchar(240) My question is, when someone clicks on any one of the tags, do i do a LIKE %search_term% search or...??? quite a few sites seem to have a very neat way of implementing this with (url rewriting?) something like http://sitename/blog/tags/tag-comes-here/ Any help in the form of advise, code or links would be appreciated. TIA. Cheers! Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Little regex help please...
Thanks guys, I appreciate the help. Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Little regex help please...
Hey Todd, Eric, Thanks for replying. > I don't believe you need both the / and the # for delimiters in your > RegEx. Try using just # (since / is actually going to be in the text > you're searching for) like this: > > $data = > file_get_contents("http://www.youtube.com/watch?v=oQ2dKXGAjNg";); > preg_match('#([^<]*)#iU', $data, $match); > $title = $match[1]; > echo $title; > ?> > > > You can also escape the / like \/. Ok, I changed it to: http://www.youtube.com/watch?v=oQ2dKXGAjNg";); preg_match('/#([^<]*)<\/title>#iU',$data,$match); $title=$match[1]; echo $title; ?> And this is the error i am getting: Warning: preg_match() [function.preg-match]: No ending delimiter '/' found in C:\wamp\www\ezee\tests\get_remote_title.php on line 3 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Little regex help please...
Hello! Here's a regex that I got off the web that I am trying to modify for my needs, I suck at regex so desperately need some help. Basically, am trying to get a remote webpage and get the value between the tags, note that it should get the values regardless if is upper or lower case (case insensitive) http://www.youtube.com/watch?v=oQ2dKXGAjNg";); preg_match('/#([^<]*)#/iU',$data,$match); $title=$match[1]; echo $title; ?> This is the error that i am getting when running the above: Warning: preg_match() [function.preg-match]: Unknown modifier 't' in C:\wamp\www\ezee\tests\get _remote_title.php on line 3 TIA, Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: Sale 79% OFF !!!
I hate to admit to this, but some 15 years ago I was consulting for a company doing oil exploration in Nigeria and I received a very elaborate and believable Nigerian scam. It was complete with signed and official documents from both the Nigerian Government and the Bank of Nigeria. I passed the proposal through two attorneys and the decision was to participate. Of course nothing happened and we did not lose anything. But the first Nigerian scams were very believable. Heck! Always wanted to "meet" someone who feel for the Nigerian scams, would never have thought you would be the one Tedd! Can you give me mroe details of the scam? Is it like the ones we get via email everyday or different? Cheers! Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Freelance PHP development in India
No apologies necessary, good luck! Cheers! R - Original Message From: Denis L. Menezes <[EMAIL PROTECTED]> To: Ryan S <[EMAIL PROTECTED]>; Wolf <[EMAIL PROTECTED]> Cc: PHP General Sent: Monday, July 14, 2008 3:31:43 PM Subject: Re: [PHP] Freelance PHP development in India Dear Ryan, Wolf. Apologies for asking from India only. No offence meant. It is because I am from India and I can personally meet and discuss with the programmers. Cost is also an issue. Mine is a startup and the finances are low. :-( Apologies. Denis - Original Message ----- From: "Ryan S" <[EMAIL PROTECTED]> To: "Wolf" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: "PHP General" Sent: Monday, July 14, 2008 8:34 PM Subject: Re: [PHP] Freelance PHP development in India > > > > > >> Dear friends. >> >> I am looking for freelance web developers in India. >> >> Can contact me? >> > > Why just in India? There are a number of us available via the world. > > Wolf > > > I'm guessing because he wants a REAL cheap solution... > what you (probably) charge for 5-7hrs work would probably be the same that > someone in india charges for a day or two or the whole project. > > HTH > > Cheers! > R > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Freelance PHP development in India
> Dear friends. > > I am looking for freelance web developers in India. > > Can contact me? > Why just in India? There are a number of us available via the world. Wolf I'm guessing because he wants a REAL cheap solution... what you (probably) charge for 5-7hrs work would probably be the same that someone in india charges for a day or two or the whole project. HTH Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Most popular per month
Thanks Brady, Wolf, Bernhard! Will write back if i hit a wall but I think your explanations and links should take me all the way. Cheers! Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Most popular per month
Hey! Thanks for replying! .. . $perc50=(img50 int)/$total; You can do it per day, per month, per year, per 28 days, per PMS cycle, per anything you want provided you have the data to do it. :) this is the part where i am a bit confused actually, can you give me one or two examples and i'll work from there? Google had an pie chart thingie, check the archives of this list. Thanks! Will do! Cheers! Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Most popular per month
Hey! The client has a set of 50 images that keep rotating everyday and when a user clicks one of those images he is taken to that images site, in the background (database) i maintain a counter _for the day_ and then display the top ten images everyday in this format: 1-10 before the next days counter starts this data is stored in a table which has a simple structure like this img_id1 int,img_id2 int (etc till img_id10) Now the client wants a little extra functionality, and with me sucking at maths I need some help please, basically he now wants to have a chart with all the 50 images there and showing _via percentages_ instead of the present 1-10 display which ones are the most popular till date. example: 1. image name: (percentage here) 2. image name: (percentage here) 3. image name: (percentage here) etc any ideas on where i can start/ code tips/ urls etc would be most appreciated. Also, if i am not mistaken there was some charting software to display this kind of data in pie and line charts... anybody know what i am talking about? because i cant find such a link in my bookmarks. Thanks in advance, Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Monitor a WP website
Ryan, That feed is indeed XML. Ooookay! I think i see where my confusion was coming in opening the "http://www.ballzbollywood.com/feed/"; in FF3 automatically parses it in a way... as does it in IE7... but opera is giving me the "raw" feed and it makes sense again. (Am on win vista home premium) Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Monitor a WP website
Okay, then get_file_contents(), parse between the tags that would contain the stuff you want to monitor, hash, store that, and do what I said. So far yours has been the best solution Tedd, thanks! Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Monitor a WP website
If it's RSS, I think it's going to be XML regardless of the language they're using to assemble it (Perl, PHP, ASP, etc.). I might be wrong, but I thought that's part of what made it RSS. I'm afraid to click on a site with the url "ballz.info" while I'm at work. :D Any other WP feed examples? LOL, no worries, all links that i sent are work safe... although if someone saw you open that their opinion of you might be lowered as its a celeb site and presently has super dumbo Paris H on the first page... Pretty much the same is this one (again work safe) http://www.ballzbollywood.com/feed/ A client runs both of these... Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Monitor a WP website
>Got an example? I've never seen a WP site with RSS feeds disabled. Hey Stut, Actually, dont have an example.. :o) but i have seen this question of how to disable wordpress rss frequently come up on many forums ( a quick google search with "wordpress disable rss" gives up quite a few results) so wanted a solution to these sites as well... however marginal they might be. Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Monitor a WP website
> So, you want something to tell you if something new has been added to > a remote site, right? > > There used to be free services that did that -- I used to monitor > competitors's web sites using such service. But, I think they > eventually stopped the free service. Here's one site that charges: > > http://www.webmetrics.com/websitemonitoring.html > > Now, if you want to do this on your own, then it should be simple > enough to use get_file_contents and put the file through a md5() > function (or use md5_file) and store the result in a dB. > > Then cron a check every so often to see if the hash has changed. If > it has, then email you notice, rehash the site and store it in the dB. > > Or, am I completely off-base in understanding what you wanted (as > I've been told lately)? tedd, (damnit, Outlook capitalized that for me, and I had to change it back...) I believe he is talking about providing such a service. Of course, I've heard of companies that outsource their entire livelihoods and charge their own customers out the nose for proxy. I'm not sure if he's trying to simply determine if a change has been made or if he is trying to notify people of the particular item that has been posted. Clarifications, Ryan? Hey, This is strange, I didnt get Tedds message but only got to read it through yours. Sorry for the mixup, yes, was thinking of making something like this and offer it for free, its a bit of both: what you and Tedd said. I want to check if a new post has been published AND get the text+url of the post to send out to people along with the link to it. To make matters worse, i think i am a bit confused about the feeds themselves... i used to work with RSS feeds from Yahoo! and others (example: http://www.php.net/news.rss) but they used to come via XML... but now i see a lot of sites using something different via "feedburner" (example http://feeds.feedburner.com/eZeeDotse) or wordpress' default feed (example: http://www.ballz.info/feed/) um... help? :) Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Monitor a WP website
Hey Eric, Stut, >Maybe you should start by trying to utilize the RSS feed. Went to that option at first too... but have a quick look around, there are many sites that for some reason dont have this feature turned "on", and for them... the only option i think is to "read" the page... unless I am missing something? Cheers! R > Is there a way to check if a new post has been submitted on your favourite > wordpress site? > > Heres what i am trying to do: > do a fopen http://ezee.se/articles-blog/ via CRON every x minutes > if a new post has been submitted, i mail someone... > > but am not just looking to do this for this one site... am thinking other WP sites too, but am hoping if i can get this to work on this one site.. the others should be pretty much the same. > > Any suggestions on how to check for new posts? keep in mind most wp sites use some kind of url-rewriting so the formats a bit different (there are around 7 formats if i am not mistaken) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Monitor a WP website
Hey, Is there a way to check if a new post has been submitted on your favourite wordpress site? Heres what i am trying to do: do a fopen http://ezee.se/articles-blog/ via CRON every x minutes if a new post has been submitted, i mail someone... but am not just looking to do this for this one site... am thinking other WP sites too, but am hoping if i can get this to work on this one site.. the others should be pretty much the same. Any suggestions on how to check for new posts? keep in mind most wp sites use some kind of url-rewriting so the formats a bit different (there are around 7 formats if i am not mistaken) Thanks! R -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] O-T What are we going to do about the O-T thread that asks the question: What we are going to do about those OT's?
Sorry, had to ask :o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
> > P.S will be deleting the urls that you created, hope you dont mind, coz > > just in case someone later keeps using the url you posted via the > > archives... >Hang on, I want to post it on Digg first Hehe, no fear there... all my posts on dig never get me more than a few clicks anyway... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
>Thats why I love this place... theres so many ways to skin a cat Yeah, but the cat ain't going to like any of them. (Foxworthy) Hehe good one! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
Ah, the never ending loop... thanks for pointing that out. Thats why I love this place... theres so many ways to skin a cat and here they tell you the ways you have forgotten or overlooked. Thanks again, R P.S will be deleting the urls that you created, hope you dont mind, coz just in case someone later keeps using the url you posted via the archives... -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) - Original Message From: Daniel Brown <[EMAIL PROTECTED]> To: Ryan S <[EMAIL PROTECTED]> Cc: Stut <[EMAIL PROTECTED]>; Iv Ray <[EMAIL PROTECTED]>; Jon Drukman <[EMAIL PROTECTED]>; php-general@lists.php.net Sent: Thursday, June 19, 2008 4:40:59 PM Subject: Re: [PHP] Re: Search like php.net's URL thingy Ry, Make sure you also disable the ability to add in your own site, and even similar competitors such as tinyurl.com. Otherwise, you'll get something like this: http://ezee.se/30 -- Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just $59.99/mo. with no contract! Dedicated servers, VPS, and hosting from $2.50/mo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
> I really dont see what anybody could gain by spamming this form but > anyway it does check to make sure the person submits something that > starts with "http" via strstr (after bringing it down to lowercase, > thats why i didnt use stristr, and because it checks just "http", > https too is allowed, i really dont think people will have much use > for FTP or other protocols here so didnt bother, it also safeguards > my server from people trying to serve up my local files).. Yeah, that's not so great: http://ezee.se/d yep, but the above url is pretty much useless, its unable to access my filesystem and does... nothing, so other than a kid (and smart ass programmers) fooling around, who would want to do soemthing like that? You could probably stop a lot of that by checking URLs against http://www.surbl.org/ before allowing them. Thanks, thats a good idea and i think i'll work with it. Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
> Thanks for replying m8, but if you check the rest of the thread you will see > this has alraedy been solved and the result is > http://ezee.se/ezeeurl.php?do=1 > > Cheers! > Ryan How do you protect this thing from being spammed? I do not know why somebody would spam it, but I have had all kind of forms being spammed - it seem there are people out there who find immense pleasure in spamming forms, regardless of the result. I really dont see what anybody could gain by spamming this form but anyway it does check to make sure the person submits something that starts with "http" via strstr (after bringing it down to lowercase, thats why i didnt use stristr, and because it checks just "http", https too is allowed, i really dont think people will have much use for FTP or other protocols here so didnt bother, it also safeguards my server from people trying to serve up my local files).. If i do see spam, will throw in a captcha... there are many other there that are decent, i might not go for "enter the below characters" one but most probably "click the elephant/cat/dog/mouse" in the picture one. If that does not work, will either have to ask for their credit card numbers or ask them to mail me their birth certificates... :o) J/K of course! Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
Thanks for replying m8, but if you check the rest of the thread you will see this has alraedy been solved and the result is http://ezee.se/ezeeurl.php?do=1 Cheers! Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Kindla 0T, but here goes...
Hey, > I agree with Daniel. Your most likely solution is to use a Flash player > (or similar implementation) and populate a portion of your page with the > object via AJAX (which you are already apparently comfortable with). Or make your own Flash player with Ming and PHP. Working on that myself at the moment. Would love to see what you come up with, gimme a shout when you finish it. Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Kindla 0T, but here goes...
Hey guys! Thanks for replying! Cant find any midi flash player... looks like it has to be mp3, in which case can anybody recommend a place for open licensed mp3s for songs like "happy birthday" etc maybe just instrumental stuff? Thanks! R > -Original Message- > From: Daniel Brown [mailto:[EMAIL PROTECTED] > Sent: Friday, June 13, 2008 4:13 PM > To: Ryan S > Cc: php php > Subject: Re: [PHP] Kindla 0T, but here goes... > > On Fri, Jun 13, 2008 at 4:49 PM, Ryan S <[EMAIL PROTECTED]> wrote: > > > > when the user clicks on any of those links i do a quick trip to the > DB via ajax and update the div with all the artists that his choice > merits... same thing when he clicks the bands name... this time i > display all of their songs... and here's where i am stumped... when he > clicks any of those songs... it should start playing in the background > WITHOUT reloading the whole page... is this possible or am i just > barking up the wrong tree? > > Most sites, such as Project Playlist (now just Playlist.com) use > Flash for this. > > Check it out: > >http://www.playlist.com/ I agree with Daniel. Your most likely solution is to use a Flash player (or similar implementation) and populate a portion of your page with the object via AJAX (which you are already apparently comfortable with). Todd Boyd Web Programmer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Kindla 0T, but here goes...
Hey! Heres what i have done so far: I ask the user for his style of music by displaying for example 3 links in the like rock, pop,sentimental when the user clicks on any of those links i do a quick trip to the DB via ajax and update the div with all the artists that his choice merits... same thing when he clicks the bands name... this time i display all of their songs... and here's where i am stumped... when he clicks any of those songs... it should start playing in the background WITHOUT reloading the whole page... is this possible or am i just barking up the wrong tree? music files are midi, wav and mp3... would be happy if i can have just one if i cant have all three.. Thanks in advance! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy [0.T]
Hey again, First of all please note that i added a [0.T] (= off topic ) to the subject so if you dont want to continue with something OT, now's the time... Ok... for anyone thats curious as to why i wanted this.. just completed my version of tinyURL... except, its even more tiny!! Have christened it ezeeURL :) if anyone wants to take it for a test spin (as its not officially "open" yet) feel free to check it out here: http://ezee.se/a.html Thought i would do something with my small domain name... and this worked out pretty good, for example: http://tinyurl.com/ http://ezee.se/ <-- Size does matter! cant beat tiny if you even have MICROurl coz "tiny" is smaller :p but ezee does beat tiny plus .se is smaller than .com... now if only it could beat it in traffic! Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
As far as I remember, errordocument still send the code, in this case 404 to the client. In the case of IE, this will display IEs built-in error doc if the server supplied one is < 512 Bytes. Maybe other implications for spiders also. I might be wrong, but this is from some old memory. -Shawn Nate Tallman wrote: > ErrorDocument 404 /path/to/some/script.php > * $_SERVER['REDIRECT_URL'] > > (somehow misplaced underscore) Your memory might be old... but its still good! :) While searching for my answers i did come accross what you wrote above.. Cheers! R P.S Thanks for replying guys -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Search like php.net's URL thingy
Hey! Thanks for replying. Digging a bit more i found RewriteEngine On RewriteRule ^([a-z][0-9][A-Z][aA0-zZ0])$ jj.php?show=$1 But it does not work :( do you see any fault with the above? Thanks! R -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) - Original Message From: Bernhard Kohl <[EMAIL PROTECTED]> To: Ryan S <[EMAIL PROTECTED]> Sent: Thursday, June 5, 2008 9:25:46 PM Subject: Re: [PHP] Search like php.net's URL thingy you should familiarize yourself with the rewrite module of the apache server (if u operate on that one) it's pretty much the same as regular expressions syntax example: i want all requests going to www.example.com/test being forwarded to index.php?a=test place following into your .htaccess file in the root directory: RewriteEngine on RewriteBase / RewriteRule ^([a-zA-Z])$ index.php?a=$1 the whole thing can get pretty complex with alot of rewrite conditions and stuff. good luck On 6/5/08, Ryan S <[EMAIL PROTECTED]> wrote: Hey, one of the things that make the php.net site so cool is how easy it is to find info for a function or a list of topics.. eg: http://php.net/arrays http://php.net/count I'm sure nearly all of you reading this have done it more times than you would care to count, i'm trying to get something like this on my own site but even after going to php.net and clicking on the view source buttons am a bit confused. basically this is what i am trying, people who type in http://www.mysite.com/asdf should not be shown a 404 not found page but instead "asdf" should be passed onto my script where i can do a search on the term and either give them back the results of that search or direct them to a custom 404 page. since i couldnt find the answer via php.net's source i started messing around with how i *think* its done... tell me if i am on the correct track: when someone requests a page that does not exist, a .htaccess file them up and also takes the page name they were searching for and redirects them to a script... So far i have only been able to get the .htaccess file point to my custom 404 page... but how do i get it to pass the parameter of the not-found-page to my script? Would appreciate any code, tips, urls you can give me. Thanks! Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Search like php.net's URL thingy
Hey, one of the things that make the php.net site so cool is how easy it is to find info for a function or a list of topics.. eg: http://php.net/arrays http://php.net/count I'm sure nearly all of you reading this have done it more times than you would care to count, i'm trying to get something like this on my own site but even after going to php.net and clicking on the view source buttons am a bit confused. basically this is what i am trying, people who type in http://www.mysite.com/asdf should not be shown a 404 not found page but instead "asdf" should be passed onto my script where i can do a search on the term and either give them back the results of that search or direct them to a custom 404 page. since i couldnt find the answer via php.net's source i started messing around with how i *think* its done... tell me if i am on the correct track: when someone requests a page that does not exist, a .htaccess file them up and also takes the page name they were searching for and redirects them to a script... So far i have only been able to get the .htaccess file point to my custom 404 page... but how do i get it to pass the parameter of the not-found-page to my script? Would appreciate any code, tips, urls you can give me. Thanks! Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Execute php commands that are in an array
Hey, its easier to start with code and then explain: $t_array[]='chr(rand(97,122))'; echo $t_array[0]; The above code outputs chr(rand(97,122)) How can i execute that above code from the array instead of displaying it? Thanks! Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Execute php commands that are in an array
Hey all! Disregard my last email as i solved it myself via eval()... Cheers! R Hey, its easier to start with code and then explain: $t_array[]='chr(rand(97,122))'; echo $t_array[0]; The above code outputs chr(rand(97,122)) How can i execute that above code from the array instead of displaying it? Thanks! Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Anybody got a little spare time to help me out with a little OOP
Hey! Here would be my incarnation of this script http://www.ezee.se/ The UK police are by far one of the most open to being greedy and corrupted by their afore mentioned greed, case and point: the hundreds of extra speed cameras that are put in place with an idea of making more money rather than public safety, cameras that get fines that are around 100 million pounds per year! Heres one example.."; $break = 12; $words=explode(" ", $sample_string, $break); $words[($break-1)] = "... read more inside!"; echo join(' ', $words); Thanks for replying, but how and where do I put that into the script? all that "this->" stuff is confusing Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Anybody got a little spare time to help me out with a little OOP
coz i suck at OOP! Hey! Am trying to modify a wordpress plugin file,the name of the plugin is POST TEASER and can be downloaded from here http://wordpress.org/extend/plugins/post-teaser/, it works as advertised and this is what it does: I specify for example 4 words before the page should be "cut", it first breaks the page down into blocks based on the and tags example this will be block 1 this will be block 2 this will be block 3 etc then it counts the words in block 1, if its equal to the number of words i specified.. it returns the whole block if not it returns block1 and block 2 etc... What i am trying to make it do is... if i specify 3 workds it returns EXACTLY 3 words like so: "This will be read more inside!" I have written the code to get the above output... but being a total dumbo at OOP i dont know where to 'insert' the code. here is the code I have come up with: == Start code $sample_string="From http://www.ezee.se/ The UK police are by far one of the most open to being greedy and corrupted by their afore mentioned greed, case and point: the hundreds of extra speed cameras that are put in place with an idea of making more money rather than public safety, cameras that get fines that are around 100 million pounds per year! Heres one example.."; $words=explode(" ", $sample_string); $no_to_display=12; for($i =0; $i < $no_to_display; $i++) {$make_string_again .= $words[$i]." ";} echo $make_string_again."... read more inside!"; end code === Have upped the file here if you want to give it a shot the script is pretty well self documented too via comments in the script. Thanks in advance, Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Update does not work...but no errors either
Hey DB, Thanks for replying, I did solve it though was running a lot of tests and checking a lot of stuff with the fill before i finally added the database stuff... but forgot to include() the connection file :) Thanks for writing though! Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Update does not work...but no errors either
Hey, This is my code: == $update_sql="update greetings_final set heading='$heading',message='$message',signature='$signature',font_size='$font_size',font_color='$font_color',bg_color='$bg_color' where temp_cno='".$thecno."' and rand_string='".$randreference."' LIMIT 5"; echo $update_sql.""; $result2 = mysql_query($update_sql); if(mysql_affected_rows()==0){echo "Error R093d: unable to update greeting";exit;} == As you can see above, i have a echo to show me the exact SQL being run and also a mysql_affected_rows check to spit out an error if no rows get updated but for some reason no rows are getting updated but mysql is not echoing that error message plus the sql is running perfectly if i copy and paste it from the echo into phpmyadmin any ideas? Thanks! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A bit 0T - WAMPSERVER
http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html Thanks, I did STW and find that link but am just a bit unsure if while WAMPSERVER2 I should go in and do it like the above url suggests... was wondering if like XAMPP there were specific instructions to follow. Cheers! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] A bit 0T - WAMPSERVER
Hello all! Had some big problems with XAMPP crashing my windows (Vista) laptop 8 times out or 10 (actual figures) as I started XAMPP so have shifted over to WAMPSERVER2 So far so good, no crash... but their website seems to be down and need one small tidbit... if anyone of you are using WAMPSERVER can you tell me how to change MySqls default login? its on root/ presently... want to change it to root/something Thanks! Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Weird update problem..
> $result = mysql_query($sql_1); You're running the wrong query. You're building a query in "$update_sql" but running something else. DUH!!! Thats what you get for being up all night i guess! Time to hit the sack... pulled an all nighter and its 7:24am now >Some of the comments here: >http://dev.mysql.com/doc/refman/5.0/en/update.html Thanks for all the help Chris, I appreciate it. Cheers (and goodnite!) R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Weird update problem..
This is really weird... i have tried the same exact code in phpmyadmin and it works like a charm, but when i run the script... no errors then i go to phpmyadmin and nothing has changed :( this is the code: $how_many_to_update=count($cardno_array); // update the cards status to sent for($i=0;$i<$how_many_to_update;$i++) { $update_sql="update greetings set is_sent=1 where cardno='".$cardno_array[$i]."' and rand_str='".$rand_str_array[$i]."' LIMIT 1"; $result = mysql_query($sql_1); $num_rows1 = mysql_num_rows($result); if(!$result || $num_rows1==0){echo "Error: unable to update sent greetings";exit;} echo "updating$update_sql"; } = In the second last line you can see i have an echo statement... the SQL thats outputted from there works perfectly in phpmyadmin... any idea whats wrong? Slightly OT, any better way to run the multiple updates needed above than instead of running the update query in a loop? I searched google and the best i could find was the IN() for mySql... but that does not take 2 parameters (eg: cardno and rand_str) it would work just on card_no like this in('14','34') Thanks! R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 0T - Request for quick test
Hey Daniel B, Steve H and Thiago P, Thanks for replying! My cuz couldnt upload from her browser, thats why i requested this... wanted a upload with progress bar but this was the best simple one i could find which unfortunatly didnt have a progress bar but was free and OS. > Looks like it worked, Ryan. One suggestion, though: instead of the button > next to the green arrow Had a problem with something conflicting with Javascript's form submit(), and since i am using quite a lot of OS free scripts from other people and wrote more JS here myself than on any other project that comes to mind AND i am no JS guru... thought i would just work around that instead of confronting it head on. Your JS for email verification is annoying :P Type something in email address field and then go to next field, and then press shift+tab or alt+tab and see it going nuts :) Hehe! I see what you mean... you're like a little gremlin to catch that LOL! I am actually checking server side again if the user has entered the correct values, but the reason i put it there was just as a reminder because a lot of people are used to just entering their email once... do you think its over kill and i should just do it server side? Its quite easy to bypass the JS code if you REALLY wanted to do it... and if you do you will see that the script gives you a "error box" and shows you the form again... Thanks for the suggestions, am still open to any more you might have Cheers! R -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) - Original Message From: Daniel Brown <[EMAIL PROTECTED]> To: Ryan S <[EMAIL PROTECTED]> Cc: php php Sent: Tuesday, May 20, 2008 6:38:01 AM Subject: Re: [PHP] 0T - Request for quick test On Tue, May 20, 2008 at 12:01 AM, Ryan S <[EMAIL PROTECTED]> wrote: > > > Hey guys, > > Just make a egreeting app and need people to just test the AJAXy upload that i have on the form, if you have any problems please tell me.. if it goes smooth please tell me... as usual, any comments and suggestions too would be appreciated. Looks like it worked, Ryan. One suggestion, though: instead of the button next to the green arrow, why not use something like this instead? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 0T - Request for quick test
Hey guys, Just make a egreeting app and need people to just test the AJAXy upload that i have on the form, if you have any problems please tell me.. if it goes smooth please tell me... as usual, any comments and suggestions too would be appreciated. This is the form: http://www.ezee.se/ezee-ecard-egreetings/step2_v2.php All i want you to do is click the above link, click the file/browse button and try to upload a .jpg/jpeg image... Thanks in advance! Ryan P.S section is not yet open & am still testing stuff so dont try to create any egreetings right now :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Plugins... (like wordpress?)
Hey, Have just started screwing around with wordpress and I must say... it has a lot of really really nice bits and pieces... two of my favourites are widgets and plugins... not a hundred percent certain exactly what the diff is though! :) Anyway, was thinking it would be a great way to program for my next project... instead of jumping into the code again and again... write specific code and throw the file into the directory... then it either gets read and executed automatically or have a feature like WP where you have to "activate" it... only problem is, i dont know where to begin... i did do a little google searching and have a rough idea.. but would appreciate it if YOU could give me some links or code that got you started... something that was easy when you were beginning... something that lit that lightbulb in your head when you read it... Thanks in advance! R -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex to catch s (weird result)
> http://www.ezee.se/tests/para_regex2.php.txt Yep, sorry... Just add the s preg_match_all('|]*>(.*)|Uis', $myText, $myArray); Swett! It works! If you _do get time_, would love to know the actual meaning of |]*>(.*)|Uis because although I do appreciate the help and the code, am learning to work a bit with regex and this is still quite advanced for me. So far I have gotten (correct me if I am wrong) |]*> = 1) Starts with " 3) end with ">" (.*)| = 1) can have whatever inbetween till the end which is "" Have no idea of the Uis switches... Thanks again, R Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex to catch s (weird result)
preg_match_all('|]*>(.*)|Ui', $myText, $myArray); Hey! Thanks for replying. Your preg_match_all works like a charm, but for some reason catches only 8 out of 9 paragraphs... its really weird. I have upped the test page to http://www.ezee.se/tests/para_regex2.php.txt so you can have a look at it... didnt want to post such a lot of text to the list. Thanks again, R Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Re[PHP] gex to catch s
Hey, $tag_regex=array( '/\(.*?)\<\/p\> /si' => "$1", '/\<(\s*)(*.?)class\=(*.?)\>(.*?)\<\/(*.?)\>/si' => "$3" ); $paragraphs=preg_replace(array_keys($tag_regex),array_values($tag_regex),$page); I am not sure what tag is that you mean on , but in this RE .. it should capture any tags (the first element of the array) and any tags (the second element of the array) that has attribute class on it. Thanks for replying! Sorry, a bit of a typo there, i meant I ran your regex but got this warning: Warning: preg_replace() [function.preg-replace]: Compilation failed: nothing to repeat at offset 8 in C:\xampp2\htdocs\ezee\tests\para_regex.php on line 25 I think I ran it wrong, because although i have passed $page i dont know where to pass the replacement texts... Can you give me an example on how to run this or an explanation? Thanks! R Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex to catch s
> To say I suck at regex is an understatement so really need any help I can > get on this, I have a page of text with different html tags in them, but each > "block" of text has a or a < class="something"> tag... anybody have any > regex that will catch each of these paragraphs and put then into an array If you're using php5 you can use DOM's getElementsByTagName. If you still think you need to do some sort of regex it is possible but it will be buggy at best. Nope, need a regex... guess I have no choice, either chancy regex or nothing... I know for a fact that the first paragraph tag wont contain a class, and for the tags that contain a class="blah" does it matter that i know exactly what the classname is? Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regex to catch s
Hey all! To say I suck at regex is an understatement so really need any help I can get on this, I have a page of text with different html tags in them, but each "block" of text has a or a < class="something"> tag... anybody have any regex that will catch each of these paragraphs and put then into an array example: array[0]=" first block "; array[1]=" block X"; Thanks! R Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Categories like wordpress
Hey, Am not really used to using the JOIN in SQL so am a bit confused as to what kind of data I need to enter into this table: image_category_mapping table: - image_id - category_id for all of this to work... mind explaining a bit? Thanks! Ryan Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Categories like wordpress
Hey! Thanks for replying guys! > 1. Fully normalised, where you have three tables - one for your > "articles", one for your categories and a link table. This is the route that I would suggest, it's the most flexible and fastest to query. Anyone happen to have a little PHP code as an example here ( a little more than Brady gave me)? or links to where i can read up on this mySql and php side as I have never done anything like this before. TIA, R Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Xampp question, pretty much 0T
> > > Cant afford a new comp or a new OS and as for your last statement: > http://www.sophos.com.au/pressoffice/news/articles/2006/02/macosxleap.html > _almost_ no virii for the Mac :) /* None that have effected my computers here at work, or at home. No anti- virus, no firewall's ;) Oh and I'll take 1 over 97,467 anyday :) http://www.macdailynews.com/index.php/weblog/comments/5393/ */ Haha fair enough... but that will still leave you owning a Mac... will rather have the viruses than the shame! Plus you know nearly any software you download (shareware/freeware or even pirated) will support windows.. can you say the same for the Mac? Anyway, lets not take this down the my daddy can beat up your daddy lane and make this into a Apple against M$ thread. Cheers! R Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Xampp question, pretty much 0T
> > /* > Top posting from my cell... > > 1. Format hard drive > 2. Install redhat fc8 or Ubuntu 8.04 > 3. Load the new MySQL installation with your backup file > > If you really have to stay with windoze, remove and re-install > apache. Look at the system log files as they SHOULD tell you what > was causing the crash. > */ > > Hey Wolf, > Thanks for replying. > > Would love to install Linux, problem is... dont know the first thing > about it if things go wrong, I always wanted to learn what its all > about but when I started to read up on it quickly got confused with > all the different flavors out there... which one is right for me/ a > total beginner? for every little thing I would probably have to join > a linux list and post.. what about drivers for the bits and pieces > of the laptop? what about software? most of the places I go to > download software (freeware or shareware) is only for Win.. > Would love to switch away from Win... but i think the OS guys will > have to make it seem less of a mountain to climb to do so :( One option, I don't know what your budget is, but Apple's Macintosh OS X is basically a flavor of Unix (FreeBSD if I remember right) with a nice user interface on it. You have the ability to dive into the commandline when you need to/ want to, but have the comfortable point/click user interface when you don't want to worry about it. Just something else to think about... Oh... And there's no virii for the Mac :) Cant afford a new comp or a new OS and as for your last statement: http://www.sophos.com.au/pressoffice/news/articles/2006/02/macosxleap.html _almost_ no virii for the Mac :) Cheers! R Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Categories like wordpress
Hey! Heres what i have to do, upload pics and each pic can be a part of x number of categores for example: A picture of a rose can be for birthday, as well as anniversary, or miss you, or love etc exactly the same as how in wordpress an article can be in multiple categories like tech, current news, gadgets etc Was wondering how to do this, and please tell me if I am on the wrong path but: in the mysql db next to img name have a field called cate (or whatever for categories) and have a comma seperated list for each of the categories that the pic falls into and then do a mySql LIKE '%$param%' search if the user wants 'birthday'? Is this how its done or am I barking up the wrong tree? TIA /R Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Xampp question, pretty much 0T
/* Top posting from my cell... 1. Format hard drive 2. Install redhat fc8 or Ubuntu 8.04 3. Load the new MySQL installation with your backup file If you really have to stay with windoze, remove and re-install apache. Look at the system log files as they SHOULD tell you what was causing the crash. */ Hey Wolf, Thanks for replying. Would love to install Linux, problem is... dont know the first thing about it if things go wrong, I always wanted to learn what its all about but when I started to read up on it quickly got confused with all the different flavors out there... which one is right for me/ a total beginner? for every little thing I would probably have to join a linux list and post.. what about drivers for the bits and pieces of the laptop? what about software? most of the places I go to download software (freeware or shareware) is only for Win.. Would love to switch away from Win... but i think the OS guys will have to make it seem less of a mountain to climb to do so :( Cheers! R Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Xampp question, pretty much 0T
> After reading a bit I see that if I just copy the "data" directory in the > mySql directory, I can restore it from there? any idea if I have that wrong? Hmm I guess, but I'd take the safer road and open a console and run: mysqldump.exe -u -p --all-databases --add-drop-database --opt > mysql.database.dump so you have an sql file you can restore if necessary. Adjust paths/files/usernames/passwords as necessary. Hey! Thanks for replying. I decided to try something else while waiting for a response (still nothing from the main XAMPP forums though) and this is what worked for me, am posting it here so maybe it will help someone else in future (via the archives) facing the same problems that I faced , I dont know if this is a temp fix, I dont think so and it works perfectly for now. Downloaded XAMPP again, installed it in c:/xampp2 (original version was in c:/xampp) copied over all the files needed from the htdocs to c:/xampp2's htdocs in the MySql folder, go into the "data" folder and just copy the files with the DB names that you created, leave all other files alone, paste these files into the c:/xampp2/mysql/data folder... do not overwrite anything, and if you have done this correctly you should _not_ get the overwrite prompt Go to xampp's security page and redo the security including putting the password for root.. I am a bit of a paranoid dude, so i did a complete backup of all myfiles in htdocs and the mySql data folder and burnt it to DVD, you might consider doing thesame...just in case. Thats it! Remember to edit the paths in your scripts for those that need it from xampp to xampp2. A slight hassle, but not one that cant be done in 3-10 mins including copy time. Thanks again Chris for your replies to this thread. Cheers! R Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Xampp question, pretty much 0T
> You could try their forums: > http://www.apachefriends.org/f/?language=english Thanks! Just after I posted i started searching on google and found them, have joined and posted... no reply as yet... just the waiting game now i guess. Main prob is I cant even get phpmyadmin running to copy the DBs to do a reinstall because PHPmyAdmin wont work... without apache of course. After reading a bit I see that if I just copy the "data" directory in the mySql directory, I can restore it from there? any idea if I have that wrong? Cheers! R Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Xampp question, pretty much 0T
Hello! I have been using XAMPP for quite some time now (thanks to the recommendations from this list) without any real complaints... and the only reason I am writing here is because i am sure a lot of you guys run the same thing considering the amount of people who recommended it to me when I asked for an easy install of AMP. It was easy to install and has given me months of hassle free use... but today i have started facing some strange problems of everytime I start Apache... it crashes my laptop, anybody else run into this? I use this only for PHP, no perl. My config: Win Vista home premium with all updates and patches (genuine, not pirate copy) core2 duo 2ghz 2 gigs ram Nothing installed today for it to be acting up so. Do you suggest I reinstall? or can I just reinstall Apache in some way? If i have to reinstall is there an easy way of backing up my stuff and then reinstalling then putting my stuff back? (I know i can just copy the files that were in the htdocs... but am talking about an easy way to copy the files and the DBs and put them back... or is that just wishful thinking? TIA, Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
Hey Bill, Thanks for the tips, makes sense and will try to follow them. Cheers! R * Ryan, Four observations: 1. Don't try to solve your problem by changing the DOCTYPE. Bad HTML is bad HTML. Changing the DOCTYPE may reduce the severity of the problem, but it won't solve it. 2. You have interpreted the fact that IE gave you what you expected while FF did not as a problem with FF, but the opposite is true. A problem with IE allowed it to accept HTML that it should not have accepted. FF treated it properly. 3. Firebug is a free download from Mozilla. I have it and it has solved more problems for me than I can remember. (Or, maybe I just don't have a very good memory.) Get it. You will see your tags inside thetags, but not inside any ... tags. 4. Learn to use the W3C Markup Validation service - http://validator.w3.org/. It will point out many problems that you can solve quickly. -= Bill =- -- Murphy's Law Cardinal Conundrum - The optimist believes we live in the best of all possible worlds. The pessimist fears this is true. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
Hey Jim, Yep, That was the problem fixed that and now everything works. *** While we are on the topic of the ... tags, just a side note. It is invalid HTML syntax to have any tag between your ok here As a note: the only legal tag that I know of that can be placed in between the above tags is the tag. oh and the , , and tags. *** Cheers! R __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
Hey! Thanks to you and everyone else who replied, I have fixed the problem by remaking the tables... > This is not really anything to do with PHP, of course... :) :) True, in the end it was not. But in the beginning I couldnt figure out for the love of god why my PHP script was not getting the form values and variables... so thought it might be something to do with my script and PHP. Thanks again! /R Peter Ford, Developer phone: 01580 89 fax: 01580 893399 Justcroft International Ltd. www.justcroft.com Justcroft House, High Street, Staplehurst, Kent TN12 0AH United Kingdom Registered in England and Wales: 2297906 Registered office: Stag Gates House, 63/64 The Avenue, Southampton SO17 1XS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
Hey Pete, ** First, you should reply to the list - that way more people could see the links you posted and help out. ** Oops, my mistake, I thought I did that. Will add a snip at the bottom of this email. ** It looks like there may be a problem with the form tags - when I look at this code I see That looks like you've closed your "mainform" before defining the inputs ** can you tell me which line you see this? I did a search using that string on top and I couldnt find it... I even did a "form" search and still didnt find both of the form tags side by side.. Thanks again, R /// Snip of other mail with links /// but looks like posting links is the best option so will do: http://www.coinpass.com/test/step2.php (to run the script) http://www.coinpass.com/test/step2.phps (View the source, its just a html file really) All Javascript and CSS is in the "http://www.coinpass.com/test/scripts/"; directory The processing script just has print_r($_REQUEST); so its useless pointing you to the actual file source. / End snip/// __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
Hello Bitter, (so is that Bitter Andrew or Bitter Brown? :-) ) Thanks for the little titbit of request code, have saved it and will certainly use it. Lets see how the next version is, they promised to make the new IE stick closer to the standards. Cheers! R On Tue, Apr 8, 2008 at 6:20 PM, Ryan S <[EMAIL PROTECTED]> wrote: > Hey! > Thanks Andrew, will look into those points that you sent me. > > First thing to change will be the DOCTYPE I think, as i didht type that but > must have copied code into a pre-made page... One thing I learned when screwing around with AJAX is that it, like nearly everything that occurs in nature, must be customized to play nicely with Microsoft things. Call me bitter. No, seriously, it could be my new nickname. //Gets the browser specific XmlHttpRequest Object function getXmlHttpRequestObject() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else if(window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } else { document.getElementById('p_status').innerHTML = 'Status: Cound not create XmlHttpRequest Object. Consider upgrading your browser.'; } } It's something I had to use when playing around with a chat script I was building a while ago: http://pilotpig.net/gchat/ -- Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
Hello Bitter, (so is that Bitter Andrew or Bitter Brown? :-) ) Thanks for the little titbit of request code, have saved it and will certainly use it. Lets see how the next version is, they promised to make the new IE stick closer to the standards. Cheers! R On Tue, Apr 8, 2008 at 6:20 PM, Ryan S <[EMAIL PROTECTED]> wrote: > Hey! > Thanks Andrew, will look into those points that you sent me. > > First thing to change will be the DOCTYPE I think, as i didht type that but > must have copied code into a pre-made page... One thing I learned when screwing around with AJAX is that it, like nearly everything that occurs in nature, must be customized to play nicely with Microsoft things. Call me bitter. No, seriously, it could be my new nickname. //Gets the browser specific XmlHttpRequest Object function getXmlHttpRequestObject() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else if(window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } else { document.getElementById('p_status').innerHTML = 'Status: Cound not create XmlHttpRequest Object. Consider upgrading your browser.'; } } It's something I had to use when playing around with a chat script I was building a while ago: http://pilotpig.net/gchat/ -- Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
Hey! Thanks Andrew, will look into those points that you sent me. First thing to change will be the DOCTYPE I think, as i didht type that but must have copied code into a pre-made page... Cheers! R - Original Message From: Andrew Ballard <[EMAIL PROTECTED]> To: PHP General list Sent: Tuesday, April 8, 2008 11:18:36 PM Subject: Re: [PHP] dynamic boxes problem... JS and PHP On Tue, Apr 8, 2008 at 3:51 PM, Ryan S <[EMAIL PROTECTED]> wrote: > Hi Guys, [snip] > Andrew: > Thanks for replying! > [snip] > > Also, FWIW, I doubt it has anything to do with your problem but you > > are assigning the same value for ID each time through the loop. The ID > > attribute is supposed to be unique for each element on the page. > > Tried changing it, no luck. I didn't expect it to fix anything related to the problem you posted, but it is something that should be fixed. I looked at the HTML source (since I think that's where your problem is). The problem is that you have tags nested inside your table between two rows: While your nesting is correct insofar as making sure that your , , and tags don't cross each other, the tag can't be there. I see why you've done it that way - you have another form nested inside a cell within the same table (you can't nest one form within another), and your second form needs to span more than one cell or row. You need to rethink your page flow and layout so that it uses valid HTML structure. I don't know if you can combine both forms into one or if you need to split the table apart. FWIW, while validating the above solution I found an extra (empty and unclosed) tag inside the recipient table which prompted me to run your HTML through the W3C validator. It found 19 errors that keep it from validating as XHTML strict as specified in your DOCTYPE. Most of these won't cause major problems, but the 6th error reported is the cause of the problem you're having: "document type does not allow element 'form' here". Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
Hi Guys, Thanks for responding, will try to answer everyone in the same order. Mark W: Thanks for replying! > Since I'm relatively new to PHP I could be off on this, but I'd say yes, > $_REQUEST is wrong. I would think you'd want to use $_POST to receive > the incoming values from a form. $_REQUEST should work in this case (i think) as it works kind of like a "catch all" While $_POST just catches POST and $_GET just catches GET... $_REQUEST catches all requests be it get,post,cookie etc for testing I always use $_REQUEST. Andrew: Thanks for replying! > I think in this case $_REQUEST and $_POST should both get you what you > want. I'm wondering whether your javascript is inserting the form > fields within the correct tags. Yep, it is correct, further down I will post the URL so you can check it out if you want. > Also, FWIW, I doubt it has anything to do with your problem but you > are assigning the same value for ID each time through the loop. The ID > attribute is supposed to be unique for each element on the page. Tried changing it, no luck. Pete F: Thanks for replying! > 1. Check that the Javascript is doing what you expect: you *are* using > Firebug > on Firefox, aren't you? Also the WebDeveloper toolbar plugin is useful - it > has > a View Generated Source tool which will show you what Firefox thinks your > page > actually looks like after the JS has run... Dont have either of them dont know how to use them actually, but will have a look after this email. I did hear of firebug though not the other one. > 2. Check that the TD you are loading with content is actually inside the > > tags - otherwise the inputs won't be included in the request/post variables... Yep, checked that. IE is getting it... FF is not. Which is really strange as IE is usually the bit*h that usually throws weird errors and results. Daniel, Thanks for replying! > Ryan, would it be possible for you to send an actual link to the > page in question? You'll probably wind up with some better feedback > with a real-world test in this particular case. Didnt want to bloat my post and take up extra time from the people who reply, but looks like posting links is the best option so will do: http://www.coinpass.com/test/step2.php (to run the script) http://www.coinpass.com/test/step2.phps (View the source, its just a html file really) All Javascript and CSS is in the "http://www.coinpass.com/test/scripts/"; directory The processing script just has print_r($_REQUEST); so its useless pointing you to the actual file source. Jim L, Thanks for replying! > Show us the actual output of the print_r() call above. Would be easier if you click on the top link/s and just click the submit button Cheers! R You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] dynamic boxes problem... JS and PHP
Hey everyone, A bit of a puzzle here, dont know if this is a JS problem or PHP or FF or just me. (My money is on the last one :p ) Here's what I am trying to do: In a form I have a listbox with the values 1-5, and under the listbox i have a with the id of "recips" (like so: ' + '' + ''+ x +'. Recipient\'s name:' + '' + 'Recipient\'s email:' + '' + '' + '' + ''; } document.getElementById('recips').innerHTML=msg; } / # End JS code So far on the page everything is working, but when I click the submit button this is my PHP processing script: It shows me everything that has been submitted but NOT any of the above dynamically made boxes values... but get this, it DOES show me all values... in IE7 _not_ in FF (am using 2.0.0.13) Anybody else face anything like this? Is this a bug in FF? Is $_REQUEST wrong to catch this? Dont know what the @#$@ to do... ANY help even a link to a site which can shed a little light would be appreciated. Thanks in advance. /Ryan You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Comparing file creating dates...
Hey all, Heres what i am trying to do: When someone sends a message from my site, i take their ip address and make a file with their ip address in a directory called "hash-directory", the file looks like this: 169.34.534.243.txt I want to make sure they cant send too many messages because of the potential to spam, so I want to limit them to sending a message every X number of minutes... heres what i have written (its not working for some damn reason) # Start PHP file if(isset($_SERVER['REMOTE_ADDR'])) {$rem_address=$_SERVER['REMOTE_ADDR'];} $directory_with_files="hash-directory/"; $threshold = strtotime('-2 minutes'); echo "File created on: ".$rem_address .".txt - ". date("F d Y H:i:s.", filectime($directory_with_files.$rem_address.".txt"))." ".$file_time_details[0].""; if (file_exists($directory_with_files.$rem_address.".txt")) { if (getdate(filectime($directory_with_files.$rem_address.".txt")) < $threshold) {echo "Please wait more than 1 minute before posting.";} else{echo "Enough time has elapsed.";} } # END PHP file Where am I going wrong? Thanks! Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php