Jump to content


  • Posts

  • Joined

  • Last visited


Profile Information

  • Gender
    Not Telling

spaceman12's Achievements


Member (2/5)



  1. Visit my facebook style chat @ brightstar.99k.org/obf.php I use XMPP framework to push out the data in a nearly real time
  2. Hello, I'm just too vague over my understanding as to what I know so far may be true or not. Suppose, I have a text file stored on the server. We all know that when a file stored on a server is opened for viewing, some bandwidth is consumned and the consumption increases with every refresh of the page and so on. So if i use $.get on the client browser to reteieve the contents of the text file stored on the server, will it affect the server bandwidth consumption? I just want to make it clear that it is just a plain text file. I'm looking for all posibilities as to how I can retrieve the contents of the text file stored on the server from the client browser without necesarily having to consumned any server bandwidth. thank you all in advance!
  3. thanks alot, that did the job pretty well. However, i'd like to know if 'return' in javascript is so same in function as to exit() in php? Thanks
  4. I have been trying to sort this out by myself but it seems like I just can't figure to work it out correctly. Suppose, I have a string like this- var string="Where are you and Iam so sorry I cannot sleep I cannot dream tonight"; Here, lets assume that the string that I want to search for it is Where var search= new RegExp["^Where$"]; I'm sure the object split() has got to do something with string and then do a testing. Like this var array=new array(); array=string.split(" "); if(search.test(array)) { document.write('true'); } Despite all my efforts to make it work, I just can't. In php, we could have easily split the string into arrays using explode and call the function if(in_array($search,$array)) { echo "true"; } Please help(I'm just not very familiar with javascript) .Thanks
  5. it requires ajax and jquery for certain. It aint so easy,..unless u hire some freelancer to do it for u. I could also do that but i'm too engrosed in the development of a project atm.
  6. FINAL OUTPUT is the generated unique id in either of the conditional case implemented within da code!
  7. m giving u some ideas as how to accomplish the result u desire. As is in ur case, a lighter code is only required. Join output adds up together the alpha and nume strings. While loops in da code ensures that by all means, any value inserted in da db is unique with 100 percent guarantee! XD
  8. This I wrote for a fellow for non repetative unique id generation. However, the string lenght of the id is abt 9-10. Make so alteration withn da code so as to generate only 5 characters and made it useful for urself <?php $str_alpha="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; $str_num=1234567890; $shuffle_alpha=str_shuffle($str_alpha); $shuffle_num=str_shuffle($str_num); $alpha=str_split($shuffle_alpha,7); $num=str_split($shuffle_num,3); $rand_alpha=mt_rand(0,6); $rand_num=mt_rand(0,2); $rand_alpha_output=$alpha[$rand_alpha]; $rand_num_output=$num[$rand_num]; $join_output=$rand_alpha_output.$rand_num_output; if(file_exists('printed_id.txt')) { $getID=file_get_contents('printed_id.txt'); $printed_id=explode(PHP_EOL,$getID); while($final_output=str_shuffle($join_output)) { if(!in_array($final_output,$printed_id)) { $final_output=str_shuffle($join_output);//valid id for further usage and processing break; } } echo $final_output; $fileOPN=fopen('printed_id.txt','a+'); fwrite($fileOPN,$final_output); fwrite($fileOPN,"\r\n"); } else { $final_output=str_shuffle($join_output); $fileOPN=fopen('printed_id.txt','a+'); fwrite($fileOPN,$final_output); fwrite($fileOPN,"\r\n"); echo $final_output;//valid id for further usage and processing } ?>
  9. Do it this ways which is alot cleaner. $pincode=$row['pincode']; If(strlen($pincode)==4) { $pincode='0'.$pincode; }
  10. preg_match() function in php i a regular search expression. For details of its usage, please visit http://www.php.net Here is a sample of code that i made which i believe will be useful to you FOR CASE SENSITIVE SEARCH <?php $string="Sol 3 Drawer Chests Antique Pine Bedside Chest"; $word='Chest'; if(preg_match("*$word*",$string)) { echo $word." "."found"; } else echo $word." ".'not forund'; ?> FOR CASE-INSENSITIVE SEARCH <?php $string="Sol 3 Drawer Chests Antique Pine Bedside Chest"; $word='chest'; if(strcasecmp($word,$string)) { echo $word." "."found"; } else echo $word." ".'not forund'; ?>
  11. in ur case, stristr() is so very unreliable. Used preg_match() for an absolute error free. It is multifold reliable than the former.
  12. the foremost and 1st thing that a webmaster has in his mind is adds! And most probably, adds is the one important thing that every webmaster is looking up to when comes to revenues generation....!! Wow, this site is the next best to wikipedia XD
  13. php with html and css along would be just too boring to get on alone with any type of project or web apps at this stage of time. It is an added advantage for us all to learn which we deem has a greater prospect in the future and in the days to come rather than doing the same traditional thing over and over again. Ajax and jquery along with php is an absolute piece of ingredients for a dynamic content delivery. So its better not to ignore this. For instance, while filling up for a registration form, u r required to put a username whos value of existence in the db must b unique. There is no way in hell that the user will know if the username he fills in has been taken not until he gets down to clicks the SUBMIT BUTTON, and to our dismay if its already taken, he had to take in all the trouble of fillin up the infos again and resubmit it. However, with ajax, u can bind any occuring events with some kind of function and execute it behind the server using php, all these without the knowledge of the users, In the above example, as soon as u leave off the input field, it can always be set to trigger an ajax call using the onblur event in ur html code which wil eventualy let u know at instant about the consequence of the username u entered been taken thus abstainin u from the display of any relevent annoyin errors if any after the click of submit button.
  14. if u are a relative beginner to php, instead avert ur interest of learning to python.Now I have progres myself so much in php (to the level that i could write out any programing if som1 ask me) that its a lil bit difficult for me to adapt to the new environment of python where the two are a complete contrast to each other in terms of everything from syntax to functions to variables! But coming this summer and i surely wil why so suden interes in learnin python? Wel, m developin a browser based chat system comparable to those incoporated in gtalk and facebook. This is the time wher i come to grabs the fact abt the importance of python as a dynamic programin language in this era of modernisation.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.