[PHP] chmod - Opertaion not permitted in ....
Hi all Got a problem don't know how to get in really.. simple code: ?php chmod(/aaa/bbb.php, 0777); ? and I get a warning says Operations not permitted in . Anyone met this before? I've done quite a lot reading on Google but couldn't get to it. THanks
[PHP] URL injection
Hi Can anyone help me handel this URL injection ? https://www.xxx.co.uk/register.php;| grep 123 I want to detect it and header back to my index page. It's quite urgent Thanks for help M.
Re: [PHP] URL injection
Hi The register.php has only a form ?php form name=registerUser action=register.php method=post input type=text name=username size=10 / input type=submit value=send / /form ? Does this help ? Thanks for reply 2009/6/4 Stuart stut...@gmail.com 2009/6/4 Morris morris...@gmail.com: Hi Can anyone help me handel this URL injection ? https://www.xxx.co.uk/register.php;| grep 123 I want to detect it and header back to my index page. It's quite urgent What the smeg is register.php doing that makes it execute that?? Show us the code. -Stuart -- http://stut.net/
[PHP] php get rss tag using DOM
Hi, I am trying to write a programme to read a rss xml file. ... media:content url=*exampe.jpg* ... ... scan anyone tell me how to get the url attribute? I wrote some codes similar: $doc = new DOMDocument; $doc-load($myFlickrRss); $r = $doc-getElementsByTagName('media:content'); for($i=0;$i=$r-length;$i++) { // help here }
[PHP] Re: php get rss tag using DOM
I know rss_php, but it doesn't fit my solution. Is anyone able to help me with my question? thx 2009/2/8 Nathan Rixham nrix...@gmail.com Morris wrote: Hi, I am trying to write a programme to read a rss xml file. ... media:content url=*exampe.jpg* ... ... scan anyone tell me how to get the url attribute? I wrote some codes similar: $doc = new DOMDocument; $doc-load($myFlickrRss); $r = $doc-getElementsByTagName('media:content'); for($i=0;$i=$r-length;$i++) { // help here } use http://rssphp.net/ you can view the source online and it's all done using DOMDocuments :)
Re: [PHP] Is it possible to send POST vars through a header redirect?
Not possible to send POST in header if your aim is to hide vars from users. Could think about dynamically send POST using Javascript. form.send(); This requires some JS knowledge about how to exchange data between PHP and JS 2009/2/4 tedd tedd.sperl...@gmail.com At 9:47 AM -0500 2/4/09, Mike Roberts wrote: Ladies and Gentlemen. I am a recruiter who joined this list to understand a little about PHP. I respected the boundaries, and never tried to recruit you. Now I am asking for a courtesy in return. I have tried several ways and several times to be excluded from the list, but I still get emails. Can somebody who is 'in charge' please remove me from the list. Thank you. Michael Roberts Have you tried? To unsubscribe, visit: http://www.php.net/unsub.php It's at the bottom of every post. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirecting from unreachable page on website
What if the file exists, but it's kinda file to update database, like // get request $_REQUEST // execute sql statement to update database // redirect to the other page, showing results? in this case 404 approach does not mean to do correctly, so what else is suggested? 2009/1/22 Per Jessen p...@computer.org Richard Heyes wrote: ... Really, for URLs that don't exist you should be showing a 404, This way the user doesn't falsely believe that the URL is a valid one and keep using it. By using the ErrorDocument directive like Per suggested, you can customise it to be distinct helpful Apache also comes with a good example of how to cobble that with content negotiation to present error documents in the users preferred language. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Server cannot send emails
If you are using apache + php, check php.in your server is able to support the mail() function and you have correctly set up the send and return address. 2009/1/17 Ashley Sheridan a...@ashleysheridan.co.uk On Fri, 2009-01-16 at 15:25 +0100, Sergio Jovani wrote: Hi, Thanks for replying. Adding From header did not solve the problem. I'm thinking is a server limitation. Could it be? 2009/1/16 Thiago H. Pojda thiago.po...@gmail.com: On Fri, Jan 16, 2009 at 10:36 AM, Sergio Jovani lese...@gmail.com wrote: Hi! I have working at SourceForge.net project web space Drupal as CMS. I have many modules installed related with email like Contact, Notify... This modules never worked and I tried send an email from email php function. I did it with: ?php $to = myem...@gmail.com; $subject = Hi!; $body = Hi,\n\nHow are you?; if (mail($to, $subject, $body)) { echo(pMessage successfully sent!/p); } else { echo(pMessage delivery failed.../p); } ? This does not work too. Is there any issue with email sending from SourceForge.net? Looks like you're missing the From: part of the email. That's probably your issue. I never used sourceforge, but I know many hostings require you to specify a sender. from http://php.net/manual/en/function.mail.php ?php $to = 'nob...@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmas...@example.com' . \r\n . 'Reply-To: webmas...@example.com' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? Thiago Henrique Pojda http://nerdnaweb.blogspot DOT com What's the return code you get from your mail() call? Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to suppress error messages when using 'new mysqli(...)'
Hi, I am having this problem that I hope can be worked around. I make a connection to our MySQL database using the object version of mysqli. If access is denied because of an incorrect username or password, mysqli displays an error. Is there any way to suppress the error message? Here is the code I am using as a test case: ?php $db = null; $db = new mysqli('localhost', 'user', 'badpass', 'test'); if (mysqli_connect_errno()) { echo Database connection error.\n\n; exit(); } echo Connection successful.\n\n; ? This is the output I get: PHP Warning: mysqli::mysqli(): (28000/1045): Access denied for user 'user'@'localhost' (using password: YES) in /home/richard/dbtest.php on line 4 Warning: mysqli::mysqli(): (28000/1045): Access denied for user 'user'@'localhost' (using password: YES) in /home/richard/dbtest.php on line 4 An error occurred while trying to connect to the database. I was expecting this: An error occurred while trying to connect to the database. Is there a way to prevent the error messages from being display so that the error can be handled in a nicer manner? Thank you. -- 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
Re: [PHP] How to suppress error messages when using 'new mysqli(...)'
Richard Lynch wrote: On Fri, January 5, 2007 4:35 pm, Jochem Maas wrote: Richard Lynch wrote: On Fri, January 5, 2007 12:29 pm, Richard Morris wrote: I am having this problem that I hope can be worked around. I make a connection to our MySQL database using the object version of mysqli. If access is denied because of an incorrect username or password, mysqli displays an error. Is there any way to suppress the error message? To suppress a single error message in a single line you can use the @ operator in PHP: @this_code_errors_but_youll_never_see_the_error(...); To catch errors in a more general manner: http://php.net/set_error_handler Also, since mysqli is new-fangled, it's probably using that fancy try/catch/throw stuff, so you could PROBABLY wrap it in a try/catch if that was the case his error would have mentioned something about an uncaught exception. With all the __toString and SPL array/object mumbo-jumbo going on, I never know what's going on anymore with these things... I found out that new mysqli doesn't throw an exception during it's construction. The way I figured out how to deal with it was to do this: $db =@ new mysqli('localhost', 'user', 'badpass', 'test'); With this in place no warning messages are displayed and then I can follow it up with a check for any errors using mysqli_connect_errno(). I was a little surprised to see it not use an exception as I thought that would be a better mechanism to know something is wrong when dealing with objects. Either way, it was a simple fix. I just want to thank Fernando Chure for pointing me in the right direction. -- Richard Morris Toll Free: (866) 960-3331 International: +1 250 474-6022 Fax: +1 250 474-6099 E-Mail: [EMAIL PROTECTED] Web Site: www.hddbroker.com
[PHP] Segmentation fault using imap_open
Hello all, I was experimenting with the imap_* library functions trying to see if I could get a PHP script to access a folder on our IMAP server and I ran into a problem. I was trying to get a simple script to work which simply opened a connection to the mail server and then closed it but when I ran the script it caused a segmentation fault on the imap_open line. Here is the code I was trying to run: ?php $mailbox = '{mail.hddbroker.com:143}INBOX'; $username = 'xxx'; $password = 'yyy'; $mbox = imap_open($mailbox, $username, $password); imap_close($mbox); ? and on the CLI it produced the output: Segmentation fault (core dumped) I configured my PHP installation with --enable-debug and using the core dump, I got the following backtrace: #0 0x00144019 in SSL_SESSION_hash () from /lib/libssl.so.4 #1 0x001ca484 in lh_free () from /lib/libcrypto.so.4 #2 0x001ca5f3 in lh_delete () from /lib/libcrypto.so.4 #3 0x00148141 in SSL_CTX_get_timeout () from /lib/libssl.so.4 #4 0x001ca56e in lh_retrieve () from /lib/libcrypto.so.4 #5 0x001481f7 in SSL_CTX_flush_sessions () from /lib/libssl.so.4 #6 0x001441a3 in SSL_CTX_free () from /lib/libssl.so.4 #7 0x005185ac in ssl_close () from /usr/lib/libc-client.so.0 #8 0x0051851f in ssl_close () from /usr/lib/libc-client.so.0 #9 0x005176c3 in ssl_aopen () from /usr/lib/libc-client.so.0 #10 0x0054a697 in imap_open () from /usr/lib/libc-client.so.0 #11 0x00523a90 in mail_open () from /usr/lib/libc-client.so.0 #12 0x0814dcfc in zif_imap_open (ht=3, return_value=0xb7c8bc9c, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at /usr/local/src/php-5.2.0/ext/imap/php_imap.c:780 #13 0x08332c92 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfe372e0) at /usr/local/src/php-5.2.0/Zend/zend_vm_execute.h:200 #14 0x08332419 in execute (op_array=0xb7c8b68c) at /usr/local/src/php-5.2.0/Zend/zend_vm_execute.h:92 #15 0x0831aa9b in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/local/src/php-5.2.0/Zend/zend.c:1097 #16 0x082e4a51 in php_execute_script (primary_file=0xbfe397d0) at /usr/local/src/php-5.2.0/main/main.c:1758 #17 0x08393462 in main (argc=2, argv=0xbfe398a4) at /usr/local/src/php-5.2.0/sapi/cli/php_cli.c:1108 It doesn't mean too much to me but I thought someone might be able to understand it. Here is some additional details that might be needed: PHP Version: PHP 5.2.0 (cli) (built: Nov 3 2006 06:07:03) OS: CentOS 4.4 i386 RPM packages installed: - openssl-0.9.7a-43.14 - openssl-devel-0.9.7a-43.14 - libc-client-2002e-14 - libc-client-devel-2002e-14 There was a bug opened that has the same segmentation problem but the scenario seems to be different including using a different version number. PHP Bug #39726 (http://bugs.php.net/bug.php?id=39726) If there are any other details I can provide or if someone could point my in another direction that would help, I would really appreciate it. Thank you. -- 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
[PHP] PHP5 Inheritance/method override problem
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 ?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
[PHP] Re: PHP5 Inheritance/method override problem
Edward Kay wrote: Hi Richard, This is very strange. I can certainly reproduce the problem. Putting a var_dump($this) in ClassA's save method shows that PHP sees $this as an instance of ClassB - when it should be of ClassA. what *you* think it should be and what php's developers decided it should be about 3+ years ago obviously differ. if you have an instance of ClassB it is exactly that - refering to $this in the parent class definition won't magically make the class of the instance change. $this is plain this and not something else. Yes, you are indeed correct. I was thinking that as B extends A, A wouldn't know anything about B thus $this in A would refer to A. I can now see that my logic was flawed here. Thanks for pointing it out Jochem! Richard, replacing your if ($this-exists($value)) with if (self::exists($value)) will call A's exists method, as you require. As Brad pointed out however, your defintion of B overrides A's exists method. If you need both, then you should rename the method in class B. Edward Using the self::exists(...) call instead of $this-exists(...) worked perfectly. It threw me for a loop to see ClassA call a method in ClassB even though ClassA has no reference to ClassB at design time. It is probably why in other languages like C++ they use the virtual keyword to identify this behaviour. Can self::method(...)/self::$variable replace $this-method(...)/$this-variable in all uses or are there cases where you would need to use $this instead of self? In another post Roman said that all non-private method are virtual in PHP. If this is the case, I am assuming that the PHP architects would want developers to use self:: in classes that could be subclassed with method names that are the same as the parent(s)? Thanks all for the help. -- 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
[PHP] Form variable can't transfer to web page
Dear all PHP users, I have installed a new web server for PHP scripting. I wrote a PHP form page to submit some variables to another PHP pages. After submission, I found that the variables cannot be echoed out. The scripts are as simple like these, !-- hello2.php-- body ?php print form action=\hello.php\ method=\POST\\n; print Name: input type=\text\ name=\name\br\n; print input type=\submit\\n/form\n; ? !-- hello.php-- body ?php echo(Hello, $name!\n); echo(p\nWhat a bbold/b move this is!\n); ? /body What sort of problem relating to installation is it? Thanks for any inputs and advice. Morris Law IT Coordinator Science Faculty Hong Kong Baptist University /body -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php backtraces with gdb print gibberish for function name
I have have a PHP script that is core dumping, I'm trying to find out exactly where. I carefully followed the instructions on http://bugs.php.net/bugs-generating-backtrace.php with a little help in creating an apache debug build using: http://www.bowiesnyder.com/writings/gdb_apache.htm however, when I get to the end bit where it's supposed to print out the function that was causing the seg fault (I've already typed frame x where x is the lowest-numbered execute() call), I get crap: (gdb) print (char *)(executor_globals.function_state_ptr-function)-common.function_name $2 = 0x83a2be0 ´\221/\b\024àJ\bÜï[\b´ì0\b where it should say, according to the bugs.php.net page above, something like: (gdb) print (char *)(executor_globals.function_state_ptr-function)-common.function_name $14 = 0x80fa6fa pg_result_error I can't find any docs anywhere on what else I can ask executor_globals for... getting executor_globals.active_op_array-function_name returns one of my functions, but that's not terribly useful without knowing what line of it caused the segfault. Any suggestions for futher probing? joe
[PHP] Re: difference
It was changed for security reasons: http://www.php.net/release_4_1_0.php joe Bob Lockie wrote: What is the difference from using $_GET['some_var'] from using $_REQUEST['some_var']? I think the documentation says either can be used to do the same thing. What is the performance difference from having register_globals turned off from having it turned on? I assume the default was changed for performance reasons? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Warning: Too many connections in xxx on line xx
Is there anyway to get rid of this message: Warning: Too many connections in xxx on line xx line xx is a connection to a mysql database. In PHP.ini I have: [MySQL] ; Allow or prevent persistent links. mysql.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. mysql.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. mysql.max_links = -1 Can anyone suggest what I can do to get rid of this error? I am running on a Dell PowerEdge 350 with the max of 1GB of memory running RH7.2, php 4.1.1, and mysql 3.23.49a. Thanks. Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: Too many connections in xxx on line xx
The error message is coming from the connect line in: function MOpen() { global $db_address, $db_username, $db_password, $link; $link = mysql_connect($db_address,$db_username,$db_password); } Nick Wilson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Dan Morris declared Is there anyway to get rid of this message: Warning: Too many connections in xxx on line xx Can you show the code that connects? - -- Nick Wilson // www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE9AdECHpvrrTa6L5oRAmUkAJ0S/N7E8ifYqP4bm6mb38wWoZqJ+gCfRPVp dxNJezvEs5aav5Yw814axIE= =QH6x -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems with Parent Child References
I've designed an architecture in PHP which is dependent on a class hierarchy which has a parent class with a member variable which is a child object. That child object contains a reference back to the parent. The problem I'm running into is changes to the parent's member variables are not reflected in the child's reference to the parent. Let me use a code example to illustrate my point. Class Parent { var $sTest = apple; var $pChild; function Parent() { $this-pChild = new Child(); $this-pChild-SetParent($this); } } Class Child { var $pParent; function SetParent($pParent) { $this-pParent = $pParent; } function PrintParentData() { echo Parents Test data: .$this-pParent-sTest.Br\n; } } $pParent = new Parent(); $pParent-sTest = orange; echo pParent-sTest = .$pParent-sTest.br\n; $pParent-pChild-PrintParentData(); // Prints: // pParent-sTest = orange // Parents Test data: apple // Instead of : // pParent-sTest = orange // Parents Test data: orange I've also tried changing the first line of the Parent constructor to : $this-pChild = new Child(); I think I've coded this correctly as per the docs on references. I'm using PHP4.1.1. My conclusions are : 1. This is not possible in PHP due to safety mechanisms built into the language to safeguard against circular references (and infinite recursion). 2. I'm doing something wrong. Thanks to anyone willing to take a stab... Kevin Morris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP 4.0.6 Problem with ImageTTFText
Hello all, I have just recently found out that there is a bug in the function ImageTTFText regarding the font name. Apparently no matter what you enter, the font is unable to be loaded regardless if you put an absolute path or not to the filename. I read some where that it was fixed in the CSV. My problem is that I need 4.0.6 as I am doing some work with 24-bit PNG images and 4.0.5 doesn't seem to support the high colours. The images work fine in 4.0.6 but now the font function doesn't work. So I guess I am asking is if I want to get the new version working before the next release, I will need to download the CSV tree and manually compile everything? If this is the case, is there some where that explains what is necessary to compile the PHP, GD, FreeType and ODBC libraries under the Win32 platform? Do when know when the next release will be coming out? Any help that you can provide would be appreciated. Thanks. -- Richard Morris [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] $B#P#CA`:n$K:$$C$?$i(B
-- $B-j#J#M#P$N!X#E%a!<%k#D#M!Y$r$*FO$1CW$7$^$9!#(B -- - $B!y(B.$B%&%#%s%Q%o!http://www.tokioinfo.co.jp/winpwr/index.htm $B%Q%=%3%sA`:n$K$D$^$E$$$?$i(B $BGA$$$F$_$F$/$@$5$$(B http://www.tokioinfo.co.jp/winpwr/index.htm - -- $B$3$N%a!<%k$O>pJsDs6!4k6H$h$j(B $B#J#M#P$+$iG[?.$7$F$*$j$^$9!#(B $B-j%8%'%$%(%`%T!http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]