Re: [PHP] Embedded Video
You would need to use Java or Flash to load the video and check the loaded size against the total size. - Craige On 12/9/06, Beauford <[EMAIL PROTECTED]> wrote: Not sure if this can be done with PHP, or if I would need to use a java script or something. If anyone has any ideas it would be appreciated. I have a video on my site and I want something to say that the video is loading and then disappear once the video starts. Thanks again. -- 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] Embedded Video
Not sure if this can be done with PHP, or if I would need to use a java script or something. If anyone has any ideas it would be appreciated. I have a video on my site and I want something to say that the video is loading and then disappear once the video starts. Thanks again. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Error Display
I have been working with PHP5 since it's release, and until a few months ago, have never experienced the problem I am about to describe to you. I am not sure weather it has been discovered previously or not, nor do I know exactly how to replicate it, but I would like to know if you have encountered the problem as well. The problem is this: I have noticed that there appears to be (fatal) errors that do not show when they occur in an included file. The script simply halts execution, and returns headers to the browser. I do not have a list of the errors that do not display, but I do not believe it applies to all fatal errors. The errors show perfectly fine when the file is called directly from the php parser (/through the browser), just not when included. This is an extreme annoyance, and would like to know if it has been discovered. As far as I can tell, the errors seem to apply mostly to Objects and classes, but I cannot be certain. I have not run too many tests on the problem. Although it should not need to be stated, I do have error reporting set to E_ALL. - Craige -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Installation question
Solved. Ditched Slackware 10 and installed Slackware 11. Both were installed the exact same way, so who knows Thanks to all. -Original Message- From: Ryan Creaser [mailto:[EMAIL PROTECTED] Sent: December 7, 2006 10:05 PM To: Beauford Cc: php-general@lists.php.net Subject: Re: [PHP] PHP Installation question Beauford wrote: > Hi, > > I am trying to install vBulletin and keep getting this error: Fatal error: > Call to undefined function: gzinflate(). > > The only thing I can find on this is that zlib needs to be configured > with PHP at compile time. So I reinstalled PHP using the following: > > ./configure --with-mysql --with-apache=../apache_1.3.36 --with-zlib > --with-gd make make install > > The above finishes with no error. > > I rebooted, but still get same error, and zlib or gd doesn't show up > in my phpinfo output. zlib is installed, and from my understanding gd > is included with PHP, all the other libraries for gd are also > installed. So what am I doing wrong? > > Also, how do I find out where something is installed? i.e. zlib. If I > do a search on it I get hundreds of hits... > > Last. In the above ./configure line I get a message from PHP saying I > am using the built in version of MySQL - if I point it to the actual > MySQL source directory I get the following error. > > configure: error: Cannot find libmysqlclient library under > ../mysql-5.0.22 > > Any help is appreciated. > > I am using Slacware 10, PHP 4.4.4, MySQL5.0, and Apache 1.3.36 > > Thanks > > > Did you recompile apache after running php's make install? Using --with-apache builds a module that gets compiled *into* apache (as opposed to --with-apxs which creates a dynamic module), ie. you need to rebuild apache after building php. My guess is the gzinflate error probably comes from an old php module. - rjc -- 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] Ensuring that variable contains a number
On 10/12/06, Richard Lynch <[EMAIL PROTECTED]> wrote: My take: $number = (int) $number; if ($number < 1) $number = 1; You could error out for < 1, or compare the original with the (int) cast to see if PHP considers them = and error out if not, while using the (int) cast to be SURE you have an int, or... But a typecast and inequality test should be pretty clear and cheap. Hey, nice. Thanks! Dotan Cohen http://what-is-what.com/what_is/bluetooth.html http://lyricslist.com/lyrics/artist_albums/509/whitesnake.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include problem
There is also a set_include_path function, I do believe. On Wed, December 6, 2006 4:26 am, Ashley Hales wrote: > I am trying to use includes on a free php server but I cannot set the > includes_path myself. Consequently when I try to include common > elements or > library files I run into trouble as I am unable to store or gain > acesss to a > central includes folder for the entire of my website to access. Is > there > any way around this? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP analytics
There are a few zillion refinements to be done here, and you had better make sure the username you stuff into your $_SESSION is validated, but, really, it's not exactly rocket science to hack something up to know what the user clicked, once you force them to login... On Wed, December 6, 2006 5:48 am, Rick. wrote: > Hello > > > > I am new to php and I would like some guidance from those who have a > bit more expereince with PHP > > > I will be attempting to do a bit of tracking and web analytics. > Basically, the user will login > and from there everything that he clicked will be recorded in a > database and analyzed > i.e user behaviour, patterns with different user groups. > > Is this possible with php and it is a major undertaking ? just trying > not to get ahead of myself here.. > > are there any tutorials or scripts or books that you know of ? > > > > Thanks > Regards > Rick > > > > -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP5 Inheritance/method override problem
You can't override the method signature in subclasses in PHP5. If you want this in PHP6, research the ...discusssion... from last month on this topic on the PHP-Internals mailing list, and weigh in if it's not already a Dead Horse. I recall the ...discussion... more for entertainment value than actual content, so can't tell you what the outcome was. :-) On Wed, December 6, 2006 9:22 am, Richard Morris wrote: > Hi, > > I came across this problem and I was wondering if someone might be > able > to explain to my why it is happening. I put together a short example > to > illustrate the problem that I am having. > > Basically I have one class that performs a certain task. I then have > a > second class which extends the first class and performs some tasks in > addition to the first class. Even though ClassA should know nothing > about ClassB since ClassA is the parent, ClassA actually calls > ClassB's > exist method when it should be calling it's own. > > I know that description is really wordy and probably confusing which > is > why I provided below the example code that illustrates the problem. > > Doesn't this break the idea of inheritance? I can get it to work if I > change ClassB::exists to some other name such as ClassB::exists2. > > If anyone can enlighten me as to why this problem is occurring or > suggest a fix I would really appreciate it. Thank you. > > > > expected output > --- > ClassB - save > ClassA - save > ClassA - exists > ClassA - update > > > > actual output > - > ClassB - save > ClassA - save > > > Warning: Missing argument 2 for ClassB::exists(), called in > /website/overridetest.php on line 6 and defined in > /website/overridetest.php on line 33 > > ClassB - exists > ClassA - update > > > > overridetest.php > > class ClassA { > public function save($value) { >echo "ClassA - save\n"; > >if ($this->exists($value)) > $this->update($value); >else > $this->insert($value); > } > > protected function insert($value) { >echo "ClassA - insert\n"; > } > > protected function update($value) { >echo "ClassA - update\n"; > } > > public function exists($value) { >echo "ClassA - exists\n"; >return true; > } >} > >class ClassB extends ClassA { > public function save($value, $classAValue) { >echo "ClassB - save\n"; > parent::save($classAValue); > // do some additional work... > } > > public function exists($value, $classAValue) { > // does a different search than ClassA >echo "ClassB - exists\n"; > return true; > } >} > >$c = new ClassB(); >$c->save('test', 'test2'); > ?> > > -- > Richard Morris > HDD Broker, Inc. > > Toll-Free: +1 866 960-3331 > International: +1 250 474-6022 >Fax: +1 250 474-6099 > E-Mail: [EMAIL PROTECTED] > Web Site: www.hddbroker.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Grammar
I think what you want is in here: http://lxr.php.net On Wed, December 6, 2006 10:59 am, yo plop wrote: > Hello > > I have been asked to do a compiler from PHP5 to C code using Lex and > Yacc > > I don't think i can find it already done and open source, but if i > could get > the PHP grammar (in Lex/Yacc would be awesome) it would be a great > help for > me, as the one i begin to write is full of conflicts. > > Does anyone have a clue or hint ? > > Thanks a lot folks ! > Fred > -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Ensuring that variable contains a number
My take: $number = (int) $number; if ($number < 1) $number = 1; You could error out for < 1, or compare the original with the (int) cast to see if PHP considers them = and error out if not, while using the (int) cast to be SURE you have an int, or... But a typecast and inequality test should be pretty clear and cheap. On Wed, December 6, 2006 2:01 pm, Dotan Cohen wrote: > How can I ensure that a variable contains a postive integer number? > I'm currently using this code: > > $number=(1-$number); > $number=(1-$number); > if ( $number<1 ) { $number=1; } > > But I'm sure that there is a better way. What would that be? > > Dotan Cohen > > http://what-is-what.com/what_is/internet.html > http://song-lirics.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to not be abused by mail form injectors?
if (strstr($subject, "\r") || strstr($subject, "\n")) die("spammer"); if (strstr($from, "\r") || strstr($from, "\n")) die("spammer"); That right there will kill off most of your header injection attacks, assuming you have already got $from = $_REQUEST['from'] or something similar. The main thing is to make sure your HEADERS are clean with no injected junk to insert more Cc: headers or MIME stuff that shouldn't be there. You can also "throttle" the amount of email you are willing to send out on behalf of a single IP address -- while this might not work for high-volume sites with heavily skewed userbase of corporate America behind firewalls, or AOL users whose IP address changes faster than drummers change their underwear, it works well for small-scale sites with reasonable limits of a handful of emails per IP per 24-hour period. What is best to do depends on your target audience, who is getting the emails, who is sending them, and what constitutes "normal" usage. Security is rarely an off-the-rack solution :-) On Wed, December 6, 2006 3:09 pm, Peter Lauri wrote: > Hi, > > > > Are there any general protection methods to minimize the risk of > robots > using your mailing forms as spam senders? > > > > /Peter > > > > > > > > -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Load Extensions
On Fri, December 8, 2006 1:25 pm, Igor Kravchenko wrote: > Can someone help me with this, please? I cannot load extensions. > > I setup php5 in the c:\php folder. I specified extension_dir = > "C:\php\ext". > > Everything else is setup correctly because php works. for me, I can > load > phpinfo file. > > It would not load extensions. > > I am going nuts here. Please anyone, what can it be When you look at phpinfo() output, where does it tell you that php.ini should be? Does it have "php.ini" at the end, or does it end in a directory? If it does not have "php.ini" at the end, then it didn't *FIND* a php.ini, and you need to put a php.ini in one of the places it is looking. For sure, *ONE* of the places it is looking is the directory listed in phpinfo() output. There may be other equally valid, perhaps even superior locations, from some perspective, but to at least get it rolling quickly, you can toss your php.ini into THAT directory, instead of wherever you have it. Or if you have no php.ini at all yet (the default) make one from one of the two samples included with the PHP download. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problems configuring php5.2.0 and php4.4.4 with mysql5.0.27
Did you configure/install MySQL *and* the mysql-dev packages or whatever your OS needs for the MySQL headers to be there? Did you also compile MySQL and install it? Is there a libmysqlclient somewhere like /usr/local/lib or /usr/lib or whatever is appropriate for your system? On Linux, did you do that 'ldconfig' thing that tells the OS to scan for new libraries in various dirs? On Linux, is the dir where your libmysqlclient lives listed in /etc/ld.so.conf so that the OS can find it when you do the ldconfig thing? ldconfig -v | grep mysql is your buddy on Linux for this one. Not that I've ever stumbled through this problem before, oh no. :-) :-) :-) It's weird how quickly this stuff becomes second nature after you screw it up a half-dozen times... On Sat, December 9, 2006 4:37 am, Erik Nordlander wrote: > Hi, im having troubles configuring php5.2.0 (since this version didnt > work i > also tried 4.4.4 without success) with mysql 5.0.27 and apache 2.2.3. > The > apache server is working properly, and so does the mysql server. > > Theres a unexpeced error in the configwindow; > > checking return type of qsort... void > checking for mysql_close in -lmysqlclient... no > checking for mysql_error in -lmysqlclient... no > configure: error: mysql configure failed. Please check config.log for > more > information. > > when i execute with command: > > ../configure --with-apxs2=/usr/local/apache2/bin/apxs > --with-mysql=/usr/local/mysql > --with-zlib-dir=/home/erikn/php5/pph-5.2.0/ext/zlib > --with-gd > > the configlog is attached to this document, if you need it :) > > thanks in advance! > Erik Nordlander > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file uploads Q?
On Sat, December 9, 2006 12:18 pm, William Stokes wrote: > Is it possible to allow user pick several images and upload them all > at > once? (I need to pass the images to a function for the resize). Or do > I need > to give several browse buttons to allow multiple file uploads? Yes, you would need to have several INPUT TYPE="FILE" browse buttons. > Also I have seen a application (written with MS tools) that allows > user to > upload a zip file containing images and the zip is automatically > uncompressed to a server disk. Can this be done with PHP also? Yes. http://php.net/zip -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] file uploads Q?
Hello, I have somehow managed to write a scipt that is able to upload and resize images to a server :))) Sad part is that now the user can upload only one image at a time.(user has a browse button for browsing images in his local disk and can pick only one at a time). Is it possible to allow user pick several images and upload them all at once? (I need to pass the images to a function for the resize). Or do I need to give several browse buttons to allow multiple file uploads? Also I have seen a application (written with MS tools) that allows user to upload a zip file containing images and the zip is automatically uncompressed to a server disk. Can this be done with PHP also? All help and tips appreciated! Thanks -Will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] using growisofs in a PHP/HTML page
On Saturday 09 December 2006 15:17, you wrote: > when running something through a web browser/server the command is > being run as/by the user that the web server runs as (in a unix/apache > environment that's generally "apache" or "nobody"). hence the likely > difference between how this works in a terminal window (where it's > being run as the logged in user) and the php/html page (where it's > being run as the web server user). > > is "www-data" the user that your web server is running as? > yes, it is. The "mkdir /tmp/CopiaSeguranca", the "mysqldump ...", and the two "cp ..." comands, are all ok. with www-data.www-data owning the directory and with the correct (I think) permissions. The directory where the command is executed (where the php file is) ~fpam/public_html/BasesDados/CopiasSeguranca is writable for all. When I tried the command in the command line, I first changed to root (su root), and then to www-data (su www-data). And I could execute the command without problems. ... > > > Original Message > > > Date: Saturday, December 09, 2006 02:57:05 PM + > > From: Pedro Quaresma <[EMAIL PROTECTED]> > > To: php-general@lists.php.net > > Subject: [PHP] using growisofs in a PHP/HTML page > > > > Hi > > > > I'm trying to write a "make a backup, page". I do the backup of all > > the databases (into /tmp/CopiaSeguranca), I do the copying of some > > directories to /tmp/CopiaSeguranca, and then I want to write a DVD of > > all the files in /tmp/CopiaSeguranca. > > > > Everything is ok, except for the last step. > > > > (...) > > $saida=system("growisofs -Z /dev/hda -R -J -input-charset > > iso8859-1 /tmp/CopiaSeguranca/",$return_value); > > echo "--- $saida --- "; > > echo "--- $return_value --- "; > > if(!$return_value){ > > echo "Success"; > > echo" return "; > > } > > else > > echo "Error."; > > (...) > > > > > > The "growisofs" command does nothing... if I do the same command in a > > bash window, in the command line everything works fine, I think that > > the permissions are ok, I put the www-data user in the "plugdev" and > > "cdrom" groups... > > > > Is it possible to use growisofs inside PHP? > > -- End Original Message -- -- At\'e breve Professor Auxiliar Pedro Quaresma Departamento de Matem\'atica Faculdade de Ci\^encias e Tecnologia Universidade de Coimbra P-3001-454 COIMBRA, PORTUGAL correio-e: [EMAIL PROTECTED] p\'agina: http://www.mat.uc.pt/~pedro/ telef: +351 239 791 181; fax: +351 239 832 568 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] using growisofs in a PHP/HTML page
Hi I'm trying to write a "make a backup, page". I do the backup of all the databases (into /tmp/CopiaSeguranca), I do the copying of some directories to /tmp/CopiaSeguranca, and then I want to write a DVD of all the files in /tmp/CopiaSeguranca. Everything is ok, except for the last step. (...) $saida=system("growisofs -Z /dev/hda -R -J -input-charset iso8859-1 /tmp/CopiaSeguranca/",$return_value); echo "--- $saida --- "; echo "--- $return_value --- "; if(!$return_value){ echo "Success"; echo" return "; } else echo "Error."; (...) The "growisofs" command does nothing... if I do the same command in a bash window, in the command line everything works fine, I think that the permissions are ok, I put the www-data user in the "plugdev" and "cdrom" groups... Is it possible to use growisofs inside PHP? ??? Thanks. -- At\'e breve Professor Auxiliar Pedro Quaresma Departamento de Matem\'atica Faculdade de Ci\^encias e Tecnologia Universidade de Coimbra P-3001-454 COIMBRA, PORTUGAL correio-e: [EMAIL PROTECTED] p\'agina: http://www.mat.uc.pt/~pedro/ telef: +351 239 791 181; fax: +351 239 832 568 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problems configuring php5.2.0 and php4.4.4 with mysql5.0.27
On Sat, 2006-12-09 at 11:37 +0100, Erik Nordlander wrote: > Hi, im having troubles configuring php5.2.0 (since this version didnt > work i also tried 4.4.4 without success) with mysql 5.0.27 and apache > 2.2.3. > The apache server is working properly, and so does the mysql server. This doesn't mean you have the libs installed. Make sure you have libmysql installed on your system and make sure you have it installed at --with-mysql=/usr/local/mysql Cheers, Rob. > > Theres a unexpeced error in the configwindow; > > checking return type of qsort... void > checking for mysql_close in -lmysqlclient... no > checking for mysql_error in -lmysqlclient... no > configure: error: mysql configure failed. Please check config.log for > more information. > > > when i execute with command: > > ./configure --with-apxs2=/usr/local/apache2/bin/apxs > --with-mysql=/usr/local/mysql --with-zlib-dir=/home/erikn/php5/pph- > 5.2.0/ext/zlib --with-gd > -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php