Re: [PHP] Anybody got a little spare time to help me out with a little OOP
Ryan S wrote: 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!"; Here would be my incarnation of this script $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.."; $break = 12; $words=explode(" ", $sample_string, $break); $words[($break-1)] = "... read more inside!"; echo join(' ', $words); ?> 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
[PHP] saving outside website content via php...
I'm using the google api to allow people to search the web via my site. The pages are simply iframed within my site. Is it possible for me to give them a 'save' button and let them save the page they are viewing in it's current state? I don't mean save to their computer but I would use php to save it to disk or the db. How can I do this and pull in all the css, images, etc? Thanks!
[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
Re: [PHP] phpeclipse debugging & setup
Eric Butera wrote: On Fri, May 30, 2008 at 11:59 AM, PJ <[EMAIL PROTECTED]> wrote: Running FreeBSD 7.0, Eclipse SDK 3.3.2, java 1.6.0_03-p4, apache 2.2.8, php5.2.6, postgresql 8.3.1. I found that configuring Xdebug just does not work the way all the manuals, instructions and hints suggest: the only way I could get Xdebug to work (but does it?), that is, to show up under phpinfo() as both the zend module and xdebug module was to enter only zend_extension=xdebug.so in php.ini (with the other configuration parameters) but NOT adding it to the extensions.ini file. phpeclipse seems to be working - HOWEVER, it does not ignore php comments and commented out instructions and the PHP Browser does not seem to be working. Such errors as "pg_exec, pg_errormessage() pg_free_result(), pg_num_rows() & others: supplied argument is not a valid PostgreSQL link resource" are not caught. Strangely, the Firefox plugin DBGbar catches these errors... ??? What are Bookmarks in phpEclipse? Are they meant to be breakpoints? Why does the PHPbrowser (internal) not work? Why does the preferences page not show PHP Web developing? Why is only MySQL included and not postgresql in the setup? Any suggestions, explanations, instructions, sources of information would be appreciated. PJ I used to use phpeclipse. I dumped it for PDT though. I never could get the debugging to work with phpeclipse. PDT for Eclipse debugging features work with xdebug & the zend debugger. Give it a look. Thanks for the suggestion. I installed the PDT plusgin and still have issues with debugging: Using the PHP DBG script I get the Gtk-WARNING **: cannot open display: What do I have to do to install the PHP Browser? Try as I may, I do not understand what has to be done to correctly configure xdebug. According to some setup instructions I recall, phpinfo() should show 2 different sections for the xdebug and zend xdebug properties. When xdebug seems to be set up, I see a reference at the botom of the PHP information table that Xdebug v.2.1.0-dev is being used and there is an xdebug section on the displayed page. In Eclipse, under the Run/Open Debug Dialog options I see two entries - PHP DBG Script and X PHP XDebug Script. So, what is phpeclipse using? I still see nothing regarding PHP Web Developing in the Preferences window. :( How do I view the contents of variables? And when I run the debugger, I see that it interprets commented out code and ignores errors for functions like pg_exec() and pg_errormessage().. I would say that either there are some pretty weird requirements(unknown) to make php developing and debugging or I am not understanding something here - like, are there issues with different versions of the various modules, or what? This is really frustrating and sadly non-productive. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP eg.
mukesh yadav escreveu: Hi, I'm trying to learn a PHP by myself...and i need a help. I have learned all the basic but i dont know how to implement the stuff. Can you please guys help me out give me a small site in PHP so that i can study and learn. thank you. Maybe, this site can help you to learn: http://www.educar.pro.br/ Apache - PHP - MySQL - Boolean Logics - Project Management -- Você deve, sempre, consultar uma segunda opinião! -- Deixe todos saberem se esta informação foi-lhe útil. -- You must hear, always, one second opinion! In all cases. -- Let the people know if this info was useful for you! -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Class Load twice
On May 31, 2008, at 211AM, Yui Hiroaki wrote: I just do not want to load mail() when load.php is load. if you know how to solove it, please teach me it! *MyClass.php*** buff(); mail("[EMAIL PROTECTED]","test","test"); class MyClass{ Private $google; function __construct($googleKEY){ $this->google=$googleKEY; } public function buff(){ echo $this->google; } } ?> Because the call to the mail function is outside of the class definition, it will be executed as soon as the file is included. If you want the email to be sent by the class, it needs to be done within one of the class methods (functions). Brady -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpeclipse debugging & setup
I also fiddled with eclipse for a bit, but couldn't make it debug. I really like nusphere php-ed. Debugging works great - local or remote to your web server. Not free, but worth it. PJ wrote: Running FreeBSD 7.0, Eclipse SDK 3.3.2, java 1.6.0_03-p4, apache 2.2.8, php5.2.6, postgresql 8.3.1. I found that configuring Xdebug just does not work the way all the manuals, instructions and hints suggest: the only way I could get Xdebug to work (but does it?), that is, to show up under phpinfo() as both the zend module and xdebug module was to enter only zend_extension=xdebug.so in php.ini (with the other configuration parameters) but NOT adding it to the extensions.ini file. phpeclipse seems to be working - HOWEVER, it does not ignore php comments and commented out instructions and the PHP Browser does not seem to be working. Such errors as "pg_exec, pg_errormessage() pg_free_result(), pg_num_rows() & others: supplied argument is not a valid PostgreSQL link resource" are not caught. Strangely, the Firefox plugin DBGbar catches these errors... ??? What are Bookmarks in phpEclipse? Are they meant to be breakpoints? Why does the PHPbrowser (internal) not work? Why does the preferences page not show PHP Web developing? Why is only MySQL included and not postgresql in the setup? Any suggestions, explanations, instructions, sources of information would be appreciated. PJ -- Selwyn Polit Computer Consulting, programming, web sites 512-696-0410 www.AustinProgressiveCalendar.com -- 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
On Sat, May 31, 2008 at 4:23 AM, Ryan S <[EMAIL PROTECTED]> wrote: > > > 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;} > == Try this: -- 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] PHP eg.
On 5/31/08, mukesh yadav <[EMAIL PROTECTED]> wrote: > > hey > thank you guys for your reply and suggestion i really appreciate > it... > now I'm planning to to write a small project. I think it will be a best way > to learn PHP and the stuff how it works. > defiantly this mailing list will provide me great help when ever I'll need. > I am so glad you are DEFINITELY defiant ;-) -- Bastien Cat, the other other white meat
Re: [PHP] PHP eg.
hey thank you guys for your reply and suggestion i really appreciate it... now I'm planning to to write a small project. I think it will be a best way to learn PHP and the stuff how it works. defiantly this mailing list will provide me great help when ever I'll need. On Fri, May 30, 2008 at 9:03 PM, Eric Butera <[EMAIL PROTECTED]> wrote: > On Fri, May 30, 2008 at 2:34 AM, mukesh yadav <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm trying to learn a PHP by myself...and i need a help. > > I have learned all the basic but i dont know how to implement the stuff. > > Can you please guys help me out give me a small site in PHP so that i can > > study and learn. > > > > thank you. > > > > The way I started was just a desire to know how to make this web thing > work. So I came up with the idea to make a page that would show some > current information I've posted and have the ability to > add/edit/delete this information. Everything else fell in line once I > had the idea of what I wanted to happen. I had to research pulling > and putting records into mysql. It was a horrible mess compared to > what I do now, but you have to get your feet wet somehow. > > Find something you want to accomplish. It gives you specific > requirements and fulfilling them is where you really learn. After you > complete your project, do another one. Along the way you'll learn > what does and doesn't work. > > The first script I ever really tried to work on was loosely based > around this article [1]. There are lots of issues I have with the > code but it is what I started out with. It shows the basics of > working with mysql and the whole record workflow. Some of the main > issues I have are: > - or die() is not error handling > - no escaping of raw data on output > - lack of data validation on user input > > These issues aren't as important if it is a local pet project. If you > plan on making this more than a weekend hobby though, please make sure > to read up on the security side of things also. [2] For a more in > depth look see the OWASP Guide. [3] > > Good luck! > > [1] http://www.melonfire.com/community/columns/trog/article.php?id=280 > [2] http://phpsec.org/library/ > [3] http://www.owasp.org/index.php/Guide_Table_of_Contents >
Re: [PHP] Class Load twice
Yes, Second file is load.php(NOT MyClass.php ) If you add comment Mail() function ,in MyClass.php, I can not get any email! I just want to get email from only MyClass.php. Regards, Yui 2008/5/31 Ludovic André <[EMAIL PROTECTED]>: > Hi, >> >> I just do not want to load mail() when load.php is load. >> if you know how to solove it, please teach me it! >> > > I assume that the second file is named 'load.php' ? > Then you should just comment the line starting with mail(... in MyClass.php > So: > > *MyClass.php*** > $objRef=new MyClass("hui7gutWSFrh6zt"); > $objRef->buff(); > //mail("[EMAIL PROTECTED]","test","test"); > class MyClass{ > Private $google; > function __construct($googleKEY){ >$this->google=$googleKEY; >} >public function buff(){ >echo $this->google; >} > } > > ?> > > That was an easy one ;) > > > Best regards, > > Ludovic André > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Class Load twice
Hi, I just do not want to load mail() when load.php is load. if you know how to solove it, please teach me it! I assume that the second file is named 'load.php' ? Then you should just comment the line starting with mail(... in MyClass.php So: *MyClass.php*** buff(); //mail("[EMAIL PROTECTED]","test","test"); class MyClass{ Private $google; function __construct($googleKEY){ $this->google=$googleKEY; } public function buff(){ echo $this->google; } } ?> That was an easy one ;) Best regards, Ludovic André -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Class Load twice
hi! Please take look at my code; I have two files. one of the two file is wrtten mail() function. when load.php is loaded, mail(), written by MyClass.php, os also loaded. I just do not want to load mail() when load.php is load. if you know how to solove it, please teach me it! *MyClass.php*** buff(); mail("[EMAIL PROTECTED]","test","test"); class MyClass{ Private $google; function __construct($googleKEY){ $this->google=$googleKEY; } public function buff(){ echo $this->google; } } ?> *MyClass.php*** Regards, Yui -- 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