Re: [PHP] Problem with Square Brackets [was: php+ ajax]
--- Jochem Maas [EMAIL PROTECTED] wrote: From a php developer point of view there is one big problem with 'follow the standards' mantra as far as square brackets go (with regard to use in the value of name attributes of form fields) ... Nope. The names of form controls MAY contain square brackets, it is the ids that may not (and the name and id attributes do NOT need to have the same value). -- David Dorward http://dorward.me.uk/ __ 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] Problem with Square Brackets [was: php+ ajax]
David Dorward wrote: --- Jochem Maas [EMAIL PROTECTED] wrote: From a php developer point of view there is one big problem with 'follow the standards' mantra as far as square brackets go (with regard to use in the value of name attributes of form fields) ... Nope. The names of form controls MAY contain square brackets, it is the ids that may not AHA! - I seem to have read the specvs incorrectly - the 'id' attribute is defined as 'W3C datatype' NAME whereas the 'name' attribute (atleast as far as the FORM, INPUT SELECT tags are concerned) is of 'W3C datatype' CDATA. the CDATA type allow ssquare brackets ofcourse = which means the php choice of using the square brackets is AOK. :-) SIDENOTE TO JAY the 'when to break the rules' idea still stands in theory :-) /SIDENOTE TO JAY (and the name and id attributes do NOT need to have the same value). that I know - I mentioned that myself in a previous post. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with mail() on Debian
Hi, I am in the process of moving from Windows (NT/XP) to Linux. I'm starting with a new small application which I have working on my Windows XP laptop. On my Linux box, I have php.ini saying: sendmail_path /usr/sbin/sendmail That 'sendmail' is a symbolic link to exim4 in the same directory. I can send mail using exim4 from the command line, but not using PHP. I couldn't find anything in the manual or on Google that helps me solve the problem. Can anyone give me a clue where to look to solve this problem? Cheers George, in Oxford -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem with HUGE floating values and fmod
THANKS! That did the trick. For future reference to all people needing to calculate check digits with ISO 7604 (MOD 97-10) method: $check=98-bcmod(($num.00),97); The .00 part is imporant... If $num was multiplied by 100 we wouldn't get a correct value in bcmod. Marco Almeida Project Manager WEBDADOS Tecnologias de Informação Telef.: +351 21 466 93 00 Fax: +351 21 466 42 81 Móvel: +351 96 324 43 44 Email: [EMAIL PROTECTED] www: http://www.webdados.pt Morada: R. 9 de Abril, 3-3A, Sala 4 2765-545 S. Pedro do Estoril -Original Message- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: sexta-feira, 17 de Fevereiro de 2006 20:40 To: php-general@lists.php.net; [EMAIL PROTECTED] Subject: Re: [PHP] Problem with HUGE floating values and fmod On Fri, Feb 17, 2006 at 06:48:13PM -, Marco Almeida wrote: Hi there, I'm trying to calculate check digits for a payment system, using the ISO 7064 (MOD 97-10) algorithm, wich is, already translated to PHP: $check=98-fmod(($num*100),97); Where $num is a huge number... Example: 90150123123400043211 should have check digit 51 In windows calculator: 98 - ( (90150123123400043211 * 100) mod 97) works OK and I get 51 as result In PHP I get 13... You will need to use GMP or BCMath to do math operations numbers that size. See: http://php.net/language.types.integer.php Curt. -- cat .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with HUGE floating values and fmod
Hi there, I'm trying to calculate check digits for a payment system, using the ISO 7064 (MOD 97-10) algorithm, wich is, already translated to PHP: $check=98-fmod(($num*100),97); Where $num is a huge number... Example: 90150123123400043211 should have check digit 51 In windows calculator: 98 - ( (90150123123400043211 * 100) mod 97) works OK and I get 51 as result In PHP I get 13... Any problems with the number beeing this huge? Notice that I tried to echo number_format(90150123123400043211+1);, in order to test some math on this number, and got 90,150,123,123,400,040,000 wich is strange... If possible, please reply to [EMAIL PROTECTED] Thanks in advance. Marco Almeida Project Manager WEBDADOS Tecnologias de Informação Telef.: +351 21 466 93 00 Fax: +351 21 466 42 81 Móvel: +351 96 324 43 44 Email: [EMAIL PROTECTED] www: http://www.webdados.pt Morada: R. 9 de Abril, 3-3A, Sala 4 2765-545 S. Pedro do Estoril -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with HUGE floating values and fmod
On Fri, Feb 17, 2006 at 06:48:13PM -, Marco Almeida wrote: Hi there, I'm trying to calculate check digits for a payment system, using the ISO 7064 (MOD 97-10) algorithm, wich is, already translated to PHP: $check=98-fmod(($num*100),97); Where $num is a huge number... Example: 90150123123400043211 should have check digit 51 In windows calculator: 98 - ( (90150123123400043211 * 100) mod 97) works OK and I get 51 as result In PHP I get 13... You will need to use GMP or BCMath to do math operations numbers that size. See: http://php.net/language.types.integer.php Curt. -- cat .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem with php.ini and include_path
Richard, et al, I tried your suggestion of the .htaccess file but that didn't do anything. I'm using Webmin to administer the linux box and the Apache server configs has a PHP module and that allowed me to set a directory level include_path. Problem solved. Now onwards towards configuring pear. Cheers George -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: 14 February 2006 11:56 pm To: George Pitcher Cc: php-general@lists.php.net Subject: RE: [PHP] Problem with php.ini and include_path http://php.net/set_include_path .htaccess php_value include_path .:/whatever/you/want/here Also, you are comparing the output of php CLI which may or may not be the same as --with-apxs compilation, especially if you have an *OLD* CLI php sitting around... From the command line, compare: which php with the output from your make install of PHP and see if you're even running the php binary you THINK you are running. On Tue, February 14, 2006 9:13 am, George Pitcher wrote: George Pitcher wrote: Hi, I have compiled php-5.1.2 with apache on Debian and have a problem with the include_path. My configure was './configure' '--with-mysql' '--with-pear' '--with-apxs' the '--with-apxs' suggest your probably running php as an apache module, if so then you'll need to restart apache for the settings in php.ini to take affect. Jochem, Sorry, I should have said that I'd done that as well. Still no joy. One other thing that I have noticed is that if I do 'php -i |grep include_path' from outside the directory where php.ini is it says 'include_path = .:/usr/lib/php' but if I do that from within the same directory as php.ini I get the include_path that I have set in php.ini. Cheers George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with php.ini and include_path
Hi, I have compiled php-5.1.2 with apache on Debian and have a problem with the include_path. My configure was './configure' '--with-mysql' '--with-pear' '--with-apxs' '--with-config-file-path=/usr/local/lib'. php.ini is in '/usr/local/lib' and phpinfo tells me that php.ini is in '/usr/local/lib'. However, where my php.ini has: 'include_path = .:/php/includes:/usr/lib/php/pear', phpinfo shows the include_path as being '/usr/lib/php' which doesn't exist. Can anyone tell me how do I get my php to use the correct include_path? MTIA George in Oxford -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with php.ini and include_path
George Pitcher wrote: Hi, I have compiled php-5.1.2 with apache on Debian and have a problem with the include_path. My configure was './configure' '--with-mysql' '--with-pear' '--with-apxs' the '--with-apxs' suggest your probably running php as an apache module, if so then you'll need to restart apache for the settings in php.ini to take affect. '--with-config-file-path=/usr/local/lib'. php.ini is in '/usr/local/lib' and phpinfo tells me that php.ini is in '/usr/local/lib'. However, where my php.ini has: 'include_path = .:/php/includes:/usr/lib/php/pear', phpinfo shows the include_path as being '/usr/lib/php' which doesn't exist. Can anyone tell me how do I get my php to use the correct include_path? MTIA George in Oxford -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem with php.ini and include_path
George Pitcher wrote: Hi, I have compiled php-5.1.2 with apache on Debian and have a problem with the include_path. My configure was './configure' '--with-mysql' '--with-pear' '--with-apxs' the '--with-apxs' suggest your probably running php as an apache module, if so then you'll need to restart apache for the settings in php.ini to take affect. Jochem, Sorry, I should have said that I'd done that as well. Still no joy. One other thing that I have noticed is that if I do 'php -i |grep include_path' from outside the directory where php.ini is it says 'include_path = .:/usr/lib/php' but if I do that from within the same directory as php.ini I get the include_path that I have set in php.ini. Cheers George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with php.ini and include_path
George Pitcher wrote: George Pitcher wrote: Hi, I have compiled php-5.1.2 with apache on Debian and have a problem with the include_path. My configure was './configure' '--with-mysql' '--with-pear' '--with-apxs' the '--with-apxs' suggest your probably running php as an apache module, if so then you'll need to restart apache for the settings in php.ini to take affect. Jochem, Sorry, I should have said that I'd done that as well. Still no joy. ack. One other thing that I have noticed is that if I do 'php -i |grep include_path' from outside the directory where php.ini is it says 'include_path = .:/usr/lib/php' but if I do that from within the same directory as php.ini I get the include_path that I have set in php.ini. sounds like you have 2 (or more) php executables floating about; try running a 'which php' and a 'locate php' to find out where exactly they are. also in both case you mention above try grepping for where php is getting it's php.ini file from - this may lead you to the 'other' php.ini on your system (assuming it's there at all). another possibility is that php can't read the file (permissions) and is therefore defaulting to internal ini settings). (-- it's a wild guess) you could sidetrack the issue by setting the include_path in a relevant .htaccess file i.e. add a line like: php_value include_path .:/your/php/inc/path:/path/to/pear:/somewhere/else Cheers George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem with php.ini and include_path
http://php.net/set_include_path .htaccess php_value include_path .:/whatever/you/want/here Also, you are comparing the output of php CLI which may or may not be the same as --with-apxs compilation, especially if you have an *OLD* CLI php sitting around... From the command line, compare: which php with the output from your make install of PHP and see if you're even running the php binary you THINK you are running. On Tue, February 14, 2006 9:13 am, George Pitcher wrote: George Pitcher wrote: Hi, I have compiled php-5.1.2 with apache on Debian and have a problem with the include_path. My configure was './configure' '--with-mysql' '--with-pear' '--with-apxs' the '--with-apxs' suggest your probably running php as an apache module, if so then you'll need to restart apache for the settings in php.ini to take affect. Jochem, Sorry, I should have said that I'd done that as well. Still no joy. One other thing that I have noticed is that if I do 'php -i |grep include_path' from outside the directory where php.ini is it says 'include_path = .:/usr/lib/php' but if I do that from within the same directory as php.ini I get the include_path that I have set in php.ini. Cheers George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with code between 4.3.4rc1 upgrading to php 4.4.2
Hello, About 2 years ago i setup Apache/1.3.28 (Unix) PHP/4.3.4RC1 mod_ssl/2.8.15 OpenSSL/0.9.7c and mysql on BSD Unix and did up some simple php enabled web pages to add / remove /edit / search entries to a 1 table mysql database to keep track of abuse complaints for my company. This week Ive had to migrate all this to new Solaris 10 box which i installed Apache/1.3.34 (Unix) PHP/4.4.2 mod_ssl/2.8.25 OpenSSL/0.9.8a with mysql . The problem im have is that when i go to search for an entry through the web interface...it pulls ALL entries in the database and displays them instead of the ones im searching for. When i go to add an entry ...it actually enters a entry to mysql ...but its empty. If i try to do an edit on an existing entry ...the form doesnt pull the existing entries from the database to be edited...Im thinking its probably something with my syntax that im using is no longer valid with the new versions of php4. Does anyone have any thoughts or suggestions ?? I can submit some of the code for everyone to look at .. Any help is greatly appreciated -- -- Brent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with code between 4.3.4rc1 upgrading to php 4.4.2
On Thu, Feb 09, 2006 at 04:04:49PM -0500, Brent wrote: Hello, About 2 years ago i setup Apache/1.3.28 (Unix) PHP/4.3.4RC1 mod_ssl/2.8.15 OpenSSL/0.9.7c and mysql on BSD Unix and did up some simple php enabled web pages to add / remove /edit / search entries to a 1 table mysql database to keep track of abuse complaints for my company. This week Ive had to migrate all this to new Solaris 10 box which i installed Apache/1.3.34 (Unix) PHP/4.4.2 mod_ssl/2.8.25 OpenSSL/0.9.8a ... ?? I can submit some of the code for everyone to look at .. Any help is greatly appreciated This sounds like the old version had register_globals [1] set to on. You'll want to change your code [2] so it works with it off, like: $_GET['variable']; or $_POST['variable']; It is strongly advisable to keep it off. [1] http://php.net/register_globals [2] http://php.net/language.variables.predefined Curt. -- cat .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Problem] - reading file
Hello, The problem is, that script outputs Last line from the file (and not first line, as expected)! 4 hours spent seeking for mistake. Hopeless. The script should read all the filenames in the directory, then open each file to read first line from file and output this line. if(!isset($_GET['id'])){//if !ISSET ID $path = files/info/.LANG; if ($handle = opendir($path)) {//first if while (false !== ($file = readdir($handle))) { //while if ($file != . $file != ..) { //if not . .. if(!is_file($file)){ //echo $file.brbr; $new_path = files/info/.LANG./.$file; //echo $new_path; $text = file($new_path); foreach($text as $lines ) { $lines = preg_replace(/\n/, br, $lines); $lines = trim($lines); $lines = explode(\n,$lines); $out = $lines[0]; } echo $out.brbr; unset ($out); }//!is_file }//if not . .. }//while closedir($handle); }//first if }//if !ISSET ID If text files look like: 1.txt{ First line of 1.txt. Second line of 1.txt. } 2.txt{ First line of 2.txt. Second line of 2.txt. } Then Output (using this script) will be: Second line of 1.txt Second line of 2.txt - - - - - - - - - - - But it should be: First line of 1.txt First line of 2.txt I'm really hopeless.. Thanks everyone in advance! Roman. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [Problem] - reading file
Hi Roman, This line is your problem. $lines = preg_replace(/\n/, br, $lines); You're replacing your newlines with br tags. Your explode won't find anything because it's looking for \n 's. Labunski wrote: Hello, The problem is, that script outputs Last line from the file (and not first line, as expected)! 4 hours spent seeking for mistake. Hopeless. The script should read all the filenames in the directory, then open each file to read first line from file and output this line. if(!isset($_GET['id'])){//if !ISSET ID $path = files/info/.LANG; if ($handle = opendir($path)) {//first if while (false !== ($file = readdir($handle))) { //while if ($file != . $file != ..) { //if not . .. if(!is_file($file)){ //echo $file.brbr; $new_path = files/info/.LANG./.$file; //echo $new_path; $text = file($new_path); foreach($text as $lines ) { $lines = preg_replace(/\n/, br, $lines); $lines = trim($lines); $lines = explode(\n,$lines); $out = $lines[0]; } echo $out.brbr; unset ($out); }//!is_file }//if not . .. }//while closedir($handle); }//first if }//if !ISSET ID If text files look like: 1.txt{ First line of 1.txt. Second line of 1.txt. } 2.txt{ First line of 2.txt. Second line of 2.txt. } Then Output (using this script) will be: Second line of 1.txt Second line of 2.txt - - - - - - - - - - - But it should be: First line of 1.txt First line of 2.txt I'm really hopeless.. Thanks everyone in advance! Roman. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with Mail function
Hello everyone, I m using php mail function it dose everyting fine besides it prints message twise in the email body can someone please have a look what i m doing wrong the code is as follows : $to = $email; $subject = someting goes here \n\n; $headers = From: [EMAIL PROTECTED] . X-Mailer: Mailserver at somewhere.com\n . Date: $date\n . MIME-Version: 1.0\n . Content-Type: text/plain; charset=ISO-8859-1\n ; message EOF ... ... . . ... EOF; if (mail($to,$subject,$message,$headers)){ $say = p /E Mail sent successfully to $email. br; } else{ $say = \n\np /Ohoho! Sending failed Please inform to Webmaster. br; } I shall highly appreciate any help Thanks Tariq -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with Mail function
This may be a bit to obvious, but I miss little stuff all the time. You wouldn't happen to have the if(mail(...)) in some form of loop would you? or perhaps $to is getting assigned the e-mail address like [EMAIL PROTECTED] [EMAIL PROTECTED] can you check the value of $email before you assign it? ~Drew www.drewpydraws.com - Original Message - From: Tariq Dalvi [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Sunday, February 05, 2006 6:55 PM Subject: [PHP] problem with Mail function Hello everyone, I m using php mail function it dose everyting fine besides it prints message twise in the email body can someone please have a look what i m doing wrong the code is as follows : $to = $email; $subject = someting goes here \n\n; $headers = From: [EMAIL PROTECTED] . X-Mailer: Mailserver at somewhere.com\n . Date: $date\n . MIME-Version: 1.0\n . Content-Type: text/plain; charset=ISO-8859-1\n ; message EOF ... ... . . ... EOF; if (mail($to,$subject,$message,$headers)){ $say = p /E Mail sent successfully to $email. br; } else{ $say = \n\np /Ohoho! Sending failed Please inform to Webmaster. br; } I shall highly appreciate any help Thanks Tariq -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/251 - Release Date: 2/4/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with Mail function
Dude, Do not use $to = $email; instead $to=$email; But i didn't even know what is your problem! On 2/6/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: This may be a bit to obvious, but I miss little stuff all the time. You wouldn't happen to have the if(mail(...)) in some form of loop would you? or perhaps $to is getting assigned the e-mail address like [EMAIL PROTECTED] [EMAIL PROTECTED] can you check the value of $email before you assign it? ~Drew www.drewpydraws.com - Original Message - From: Tariq Dalvi [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Sunday, February 05, 2006 6:55 PM Subject: [PHP] problem with Mail function Hello everyone, I m using php mail function it dose everyting fine besides it prints message twise in the email body can someone please have a look what i m doing wrong the code is as follows : $to = $email; $subject = someting goes here \n\n; $headers = From: [EMAIL PROTECTED] . X-Mailer: Mailserver at somewhere.com\n . Date: $date\n . MIME-Version: 1.0\n . Content-Type: text/plain; charset=ISO-8859-1\n ; message EOF ... ... . . ... EOF; if (mail($to,$subject,$message,$headers)){ $say = p /E Mail sent successfully to $email. br; } else{ $say = \n\np /Ohoho! Sending failed Please inform to Webmaster. br; } I shall highly appreciate any help Thanks Tariq -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/251 - Release Date: 2/4/2006 -- 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] problem with parse_str
version: 4.3.2 the example from: http://de2.php.net/manual/en/function.parse-str.php $str = first=valuearr[]=foo+bararr[]=baz; parse_str($str); echo $first; // value echo $arr[0]; // foo bar echo $arr[1]; // baz parse_str($str, $output); echo $output['first']; // value echo $output['arr'][0]; // foo bar echo $output['arr'][1]; // baz produces: valuearr[]=foo bararr[]=bazvaluearr[]=foo bararr[]=baz or slightly modified: for first: valuearr[]=foo bararr[]=baz for arr[0]: for arr[1]: which isn't the intended behavior :/ any ideas? greetings dalini -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with Sessions
Hi! I got a very funny problem. I wonder if anyone else encountered that. I start a Session at Shop startpage to keep some arrays and such. Stuff you need for the Cart and so. so fine so good. But when the customer goes through that Page some session vars just get NULL. Not the whole session dies. nah just a few vars O_o I dont understand that. It happens not often, but at least 2 times a week. I have no var overwriting them. I wonder if anyone has an issue for that. Btw its PHP 4.2-2 running on a Red Hat system under GNu linux. really no idea what that is _ Thanks Barry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Sessions
Barry wrote: Hi! I got a very funny problem. I wonder if anyone else encountered that. I start a Session at Shop startpage to keep some arrays and such. Stuff you need for the Cart and so. so fine so good. But when the customer goes through that Page some session vars just get NULL. are you sticking references to things in the session array sometimes? (as opposed to sticking things in the session array and then referencing that?) do you have a frameset in use? (where more than one page in the frameset may use/start the session?) - i.e. one page overwrites the values set by another becuase either your session logic is not 'watertight' or your using a session handler mechanism that does not do do 'locking' of the session. Not the whole session dies. nah just a few vars O_o wtf is 'O_o'? I dont understand that. It happens not often, but at least 2 times a week. I have no var overwriting them. I wonder if anyone has an issue for that. Btw its PHP 4.2-2 running on a Red Hat system under GNu linux. upgrade php to 4.4.x atleast is one thing to consider really no idea what that is _ wtf is '_'? I realise you may not know what it is either (and that you are asking the list) - but that wasn't clear to me either. and if the last couple of sentences are anything but clear as mud then I'll be darned ;-) Thanks Barry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Sessions
On Tue, January 24, 2006 10:30 am, Barry wrote: I got a very funny problem. I wonder if anyone else encountered that. I start a Session at Shop startpage to keep some arrays and such. Stuff you need for the Cart and so. so fine so good. But when the customer goes through that Page some session vars just get NULL. Not the whole session dies. nah just a few vars O_o I dont understand that. It happens not often, but at least 2 times a week. I have no var overwriting them. I wonder if anyone has an issue for that. Btw its PHP 4.2-2 running on a Red Hat system under GNu linux. really no idea what that is _ Something as infrequent as that is very difficult to debug, because by the time you start looking at the data, you've already forgotten what the data was the last time the bug ocurred. Start logging the error to a separate file or database table. Log all the variables you THINK should have a value that are NULL. Look for patterns in the variables. Also consider logging all the other variables, and their values, to see if there is a pattern. Hopefully, gathering the data into an ordered format will make the bug more clear. You should also go ahead and time-stamp it, so you can refine the 2 times per week, and possibly log successful page-hits so you have some idea of the percentage of error. Possibly log load as well, in some manner -- count # of active sessions, or OS load on the box, or... Perhaps it only happens under very heavy load? Or does it simply increase linearly with load, but still happens under light load? -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Sessions
upgrade to 4.4.X 4.2 has known problems in session handling. Thanks, Richard On 1/24/06, Barry [EMAIL PROTECTED] wrote: Hi! I got a very funny problem. I wonder if anyone else encountered that. I start a Session at Shop startpage to keep some arrays and such. Stuff you need for the Cart and so. so fine so good. But when the customer goes through that Page some session vars just get NULL. Not the whole session dies. nah just a few vars O_o I dont understand that. It happens not often, but at least 2 times a week. I have no var overwriting them. I wonder if anyone has an issue for that. Btw its PHP 4.2-2 running on a Red Hat system under GNu linux. really no idea what that is _ Thanks Barry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem encountered with stristr-based function
Hi, I'm having a problem with the following function: function terms($term,$field){ if(strlen($term)0){ if(!stristr($term, $field) === FALSE) { $output = str_replace($term, b.$term./b, $field); } elseif(!stristr(strtolower($term), $field) === FALSE) { $output = str_replace(strtolower($term), b.strtolower($term)./b, $field); } elseif(!stristr(strtoupper($term), $field) === FALSE) { $output = str_replace(strtoupper($term), b.strtoupper($term)./b, $field); } elseif(!stristr(ucfirst($term), $field) === FALSE) { $output = str_replace(ucfirst($term), b.ucfirst($term)./b, $field); } } else { $output = $field; } return $output; } I'm not comfortable enough with regex etc, so tried it my way, but no joy. For info, I am trying to highlight search terms in results. Any suggestions? George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem encountered with stristr-based function
George, George Pitcher wrote: For info, I am trying to highlight search terms in results. If you're searching and replacing within HTML, you ought to be aware of issues if someone's search term happens to be an HTML tag or attribute. For example, Alice might search for href and get the following: a bhref/b=URLText/a back, which is clearly fubar, which highlights the necessity for some handy regex skills. Following a quick google, I found this page: http://aidanlister.com/repos/?file=function.str_highlight.php David -- David Grant http://www.grant.org.uk/ http://pear.php.net/package/File_Ogg0.2.1 http://pear.php.net/package/File_XSPF 0.1.0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] problem encountered with stristr-based function
David, No html involved. Just db results. I've found that eregi_replace() does the job adequately, if not perfectly. Us typesetters are hard to please when it comes to string handling. Cheers George -Original Message- From: David Grant [mailto:[EMAIL PROTECTED] Sent: 20 January 2006 2:54 pm Cc: php-general@lists.php.net Subject: Re: [PHP] problem encountered with stristr-based function George, George Pitcher wrote: For info, I am trying to highlight search terms in results. If you're searching and replacing within HTML, you ought to be aware of issues if someone's search term happens to be an HTML tag or attribute. For example, Alice might search for href and get the following: a bhref/b=URLText/a back, which is clearly fubar, which highlights the necessity for some handy regex skills. Following a quick google, I found this page: http://aidanlister.com/repos/?file=function.str_highlight.php David -- David Grant http://www.grant.org.uk/ http://pear.php.net/package/File_Ogg0.2.1 http://pear.php.net/package/File_XSPF 0.1.0 -- 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] problem encountered with stristr-based function
On Fri, January 20, 2006 8:44 am, George Pitcher wrote: function terms($term,$field){ if(strlen($term)0){ if(!stristr($term, $field) === FALSE) { This is quite contorted... And you have the arguments swapped, which is the real problem. if(stristr($field, $term)){ $output = str_replace($term, b.$term./b, $field); The rest of this is just plain silly. stristr ignores case in both args. } elseif(!stristr(strtolower($term), $field) === FALSE) { $output = str_replace(strtolower($term), b.strtolower($term)./b, $field); } elseif(!stristr(strtoupper($term), $field) === FALSE) { $output = str_replace(strtoupper($term), b.strtoupper($term)./b, $field); } elseif(!stristr(ucfirst($term), $field) === FALSE) { $output = str_replace(ucfirst($term), b.ucfirst($term)./b, $field); } } else { $output = $field; } return $output; } I'm not comfortable enough with regex etc, so tried it my way, but no joy. For info, I am trying to highlight search terms in results. Any suggestions? http://php.net/stristr -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with large arrays in php 4.3.2
Hello, I have an old version of php (4.3.2) that is acting rather strangely. I'm searching two large arrays (approx 22,000 records in each) using array_diff_key() from the PEAR PHP_Compat library: $result = $args[0]; foreach ($args[0] as $key1 = $value1) { for ($i = 1; $i !== $array_count; $i++) { foreach ($args[$i] as $key2 = $value2) { if ((string) $key1 === (string) $key2) { unset($result[$key2]); break 2; } } } } And I'm getting aweful performance. I know it's a ton of records (22,000 * 22,000), but it shouldn't take 16 minutes on a P4 Xeon 2.4ghz! Has anyone seen this before? Is this a bug? Or are my math skills lacking and this is perfectly normal performance for the size of the data set? Thanks! -- Jesse Guardiani Programmer/Sys Admin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with large arrays in php 4.3.2
Rodolfo Andrade wrote: 22k * 22 k = 484 millions... that's really a lot of data and should take a lot of time and processing power. I don't think it's really a bug. Yeah, I guess not. I guess ~500,000 records/sec isn't so terrible. Is there a more efficient way to difference large sets of data? Regards, Rodolfo Andrade - Original Message - From: Jesse Guardiani To: php-general@lists.php.net Sent: Tuesday, January 10, 2006 5:07 PM Subject: [PHP] problem with large arrays in php 4.3.2 Hello, I have an old version of php (4.3.2) that is acting rather strangely. I'm searching two large arrays (approx 22,000 records in each) using array_diff_key() from the PEAR PHP_Compat library: $result = $args[0]; foreach ($args[0] as $key1 = $value1) { for ($i = 1; $i !== $array_count; $i++) { foreach ($args[$i] as $key2 = $value2) { if ((string) $key1 === (string) $key2) { unset($result[$key2]); break 2; } } } } And I'm getting aweful performance. I know it's a ton of records (22,000 * 22,000), but it shouldn't take 16 minutes on a P4 Xeon 2.4ghz! Has anyone seen this before? Is this a bug? Or are my math skills lacking and this is perfectly normal performance for the size of the data set? Thanks! -- Jesse Guardiani Programmer/Sys Admin [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with fsockopen and SSL
Hi everyone! I want to connect to an SSL server but i can't get the content :( Here is the code i use: $xml = 'xmldataHello!/data/xml'; function PostToHost($host, $path, $referer, $data_to_send) { $fp = fsockopen($host, 443); printf(Open!\n); fputs($fp, POST $path HTTP/1.1\r\n\r\n); fputs($fp, Host:$host\r\n); fputs($fp, Referer: $referer\r\n); fputs($fp, Content-type: text/xml\r\n); fputs($fp, Content-length: . strlen($data_to_send) .\r\n); fputs($fp, Connection: close\r\n); //fputs($fp, $data_to_send); printf(Sent!\n); while(!feof($fp)) { $res .= fgets($fp, 128); } printf(Done!\n); fclose($fp); return $res; } $data = $xml; printf(Go!\n); $x = PostToHost( ssl://easy-demo.tcinternet.de, /hosting/servlet/Dispatcher, $GLOBALS[HTTP_REFERER], $data ); echo $x; And this is what i get: Go! Open! Sent! Done! HTTP/1.1 400 Bad Request Date: Mon, 09 Jan 2006 10:28:48 GMT Server: Apache/2.0.53 (Unix) mod_ssl/2.0.53 OpenSSL/0.9.7e DAV/2 mod_jk/1.2.1 Content-Length: 363 Connection: close Content-Type: text/html; charset=iso-8859-1 Bad Request Your browser sent a request that this server could not understand. Apache/2.0.53 (Unix) mod_ssl/2.0.53 OpenSSL/0.9.7e DAV/2 mod_jk/1.2.1 Server at easy-demo.tcinternet.de Port 443 What did the Webserver not understood? Btw. i can't use cURL because the server has an old version of PHP () Would be glad if you can help or even have a code how to connect to a SSL webserver via fsockopen that works. Btw the PHP version on server is: PHP Version 4.2.2 Thanks for any help! Greets Barry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with fsockopen and SSL
Hi Barry, I'm not terrible au fait with the workings of SSL, but it strikes me as potentially problematic that you are communicating in plain text over an encrypted protocol. Might that be the problem? David Barry wrote: Hi everyone! I want to connect to an SSL server but i can't get the content :( Here is the code i use: $xml = 'xmldataHello!/data/xml'; function PostToHost($host, $path, $referer, $data_to_send) { $fp = fsockopen($host, 443); printf(Open!\n); fputs($fp, POST $path HTTP/1.1\r\n\r\n); fputs($fp, Host:$host\r\n); fputs($fp, Referer: $referer\r\n); fputs($fp, Content-type: text/xml\r\n); fputs($fp, Content-length: . strlen($data_to_send) .\r\n); fputs($fp, Connection: close\r\n); //fputs($fp, $data_to_send); printf(Sent!\n); while(!feof($fp)) { $res .= fgets($fp, 128); } printf(Done!\n); fclose($fp); return $res; } $data = $xml; printf(Go!\n); $x = PostToHost( ssl://easy-demo.tcinternet.de, /hosting/servlet/Dispatcher, $GLOBALS[HTTP_REFERER], $data ); echo $x; And this is what i get: Go! Open! Sent! Done! HTTP/1.1 400 Bad Request Date: Mon, 09 Jan 2006 10:28:48 GMT Server: Apache/2.0.53 (Unix) mod_ssl/2.0.53 OpenSSL/0.9.7e DAV/2 mod_jk/1.2.1 Content-Length: 363 Connection: close Content-Type: text/html; charset=iso-8859-1 Bad Request Your browser sent a request that this server could not understand. Apache/2.0.53 (Unix) mod_ssl/2.0.53 OpenSSL/0.9.7e DAV/2 mod_jk/1.2.1 Server at easy-demo.tcinternet.de Port 443 What did the Webserver not understood? Btw. i can't use cURL because the server has an old version of PHP () Would be glad if you can help or even have a code how to connect to a SSL webserver via fsockopen that works. Btw the PHP version on server is: PHP Version 4.2.2 Thanks for any help! Greets Barry -- David Grant http://www.grant.org.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with currency signs
Hi guys, Im having problems with the Euro and Pound currency signs and storing them etc... here is my scenario. I have a menu/list of currencies available for selection, HTML below for the signs: $ pound; euro; When listed in the browser they show fine. When I want to save them, they are saved as the actual sign in the DB and not the HTML code for the symbol, which isnt a train smash, however, when I try compare the values in the DB with the predefined list of currency symbols, I get some problems. The below if statement doesnt seem to resolve: if ($row['p_currency'] == €) //where € is also the value in the DB even if the value is €, or euro; it still never reverts to true... So is there a special way I should be treating the symbols and maybe a special way I should be storing them? or comparing them? thanks in advance -- Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with currency signs
see http://us2.php.net/manual/en/function.htmlspecialchars.php note: I believe the dollar sign will also be translated, could be wrong. Warren At 03:14 AM 1/10/2006, Angelo Zanetti wrote: Hi guys, Im having problems with the Euro and Pound currency signs and storing them etc... here is my scenario. I have a menu/list of currencies available for selection, HTML below for the signs: $ pound; euro; When listed in the browser they show fine. When I want to save them, they are saved as the actual sign in the DB and not the HTML code for the symbol, which isnt a train smash, however, when I try compare the values in the DB with the predefined list of currency symbols, I get some problems. The below if statement doesnt seem to resolve: if ($row['p_currency'] == ) //where is also the value in the DB even if the value is , or euro; it still never reverts to true... So is there a special way I should be treating the symbols and maybe a special way I should be storing them? or comparing them? thanks in advance -- Angelo -- 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] problem with currency signs
Angelo: Now might be the time to start looking at Unicode characters. Here's a start: http://www1.tip.nl/~t876506/utf8tbl.html There's all sorts of ways to show special characters. For example, the BULLET (Unicode 2022) can be shown by: bull; #149; #8226; -- Note Please note that 8226 is DEC for the HEX value of 2202 (Unicode code point for BULLET). As such, if you find the Unicode code point for the character you want, all you have to do is: 1) to convert it to DEC; 2) add the prefix of # and the suffix of ; 3) and you'll have a character that will be shown in browsers. So, my advice would be to store the DEC value of the currency label and not worry about comparing glyphs, which may not be consistent across browsers and OS's. Whereas, Unicode will be consistent. tedd --- Hi guys, Im having problems with the Euro and Pound currency signs and storing them etc... here is my scenario. I have a menu/list of currencies available for selection, HTML below for the signs: $ pound; euro; When listed in the browser they show fine. When I want to save them, they are saved as the actual sign in the DB and not the HTML code for the symbol, which isnt a train smash, however, when I try compare the values in the DB with the predefined list of currency symbols, I get some problems. The below if statement doesnt seem to resolve: if ($row['p_currency'] == ¤) //where ¤ is also the value in the DB even if the value is ¤, or euro; it still never reverts to true... So is there a special way I should be treating the symbols and maybe a special way I should be storing them? or comparing them? thanks in advance -- Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem on Instalation ~ several module failed to load
I was trying used php 5.1, but it still same problem appear, several modules succesfully load (mbstring, bz2, dba, dbase, exif, filepro, gd2, gettext, imap, ldap, mime_magic, ming, pgsql, shmop, snmp, socket, tidy, xmlrpc, xsl.) and several others are failed to load : (curl, fdf, ifx, interbase, mcrypt, mhash, mssql, mysql, mysqli, oci8, openssl, sybase_ct). Also, I was re-install my apache(2.0) Is this problem related with php or apache or my OS(XPSP2)? Hopefully, someone can help me to solve my problem. Thanks Regards From: Bagus Nugroho Sent: Friday, December 09, 2005 10:31 PM To: php-general@lists.php.net Subject: RE: [PHP] Problem on Instalation ~ several module unable to download here is my last list of module which bale to load and unable to load excerpt php.ini extension=php_mbstring.dll ;extension=php_bz2.dll extension=php_cpdf.dll ;extension=php_curl.dll extension=php_dba.dll extension=php_dbase.dll extension=php_dbx.dll ;extension=php_exif.dll ;extension=php_fdf.dll extension=php_filepro.dll extension=php_gd2.dll extension=php_gettext.dll ;extension=php_ifx.dll ;extension=php_iisfunc.dll extension=php_imap.dll ;extension=php_interbase.dll ;extension=php_java.dll ;extension=php_ldap.dll ;extension=php_mcrypt.dll ;extension=php_mhash.dll extension=php_mime_magic.dll extension=php_ming.dll ;extension=php_mssql.dll ;extension=php_msql.dll ;extension=php_mysql.dll ;extension=php_mysqli.dll ;extension=php_oci8.dll ;extension=php_openssl.dll ;extension=php_oracle.dll ;extension=php_pdf.dll extension=php_pgsql.dll extension=php_shmop.dll extension=php_snmp.dll extension=php_sockets.dll ;extension=php_sybase_ct.dll extension=php_tidy.dll ;extension=php_w32api.dll extension=php_xmlrpc.dll extension=php_xsl.dll ;extension=php_yaz.dll ;extension=php_zip.dll -- I was re-check that php_mysql.dll, php_mysqli.dll etc is on c:\php\ext as others. Any idea how come Thanks From: Bagus Nugroho [mailto:[EMAIL PROTECTED] Sent: Fri 09-Dec-2005 21:06 To: php-general@lists.php.net Subject: [PHP] Problem on Instalation ~ several module unable to download Hi All, Previously I always succed to instalation PHP, but currently I have strange problem as several module is unable to download(i.e : php_mysql.dll, php_mysqli.dll), while several other are succesfully download(i.e : mbstring, gd). I have re-installed or copy PHP folder from my succeded instalation, but it is not work. I'm used WindowsXP, Apache2.0, PHP5 May be someone out there could help me to solve it. Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with fopen and sending POST vars
Barry wrote: Hello everyone! I have a problem sending POST vars via fopen. It was possible for me to send some xml data but that's all. Anyone know how to send POST vars? Big probleme here is also that i have to connect via SSL. cURL can be your friend... http://php.net/curl http://www.zend.com/pecl/tutorials/curl.php HTH, cheers Silvio -- tradeOver | http://www.tradeover.net ...ready to become the King of the World? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem: pgsql (unicode) = php5 = HTML (iso-8859-1)
Hello, my PostgreSQL stores all data in UNICODE and now if I connect via Webbrowser to my Database my webpages are detected as ISO-8859-1. For each Page I must select View-Character Encoding-Unicode (UTF8). Please can anyone tell me the right META (???) Tag to get Motilla right to UNICODE? Thanks Michelle -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ #328449886 50, rue de Soultz MSM LinuxMichi 0033/3/8845235667100 Strasbourg/France IRC #Debian (irc.icq.com) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem: pgsql (unicode) = php5 = HTML (iso-8859-1)
Michelle, Michelle Konzack wrote: Please can anyone tell me the right META (???) Tag to get Motilla right to UNICODE? Try: meta http-equiv=Content-Type content=text/html; charset=UTF-8 Cheers, David -- David Grant http://www.grant.org.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem: pgsql (unicode) = php5 = HTML (iso-8859-1)
Michelle Konzack wrote: Hello, my PostgreSQL stores all data in UNICODE and now if I connect via Webbrowser to my Database my webpages are detected as ISO-8859-1. For each Page I must select View-Character Encoding-Unicode (UTF8). Please can anyone tell me the right META (???) Tag to get Motilla right to UNICODE? this will probably do it (make sure headers et al are not designating a conflicting codepage elsewhere): meta http-equiv=Content-Type content=text/html;charset=UTF-8 try here for more info: http://www.utf-8.com/ Thanks Michelle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with fopen and sending POST vars
Silvio Porcellana [tradeOver] wrote: Barry wrote: I have a problem sending POST vars via fopen. It was possible for me to send some xml data but that's all. Anyone know how to send POST vars? Big probleme here is also that i have to connect via SSL. cURL can be your friend... http://php.net/curl http://www.zend.com/pecl/tutorials/curl.php HTH, cheers Silvio Is there an other way? Ensim is installed on the Webserver, and this Webserver-tool is quite everywhere in the system. cURL has SSL disabled. I tried to install/update to a newer version but i get errors trying it like: # rpm -U curl-7.15.1-1.i386.rpm error: failed dependencies: libcurl.so.2 is needed by php-4.2.2-2ensim7 And i am a bit afraid if i now add/change that system too much that the whole server breaks up... See here, everything is connected to that ensim thing :( # rpm -qa | grep ensim vacation-1.2.6.1-ensim1 gettext-0.10.38-7ensim1 Zope-services-2.3.3-2ensim3 postgresql-contrib-7.1.3-4ensim3 apache-manual-1.3.27-ensim1 libsfio-1999-1ensim1 apache-mod_fastcgi-2.2.10-1ensim11 postgresql-7.1.3-4ensim4bp.2 postgresql-server-7.1.3-4ensim4bp.2 php-devel-4.2.2-2ensim7 php-ldap-4.2.2-2ensim7 php-snmp-4.2.2-2ensim7 python2-2.1.3-1ensim2 majordomo-1.94.5-2ensim6 cronolog-1.6.1-ensim4 Zope-zpublisher-2.3.3-2ensim3 tomcat4-4.0.3-ensim1 apache-devel-1.3.27-ensim1 proftpd-standalone-1.2.4-ensim2 apache-1.3.27-ensim1 postgresql-libs-7.1.3-4ensim4bp.2 postgresql-python-7.1.3-4ensim4bp.2 php-4.2.2-2ensim7 php-imap-4.2.2-2ensim7 php-pgsql-4.2.2-2ensim7 sendmail-doc-8.11.6-3ensim7 analog-5.1-1ensim2 mx-2.0.2-1ensim3 Zope-zserver-2.3.3-2ensim3 phpMyAdmin-2.2.0-ensim4 mod_jk-1.3-1.0-1.4.0.2ensim2 proftpd-1.2.4-ensim2 postgresql-devel-7.1.3-4ensim4bp.2 php-gettext-4.2.2-2ensim7 php-mysql-4.2.2-2ensim7 php-sysvshm-4.2.2-2ensim7 sendmail-cf-8.11.6-3ensim7 perl-Quota-1.4-ensim2 frontpage-5.0-ensim15 Zope-components-2.3.3-2ensim3 Zope-ztemplates-2.3.3-2ensim3 ensim-appliance-libs-3.1.0-25 MySQL-python21-0.3.5-1ensim3 mod_ssl-2.8.12-ensim1 ensim-appliance-l-3.1.4-1 php-ftp-4.2.2-2ensim7 php-manual-4.2.2-2ensim7 php-sysvsem-4.2.2-2ensim7 sendmail-8.11.6-3ensim7 Greetings Barry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with fopen and sending POST vars
There are a couple examples of manually sending POST data via fsockopen() on: http://us2.php.net/manual/en/function.fsockopen.php Basically the stucture is the same as URL GET variables but you have to send the header data manually and set content-type to application/x-www-form-urlencoded. But you still end up sneding data in this form: var1=value1var2=value2var3=value3 (hence the urlencoded part). Good luck! -TG = = = Original message = = = Hello everyone! I have a problem sending POST vars via fopen. It was possible for me to send some xml data but that's all. Anyone know how to send POST vars? Big probleme here is also that i have to connect via SSL. Many thanks for any help. Greetings ~Barry Here is my code: ? # generating xml for testing $request_data = xmldatablablubb/data/xml; # array with the options to create stream context $opts = Array(); # compose HTTP request header $header .= User-Agent: PHP Script\\r\\n; $header .= Content-Type: text/xml\\r\\n; $header .= Content-Length: .strlen($request_data).\\r\\n; $header .= Connection: close; # define context options for HTTP request $opts['http']['method'] = 'POST'; $opts['http']['header'] = $header; $opts['http']['content'] = $request_data; # create stream context $context = stream_context_create($opts); $fp = fopen (https://easy-demo.tcinternet.de/hosting/servlet/Dispatcher,r,false,$context); if (!$fp) echo error; else $vars= explode (,stream_get_contents($fp)); foreach ($vars as $key = $value) $var = explode (=, $value); $tcph[$var[0]] = urldecode($var[1]); print_r($tcph); ? ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem on Instalation ~ several module unable to downl oad
Sorry, just reply it.. I was tring to put php.ini on c:\php or c:\windows, still fail to load several modules. Then, I'm check to load module by module and notified almost all of database module(mysql, mysqli,oracle,sybase,oci) unable to load when php start_up.(only postgreSQL is able to load). Meanwhile, other database module such as (mbstring, gd etc) is able to load. Anyone have experience like this? Thanks in advance Note : System configuration : PHP : PHP5.05 OS : XP SP2 Server : Apache 2.0 Database : MySQL4 and MySQL5 From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Sat 10-Dec-2005 04:14 To: Bagus Nugroho; php-general@lists.php.net Subject: RE: [PHP] Problem on Instalation ~ several module unable to downl oad [snip] Yes, all requested module is put on same folder which module which succesfully load. But, I don't understand why they say the module is not found? What operating system are you using? {/snip] Sorry, found the original post. Can you send the snippet for the php.ini where you set the extensions directory?
[PHP] Problem: Distortion while saving text file.
What could be wrong when this is transformed: img src=graphics/auringonlasku2.jpg align=left to this form: img src=\graphics/auringonlasku2.jpg\ align=\left\ The line is saved to text file with this function: function savesite($site, $lang, $contents){ if (check_session()){ $file=fopen('content/' . $site . '_' . $lang . '.txt', w); fwrite($file, $contents); fclose($file); } I run it through nl2br() before saving and this only happens on Linux server, on Windows server it works fine, no \ before . Tested with: On Windows: Apache2, PHP5 Linux: Debian distro, Apache2, PHP4, also tried with PHP5 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem: Distortion while saving text file.
Could it be the other way around, i.e. Windows is stripping slashes, and Linux is not? How does $contents come to exist in the script? Check for any difference in your ini files for magic_quotes_runtime. Cheers, David Grant Janne Miettunen wrote: What could be wrong when this is transformed: img src=graphics/auringonlasku2.jpg align=left to this form: img src=\graphics/auringonlasku2.jpg\ align=\left\ The line is saved to text file with this function: function savesite($site, $lang, $contents){ if (check_session()){ $file=fopen('content/' . $site . '_' . $lang . '.txt', w); fwrite($file, $contents); fclose($file); } I run it through nl2br() before saving and this only happens on Linux server, on Windows server it works fine, no \ before . Tested with: On Windows: Apache2, PHP5 Linux: Debian distro, Apache2, PHP4, also tried with PHP5 -- David Grant http://www.grant.org.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem on Instalation ~ several module unable to download
Hi All, Previously I always succed to instalation PHP, but currently I have strange problem as several module is unable to download(i.e : php_mysql.dll, php_mysqli.dll), while several other are succesfully download(i.e : mbstring, gd). I have re-installed or copy PHP folder from my succeded instalation, but it is not work. I'm used WindowsXP, Apache2.0, PHP5 May be someone out there could help me to solve it. Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem on Instalation ~ several module unable to download
here is my last list of module which bale to load and unable to load excerpt php.ini extension=php_mbstring.dll ;extension=php_bz2.dll extension=php_cpdf.dll ;extension=php_curl.dll extension=php_dba.dll extension=php_dbase.dll extension=php_dbx.dll ;extension=php_exif.dll ;extension=php_fdf.dll extension=php_filepro.dll extension=php_gd2.dll extension=php_gettext.dll ;extension=php_ifx.dll ;extension=php_iisfunc.dll extension=php_imap.dll ;extension=php_interbase.dll ;extension=php_java.dll ;extension=php_ldap.dll ;extension=php_mcrypt.dll ;extension=php_mhash.dll extension=php_mime_magic.dll extension=php_ming.dll ;extension=php_mssql.dll ;extension=php_msql.dll ;extension=php_mysql.dll ;extension=php_mysqli.dll ;extension=php_oci8.dll ;extension=php_openssl.dll ;extension=php_oracle.dll ;extension=php_pdf.dll extension=php_pgsql.dll extension=php_shmop.dll extension=php_snmp.dll extension=php_sockets.dll ;extension=php_sybase_ct.dll extension=php_tidy.dll ;extension=php_w32api.dll extension=php_xmlrpc.dll extension=php_xsl.dll ;extension=php_yaz.dll ;extension=php_zip.dll -- I was re-check that php_mysql.dll, php_mysqli.dll etc is on c:\php\ext as others. Any idea how come Thanks From: Bagus Nugroho [mailto:[EMAIL PROTECTED] Sent: Fri 09-Dec-2005 21:06 To: php-general@lists.php.net Subject: [PHP] Problem on Instalation ~ several module unable to download Hi All, Previously I always succed to instalation PHP, but currently I have strange problem as several module is unable to download(i.e : php_mysql.dll, php_mysqli.dll), while several other are succesfully download(i.e : mbstring, gd). I have re-installed or copy PHP folder from my succeded instalation, but it is not work. I'm used WindowsXP, Apache2.0, PHP5 May be someone out there could help me to solve it. Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem on Instalation ~ several module unable to downl oad
[snip] here is my last list of module which bale to load and unable to load excerpt php.ini extension=php_mbstring.dll ;extension=php_bz2.dll extension=php_cpdf.dll ;extension=php_curl.dll extension=php_dba.dll extension=php_dbase.dll extension=php_dbx.dll ;extension=php_exif.dll ;extension=php_fdf.dll extension=php_filepro.dll extension=php_gd2.dll extension=php_gettext.dll ;extension=php_ifx.dll ;extension=php_iisfunc.dll extension=php_imap.dll ;extension=php_interbase.dll ;extension=php_java.dll ;extension=php_ldap.dll ;extension=php_mcrypt.dll ;extension=php_mhash.dll extension=php_mime_magic.dll extension=php_ming.dll ;extension=php_mssql.dll ;extension=php_msql.dll ;extension=php_mysql.dll ;extension=php_mysqli.dll ;extension=php_oci8.dll ;extension=php_openssl.dll ;extension=php_oracle.dll ;extension=php_pdf.dll extension=php_pgsql.dll extension=php_shmop.dll extension=php_snmp.dll extension=php_sockets.dll ;extension=php_sybase_ct.dll extension=php_tidy.dll ;extension=php_w32api.dll extension=php_xmlrpc.dll extension=php_xsl.dll ;extension=php_yaz.dll ;extension=php_zip.dll -- I was re-check that php_mysql.dll, php_mysqli.dll etc is on c:\php\ext as others. Any idea how come [/snip] Remove the semi-colons from in front of the ones you wish to load and then restart. They should load then. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem on Instalation ~ several module unable to download
It's done ... But it was create errror like this PHP Startup: unable to load dynamic library 'c:\php\ext\php_mysqli.dll' - The specified module could not found. I was re-check to ensure php_mysqli.dll is on c:\php\ext and used from same source... Thanks From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Fri 09-Dec-2005 22:36 To: Bagus Nugroho; php-general@lists.php.net Subject: RE: [PHP] Problem on Instalation ~ several module unable to download [snip] here is my last list of module which bale to load and unable to load excerpt php.ini extension=php_mbstring.dll ;extension=php_bz2.dll extension=php_cpdf.dll ;extension=php_curl.dll extension=php_dba.dll extension=php_dbase.dll extension=php_dbx.dll ;extension=php_exif.dll ;extension=php_fdf.dll extension=php_filepro.dll extension=php_gd2.dll extension=php_gettext.dll ;extension=php_ifx.dll ;extension=php_iisfunc.dll extension=php_imap.dll ;extension=php_interbase.dll ;extension=php_java.dll ;extension=php_ldap.dll ;extension=php_mcrypt.dll ;extension=php_mhash.dll extension=php_mime_magic.dll extension=php_ming.dll ;extension=php_mssql.dll ;extension=php_msql.dll ;extension=php_mysql.dll ;extension=php_mysqli.dll ;extension=php_oci8.dll ;extension=php_openssl.dll ;extension=php_oracle.dll ;extension=php_pdf.dll extension=php_pgsql.dll extension=php_shmop.dll extension=php_snmp.dll extension=php_sockets.dll ;extension=php_sybase_ct.dll extension=php_tidy.dll ;extension=php_w32api.dll extension=php_xmlrpc.dll extension=php_xsl.dll ;extension=php_yaz.dll ;extension=php_zip.dll -- I was re-check that php_mysql.dll, php_mysqli.dll etc is on c:\php\ext as others. Any idea how come [/snip] Remove the semi-colons from in front of the ones you wish to load and then restart. They should load then. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem on Instalation ~ several module unable to downl oad
[snip] It's done ... But it was create errror like this PHP Startup: unable to load dynamic library 'c:\php\ext\php_mysqli.dll' - The specified module could not found. I was re-check to ensure php_mysqli.dll is on c:\php\ext and used from same source... [/snip] Any of the modules that you want to load should be in that directory and the php.ini should point to it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem on Instalation ~ several module unable to download
Yes, all requested module is put on same folder which module which succesfully load. But, I don't understand why they say the module is not found? I hope, you can help me Thanks From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Fri 09-Dec-2005 23:06 To: Bagus Nugroho; Jay Blanchard; php-general@lists.php.net Subject: RE: [PHP] Problem on Instalation ~ several module unable to download [snip] It's done ... But it was create errror like this PHP Startup: unable to load dynamic library 'c:\php\ext\php_mysqli.dll' - The specified module could not found. I was re-check to ensure php_mysqli.dll is on c:\php\ext and used from same source... [/snip] Any of the modules that you want to load should be in that directory and the php.ini should point to it.
RE: [PHP] Problem on Instalation ~ several module unable to downl oad
[snip] Yes, all requested module is put on same folder which module which succesfully load. But, I don't understand why they say the module is not found? [/snip] What operating system are you using? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem on Instalation ~ several module unable to downl oad
[snip] Yes, all requested module is put on same folder which module which succesfully load. But, I don't understand why they say the module is not found? What operating system are you using? {/snip] Sorry, found the original post. Can you send the snippet for the php.ini where you set the extensions directory? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with pdf_show_boxed()
Hello, Sir: I just installed PHP with pdflib : PHP-4.4.1 pdflib PDFlib GmbH Version 6.0.2 pdflib PECL Version 2.0.3 apache 1.3.34 in Liunx FC1. -- When I run the script , I got the error messages as following: - Fatal error: pdf_show_boxed(): [2102] PDF_show_boxed: Function not supported for 'CID' in /home/apache/htdocs/004.php on line 8 - Some thing wrong with this function at the 8th parameter, I think: pdf_show_boxed($pdf,$text,50,650,150,100,'right',''); if I remove the 8th parameter, It would tell me : - Warning: pdf_show_boxed() expects exactly 8 parameters, 7 given in /home/apache/htdocs/004.php on line 8 - What should I do? Thanks form Any help. ### The code: ### $pdf = PDF_new(); pdf_open_file($pdf,); pdf_begin_page($pdf,595,842); //a4 $font = pdf_findfont($pdf,MSung-Light,ETen-B5-H,0); pdf_setfont($pdf,$font,12); $text=MY TEST WORD; pdf_show_boxed($pdf,$text,50,650,150,100,'right',''); pdf_end_page($pdf); pdf_close($pdf); $buffer=pdf_get_buffer($pdf); $leng = strlen($buffer); header (Cache-Control: must-revalidate, post-check=0, pre-check=0); header(Content-type: application/pdf; charset: big5); header(Content-Length: $leng); header(Content-Disposition: inline; filename=hello.pdf); print($buffer); pdf_delete($pdf); ___ 最新版 Yahoo!奇摩即時通訊 7.0,免費網路電話任你打! http://messenger.yahoo.com.tw/
[PHP] php problem
in a huge php page it's happen that some page included in index.php, for some strange reason went write. 2 byte are write on the pages included, and are always the same (FF and FE in hexadecilam) at the start of file. so the file will be FF FE? php blablabla ? i cannot understand why, i don't use fopen, fwrite, and things like that, so what i can do to debug this script? also i cannot understand where the problem is, so i don't know if is regarded to a page included in index.php or in some other place. Any help is appreciated! best regards Matteo
Re: [PHP] php problem
Hi Matteo, can you reduce the code to the smallest one and provide your scripts here to reproduce it? in a huge php page it's happen that some page included in index.php, for some strange reason went write. 2 byte are write on the pages included, and are always the same (FF and FE in hexadecilam) at the start of file. -- Marco Kaiser -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php problem
anyone looking for an example of how not to ask a question on a mailing list, this is it: Rama wrote: in a huge php page it's happen that some page included in index.php, for some strange reason went write. 2 byte are write on the pages included, and are always the same (FF and FE in hexadecilam) at the start of file. so the file will be FF FE? php blablabla ? i cannot understand why, i don't use fopen, fwrite, and things like that, so what i can do to debug this script? also i cannot understand where the problem is, so i don't know if is regarded to a page included in index.php or in some other place. I can't even debug the question, let alone tell the OP how to debug his script. any mindreaders here? Any help is appreciated! best regards Matteo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem in installing php5
Hi, I tried to install php5 in redhat7.2,but i was unable to do so. There was some problem related to libxml2. I even tried down loading the libxml2 rpm and upgraded the package.Even then some other problem occured related to libxml2. is that possible to install php5 in redhat7.2 ?. with regards vijay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Frames and Sessions
Frames are just nested windows, the server can't tell the difference between a page requested from a frame or a separate window and you should treat them as such. So if your frame was created before a session was created, it's not part of the session. On Nov 28, 2005, at 6:52 PM, Shaun wrote: Hi, I have a frameset with a left column and a main column. I have a login script with a form in the left column. When I log in I get a menu in the left column which targets to the main column. My problem is that when I click on links in the left column nothing appears in the main frame, however if I refresh the browser then the links work. I am sure this must be a PHP session problem but I don't have any experience using frames, does anyone have suggestions as to what the problem might be? Thanks for your advice. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with Frames and Sessions
Hi, I have a frameset with a left column and a main column. I have a login script with a form in the left column. When I log in I get a menu in the left column which targets to the main column. My problem is that when I click on links in the left column nothing appears in the main frame, however if I refresh the browser then the links work. I am sure this must be a PHP session problem but I don't have any experience using frames, does anyone have suggestions as to what the problem might be? Thanks for your advice. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] R: [PHP] Problem with Frames and Sessions
Change the logon script. The cookies of each frame are loaded separately, so if you want the session to be active in all the frames, at least once you got to reload them. The easiest way, I think, is to change the logon script: put it on a main page and once the user is logged in, create the frameset. The session will be available in all the frames. Cheers, En3pY Sebastian Konstanty Zdrojewski URL: http://www.en3py.net/ E-Mail: [EMAIL PROTECTED] Le informazioni contenute in questo messaggio sono riservate e confidenziali. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora Lei non fosse la persona a cui il presente messaggio è destinato, La invito ad eliminarlo dal Suo Sistema ed a distruggere le varie copie o stampe, dandone gentilmente comunicazione. Ogni utilizzo improprio è contrario ai principi del D.lgs 196/03 e alla legislazione Europea (Direttiva 2002/58/CE). -Messaggio originale- Da: Shaun [mailto:[EMAIL PROTECTED] Inviato: martedì 29 novembre 2005 0.53 A: php-general@lists.php.net Oggetto: [PHP] Problem with Frames and Sessions Hi, I have a frameset with a left column and a main column. I have a login script with a form in the left column. When I log in I get a menu in the left column which targets to the main column. My problem is that when I click on links in the left column nothing appears in the main frame, however if I refresh the browser then the links work. I am sure this must be a PHP session problem but I don't have any experience using frames, does anyone have suggestions as to what the problem might be? Thanks for your advice. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.13.8/184 - Release Date: 27/11/2005 smime.p7s Description: S/MIME cryptographic signature
Re: [PHP] Problem with the fwrite function (not as simple as it sounds though)
Hello again, here's some more extra info on my case that came out while Suhas Pharkute was helping me find a resolution: So the safe-mode is off, that's for sure, I turned it off at compile stage. I delete the file after each run of the script, the folder where the script is located has 777 permissions and the ownership is given to uid 1027 gid 1020, whereas these are the uid/gid set for apache to run with (and it does!). The script: $data=some data; $file=file.txt; $handle = fopen($file,w); fwrite($handle,$data); fflush($handle); fclose($handle); if (is_writable($file)) echo Is writablebr; else echo Isn't writablebr; works when I run it as root, from the shell (php script.php), but when it's run from the server, it doesn't. I mean, the output _IS_ in _BOTH_ cases Is writable but that doesn't change a thing, cause when executed from the apache, it just creates an empty file without content. The other thing I was supposed to check was stat($file); with clearstatcache(); called beforehand. The output of this is: device number: 777 inode number: 1142470 inode protection mode: 33188 number of links: 1 _userid_of_owner:_1027_ groupid of owner: 1020 device type, if inode device *: 0 _size_in_bytes:_0_ time of last access (Unix timestamp): 1132482491 time of last modification (Unix timestamp): 1132482505 time of last inode change (Unix timestamp): 1132482505 blocksize of filesystem IO *: 4096 _number_of_blocks_allocated:_0_ and of course when executed as root: device number: 777 inode number: 1142470 inode protection mode: 33188 number of links: 1 _userid_of_owner:_0_ groupid of owner: 1020 device type, if inode device *: 0 _size_in_bytes:_9_ time of last access (Unix timestamp): 1132482980 time of last modification (Unix timestamp): 1132482980 time of last inode change (Unix timestamp): 1132482980 blocksize of filesystem IO *: 4096 _number_of_blocks_allocated:_8_ Can anybody help me? -- Best wishes Łukasz Hejnak -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with the fwrite function (not as simple as it sounds though)
On Sun, 2005-11-20 at 05:44, Łukasz Hejnak wrote: Hello again, here's some more extra info on my case that came out while Suhas Pharkute was helping me find a resolution: So the safe-mode is off, that's for sure, I turned it off at compile stage. I delete the file after each run of the script, the folder where the script is located has 777 permissions and the ownership is given to uid 1027 gid 1020, whereas these are the uid/gid set for apache to run with (and it does!). The script: $data=some data; $file=file.txt; $handle = fopen($file,w); fwrite($handle,$data); fflush($handle); fclose($handle); if (is_writable($file)) echo Is writablebr; else echo Isn't writablebr; works when I run it as root, from the shell (php script.php), but when it's run from the server, it doesn't. I missed the beginning of this thread... You are saying: From the CLI you can write to a file all day long, no prob. From the web, if the file does not exist it is created, however, no content is appended to it. Furthermore, IF there is content in the file it can be appended to via web, but if it's an empty file it will not get written too. Am I following correctly? -Brian -- s/:-[(/]/:-)/g BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu == gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC Key Info: http://gfx-design.com/keys Linux Registered User #339825 at http://counter.li.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with the fwrite function (not as simple as it sounds though)
Brian V Bonini napisał(a): You are saying: From the CLI you can write to a file all day long, no prob. Yes, the shell command php test.php works fine when executed as root (any other user has the same problem as from the web) From the web, if the file does not exist it is created, however, no content is appended to it. Furthermore, IF there is content in the file it can be appended to via web, but if it's an empty file it will not get written too. Am I following correctly? Exactly, as strange as it sounds, it's just like it is. And another thing, the whole instalation was working perfectly for the past month or two, and now (friday-saturday) suddenly the above symptom have appeared. No config changes, no updates or anything else I could relate was happening on the server, and there is no info in the log files on this behaviour, the is_writable says it is writable. The safe mode is disabled. Hope this tells You something, and gives You an idea on how to solve this. -- Best wishes Łukasz Hejnak -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with the fwrite function (not as simple as it sounds though)
On Sun, Nov 20, 2005 at 03:38:56PM +0100, ukasz Hejnak wrote: Brian V Bonini napisa�(a): You are saying: From the CLI you can write to a file all day long, no prob. Yes, the shell command php test.php works fine when executed as root (any other user has the same problem as from the web) From the web, if the file does not exist it is created, however, no content is appended to it. Furthermore, IF there is content in the file it can be appended to via web, but if it's an empty file it will not get written too. Am I following correctly? Exactly, as strange as it sounds, it's just like it is. And another thing, the whole instalation was working perfectly for the past month or two, and now (friday-saturday) suddenly the above symptom have appeared. This almost sounds as your disk usage (or quota) is at 100%. Curt. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with the fwrite function (not as simple as it sounds though)
This is not a disk usage as it works when script is run from terminal as su\ Suhas On 11/20/05, Curt Zirzow [EMAIL PROTECTED] wrote: On Sun, Nov 20, 2005 at 03:38:56PM +0100, ukasz Hejnak wrote: Brian V Bonini napisa�(a): You are saying: From the CLI you can write to a file all day long, no prob. Yes, the shell command php test.php works fine when executed as root (any other user has the same problem as from the web) From the web, if the file does not exist it is created, however, no content is appended to it. Furthermore, IF there is content in the file it can be appended to via web, but if it's an empty file it will not get written too. Am I following correctly? Exactly, as strange as it sounds, it's just like it is. And another thing, the whole instalation was working perfectly for the past month or two, and now (friday-saturday) suddenly the above symptom have appeared. This almost sounds as your disk usage (or quota) is at 100%. Curt. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Contact @ Suhas Pharkute. [EMAIL PROTECTED] 208 830 8915 (C) 208 429 6943 (H)
Re: [PHP] Problem with the fwrite function (not as simple as it sounds though)
On Sun, Nov 20, 2005 at 09:26:15AM -0700, Suhas wrote: This is not a disk usage as it works when script is run from terminal as su\ root can break the 100% barrier, it usually can get around 110%. [EMAIL PROTECTED]:/tmp df -h /tmp Filesystem SizeUsed Avail Capacity Mounted on /dev/ad0s1e248M8.2M220M 4%/tmp [EMAIL PROTECTED]:/tmp cat /dev/random foobar /tmp: write failed, filesystem is full cat: stdout: No space left on device [EMAIL PROTECTED]:/tmp df -h /tmp Filesystem SizeUsed Avail Capacity Mounted on /dev/ad0s1e248M228M8.0K 100%/tmp [EMAIL PROTECTED]:/tmp su [EMAIL PROTECTED]:/tmp# cat /dev/random foobar /tmp: write failed, filesystem is full cat: stdout: No space left on device [EMAIL PROTECTED]:/tmp# df -h /tmp Filesystem SizeUsed Avail Capacity Mounted on /dev/ad0s1e248M248M-20M 109%/tmp Curt. -- cat: .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with the fwrite function (not as simple as it sounds though)
thanks, never thought about that. Suhas On 11/20/05, Curt Zirzow [EMAIL PROTECTED] wrote: On Sun, Nov 20, 2005 at 09:26:15AM -0700, Suhas wrote: This is not a disk usage as it works when script is run from terminal as su\ root can break the 100% barrier, it usually can get around 110%. [EMAIL PROTECTED]:/tmp df -h /tmp Filesystem SizeUsed Avail Capacity Mounted on /dev/ad0s1e248M8.2M220M 4%/tmp [EMAIL PROTECTED]:/tmp cat /dev/random foobar /tmp: write failed, filesystem is full cat: stdout: No space left on device [EMAIL PROTECTED]:/tmp df -h /tmp Filesystem SizeUsed Avail Capacity Mounted on /dev/ad0s1e248M228M8.0K 100%/tmp [EMAIL PROTECTED]:/tmp su [EMAIL PROTECTED]:/tmp# cat /dev/random foobar /tmp: write failed, filesystem is full cat: stdout: No space left on device [EMAIL PROTECTED]:/tmp# df -h /tmp Filesystem SizeUsed Avail Capacity Mounted on /dev/ad0s1e248M248M-20M 109%/tmp Curt. -- cat: .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Contact @ Suhas Pharkute. [EMAIL PROTECTED] 208 830 8915 (C) 208 429 6943 (H) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with the fwrite function (not as simple as it sounds though)
On Sun, 2005-11-20 at 09:38, Łukasz Hejnak wrote: Brian V Bonini napisał(a): You are saying: From the CLI you can write to a file all day long, no prob. Yes, the shell command php test.php works fine when executed as root (any other user has the same problem as from the web) From the web, if the file does not exist it is created, however, no content is appended to it. Furthermore, IF there is content in the file it can be appended to via web, but if it's an empty file it will not get written too. Am I following correctly? Exactly, as strange as it sounds, it's just like it is. And another thing, the whole instalation was working perfectly for the past month or two, and now (friday-saturday) suddenly the above symptom have appeared. No config changes, no updates or anything else I could relate was happening on the server, and there is no info in the log files on this behaviour, the is_writable says it is writable. The safe mode is disabled. Hope this tells You something, and gives You an idea on how to solve this. What does 'df -h' say on your system? -- s/:-[(/]/:-)/g BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu == gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC Key Info: http://gfx-design.com/keys Linux Registered User #339825 at http://counter.li.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with the fwrite function (not as simple as it sounds though)
Brian V Bonini napisał(a): What does 'df -h' say on your system? !!! The simplest of all is the most unforseen.. Wow. that's it ;) I NEVER EVEN Imagined to check for that, in fact that _IS_ the thing. I feel so totaly stupid right now, I checked everything except this, although I think the fwrite _SHOULD_ return false on this, and it should print out an error saying that there's no space available.. The thing is that my system has a few partitions, one of them is the one containing wwwroot. I never even once got a msg that the filesystem is full, as most of my operations (recompiling etc.) were conducted on a seperate partition. Now I see it and can take it all together, as there is one script doing backup of the www sites, it does so every night, and that was the thing that made it full. BIG ENORMOUS Thanks for the help to all of You, and sorry for the problem, I would never ever thought about this, until You suggested it. a modification to the topic of this message, Simpler the You could've thought ;] -- Best wishes Łukasz Hejnak -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with the fwrite function (not as simple as it sounds though)
Hello, First of all sorry for my english, trying my best :] The story is: I'm running a small webserver and to monitor the amount of people going trough my pages, I've made a simple counter (storing the data in a text file), no matter the details, the important thing is that it WORKED just the way I wanted it to. Till yesterday evening. Today I noticed that all of the counters, that were modyfied since yesterday, have been blanked. I started looking trough the logs and found a large amount of PHP Warning: fread(): Length parameter must be greater than 0. which was the expected behaviour when reading an empty file. After a while of checking, I got to the fact that something's wrong with the fwrite() function. I've writen a 'test' script only to see if I can write files. When writing to the /tmp dir, all went fine, but when I tried to write to any of the other directories within my $WWWroot the result was an empty file. This is the script: $data=some data; $file=/wwwroot/file $handle=fopen($file,w); fwrite($handle,$data); fflush($handle); fclose($handle); And as written above, the output was only an empty file /wwwroot/file nothing more. I thought about premissions, but after setting the wwwroot a+rwx, setting the owner and group as the same as the apache server works under I got the idea that's not it. I reinstalled the apache and php. Now I'm using httpd-2.1.9 and php-4.4.0 (as a module) but the problem is still there, before I was using httpd-2.1.8, but as I said, the problem appeared out of nowhere, when the server was just running on it's own, without upgrades, patches, config changes, or anything other. In fact all it was doing trough the night was serving the websites and receiving mail. I runned out of ideas. The logs don't show anything related to this. I tried to enable all debug logging, but despite the fact that I'm receiving now 3 times more info on everything else, there's nothing on the fwrite() attempt or related. Can anybody help? If any more data is required on my side, I will gladly cooperate to get the thing solved. -- Best wishes Łukasz Hejnak -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with the fwrite function (not as simple as it sounds though)
Hello again, some extra info on my case: the fwrite is completely fine, when fopen is in 'a' mode! Thus leading to a temporary workaround like this: $file = /wwwroot/file $countt = explode(., fread(fopen($file,r), filesize($file))); $count=$countt[1]; $count++; $handle=fopen($file,a); ftruncate($handle, 1); fwrite($handle,$file); fclose($handle); Now having a file with content in the form: .15 makes it possible to use the above as a workaround.. but still I need to find out what's the problem here. The counter isn't exactly the only thing I use fwrite for.. The clue I got is, non-empty files are ok to be written in (appended), empty on the other hand, are totaly uncool for that. So using a ftruncate($handle,0); is just as I'd use fopen($file,w); (gives the same result). -- Best wishes Still hoping for Your help Łukasz Hejnak -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem in create new diretory..
Hello all, I have created a new dir, with php code .. which is like that function mkDirE($dir,$dirmode=777) { if (!empty($dir)) { if (!file_exists(./microsite/.$dir)) { preg_match_all('/([^\/]*)\/?/i', $dir,$atmp); $base=; foreach ($atmp[0] as $key=$val) { $base=$base.$val; if(!file_exists(./microsite/.$base)){ if (!mkdir(./microsite/.$base,777)) { echo Error: Cannot create .$base; return 2; } //echo Inside mk; touch(./microsite/.$base./index.php); $source = ./microsite/index.php; $destination = ./microsite/.$base./index.php; $copy_file = copy($source,$destination); } } } else if (!is_dir($dir)) { //echo Error: .$dir. exists; return Error: .$dir. already exists; } } return 0; } - this will create a new folder in my root folder, Locally every thing is working fine but when I upload the files then in my live server dir is creating but with the permission 410 drx--t can any body help me ... wt is the problem thnx...
[PHP] Problem with Regexp
Hello, I have the string: trtdimg src=http://www.runescape.com/img/hiscores/attack.gif; valign=bottom width=16 height=16 //tdtdnbsp;/tdtda href=hiscoreuser.cgi?username=zezimacategory=1 class=cAttack/a/tdtd align=right4/tdtd align=right99/tdtd align=right53,156,556/td/tr and I apply preg_match_all: preg_match_all(/(trtdimg src=\http:\/\/www.runescape.com\/img\/hiscores\/attack.gif\ valign=\bottom\ width=16 height=16 \/\/tdtdnbsp;\/tdtda href=\hiscoreuser.cgi\?username=)([\w])+(category=1\ class=cAttack\/a\/tdtd align=\right\)([1-9])+(\/tdtd align=\right\)([1-9])+(\/tdtd align=\right\)([1-9,])+(\/td\/tr)/,$seite,$attack); ($seite is the string) If i make print_r($attack); then I get: Array ( [0] = Array ( [0] = trtdimg src=http://www.runescape.com/img/hiscores/attack.gif; valign=bottom width=16 height=16 //tdtdnbsp;/tdtda href=hiscoreuser.cgi?username=zezimacategory=1 class=cAttack/a/tdtd align=right4/tdtd align=right99/tdtd align=right53,156,556/td/tr ) [1] = Array ( [0] = trtdimg src=http://www.runescape.com/img/hiscores/attack.gif; valign=bottom width=16 height=16 //tdtdnbsp;/tdtda href=hiscoreuser.cgi?username= ) [2] = Array ( [0] = a ) [3] = Array ( [0] = category=1 class=cAttack/a/tdtd align=right ) [4] = Array ( [0] = 4 ) [5] = Array ( [0] = /tdtd align=right ) [6] = Array ( [0] = 9 ) [7] = Array ( [0] = /tdtd align=right ) [8] = Array ( [0] = 6 ) [9] = Array ( [0] = /td/tr ) ) But I would expect to get [2] = Array ( [0] = zezima ) [6] = Array ( [0] = 99 ) [8] = Array ( [0] = 53,156,556 ) Instead of the values above. Can you explain me how I can get those values? Yannick Mortier -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Regexp
Yannick Mortier wrote: Hello, I have the string: trtdimg src=http://www.runescape.com/img/hiscores/attack.gif; valign=bottom width=16 height=16 //tdtdnbsp;/tdtda href=hiscoreuser.cgi?username=zezimacategory=1 class=cAttack/a/tdtd align=right4/tdtd align=right99/tdtd align=right53,156,556/td/tr and I apply preg_match_all: preg_match_all(/(trtdimg src=\http:\/\/www.runescape.com\/img\/hiscores\/attack.gif\ valign=\bottom\ width=16 height=16 \/\/tdtdnbsp;\/tdtda href=\hiscoreuser.cgi\?username=)([\w])+(category=1\ class=cAttack\/a\/tdtd align=\right\)([1-9])+(\/tdtd align=\right\)([1-9])+(\/tdtd align=\right\)([1-9,])+(\/td\/tr)/,$seite,$attack); ... But I would expect to get [2] = Array ( [0] = zezima ) [6] = Array ( [0] = 99 ) [8] = Array ( [0] = 53,156,556) Instead of the values above. Can you explain me how I can get those values? Try something like: preg_match_all('#username=([^]+).+td align=right\d+/tdtd align=right(\d+)/tdtd align=right([\d, ]+)/td#i', $seite, $matches); print_r($matches); Not tested - might need tweaking. -- Richard Heyes http://www.phpguru.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Regexp
On Mon, October 31, 2005 9:27 am, Yannick Mortier wrote: trtdimg src=http://www.runescape.com/img/hiscores/attack.gif; valign=bottom width=16 height=16 //tdtdnbsp;/tdtda href=hiscoreuser.cgi?username=zezimacategory=1 class=cAttack/a/tdtd align=right4/tdtd align=right99/tdtd align=right53,156,556/td/tr and I apply preg_match_all: preg_match_all(/(trtdimg src=\http:\/\/www.runescape.com\/img\/hiscores\/attack.gif\ valign=\bottom\ width=16 height=16 \/\/tdtdnbsp;\/tdtda href=\hiscoreuser.cgi\?username=)([\w])+(category=1\ class=cAttack\/a\/tdtd align=\right\)([1-9])+(\/tdtd align=\right\)([1-9])+(\/tdtd align=\right\)([1-9,])+(\/td\/tr)/,$seite,$attack); ($seite is the string) When trying to web-scrape data like this, I would recommend that you try to focus on things that are NOT likely to change, rather than the HTML bits that probably will change. When you HAVE to use the HTML, focus on the smallest elements of HTML that you can to identify what you want, so your odds of an altered HTML page will be less likely to affect you. I would try this: '/username=(.*)\\.*right([0-9]*).*right([0-9]*).*right([0-9,]*)/' PS FOR SURE, you need 0-9 and not 1-9 for your numbers: Rank: 10 Score: 45,067,13 etc Can you explain me how I can get those values? and are probably being interpreted as special characters or something. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Regexp
Richard Heyes schrieb: Yannick Mortier wrote: Hello, I have the string: trtdimg src=http://www.runescape.com/img/hiscores/attack.gif; valign=bottom width=16 height=16 //tdtdnbsp;/tdtda href=hiscoreuser.cgi?username=zezimacategory=1 class=cAttack/a/tdtd align=right4/tdtd align=right99/tdtd align=right53,156,556/td/tr and I apply preg_match_all: preg_match_all(/(trtdimg src=\http:\/\/www.runescape.com\/img\/hiscores\/attack.gif\ valign=\bottom\ width=16 height=16 \/\/tdtdnbsp;\/tdtda href=\hiscoreuser.cgi\?username=)([\w])+(category=1\ class=cAttack\/a\/tdtd align=\right\)([1-9])+(\/tdtd align=\right\)([1-9])+(\/tdtd align=\right\)([1-9,])+(\/td\/tr)/,$seite,$attack); ... But I would expect to get [2] = Array ( [0] = zezima ) [6] = Array ( [0] = 99 ) [8] = Array ( [0] = 53,156,556) Instead of the values above. Can you explain me how I can get those values? Try something like: preg_match_all('#username=([^]+).+td align=right\d+/tdtd align=right(\d+)/tdtd align=right([\d, ]+)/td#i', $seite, $matches); print_r($matches); Not tested - might need tweaking. Now it works! I still use mine, but i put the + directly after the closing bracket: ([\d]+) instead of ([\d])+ Thanks a lot for your help! I looked at your reg exp and saw this. Yannick Mortier -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem upgrading from 5.0.2 and 5.05
My system was runig apache 2.0.52+php5.0.2 under Windows Xp without any problem. Today i've decided to upgrade to 5.0.5 but after unzipping the files in the C:\php folder where it was installed de .0.2 version Apache complained about not finding php5apache2.dll. The message from the command line: Syntax error on line 179 of C:/'...'/Apache2/conf/httpd.conf: Cannot load C:/PHP/php5apache2.dll into server: Especified process not found.
RE: [PHP] Problem reading SimpleXML array NOT SOLVED but NO LONGER A PROBLEM
Hi, Got round the problem by doing this instead: $param = array( 'country1' = 'uk', 'country2' = 'usa' ); $wsdl=http://www.xmethods.net/sd/2001/CurrencyExchangeService.wsdl;; $curr_client = new nusoapclient($wsdl, 'wsdl'); $rate = $curr_client-call('getRate' ,$param); The ends justified the means, though I am still using SimpleXML to parse my Copyright Clearance Center processes. Cheers George -Original Message- From: Jochem Maas [mailto:[EMAIL PROTECTED] Sent: 24 October 2005 8:50 pm To: [EMAIL PROTECTED] Cc: George Pitcher; php-general@lists.php.net Subject: Re: [PHP] Problem reading SimpleXML array Richard, I'm guessing you haven't played with simpleXML ... (apologies inadvance for any/all mistakes :-) chances are the var_dump() pointer you gave (which under normal circumstances would be spot on) will probably lead to more confusion. to put it lightly SimpleXML doesn't lend itself to introspection (ATM?) because of the very #%^$ (for the totally naive: that was masking the word 'nice') string casting magic. at least it drove me absolutely nuts. anyway copious and experimental use of explicit casting to strings [i.e. using '(string)'] was the order of the day for me. as far as I understand it the problem lies in the fact that the object you get back has properties which behave as strings and objects which for good measure can (all) can be iterated [foreach] like arrays. all very simple, well ... you decide. :-) Richard Lynch wrote: On Mon, October 24, 2005 3:50 am, George Pitcher wrote: Hi, I'm having a problem reading an xml feed. This is my object: SimpleXMLElement Object ( [Header] = SimpleXMLElement Object ( [ID] = FX12GB [Test] = false [Name] = Foreign Exchange United Kingdom Pound Noon Rates [Prepared] = 2005-10-24 [Sender] = SimpleXMLElement Object ( [Name] = Federal Reserve Bank of New York [Contact] = SimpleXMLElement Object ( [Name] = George Matthes [Email] = [EMAIL PROTECTED] ) ) [ReportingBegin] = 1994-01-06 ) [DataSet] = SimpleXMLElement Object ( [Series] = SimpleXMLElement Object ( [Key] = SimpleXMLElement Object ( [FREQ] = D [CURR] = GBP [FX_TIME] = 12 [FX_TYPE] = S ) [Obs] = SimpleXMLElement Object ( [TIME_PERIOD] = 2005-10-21 [OBS_VALUE] = 1.7692 ) ) ) ) I'm trying to get those last two lines: TIME_PERIOD and OBS_VALUE. I can get the ID (third line) using $s-Header-ID (where $s is my object). $s-DataSet-Series-Obs-TIME_PERIOD; // 'Trying to get property of non-object' echo PRE; var_dump($s); echo hr /\n; var_dump($s-DataSet); echo hr /\n; var_dump($s-DataSet-Series); echo hr /\n; . . . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem reading SimpleXML array
Hi, I'm having a problem reading an xml feed. This is my object: SimpleXMLElement Object ( [Header] = SimpleXMLElement Object ( [ID] = FX12GB [Test] = false [Name] = Foreign Exchange United Kingdom Pound Noon Rates [Prepared] = 2005-10-24 [Sender] = SimpleXMLElement Object ( [Name] = Federal Reserve Bank of New York [Contact] = SimpleXMLElement Object ( [Name] = George Matthes [Email] = [EMAIL PROTECTED] ) ) [ReportingBegin] = 1994-01-06 ) [DataSet] = SimpleXMLElement Object ( [Series] = SimpleXMLElement Object ( [Key] = SimpleXMLElement Object ( [FREQ] = D [CURR] = GBP [FX_TIME] = 12 [FX_TYPE] = S ) [Obs] = SimpleXMLElement Object ( [TIME_PERIOD] = 2005-10-21 [OBS_VALUE] = 1.7692 ) ) ) ) I'm trying to get those last two lines: TIME_PERIOD and OBS_VALUE. I can get the ID (third line) using $s-Header-ID (where $s is my object). $s-DataSet-Series-Obs-TIME_PERIOD; // 'Trying to get property of non-object' $s-DataSet-Series-Obs['TIME_PERIOD'] // 'Trying to get property of non-object' $s-DataSet-Series-TIME_PERIOD // 'Trying to get property of non-object' $s-DataSet-Series['TIME_PERIOD'] // No error but no data $s-DataSet-TIME_PERIOD // No error but no data $s-DataSet['TIME_PERIOD'] // No error but no data Can anyone point me in the right direction please? MTIA George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem reading SimpleXML array
On Mon, October 24, 2005 3:50 am, George Pitcher wrote: Hi, I'm having a problem reading an xml feed. This is my object: SimpleXMLElement Object ( [Header] = SimpleXMLElement Object ( [ID] = FX12GB [Test] = false [Name] = Foreign Exchange United Kingdom Pound Noon Rates [Prepared] = 2005-10-24 [Sender] = SimpleXMLElement Object ( [Name] = Federal Reserve Bank of New York [Contact] = SimpleXMLElement Object ( [Name] = George Matthes [Email] = [EMAIL PROTECTED] ) ) [ReportingBegin] = 1994-01-06 ) [DataSet] = SimpleXMLElement Object ( [Series] = SimpleXMLElement Object ( [Key] = SimpleXMLElement Object ( [FREQ] = D [CURR] = GBP [FX_TIME] = 12 [FX_TYPE] = S ) [Obs] = SimpleXMLElement Object ( [TIME_PERIOD] = 2005-10-21 [OBS_VALUE] = 1.7692 ) ) ) ) I'm trying to get those last two lines: TIME_PERIOD and OBS_VALUE. I can get the ID (third line) using $s-Header-ID (where $s is my object). $s-DataSet-Series-Obs-TIME_PERIOD; // 'Trying to get property of non-object' echo PRE; var_dump($s); echo hr /\n; var_dump($s-DataSet); echo hr /\n; var_dump($s-DataSet-Series); echo hr /\n; . . . -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem reading SimpleXML array
Richard, I'm guessing you haven't played with simpleXML ... (apologies inadvance for any/all mistakes :-) chances are the var_dump() pointer you gave (which under normal circumstances would be spot on) will probably lead to more confusion. to put it lightly SimpleXML doesn't lend itself to introspection (ATM?) because of the very #%^$ (for the totally naive: that was masking the word 'nice') string casting magic. at least it drove me absolutely nuts. anyway copious and experimental use of explicit casting to strings [i.e. using '(string)'] was the order of the day for me. as far as I understand it the problem lies in the fact that the object you get back has properties which behave as strings and objects which for good measure can (all) can be iterated [foreach] like arrays. all very simple, well ... you decide. :-) Richard Lynch wrote: On Mon, October 24, 2005 3:50 am, George Pitcher wrote: Hi, I'm having a problem reading an xml feed. This is my object: SimpleXMLElement Object ( [Header] = SimpleXMLElement Object ( [ID] = FX12GB [Test] = false [Name] = Foreign Exchange United Kingdom Pound Noon Rates [Prepared] = 2005-10-24 [Sender] = SimpleXMLElement Object ( [Name] = Federal Reserve Bank of New York [Contact] = SimpleXMLElement Object ( [Name] = George Matthes [Email] = [EMAIL PROTECTED] ) ) [ReportingBegin] = 1994-01-06 ) [DataSet] = SimpleXMLElement Object ( [Series] = SimpleXMLElement Object ( [Key] = SimpleXMLElement Object ( [FREQ] = D [CURR] = GBP [FX_TIME] = 12 [FX_TYPE] = S ) [Obs] = SimpleXMLElement Object ( [TIME_PERIOD] = 2005-10-21 [OBS_VALUE] = 1.7692 ) ) ) ) I'm trying to get those last two lines: TIME_PERIOD and OBS_VALUE. I can get the ID (third line) using $s-Header-ID (where $s is my object). $s-DataSet-Series-Obs-TIME_PERIOD; // 'Trying to get property of non-object' echo PRE; var_dump($s); echo hr /\n; var_dump($s-DataSet); echo hr /\n; var_dump($s-DataSet-Series); echo hr /\n; . . . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem returning private member array variables
Hi to all, I was wondering if someone out there has had the same problem as I have; fetching from an object a private array variable through a get method. And instead of getting a copy of the array, you get access to the original array, being able to access the object's internal data! I have tried my test script on a Linux 2.6.5 running PHP 5.0.4 and on a FreeBSD 5.4 running PHP 5.0.5. Bellow is the test script: ?php class Atom { } ?
[PHP] Problem returning private member array variables
Hi to all, I was wondering if someone out there has had the same problem as I have; fetching from an object a private array variable through a get method. And instead of getting a copy of the array, you get access to the original array, being able to access the object's internal data! I have tried my test script on a Linux 2.6.5 running PHP 5.0.4 and on a FreeBSD 5.4 running PHP 5.0.5 obtaining the same results on both systems. Bellow is the test script: == #!/usr/local/bin/php ?php class Atom { private $x=0; public function __construct($x) { $this-x = $x; } public function setX($x) { $this-x = $x; } public function getX() { return $this-x; } } class Element { private $atoms = array(); public function __construct($NMAX) { for ($i = 0; $i $NMAX; ++$i) $this-atoms[] = new Atom($i); } public function setAtoms($atoms) { $this-atoms = $atoms; } public function getAtoms() { return $this-atoms; } } echo Starting testing on returning private member array variables\n; echo System details: PHP .PHP_VERSION. on .PHP_OS.\n; $element = new Element(3); $v = $element-getAtoms(); print_r($v); $v[0]-setX(79); print_r($v); $w = $element-getAtoms(); print_r($w); echo Testing finished\n; ? == The results are : == Starting testing on returning private member array variables System details: PHP 5.0.4 on Linux Array ( [0] = Atom Object ( [x:private] = 0 ) [1] = Atom Object ( [x:private] = 1 ) [2] = Atom Object ( [x:private] = 2 ) ) Array ( [0] = Atom Object ( [x:private] = 79 ) [1] = Atom Object ( [x:private] = 1 ) [2] = Atom Object ( [x:private] = 2 ) ) Array ( [0] = Atom Object ( [x:private] = 79 ) [1] = Atom Object ( [x:private] = 1 ) [2] = Atom Object ( [x:private] = 2 ) ) Testing finished == Is this expected behavior, or shouldn't the third Array print-out have also a zero in its first objects's x variable? Thanks to everyone for their time. --Best regards FNanDO
[PHP] Problem with special chars.
Hi all I have some problems when I make a string containing the following Malmö, Asunción to capital letters and then save it to a file. I use the following to make it to capital letters: $msg = mb_strtoupper($msg, HTML-ENTITIES); And this works just fine, everything looks as it should, but when I save it to a file, this is how it looks: MALMOuml;, ASUNCIOacute;N It seems it has problems with ó and Ö, does anybody know how this can be solved? I have tried some different encodings but nothing helps, I'm using PHP 4.3.2. Thx in advance for all help. /Erfan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with special chars.
Erfan Shirazi wrote: Hi all I have some problems when I make a string containing the following Malmö, Asunción to capital letters and then save it to a file. I use the following to make it to capital letters: $msg = mb_strtoupper($msg, HTML-ENTITIES); ^- you are telling mb_strtoupper to encode your 'funky' chars into html entities. And this works just fine, everything looks as it should, but when I save it to a file, this is how it looks: MALMOuml;, ASUNCIOacute;N ^\ \-- notice the names: 'Ouml' meaning. 'O umlaut' It seems it has problems with ó and Ö, does anybody know how this it has no problems AFAICT, the characters you mention have been turned into html entities... these entities (in the form '' + xyz + ';') are shown in the browser as the relevant char. can be solved? I have tried some different encodings but nothing helps, the solution is to not convert to html entities, or (if its required) only converting to html entities when you want to output something to the browser I'm using PHP 4.3.2. Thx in advance for all help. /Erfan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with special chars.
The problem is if I don't specify and encoding even an echo() on the string shows strange chars when I have made a mb_strtoupper() on the string. With HTML-ENTITIES at least it looked ok when you made an echo() but when saved in file it looks bad. Does anybody now what I can do in order to make the string into capital letters, be able to save it to a file and looking as it should look, that is: Asunción and not ASUNCIOacute;N? /Erfan Jochem Maas wrote: Erfan Shirazi wrote: Hi all I have some problems when I make a string containing the following Malmö, Asunción to capital letters and then save it to a file. I use the following to make it to capital letters: $msg = mb_strtoupper($msg, HTML-ENTITIES); ^- you are telling mb_strtoupper to encode your 'funky' chars into html entities. And this works just fine, everything looks as it should, but when I save it to a file, this is how it looks: MALMOuml;, ASUNCIOacute;N ^\ \-- notice the names: 'Ouml' meaning. 'O umlaut' It seems it has problems with ó and Ö, does anybody know how this it has no problems AFAICT, the characters you mention have been turned into html entities... these entities (in the form '' + xyz + ';') are shown in the browser as the relevant char. can be solved? I have tried some different encodings but nothing helps, the solution is to not convert to html entities, or (if its required) only converting to html entities when you want to output something to the browser I'm using PHP 4.3.2. Thx in advance for all help. /Erfan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with special chars.
Erfan Shirazi wrote: The problem is if I don't specify and encoding even an echo() on the specify a different encoding if you don't want html entities. string shows strange chars when I have made a mb_strtoupper() on the string. With HTML-ENTITIES at least it looked ok when you made an echo() of course it looks ok - the browser is showing you the characters that the html entities represent. this string: 'Oacute;' ...is an html entity. but when saved in file it looks bad. time for you to find out (STFW) about html entities and encoding in general Does anybody now what I can do in order to make the string into capital try setting your encoding to 'UTF-8' or some such, your mileage may vary. letters, be able to save it to a file and looking as it should look, that is: Asunción and not ASUNCIOacute;N? /Erfan Jochem Maas wrote: Erfan Shirazi wrote: Hi all I have some problems when I make a string containing the following Malmö, Asunción to capital letters and then save it to a file. I use the following to make it to capital letters: $msg = mb_strtoupper($msg, HTML-ENTITIES); ^- you are telling mb_strtoupper to encode your 'funky' chars into html entities. And this works just fine, everything looks as it should, but when I save it to a file, this is how it looks: MALMOuml;, ASUNCIOacute;N ^\ \-- notice the names: 'Ouml' meaning. 'O umlaut' It seems it has problems with ó and Ö, does anybody know how this it has no problems AFAICT, the characters you mention have been turned into html entities... these entities (in the form '' + xyz + ';') are shown in the browser as the relevant char. can be solved? I have tried some different encodings but nothing helps, the solution is to not convert to html entities, or (if its required) only converting to html entities when you want to output something to the browser I'm using PHP 4.3.2. Thx in advance for all help. /Erfan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with special chars.
I have tried every encoding which could be found in: http://www.php.net/manual/en/ref.mbstring.php But nothing seems to work, I don't have any problems displaying the funny chars in the browsers, there are some encodings which works fine for that, the problem is when I save it to a file using fwrite(). Jochem Maas wrote: Erfan Shirazi wrote: The problem is if I don't specify and encoding even an echo() on the specify a different encoding if you don't want html entities. string shows strange chars when I have made a mb_strtoupper() on the string. With HTML-ENTITIES at least it looked ok when you made an echo() of course it looks ok - the browser is showing you the characters that the html entities represent. this string: 'Oacute;' ...is an html entity. but when saved in file it looks bad. time for you to find out (STFW) about html entities and encoding in general Does anybody now what I can do in order to make the string into capital try setting your encoding to 'UTF-8' or some such, your mileage may vary. letters, be able to save it to a file and looking as it should look, that is: Asunción and not ASUNCIOacute;N? /Erfan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with Javascript:...submit()
while ($row = mysql_fetch_array($sql_result)) { echoForm name=\.$row['LITERATURE_title'].\ action=\searchlit.php\ method=\post\ font face=\arial\ size=\2\ a href=\javascript:.$row['LITERATURE_title']..submit();\ .$row['LITERATURE_title']. - .$row['res_fname']. .$row['res_lname']./a ... Everything works as long as $row['LITERATURE_title'] is one word, see this variable contains the names of books, and if the books name is Heaven for instance it works fine but as soon as the title is something like PHP for Dummies it doesnt work and i get a error on page message, I tried using numbers as the form name but then the same thing happens. Any ways around this? thanx Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Peninsula University of Technology or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Javascript:...submit()
Johan Grobler wrote: while ($row = mysql_fetch_array($sql_result)) { echoForm name=\.$row['LITERATURE_title'].\ action=\searchlit.php\ method=\post\ font face=\arial\ size=\2\ a href=\javascript:.$row['LITERATURE_title']..submit();\ .$row['LITERATURE_title']. - .$row['res_fname']. .$row['res_lname']./a ... Everything works as long as $row['LITERATURE_title'] is one word, see this variable contains the names of books, and if the books name is Heaven for instance it works fine but as soon as the title is something like PHP for Dummies it doesnt work and i get a error on page message, I tried using numbers as the form name but then the same thing happens. If you've got a row ID number or something, just call the form lit[id] (replacing [id] with the ID number), because I don't think a form name can start with a number. Otherwise you could sha1() the title and use that as the identifier, or simply remove all spaces... -- Jasper Bryant-Greene Freelance web developer http://jasper.bryant-greene.name/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Javascript:...submit()
I'm just taking a wild guess... but I'm guessing that if you set a name with spaces, it'll be replaced with _(underscore). A couple of ways around this is to 1) figure out a way to assign a one-word name for all your books(e.g. Code, ID number, etc.) 2) generate a hash code(e.g. md5($row['LITERATURE_title'])) will generate a one word(no spaces). If this is going to be a library application, you can always use ISBNX(no spaces, no dashes), since the idea is that every book has a unique ISBN number Johan Grobler wrote: while ($row = mysql_fetch_array($sql_result)) { echoForm name=\.$row['LITERATURE_title'].\ action=\searchlit.php\ method=\post\ font face=\arial\ size=\2\ a href=\javascript:.$row['LITERATURE_title']..submit();\ .$row['LITERATURE_title']. - .$row['res_fname']. .$row['res_lname']./a ... Everything works as long as $row['LITERATURE_title'] is one word, see this variable contains the names of books, and if the books name is Heaven for instance it works fine but as soon as the title is something like PHP for Dummies it doesnt work and i get a error on page message, I tried using numbers as the form name but then the same thing happens. Any ways around this? thanx Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Peninsula University of Technology or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Javascript:...submit()
On Thursday 13 October 2005 01:13 am, Johan Grobler wrote: while ($row = mysql_fetch_array($sql_result)) { echoForm name=\.$row['LITERATURE_title'].\ action=\searchlit.php\ method=\post\ font face=\arial\ size=\2\ a href=\javascript:.$row['LITERATURE_title']..submit();\ .$row['LITERATURE_title']. - .$row['res_fname']. .$row['res_lname']./a ... Everything works as long as $row['LITERATURE_title'] is one word, see this variable contains the names of books, and if the books name is Heaven for instance it works fine but as soon as the title is something like PHP for Dummies it doesnt work and i get a error on page message, I tried using numbers as the form name but then the same thing happens. Another way you can access these is by using this function. document.getElementByName('name'); or document.getElementById('id'); As I recall w3 sees ByName as standard but Mozilla(and many others) only support ById, the last time I checked. Any ways around this? thanx Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Peninsula University of Technology or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Javascript:...submit()
Stephen Leaf wrote: On Thursday 13 October 2005 01:13 am, Johan Grobler wrote: while ($row = mysql_fetch_array($sql_result)) { echoForm name=\.$row['LITERATURE_title'].\ action=\searchlit.php\ method=\post\ font face=\arial\ size=\2\ a href=\javascript:.$row['LITERATURE_title']..submit();\ .$row['LITERATURE_title']. - .$row['res_fname']. .$row['res_lname']./a ... Everything works as long as $row['LITERATURE_title'] is one word, see this variable contains the names of books, and if the books name is Heaven for instance it works fine but as soon as the title is something like PHP for Dummies it doesnt work and i get a error on page message, I tried using numbers as the form name but then the same thing happens. Another way you can access these is by using this function. Stephen is being polite - he means the 'correct' way ;-) document.getElementByName('name'); or document.getElementById('id'); As I recall w3 sees ByName as standard but Mozilla(and many others) only support ById, the last time I checked. script language=Javascript !-- the value of a name attribute does not need to be unique, where as the value of the id attribute _MUST_ be unique (according to the specs) document.getElementsByName('name'); ^---notice the 's' that method returns an array of elements. out of interest there is also: document.getElementsByTagName('INPUT'); which also returns an array. note that these DOM methods will not work in some older browsers, you may not care but if you do you will probably want to look into finding a browser compatibility library (some code) that will patch the problem for you. //-- /script Any ways around this? thanx Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Peninsula University of Technology or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem w/ Hidden Input Fields
Jason Ferguson wrote: Jochem, Thanks for the response. I actually solved the problem a few days ago... I'm suprised this message never went out to the list until today. I actually WANTED one to override the other in this case. The user should be able to choose one of the default radio buttons (in which case the hidden field would work) or be able to provide their own by typing/pasting it into the text box. I see - then I recommend that you reNAME both elements to 'txtKeyValue[]'. this will cause php to create an array for you so you can always get to both values. e.g. print_r($_POST['txtKeyValue']); // Array that will give you a numerically indexed array, if you rename the textboxes individually to 'txtKeyValue[default]' and 'txtKeyValue[other]' you will have an associative array with a structure like: $arr = array( 'default' = 'ABQIh2cCTTmAE6T4OXjecIFe5BQMxb4e6BwgeSB7cBu9SbVQSak6ARTgAPoctbx36BXXgbYZONZls0B1LQ', 'other' = '', ); there is no intrisic need to give the elements an id at all (regardless never give 2 elements on one page the same id.) I got around the problem by temporarily using a rather ugly switch statement until I revist the problem in a later release. I like switch statements, my favorite is the rather evil use of switch()'ing on true: switch (true) { case (/* arbitrary boolean expression */): break; // .. and so on } Jason On 10/10/05, Jochem Maas [EMAIL PROTECTED] wrote: hi Jason, Jason Ferguson wrote: I have a input type=hidden field with a value 86 characters long. Here is the entire form: form name=frmWizard id=frmWizard method=post action= table tr tdinput type=radio name=radioKey value=2 checked=checked /Rootsweb input type=hidden name=txtKeyValue id=txtKeyValue maxlength=90 value=ABQIh2cCTTmAE6T4OXjecIFe5BQMxb4e6BwgeSB7cBu9SbVQSak6ARTgAPoctbx36BXXgbYZONZls0B1LQ / /td /tr tr tdinput type=radio name=radioKey value=2 /Other Site: input type=text name=txtKeyValue id=txtKeyOther //td this text input has the same name, seeing as it comes after the hidden field it will be submitted after it (in terms of the order of the POST vars) too. the value of second incoming txtKeyValue effectively overwrites the first - result is you always see an empty value. after thought: you can work around it with javascript or php (and possibly changing 'txtKeyValue' to 'txtKeyValue[]'), or just change the name of one of the fields :-) /tr tr td class=center input type=button name=btnGenTemplate id=btnGenTemplate value=Generate HTML onclick=setWizardAction('genHTML.php') / /td tr td class=center input type=button name=btnPrev id=btnPrev value=lt;-- Prev disabled=true / input type=button name=btnNext id=btnNext value=Next --gt; onclick=setWizardAction('mmwizard1.php')/ input type=button name=btnFinish id=btnFinish value = Finish / /td /tr /table /form However, when I submit and do a print_r($_POST), there is no value for $_POST['txtKeyValue']. Note: the setWizardAction() function sets the form action= attribute so the Prev/Next buttons work correctly. The application is very close to being complete, so I need help ASAP don't quite follow that logic ;-) . Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem w/ Hidden Input Fields
Hello -Original Message- From: Jason Ferguson [mailto:[EMAIL PROTECTED] Sent: Sunday, October 09, 2005 5:55 PM To: php-general@lists.php.net Subject: [PHP] Problem w/ Hidden Input Fields I have a input type=hidden field with a value 86 characters long. Here is the entire form: form name=frmWizard id=frmWizard method=post action= table tr tdinput type=radio name=radioKey value=2 checked=checked /Rootsweb input type=hidden name=txtKeyValue id=txtKeyValue maxlength=90 value=ABQIh2cCTTmAE6T4OXjecIFe5BQMxb4e6BwgeSB7cBu9SbVQSak6ARTgAPoctbx 36BXXgbYZONZls0B1LQ / /td /tr tr tdinput type=radio name=radioKey value=2 /Other Site: input type=text name=txtKeyValue id=txtKeyOther //td /tr tr td class=center input type=button name=btnGenTemplate id=btnGenTemplate value=Generate HTML onclick=setWizardAction('genHTML.php') / /td tr td class=center input type=button name=btnPrev id=btnPrev value=lt;-- Prev disabled=true / input type=button name=btnNext id=btnNext value=Next --gt; onclick=setWizardAction('mmwizard1.php')/ input type=button name=btnFinish id=btnFinish value = Finish / /td /tr /table /form However, when I submit and do a print_r($_POST), there is no value for $_POST['txtKeyValue']. Because You later in the form set: input type=text name=txtKeyValue id=txtKeyOther / It´s overwritten then. -- Med venlig hilsen / best regards ComX Networks A/S Kim Madsen Systemudvikler/Systemdeveloper ComX Networks A/S Naverland 31, 2 DK-2600 Glostrup Denmark Phone: +45 70 25 74 74 direct: +45 32 87 73 93 Fax: +45 70 25 73 74 Web: www.comx.dk E-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem w/ Hidden Input Fields
I have a input type=hidden field with a value 86 characters long. Here is the entire form: form name=frmWizard id=frmWizard method=post action= table tr tdinput type=radio name=radioKey value=2 checked=checked /Rootsweb input type=hidden name=txtKeyValue id=txtKeyValue maxlength=90 value=ABQIh2cCTTmAE6T4OXjecIFe5BQMxb4e6BwgeSB7cBu9SbVQSak6ARTgAPoctbx36BXXgbYZONZls0B1LQ / /td /tr tr tdinput type=radio name=radioKey value=2 /Other Site: input type=text name=txtKeyValue id=txtKeyOther //td /tr tr td class=center input type=button name=btnGenTemplate id=btnGenTemplate value=Generate HTML onclick=setWizardAction('genHTML.php') / /td tr td class=center input type=button name=btnPrev id=btnPrev value=lt;-- Prev disabled=true / input type=button name=btnNext id=btnNext value=Next --gt; onclick=setWizardAction('mmwizard1.php')/ input type=button name=btnFinish id=btnFinish value = Finish / /td /tr /table /form However, when I submit and do a print_r($_POST), there is no value for $_POST['txtKeyValue']. Note: the setWizardAction() function sets the form action= attribute so the Prev/Next buttons work correctly. The application is very close to being complete, so I need help ASAP. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem w/ Hidden Input Fields
hi Jason, Jason Ferguson wrote: I have a input type=hidden field with a value 86 characters long. Here is the entire form: form name=frmWizard id=frmWizard method=post action= table tr tdinput type=radio name=radioKey value=2 checked=checked /Rootsweb input type=hidden name=txtKeyValue id=txtKeyValue maxlength=90 value=ABQIh2cCTTmAE6T4OXjecIFe5BQMxb4e6BwgeSB7cBu9SbVQSak6ARTgAPoctbx36BXXgbYZONZls0B1LQ / /td /tr tr tdinput type=radio name=radioKey value=2 /Other Site: input type=text name=txtKeyValue id=txtKeyOther //td this text input has the same name, seeing as it comes after the hidden field it will be submitted after it (in terms of the order of the POST vars) too. the value of second incoming txtKeyValue effectively overwrites the first - result is you always see an empty value. after thought: you can work around it with javascript or php (and possibly changing 'txtKeyValue' to 'txtKeyValue[]'), or just change the name of one of the fields :-) /tr tr td class=center input type=button name=btnGenTemplate id=btnGenTemplate value=Generate HTML onclick=setWizardAction('genHTML.php') / /td tr td class=center input type=button name=btnPrev id=btnPrev value=lt;-- Prev disabled=true / input type=button name=btnNext id=btnNext value=Next --gt; onclick=setWizardAction('mmwizard1.php')/ input type=button name=btnFinish id=btnFinish value = Finish / /td /tr /table /form However, when I submit and do a print_r($_POST), there is no value for $_POST['txtKeyValue']. Note: the setWizardAction() function sets the form action= attribute so the Prev/Next buttons work correctly. The application is very close to being complete, so I need help ASAP don't quite follow that logic ;-) . Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem half-solved, however have another
hello again I have been battling this mysterious char thats showing up in the buffer when i first log onto my chat, or else try to add new things to the logon function, I am getting the code not to fall through to the next prompt however, using $varname = socket_recv($sock, $read, 1024, 0) this won't put anything but a number in that variable, say for example the passwd was 'test'(just for the sake of testing for now), the password would end up being not test, but maybe the number 5 I'm assuming its returning the number of digits but this is totally not what I expected, and the manual for socket_recv is um, well for a lack of better wording, its not there on the website anymore, all except the format of it, no descriptions or anything, should i be using something else instead of socket_recv()? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Internet Explorer when downloading / viewing dynamically generated PDF files
Hello. For your information: It seems to me that the misbehaviour of Explorer is neither related to the PHP script itself, nor it is related to the PDF file created by the script. The basic problem is that Apache is actually sending a header with a 404 - file not found status code message. So, the .htaccess directive (ErrorDocument 404 /link-to-PHP-script.php) only tells Apache that it should present a custom 404 page, which in my case is a PHP script. With this in mind, I would say that MS Explorer behaves more exact so to say than other browsers, which obviously accepts a PDF file as a custom 404 error page. Right now, I am investigating if there is a way to tell Apache not to send the 404 header. I saw in the Apache manual that there is a module called ErrorHeader, but I was not able to write this rule with the correct syntax into my .htaccess file yet. The line ErrorHeader unset 404 gives a internal missconfiguration error. Is there someone who is familiar with Apache and writing htaccess directives? Or can someone recommend a general-purpose-userlist for Apache related questions? I subscribed to users@httpd.apache.org, but this list seems to have very low traffic. /frank 2005-09-22 kl. 12.59 skrev Frank Arensmeier: Hello list-members I have written a script which dynamically generates PDF documents (with PDFlib). The link to the PDF file is presented as a static link (thanks btw to Richard Lynch and his previous contributions to this list on the subject force download). It is redirected to the script via a htaccess file. If the name of the PDF document matches a certain pattern, than the script will output the document, if not, a 404 error page will pop up. Everything works very well with all kinds of browsers, except Microsoft Explorer (tested with Windows Explorer 6 SP1, Internet Explorer 5.2 for Macintosh). And I want to know why. Explorer shows the PDF document as plain text only. Trying to save the linked document to the computer (right click) gives something like The server can not be reached or the document does not exist. I know that explorer is a real p.i.t.a. when it comes to all kinds of web standards. And my best guess is that this could have to do with headers, or? Google was not my friend this time, I might say. /frank -- 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