[PHP] Re: Passing or not passing SID in links etc
No, that will work fine. Just having ? at the end of the URL just means an empty querystring - same as if you had nothing there. Regards Jasper Bryant-Greene Cabbage Promotions http://fatalnetwork.com/ [EMAIL PROTECTED] Gerard Samuel wrote: Im currently modifying templates to include the SID constant, for the few set of users who are rejecting session cookies. If I have an url like - a href=http://www.foo.com/;Go Home/a For users who are rejecting cookies the url looks like - a href=http://www.foo.com/?PHPSISSID=1234;Go Home/a For users who are accepting cookies, the url looks like - a href=http://www.foo.com/?;Go Home/a My question is, are there any known problems with just having '?' at the end of urls/links? Yes, I can do an if/else, but for simple things like this in the templates, but it makes it look more like code than html, and I rather stay away from it. The simpler the template the better. Thanks for your advise. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing or not passing SID in links etc
On Monday 22 December 2003 01:20 am, Gerard Samuel wrote: My question is, are there any known problems with just having '?' at the end of urls/links? Don't worry, I think I figured out another way... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] serialize and unserialize
Hello all i need a little help with serialize and unserialize here is my code ?php session_start(); if(!isset($_COOKIE['data'])) { //Check to see if cookie is there. include(cookie_num.dat); $y = $password; //Assign a special number for each cookie. $data = array('x' = 'cart', 'y' = $password); session_register(y); $var = serialize($data); //$chksum = md5($data . md5('secret salt here')); //$var = serialize(array($data,$chksum)); setcookie('data', $var, time() + 3600); } else { $var = unserialize($_COOKIE['data']); list($data, $chksum) = $var; if (md5($data . md5('secret salt here')) == $chksum) { // Data is valid $data = unserialize($_COOKIE['data']); list($y, $chksum) = $data; $x = $data['x']; $y = $data['y']; session_register(y); } //session_register(y); } ? the problem is when i try to pull it back out to use the number that is generated by $password it gives me this error Notice: unserialize(): Error at offset 9 of 118 bytes in c:\program files\apache group\apache\htdocs\header.php on line 24 any ideas towards fixin this would be appreciated
[PHP] Re: HTTP headers, IE and downloading
Hi! Andreas Magnusson wrote: I'm writing a script to view/download an email-attachment. If the file happens to be an MS Word document and the browser IE (only tried with 6.0), then the download fails. If I choose to download (Content-Disposition: attachment; filename=whatever.doc) then only a part of the file (2/3) is saved to disk. Of course viewing the file doesn't work either. It doesn't seem to matter what I set the Content-Type to since IE seems to ignore that anyway, however I've tried application/msword, application/octet-stream and some others. I've tried all the things said in the comments to the header-function in the online-docs at php.net. I know my Content-Length header is correct and the whole procedure works great with Netscape 7.0 and if the attachment is a zip-file or a jpeg-image it also works in both IE and Netscape. Have a look at: http://pear.php.net/package/HTTP_Download And the first comment of: http://www.php.net/manual/en/function.session-cache-limiter.php Perhaps you should not use ouput-compression, and look at the headers generated by PHP What headers are sent? Do you use sessions? you can see this using Mozilla + Live Headers, Ethereal, http://schroepl.net/cgi-bin/http_trace.pl ... Regards, Andreas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Passing or not passing SID in links etc
On Monday 22 December 2003 02:14 am, Jasper Bryant-Greene wrote: No, that will work fine. Just having ? at the end of the URL just means an empty querystring - same as if you had nothing there. Regards Thanks. My other idea didn't pan out, so Im going back to this idea. Back to work for me... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Https
Hello! I have search for info in this group about this topic and found it but can't get working my program. These are the steps I have done: 1º Download and install latest php version (4.3.4) 2º Test that it works (IIS) 3º Change php.ini: extension_dir = install_dir/extensions/ uncomment extension=php_openssl.dll 4º Copy from dlls folder to win\system32 libeay32.dll and ssleay32.dll The code I'm using is: $sFinalUrl = https://www.alsa.es/compra/com_csimpleidavuelta.asp; $handle = fopen($sFinalUrl, r); $lExpireDate = fgets($handle); fclose($handle); And the errors are Notice: fopen(): Unable to find the wrapper https - did you forget to enable it when you configured PHP? in C:\Inetpub\PostNuke-0.726\mpValidar.php on line 62 Warning: fopen(https://www.alsa.es/compra/com_comprasimple.htm): failed to open stream: Invalid argument in C:\Inetpub\PostNuke-0.726\mpValidar.php on line 62 Warning: fgets(): supplied argument is not a valid stream resource in C:\Inetpub\PostNuke-0.726\mpValidar.php on line 63 Warning: fclose(): supplied argument is not a valid stream resource in C:\Inetpub\PostNuke-0.726\mpValidar.php on line 64 What else must I do? What I'm doing wrong? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] New member
Hi! I'm new here. Where found I listarchive? Otherwise I'm looking for mailing list develope with php (SMTP or...) Regards, Janos from HU -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 22 Dec 2003 08:54:25 -0000 Issue 2487
php-general Digest 22 Dec 2003 08:54:25 - Issue 2487 Topics (messages 173112 through 173138): Re: [posibleOT] Forcing entering te site thru index.php 173112 by: Andreas Magnusson 173114 by: Eugene Lee HTTP headers, IE and downloading 173113 by: Andreas Magnusson 173135 by: Andreas Korthaus Magic Quotes 173115 by: stiano.optonline.net 173116 by: stiano.optonline.net 173117 by: stiano.optonline.net 173118 by: stiano.optonline.net 173119 by: Andreas Magnusson 173120 by: John W. Holmes newbie question about header() 173121 by: Scott Taylor 173122 by: Website Managers.net 173123 by: John W. Holmes 173126 by: Justin French Close on exit 173124 by: David Leon Fetch Information Via a link 173125 by: Eric Holmstrom 173130 by: Jasper Bryant-Greene Why won't this form post session variables? 173127 by: Dave G 173128 by: Martin Towell Re: Why won't this form post session variables? [SOLVED] 173129 by: Dave G Passing or not passing SID in links etc 173131 by: Gerard Samuel 173132 by: Jasper Bryant-Greene 173133 by: Gerard Samuel 173136 by: Gerard Samuel serialize and unserialize 173134 by: webmaster.multiwebmastertools.com Https 173137 by: Homer New member 173138 by: Kovy Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- There are several ways to do this. The most obvious is with cookies. Set up your index.php to initially create a cookie that authorizes a user to look in the site. On the rest of your PHP pages, check that this authorization cookie exists. If not, redirect to index.php. Thanks for the response. No, this way don't do it: once the cookie is set up in the client's browser, there is no way for me to prevent the client to type the url pointing to another page, and the cookie will be valid on that page. What i'm trying to do is to force the client to travel pages in the order expected, forbidding him/her to access a page out of sequence, wich take him to an error message (because, for example, for abscense of POST data or something). So i'm stuck. Thenak you. You can use the Referer header found in $_SERVER['HTTP_REFERER'] to check from which page the user comes from. /Andreas ---End Message--- ---BeginMessage--- On Mon, Dec 22, 2003 at 01:09:37AM +0100, Andreas Magnusson wrote: : : You can use the Referer header found in $_SERVER['HTTP_REFERER'] to check : from which page the user comes from. Unfortunately, HTTP_REFERER is not guaranteed to exist. In fact, several Windoze firewall software actively block this information from being sent to the web server. ---End Message--- ---BeginMessage--- I'm writing a script to view/download an email-attachment. If the file happens to be an MS Word document and the browser IE (only tried with 6.0), then the download fails. If I choose to download (Content-Disposition: attachment; filename=whatever.doc) then only a part of the file (2/3) is saved to disk. Of course viewing the file doesn't work either. It doesn't seem to matter what I set the Content-Type to since IE seems to ignore that anyway, however I've tried application/msword, application/octet-stream and some others. I've tried all the things said in the comments to the header-function in the online-docs at php.net. I know my Content-Length header is correct and the whole procedure works great with Netscape 7.0 and if the attachment is a zip-file or a jpeg-image it also works in both IE and Netscape. Let's just say I'm stumped and I have googled for a solution for a long time and would be very happy if someone had one... Thanks in advance /Andreas ---End Message--- ---BeginMessage--- Hi! Andreas Magnusson wrote: I'm writing a script to view/download an email-attachment. If the file happens to be an MS Word document and the browser IE (only tried with 6.0), then the download fails. If I choose to download (Content-Disposition: attachment; filename=whatever.doc) then only a part of the file (2/3) is saved to disk. Of course viewing the file doesn't work either. It doesn't seem to matter what I set the Content-Type to since IE seems to ignore that anyway, however I've tried application/msword, application/octet-stream and some others. I've tried all the things said in the comments to the header-function in the online-docs at php.net. I know my Content-Length header is correct and the whole procedure works great with Netscape 7.0 and if the attachment is a zip-file or a jpeg-image it also works in both IE and Netscape. Have a look at: http://pear.php.net/package/HTTP_Download And the first comment of:
[PHP] include_path
Is there a way of modifying the include_path within a script, I want to add to it, not completely change it. The sort of thing that I want to do is equivalent to the following bit of shell code: PATH=$HOME/bin:$PATH ie add a user specific part to the path - so that a production/test 'require' gets the production/test version of a file. Please CC me on any reply since I don't subscribe to this list. Thanks -- Alain Williams #include std_disclaimer.h FATHERS-4-JUSTICE - Campaigning for equal rights for parents and the best interests of our children. See http://www.fathers-4-justice.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] include_path
set_include_path(get_include_path().:/new/incude/path); -Original Message- From: Alain Williams [mailto:[EMAIL PROTECTED] Sent: 22 December 2003 10:16 To: [EMAIL PROTECTED] Subject: [PHP] include_path Is there a way of modifying the include_path within a script, I want to add to it, not completely change it. The sort of thing that I want to do is equivalent to the following bit of shell code: PATH=$HOME/bin:$PATH ie add a user specific part to the path - so that a production/test 'require' gets the production/test version of a file. Please CC me on any reply since I don't subscribe to this list. Thanks -- Alain Williams #include std_disclaimer.h FATHERS-4-JUSTICE - Campaigning for equal rights for parents and the best interests of our children. See http://www.fathers-4-justice.org -- 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] Small riddle with classes and references, or bug?
Hello, I have a problem understanding following chunk of code. It seems that global $rme does not remember an reference to $this, but instead it is remembering null or something like that: ?PHP class A { function rememberMe() { global $rme; $rme = $this; $this-someInstanceVar =77; } function report() { global $rme; echo 'X'; print_r($rme); echo 'X'; } } $a = new A(); $a-rememberMe(); $a-report(); ? This little script outputs: XX While I would expect it to return: Xa Object ( [someInstanceVar] = 77 ) X rush -- http://www.templatetamer.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Small riddle with classes and references, or bug?
On Mon, Dec 22, 2003 at 11:57:58AM +0100, rush wrote: Hello, I have a problem understanding following chunk of code. It seems that global $rme does not remember an reference to $this, but instead it is remembering null or something like that: ?PHP class A { function rememberMe() { global $rme; this creates a reference from $rme to $GLOBALS['rme'] $rme = $this; this create a *new* reference from $rme to $this. so only a local $rme is referencing $this now. change the line to $GLOBALS['rme'] = $this; to get the expected behaviour. $this-someInstanceVar =77; } function report() { global $rme; echo 'X'; print_r($rme); echo 'X'; } } $a = new A(); $a-rememberMe(); $a-report(); ? This little script outputs: XX While I would expect it to return: Xa Object ( [someInstanceVar] = 77 ) X rush -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can't use HTTPS with fgets
Hello! I have search for info in this group about this topic and found it but can't get working my program. These are the steps I have done: 1º Download and install latest php version (4.3.4) 2º Test that it works (IIS) 3º Change php.ini: extension_dir = install_dir/extensions/ uncomment extension=php_openssl.dll 4º Copy from dlls folder to win\system32 libeay32.dll and ssleay32.dll The code I'm using is: $sFinalUrl = https://www.alsa.es/compra/com_csimpleidavuelta.asp; $handle = fopen($sFinalUrl, r); $lExpireDate = fgets($handle); fclose($handle); And the errors are Notice: fopen(): Unable to find the wrapper https - did you forget to enable it when you configured PHP? in C:\Inetpub\PostNuke-0.726\mpValidar.php on line 62 Warning: fopen(https://www.alsa.es/compra/com_comprasimple.htm): failed to open stream: Invalid argument in C:\Inetpub\PostNuke-0.726\mpValidar.php on line 62 Warning: fgets(): supplied argument is not a valid stream resource in C:\Inetpub\PostNuke-0.726\mpValidar.php on line 63 Warning: fclose(): supplied argument is not a valid stream resource in C:\Inetpub\PostNuke-0.726\mpValidar.php on line 64 What else must I do? What I'm doing wrong? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Small riddle with classes and references, or bug?
Messju Mohr [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] this creates a reference from $rme to $GLOBALS['rme'] $rme = $this; this create a *new* reference from $rme to $this. so only a local $rme is referencing $this now. change the line to $GLOBALS['rme'] = $this; to get the expected behaviour. Thank you very much, I was not aware that global $something is just a syntax sugar for reference into the $GLOBALS array. Very spookey indeed, but thanks again :) rush -- http://www.templatetamer.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New member
Janos -- ...and then Kovy said... % % Hi! Hi, and welcome to the list! We're glad to have you. In the future, though, please don't just reply to any old list message and start a new subject; it doesn't really separate your message from its parents. % % I'm new here. Where found I listarchive? It looks like http://php.net and http://lists.php.net are good places to start. % Otherwise I'm looking for mailing list develope with php (SMTP or...) Mailing list software written in php? I don't know of any, but there's bound to be some out there :-) It's not the best choice, though; yould almost certainly be better off with a real listmanager such as ezmlm. % % Regards, % Janos from HU HTH HAND Happy Holidays :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
[PHP] debugger listener
php 4.3.0 + apache + linux suse 8.2 I tried to install xdebug (http://www.xdebug.org/install.php) as an precompiled module, but it seems not running when I did reload apache. I mean, I can't see it in the module list in phpinfo() page. Also, I don't know how to catch up events sent by debugger, may I need to build a tcp listener? Any hint about how to do it? Bye, Alberto. -- Imagination is more important than knowledge -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] debugger listener
Alberto M. wrote: php 4.3.0 + apache + linux suse 8.2 I tried to install xdebug (http://www.xdebug.org/install.php) as an precompiled module, but it seems not running when I did reload apache. I mean, I can't see it in the module list in phpinfo() page. Also, I don't know how to catch up events sent by debugger, may I need to build a tcp listener? Any hint about how to do it? Bye, Alberto. as usual, I answer myself: http://www.xdebug.org/docs-settings.php there are several options to set in php.ini file in order to get the xdebug work. BTW I would know if someone has tried xdebug and has some hints. bye, alberto. -- Imagination is more important than knowledge -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sorting multi-dimensional arrays
Hi All, I am trying to sort a multi-dimensional array using a value in the second dimension. I have looked at the usort examples but don't fully understand what usort is actually doing so am struggling. I have tried the following: if (! getmxrr($this-_Domain, $as_hosts, $ai_weights)) { return false; } for ($i = 0; $i count($as_hosts); $i++) { $this-MXRecs[] = array($as_hosts[$i], $ai_weights[$i]); } function IsBestMX($a, $b) { if ($a[1] == $b[1]) { return 0; } return ($a[1] $b[1]) ? -1 : 1; } usort($this-MXRecs); Can anyone point me in the right direction? TIA Phil. --- Phil Ewington - Technical Director 43 Plc - Ashdale House 35 Broad Street, Wokingham Berkshire RG40 1AU T: +44 (0)1189 789 500 F: +44 (0)1189 784 994 E: mailto:[EMAIL PROTECTED] W: www.soyouthink.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] sorting multi-dimensional arrays
Ooops, forgot to specify the compare function with usort(); all working now. Phil. -Original Message- From: Phil Ewington - 43 Plc [mailto:[EMAIL PROTECTED] Sent: 22 December 2003 14:08 To: [EMAIL PROTECTED] Subject: [PHP] sorting multi-dimensional arrays Hi All, I am trying to sort a multi-dimensional array using a value in the second dimension. I have looked at the usort examples but don't fully understand what usort is actually doing so am struggling. I have tried the following: if (! getmxrr($this-_Domain, $as_hosts, $ai_weights)) { return false; } for ($i = 0; $i count($as_hosts); $i++) { $this-MXRecs[] = array($as_hosts[$i], $ai_weights[$i]); } function IsBestMX($a, $b) { if ($a[1] == $b[1]) { return 0; } return ($a[1] $b[1]) ? -1 : 1; } usort($this-MXRecs); Can anyone point me in the right direction? TIA Phil. --- Phil Ewington - Technical Director 43 Plc - Ashdale House 35 Broad Street, Wokingham Berkshire RG40 1AU T: +44 (0)1189 789 500 F: +44 (0)1189 784 994 E: mailto:[EMAIL PROTECTED] W: www.soyouthink.com -- 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] combining two variables to make one???
I want to out put three bits of text... I want my end page to look like this... = result 1 result 2 result 3 = here's the code I've got... === ? $i = 1; while ($i = 3) { $options$i = result $i; } ? html body ?=$option1 ? ?=$option2 ? ?=$option3 ? /body /html === yet I get an error...? Anyone know who to make $option$i work? * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. ***
[PHP] Apache 2.0.48 won't play nice with php 4.3.4 ?
Hola, PHP folk! I hope this is an appropriate forum for this: I am setting up a Redhat 9 webserver to serve as my testbed for a little php/mysql app I want to develop. I installed RH9 without the webserver/php/mysql so I could manually install the most current versions. MySQL 4.0.16 installed fine, Apache (httpd-2.0.48) installed fine. PHP 4.3.4 seemed to install fine. Unfortunately, when I try to start the webserver with php, I get the following error: '...httpd: module /usr/local/php-4.3.4/sapi/apache2handlers/sapi_apache2.c is not compatible with this version of Apache. Help! Is there a work around for this? Apache will start fine if I don't try to enable php via LoadModule in the Apache configuration file. Any comments and suggestions appreciated. Thanks, Danny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] combining two variables to make one???
? $i = 1; while ($i = 3) { $options$i = result $i; } ? You want this: ${$options{$i}} = result $i; For the sake of clarity I typically do something like the following: $i = 1; while ($i = 3) { $varName = $options . $i; ${$varName} = result $i; } Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can i build e-commerce site with php?
Hello. How can i build e-commerce site with php. Do you know any source,documentation,e-book. Please help me. if you use msn messenger, please add me your contact list. messenger : [EMAIL PROTECTED] _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How can i build e-commerce site with php?
go and check out www.hotscripts.com - there's load of ecomerecce scripts there. regards Pete Pehepe Php wrote: Hello. How can i build e-commerce site with php. Do you know any source,documentation,e-book. Please help me. if you use msn messenger, please add me your contact list. messenger : [EMAIL PROTECTED] _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] combining two variables to make one???
Cheers... Doesn't work for me though...? What do the '{' mean when declaring the variable? Chris Boget [EMAIL PROTECTED] 22/12/2003 14:16 To [EMAIL PROTECTED], [EMAIL PROTECTED] cc Subject Re: [PHP] combining two variables to make one??? ? $i = 1; while ($i = 3) { $options$i = result $i; } ? You want this: ${$options{$i}} = result $i; For the sake of clarity I typically do something like the following: $i = 1; while ($i = 3) { $varName = $options . $i; ${$varName} = result $i; } Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. ***
Re: [PHP] combining two variables to make one???
Doesn't work for me though...? Which isn't working? This: ${$options{$i}} = result $i; or this: $i = 1; while ($i = 3) { $varName = $options . $i; ${$varName} = result $i; } What do the '{' mean when declaring the variable? I can't remember where it is in the documentation, but the '{' '}' symbols basically clear up any ambiguity for the parser indicatig where the actual variables are in a statement. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] combining two variables to make one???
I am a monkey... I had me angle bracket the wrong way round... what a stoner...! Chris Boget [EMAIL PROTECTED] 22/12/2003 15:04 To [EMAIL PROTECTED] cc [EMAIL PROTECTED] Subject Re: [PHP] combining two variables to make one??? Doesn't work for me though...? Which isn't working? This: ${$options{$i}} = result $i; or this: $i = 1; while ($i = 3) { $varName = $options . $i; ${$varName} = result $i; } What do the '{' mean when declaring the variable? I can't remember where it is in the documentation, but the '{' '}' symbols basically clear up any ambiguity for the parser indicatig where the actual variables are in a statement. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. ***
[PHP] user running PHP
Hi, I've got an Apache 2 setup with PHP 4.3.4 running many virtual hosts. Each user has a virtual host of his own, and many use php. I've set SuexecUserGroup to the username and group of the individual user, yet running phpinfo() as that user reveals under section apache2handler that it runs as user www and group www rather than the user and group I set with SuexecUserGroup. Why is that, and how can I make it use the user and group the user belongs to? People are starting to complain that they have problems using fopen() and the like. Cheers Niklas Saers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sorting a mulit-dimensional array
Can anyone pls tell me with an example on how to select distinct values from a multi-dimensional array. Moving distinct values into another array is ok. Thanks !
[PHP] need help getting one variable
hello all i need help to enter one variable in a cookie and then retreive it back later, i know this probably sounds dumb to most but this is really the first time ive tried working with cookies so please bear with me, thanks for any help.
Re: [PHP] serialize and unserialize
You should use stripslashes to get rid of escaped characters in $_COOKIE['data']. Then remember to use addslashes when you want to use $data or $chksum in sql queries. [EMAIL PROTECTED] wrote: Hello all i need a little help with serialize and unserialize here is my code ?php session_start(); if(!isset($_COOKIE['data'])) { //Check to see if cookie is there. include(cookie_num.dat); $y = $password; //Assign a special number for each cookie. $data = array('x' = 'cart', 'y' = $password); session_register(y); $var = serialize($data); //$chksum = md5($data . md5('secret salt here')); //$var = serialize(array($data,$chksum)); setcookie('data', $var, time() + 3600); } else { $var = unserialize($_COOKIE['data']); list($data, $chksum) = $var; if (md5($data . md5('secret salt here')) == $chksum) { // Data is valid $data = unserialize($_COOKIE['data']); list($y, $chksum) = $data; $x = $data['x']; $y = $data['y']; session_register(y); } //session_register(y); } ? the problem is when i try to pull it back out to use the number that is generated by $password it gives me this error Notice: unserialize(): Error at offset 9 of 118 bytes in c:\program files\apache group\apache\htdocs\header.php on line 24 any ideas towards fixin this would be appreciated -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need help getting one variable
[snip] hello all i need help to enter one variable in a cookie and then retreive it back later, i know this probably sounds dumb to most but this is really the first time ive tried working with cookies so please bear with me, thanks for any help. [/snip] this should give you a good start http://www.php.net/setcookie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Working pop-up progress window
I've read through the archives and run through some of the suggestions given for progress bars and pop ups with animated gifs and haven't had much luck. I've had the most luck using the pop-up window method. In the form element I call onSubmit={open some window here} This works as the pop-up appears while the file is transferring. Here's where I run into problems. I've tried all kinds of examples found on google and can never get it to work right. In the script where my form goes to, I'm supposed to use a body onLoad=window.close() call to close my pop-up. I've actually tried this 2 ways. I've used it as afore mentioned as well as body onUnload= on the page containing the form. Either my pop-up stays open or I close the parent window. Does anybody have a working example I could work off of so I could please my boss. Personally, I didn't want to do this but he thinks we should have these flashy things on out site. Thanks, Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Working pop-up progress window
Hi Ed, Every time I see someone ask about an upload meter a hardcore programmer writes back saying no one ever asks for it so why should anyone work on one? I have a demo up of what you might be looking for, check it out here: http://www.pfohlsolutions.com/projects/upload/ You will need to recompile PHP but its a very convenient tool that many of my clients ask for, enjoy. Steve -Original Message- From: Ed Curtis [mailto:[EMAIL PROTECTED] Sent: Monday, December 22, 2003 12:19 PM To: [EMAIL PROTECTED] Subject: [PHP] Working pop-up progress window I've read through the archives and run through some of the suggestions given for progress bars and pop ups with animated gifs and haven't had much luck. I've had the most luck using the pop-up window method. In the form element I call onSubmit={open some window here} This works as the pop-up appears while the file is transferring. Here's where I run into problems. I've tried all kinds of examples found on google and can never get it to work right. In the script where my form goes to, I'm supposed to use a body onLoad=window.close() call to close my pop-up. I've actually tried this 2 ways. I've used it as afore mentioned as well as body onUnload= on the page containing the form. Either my pop-up stays open or I close the parent window. Does anybody have a working example I could work off of so I could please my boss. Personally, I didn't want to do this but he thinks we should have these flashy things on out site. Thanks, Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Working pop-up progress window
[snip] I've had the most luck using the pop-up window method. In the form element I call onSubmit={open some window here} This works as the pop-up appears while the file is transferring. Here's where I run into problems. I've tried all kinds of examples found on google and can never get it to work right. In the script where my form goes to, I'm supposed to use a body onLoad=window.close() call to close my pop-up. I've actually tried this 2 ways. I've used it as afore mentioned as well as body onUnload= on the page containing the form. Either my pop-up stays open or I close the parent window. [/snip] If I understand you correctly, when you call window.close on the next page you want it to close the child window. I am not sure if this is possible with Javascript if you go to a new page, it might be. You would want to not call window.close but something like myPopUp.close() on the next page. Someone else might be able to shed so more light on it. Keep in mind that more and more users are blocking all pop ups. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Working pop-up progress window
If I understand you correctly, when you call window.close on the next page you want it to close the child window. I am not sure if this is possible with Javascript if you go to a new page, it might be. You would want to not call window.close but something like myPopUp.close() on the next page. Someone else might be able to shed so more light on it. Keep in mind that more and more users are blocking all pop ups. That's correct. I didn't make that clear enough in my first post. When I call the popup I give it a name (i.e. MyWindow) and when I try to close it I call MyWindow.close() and it still will not close. Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parse error in mysql_query()
Error: Parse error: parse error, expecting `']'' in /usr/local/apache/htdocs/UP/index.php on line 871 Line 871: mysql_query(INSERT INTO domainregistrations (domain,type,years,price) VALUES ('$_POST[domainregister_domain$i]','$_POST[domainregister_type$i]','$_POST[domainregister_years$i]','$_POST[domainregister_price$i]')); Anyone know why that parse error is happening? I can't find a missing ] anywhere. Any help would be greatly appreciated. Thanks, Tyler Longren -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse error in mysql_query()
Perhaps it doesn't like the fact that you don't have quotes around your array keys? --Sam Tyler Longren wrote: Error: Parse error: parse error, expecting `']'' in /usr/local/apache/htdocs/UP/index.php on line 871 Line 871: mysql_query(INSERT INTO domainregistrations (domain,type,years,price) VALUES ('$_POST[domainregister_domain$i]','$_POST[domainregister_type$i]','$_PO ST[domainregister_years$i]','$_POST[domainregister_price$i]')); Anyone know why that parse error is happening? I can't find a missing ] anywhere. Any help would be greatly appreciated. Thanks, Tyler Longren -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse error in mysql_query()
Sorry, should have mentioned that I tried quoting them already. That gives a T_VARIABLES parse error. Thanks for the reply, Tyler On Mon, 2003-12-22 at 12:30, Sam Masiello wrote: Perhaps it doesn't like the fact that you don't have quotes around your array keys? --Sam Tyler Longren wrote: Error: Parse error: parse error, expecting `']'' in /usr/local/apache/htdocs/UP/index.php on line 871 Line 871: mysql_query(INSERT INTO domainregistrations (domain,type,years,price) VALUES ('$_POST[domainregister_domain$i]','$_POST[domainregister_type$i]','$_PO ST[domainregister_years$i]','$_POST[domainregister_price$i]')); Anyone know why that parse error is happening? I can't find a missing ] anywhere. Any help would be greatly appreciated. Thanks, Tyler Longren -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HTTP headers, IE and downloading
Thanks for your reply! Have a look at: http://pear.php.net/package/HTTP_Download I looked at it and it's hard to see what it does differently from what I do... And the first comment of: http://www.php.net/manual/en/function.session-cache-limiter.php Thanks, I've read that and I'm not using output compression. Perhaps you should not use ouput-compression, and look at the headers generated by PHP What headers are sent? Do you use sessions? I use sessions, and I've tried to send the same headers as the webserver sends if I download a file directly (rather than through PHP). It doesn't work... Maybe I should just create a temporary file and relocate the browser to it in case the browser is IE... you can see this using Mozilla + Live Headers, Ethereal, http://schroepl.net/cgi-bin/http_trace.pl ... Thanks, I've written my own HTTP header tracer in C++, but it hasn't been able to help me since the headers looks good to me... /Andreas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reading excell and writing to text file..
I was wondering a good place I could get started on reading excel spreadsheets in PHP ive seen a couple of things out there that will take data from the web and transform it into a .xls file. I was wondering if I could take a XLS file with php and read it, and rip out certain data from it :-) but just knowing how to read it to the screen would be enough to get me going. Thanks! Dragoonkain
RE: [PHP] Parse error in mysql_query()
[snip] Sorry, should have mentioned that I tried quoting them already. That gives a T_VARIABLES parse error. Thanks for the reply, Tyler [/snip] What happens if you comment out the mysql statement and just echo the variables? echo $_POST[domainregister_domain$i] $_POST[domainregister_type$i]; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reading excell and writing to text file..
[snip] I was wondering a good place I could get started on reading excel spreadsheets in PHP ive seen a couple of things out there that will take data from the web and transform it into a .xls file. I was wondering if I could take a XLS file with php and read it, and rip out certain data from it :-) but just knowing how to read it to the screen would be enough to get me going. Thanks! [/snip] you could use the excel com object if you are on windows http://fi.php.net/manual/en/ref.com.php I know there is a pear package to write excel files but not sure if there is one to read them yet. If you can use perl you can use Spreadsheet::ParseExcel, I have used it before and it works really well. http://search.cpan.org/~kwitknr/Spreadsheet-ParseExcel-0.2602/ParseExcel.pm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse error in mysql_query()
Tyler Longren wrote: Error: Parse error: parse error, expecting `']'' in /usr/local/apache/htdocs/UP/index.php on line 871 ('$_POST[domainregister_domain$i]', If you're going to be creating array keys like that, break out of the string to do it. (' . $_POST['domainregister_domain' . $i] . ', ... Having a key like that kind of begs the question of why you're not just using $_POST['domainregister_domain'][$i], though... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reading excell and writing to text file..
Andrew Kwiczola wrote: I was wondering a good place I could get started on reading excel spreadsheets in PHP ive seen a couple of things out there that will take data from the web and transform it into a .xls file. I was wondering if I could take a XLS file with php and read it, and rip out certain data from it :-) but just knowing how to read it to the screen would be enough to get me going. Thanks! To actually read the XLS file, you'll probably need to use COM. Or if you convert / save-as the file to a .csv, then you can read it as a normal text file. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Working pop-up progress window
Ed Curtis wrote: If I understand you correctly, when you call window.close on the next page you want it to close the child window. I am not sure if this is possible with Javascript if you go to a new page, it might be. You would want to not call window.close but something like myPopUp.close() on the next page. Someone else might be able to shed so more light on it. Keep in mind that more and more users are blocking all pop ups. That's correct. I didn't make that clear enough in my first post. When I call the popup I give it a name (i.e. MyWindow) and when I try to close it I call MyWindow.close() and it still will not close. Ed There might be a proper way, but this should work: MyWindow = window.open('', 'MyWindow'); MyWindow.close(); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse error in mysql_query()
Hi Matt, I put this right above like 871: print brbr$_POST[domainregister_domain$i]brbr; So now that print line is 871. It produces the exact same error as the mysql_query() line. The reason I'm doin it like this is cuz I'm dynamically generating forms, and lots of the fields are the same, just with different numbers at the end: ex: domainregister_domain1 domainregister_domain2 Those field names are generated by PHP for the form, and now I'm doing the page to process that form. Would doing $_POST['domainregister_domain'][$i] get the correct value from my domainregister_domain1 field if $i=1? Thanks, Tyler Thanks, Tyler On Mon, 2003-12-22 at 12:47, Matt Matijevich wrote: [snip] Sorry, should have mentioned that I tried quoting them already. That gives a T_VARIABLES parse error. Thanks for the reply, Tyler [/snip] What happens if you comment out the mysql statement and just echo the variables? echo $_POST[domainregister_domain$i] $_POST[domainregister_type$i]; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse error in mysql_query()
Doing this fixed it: mysql_query(INSERT INTO domainregistrations (domain,type,years,price) VALUES ('$_POST[domainregister_domain]$i','$_POST[domainregister_type]$i','$_POST[domainregister_years]$i','$_POST[domainregister_price]$i')); I just moved the $i to the outside of the [] and it works now. Thanks for everyone's input..helped me open my eyes a bit. Tyler On Mon, 2003-12-22 at 12:51, John W. Holmes wrote: Tyler Longren wrote: Error: Parse error: parse error, expecting `']'' in /usr/local/apache/htdocs/UP/index.php on line 871 ('$_POST[domainregister_domain$i]', If you're going to be creating array keys like that, break out of the string to do it. (' . $_POST['domainregister_domain' . $i] . ', ... Having a key like that kind of begs the question of why you're not just using $_POST['domainregister_domain'][$i], though... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP LDAP query - need to add Exchange fields
Ben, I was trying the same thing, but I am not sure you are using the same setup as me. My office runs a windows 2000 domain with a Exchange server 2000 box. All profile information is stored in the windows 2000 domain controller, and the exchange server accesses the information from there. So it doesnt use its own LDAP. And to make it all the more interesting, this script is running on our Intranet, on a FreeBSD 5 box with the OpenLDAP client. The following script will bring back all the fields available in LDAP, as long as they are filled out. In this script you need to have a valid DOMAIN_USER and a valid DOMAIN_PASS. There are ways to do this anonymously, you just need to change the $ldap_bind line to remove the $ldaprdn and $ldappass. To change the search criteria, you can change the $filter variable, at the moment it filters on the domain user's userid, or samaccountname. At the bottom of this post, I have included search results based on my user, I have removed everything except the fields you might want. ? $ldapuser = DOMAIN_USER; $ldappass = DOMAIN_PASS; $ldaprdn = 'DOMAIN\\'.$ldapuser; $ldapconn = @ldap_connect(dns.domain.com, 3268); @ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3); @ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, 0); if ($ldapconn) { $ldapbind = @ldap_bind($ldapconn, $ldaprdn, $ldappass); } $base_dn = DC=dns,DC=domain,DC=com; $filter=samaccountname=$ldapuser; $read = ldap_search($ldapconn, $base_dn, $filter); $info = ldap_get_entries($ldapconn, $read); $ii=0; for ($i=0; $ii$info[$i][count]; $ii++){ $data = $info[$i][$ii]; echo $data.:nbsp;nbsp;.$info[$i][$data][0].br; } ? Hope it helps Phil Dowson Ben Crothers wrote: Hoping this is an easy question to answer, apologise upfront if this is so basic, but just been put in charge of a PHP app with LDAP interface to M$ Exchange, and trying to figure out how it works. At the moment it works fine and extracts fields like first- and surname, title, department, etc. I need to add the 'office' field, and added it at the end of this filter line: --- $filter = (|(sn=$search[$i]*)(givenname=$search[$i]*)(title=$search[$i]*)(department= $search[$i]*)(office=$search[$i]*)); ...but so far it's not working. I *know* there's data in the 'office' field -- any ideas as to what I'm missing? Thanks a lot in advance, Ben ---Field List--- homemdb: manager: memberof: altrecipientbl: publicdelegatesbl: streetaddress: info: cn: company: c: department: description: displayname: mail: facsimiletelephonenumber: givenname: initials: instancetype: legacyexchangedn: l: distinguishedname: objectcategory: objectclass: objectguid: objectsid: homephone: mobile: pager: physicaldeliveryofficename: postofficebox: postalcode: primarygroupid: proxyaddresses: name: samaccountname: samaccounttype: showinaddressbook: st: sn: telephonenumber: co: textencodedoraddress: title: useraccountcontrol: userprincipalname: usnchanged: usncreated: whenchanged: whencreated: wwwhomepage: mailnickname: msexchuseraccountcontrol: deliverandredirect: homemta: msexchhomeservername: msexchmailboxguid: msexchmailboxsecuritydescriptor: mdbusedefaults: protocolsettings: ---Field List--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse error in mysql_query()
[snip] I put this right above like 871: print brbr$_POST[domainregister_domain$i]brbr; So now that print line is 871. It produces the exact same error as the mysql_query() line. [/snip] I should have mentioned this in my last email. You should try a print_r of the $_POST array. print pre; print_r($_POST); print /pre; that will give you every value in the array and all of the array keys. I would probably put togethere the sql string like John Holmes' example. (' . $_POST['domainregister_domain' . $i] . ', ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: progress in php (was Re: [PHP] Working pop-up progress window)
Steve, et al -- ...and then Steve Murphy said... % % Every time I see someone ask about an upload meter a hardcore programmer writes back saying no one ever asks for it so why should anyone work on one? I have a demo up of what you might be looking for, check it out here: Heh :-) I always ask what's wrong with progress bar in your browser? % % http://www.pfohlsolutions.com/projects/upload/ That didn't keep me from trying this, though; it would be interesting. Unfortunately I tried the demo and uploaded a 466k zip file and got nothing until I then got the File Upload Complete result page. Um, what is it supposed to do? TIA HAND Happy Holidays :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] Parse error in mysql_query()
Tyler Longren wrote: Hi Matt, I put this right above like 871: print brbr$_POST[domainregister_domain$i]brbr; So now that print line is 871. It produces the exact same error as the mysql_query() line. The reason I'm doin it like this is cuz I'm dynamically generating forms, and lots of the fields are the same, just with different numbers at the end: ex: domainregister_domain1 domainregister_domain2 Those field names are generated by PHP for the form, and now I'm doing the page to process that form. Would doing $_POST['domainregister_domain'][$i] get the correct value from my domainregister_domain1 field if $i=1? So name all of your form elements domainregister_domain[] and now you'll be submitting an array. You'll end up with $_POST['domainregister_domain'][0] as the value of the first one, $_POST['domainregister_domain'][1] as the second, etc. You can then use them directly in a string/echo: echo Value is: {$_POST['domainregster_domain'][0]}.; If you continue to do it the way you are, then break out of the string. echo Value is . $_POST['domainregister_domain' . $i] . .; or echo Value is . $_POST[domainregister_domain$i] . .; The reason you can't do it the way you are now is that you're expecting PHP to evaluate the variables twice. First, evaluate $i, then evaluate $_POST with the evaluated value of $i. PHP gets confused (rightfully so). -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] evaluating a variable
Hey, I have stored the name of a function as a variable. I have then passed the variable to another function as follows: //put function name in a variable $contentfunction = newsadmincontent(); //pass variable to another function Html_content($contentfunction); //function is: function html_content($contentfunction) { ? tr td colspan=2 valign=top table width=100% height=390 border=1 cellpadding=0 cellspacing=0 bordercolor=#66 bgcolor=#FF tr td valign=top ? $contentfunction; //doesnt work Echo $contentfunction; //outputs the name of the function but does not evaluate it Echo ? .$contentfunction. ?; //outputs ? Newsadmincontent() ? but does not evaluate it ? /td /tr /table /td /tr ? } This does seem like a simple question but I cannot find any information to help me. Can anyone tell me how to get the function to be executed here? Thanks Carey --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.552 / Virus Database: 344 - Release Date: 15/12/2003
[PHP] onChange
I have 2 list fields in a form. The second is populated basing on selection in field 1. Can anyone pls tell me how to do this in PHP ?
Re: [PHP] evaluating a variable
On Mon, 2003-12-22 at 12:36, Carey Baird wrote: Hey, I have stored the name of a function as a variable. I have then passed the variable to another function as follows: //put function name in a variable $contentfunction = newsadmincontent(); //pass variable to another function Html_content($contentfunction); //function is: function html_content($contentfunction) { ? tr td colspan=2 valign=top table width=100% height=390 border=1 cellpadding=0 cellspacing=0 bordercolor=#66 bgcolor=#FF tr td valign=top ? $contentfunction; //doesnt work Echo $contentfunction; //outputs the name of the function but does not evaluate it Echo ? .$contentfunction. ?; //outputs ? Newsadmincontent() ? but does not evaluate it ? /td /tr /table /td /tr ? } This does seem like a simple question but I cannot find any information to help me. Can anyone tell me how to get the function to be executed here? Try $$contentfunction - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] evaluating a variable
try eval($contentfunction); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] onChange
I have 2 list fields in a form. The second is populated basing on selection in field 1. Can anyone pls tell me how to do this in PHP ? You can't do this with PHP. PHP is server side which means it only reacts after a request has been made to the server (by loading a Web page or submitting a form, for example). For what you're trying to do, you'll need to use JavaScript, which is client side. You can use PHP to help create the JavaScript, though. There are some ready-made scripts available for this purpose (search Google). Hope that helps, Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: progress in php (was Re: [PHP] Working pop-up progress window)
David, A window will popup with the progress meter. Obviously don't block popups and try using a larger file if you have a high speed line, it takes a second for the meter to start and if the upload is done it won't popup properly. Steve -Original Message- From: David T-G [mailto:[EMAIL PROTECTED] Sent: Monday, December 22, 2003 2:20 PM To: PHP General list Cc: Steve Murphy Subject: [PHP] Re: progress in php (was Re: [PHP] Working pop-up progress window) Steve, et al -- ...and then Steve Murphy said... % % Every time I see someone ask about an upload meter a hardcore programmer writes back saying no one ever asks for it so why should anyone work on one? I have a demo up of what you might be looking for, check it out here: Heh :-) I always ask what's wrong with progress bar in your browser? % % http://www.pfohlsolutions.com/projects/upload/ That didn't keep me from trying this, though; it would be interesting. Unfortunately I tried the demo and uploaded a 466k zip file and got nothing until I then got the File Upload Complete result page. Um, what is it supposed to do? TIA HAND Happy Holidays :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
RE: [PHP] evaluating a variable
Eval ($contentfunction); gave me a parse error: Parse error: parse error in /home/pickled/public_html/main/inc/html.php(145) : eval()'d code on line 1 $$contentfunction didnt output anything Any other ideas? -Original Message- From: Brad Pauly [mailto:[EMAIL PROTECTED] Sent: 22 December 2003 19:43 To: Carey Baird Cc: php-gen Subject: Re: [PHP] evaluating a variable On Mon, 2003-12-22 at 12:36, Carey Baird wrote: Hey, I have stored the name of a function as a variable. I have then passed the variable to another function as follows: //put function name in a variable $contentfunction = newsadmincontent(); //pass variable to another function Html_content($contentfunction); //function is: function html_content($contentfunction) { ? tr td colspan=2 valign=top table width=100% height=390 border=1 cellpadding=0 cellspacing=0 bordercolor=#66 bgcolor=#FF tr td valign=top ? $contentfunction; //doesnt work Echo $contentfunction; //outputs the name of the function but does not evaluate it Echo ? .$contentfunction. ?; //outputs ? Newsadmincontent() ? but does not evaluate it ? /td /tr /table /td /tr ? } This does seem like a simple question but I cannot find any information to help me. Can anyone tell me how to get the function to be executed here? Try $$contentfunction - Brad --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.552 / Virus Database: 344 - Release Date: 15/12/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.552 / Virus Database: 344 - Release Date: 15/12/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] onChange
[snip] I have 2 list fields in a form. The second is populated basing on selection in field 1. Can anyone pls tell me how to do this in PHP ? [/snip] you can't, onchange is fired with javascript on the client. You have a number of ways you can do it a few are. 1. have on change submit the form to a php page, grab the form variable from the first drop down and build the second select box. 2. if the data set is small, output it all to the page as javascript arrays, then onchange, rebuild the second drop down box. 3. take a look at http://developer.apple.com/internet/javascript/iframe.html these are just a few options. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] reading excell and writing to text file..
Hey there... Are you using a windows server? If so, I can provide you with code examples as to how to select fields and write new excel docs using the COM stuff built into windows. For linux, things get a little bit more complicated -- really, you just need some sort of external app to do the conversion. Something like this might help: http://chicago.sourceforge.net/xlhtml/ -- jon -Original Message- From: Andrew Kwiczola [mailto:[EMAIL PROTECTED] Sent: Monday, December 22, 2003 11:47 AM To: '[EMAIL PROTECTED]' Subject: [PHP] reading excell and writing to text file.. I was wondering a good place I could get started on reading excel spreadsheets in PHP ive seen a couple of things out there that will take data from the web and transform it into a .xls file. I was wondering if I could take a XLS file with php and read it, and rip out certain data from it :-) but just knowing how to read it to the screen would be enough to get me going. Thanks! Dragoonkain --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.551 / Virus Database: 343 - Release Date: 12/11/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.551 / Virus Database: 343 - Release Date: 12/11/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] evaluating a variable
[snip] Eval ($contentfunction); gave me a parse error: Parse error: parse error in /home/pickled/public_html/main/inc/html.php(145) : eval()'d code on line 1 [/snip] try to add a semicolon to the end of the variable $contentfunction = newsadmincontent();; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] evaluating a variable
On Mon, 2003-12-22 at 12:43, Carey Baird wrote: Eval ($contentfunction); gave me a parse error: Parse error: parse error in /home/pickled/public_html/main/inc/html.php(145) : eval()'d code on line 1 $$contentfunction didnt output anything Any other ideas? What are you trying to do exactly? Looking at your code again maybe you want: $contenctfunction(); - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: HTTP headers, IE and downloading
Did you try session_cache_limiter('private_no_expire')? Andreas Magnusson wrote: Thanks for your reply! Have a look at: http://pear.php.net/package/HTTP_Download I looked at it and it's hard to see what it does differently from what I do... And the first comment of: http://www.php.net/manual/en/function.session-cache-limiter.php Thanks, I've read that and I'm not using output compression. Perhaps you should not use ouput-compression, and look at the headers generated by PHP What headers are sent? Do you use sessions? I use sessions, and I've tried to send the same headers as the webserver sends if I download a file directly (rather than through PHP). It doesn't work... Maybe I should just create a temporary file and relocate the browser to it in case the browser is IE... you can see this using Mozilla + Live Headers, Ethereal, http://schroepl.net/cgi-bin/http_trace.pl ... Thanks, I've written my own HTTP header tracer in C++, but it hasn't been able to help me since the headers looks good to me... /Andreas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] evaluating a variable
Carey Baird wrote: Hey, I have stored the name of a function as a variable. I have then passed the variable to another function as follows: //put function name in a variable $contentfunction = newsadmincontent(); Take off the parenthesis... $contentfunction = 'newsadmincontent'; To call the function, you simply use: $contentfunction(); Which will call the newsadmincontent function. $contentfunction = 'newsadmincontent'; html_function($contentfunction); function html_function($func_name) { echo You requested to execute the function: $func_name.; echo 'The output of the function is: ' . $func_name(); } -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: progress in php
Steve -- ...and then Steve Murphy said... % % David, % A window will popup with the progress meter. Obviously don't block popups and try using a larger file if you have a high speed line, it takes a second for the meter to start and if the upload is done it won't popup properly. Ah. Since I don't use javascript I probably won't get a lot out of it :-) Darn; I was hoping for something non-JS. I guess I'll stick with my browser status window. % % Steve Thanks HAND Happy Holidays :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] evaluating a variable
On Mon, 2003-12-22 at 13:09, John W. Holmes wrote: Carey Baird wrote: Hey, I have stored the name of a function as a variable. I have then passed the variable to another function as follows: //put function name in a variable $contentfunction = newsadmincontent(); Take off the parenthesis... $contentfunction = 'newsadmincontent'; To call the function, you simply use: $contentfunction(); Which will call the newsadmincontent function. $contentfunction = 'newsadmincontent'; html_function($contentfunction); function html_function($func_name) { echo You requested to execute the function: $func_name.; echo 'The output of the function is: ' . $func_name(); } Nicely explained! Please disregard my earlier suggestions. Typing too fast and not paying enough attention. I'll go sit in the corner now =) - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] overload() problem
I'm trying to write a class for abstracting some aspects of database programming and am running into a problem: http://hashphp.org/pastebin.php?pid=567 The code works fine for the first instantiation of the DbTable (Product) class, but not the second. It seems clear that the reason it works the first time is that overload() isn't called until after describe() in DbTable's constructor, so DbTable can see its actual properties. The second time it's instantiated, the class is already overloaded, so it can't and describe() fails to populate the columns array. Unfortunately, seeing the problem is not helping me see the solution =P Does anyone have an idea for a workaround for this? BTW, the DbTable class isn't tied to any particular table, so it should be easy to test against any spare PostgreSQL tables you might have lying around (just change the test code). TIA, Cliff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: progress in PHP
Well its actually a pure PHP upload meter it just uses JS to open the window. You could make PHP open the window as well with a little tweaking. -Original Message- From: David T-G [mailto:[EMAIL PROTECTED] Sent: Monday, December 22, 2003 3:16 PM To: [EMAIL PROTECTED] Cc: Steve Murphy Subject: Re: [PHP] Re: progress in php Steve -- ...and then Steve Murphy said... % % David, % A window will popup with the progress meter. Obviously don't block popups and try using a larger file if you have a high speed line, it takes a second for the meter to start and if the upload is done it won't popup properly. Ah. Since I don't use javascript I probably won't get a lot out of it :-) Darn; I was hoping for something non-JS. I guess I'll stick with my browser status window. % % Steve Thanks HAND Happy Holidays :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
Re: [PHP] Re: progress in PHP
Steve, et al -- ...and then Steve Murphy said... % % Well its actually a pure PHP upload meter it just uses JS to open the window. You could make PHP open the window as well with a little tweaking. Now that might interest me. So what has been added to the PHP codebase that makes this work? And what tweaking would I need to do? [Can't I just have it display in the current window? Why bother with a popup?] Thanks HAND Happy Holidays :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
[PHP] Re: sorting a mulit-dimensional array
Your subject line raises a completely different question than your message. Are you looking to sort a multi-dimensional array or select distinct values from one? -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org - Original Message - From: Chakravarthy Cuddapah [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Monday, December 22, 2003 7:55 AM Subject: sorting a mulit-dimensional array Can anyone pls tell me with an example on how to select distinct values from a multi-dimensional array. Moving distinct values into another array is ok. Thanks ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Fetch Information Via a link
Thankyou, put me on the right track :) Jasper Bryant-Greene [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi Eric What you need to do is make another PHP page, maybe info.php, which will fetch the info field from the DB and display it. So for example, assuming the eventname field is unique, you could make the info like something like: a href=info.php?eventname=?=urlencode($eventname)?information/a And then make info.php fetch the info field from the DB, for example if you were using MySQL: // page header HTML here ? $row = mysql_fetch_assoc(mysql_query(SELECT info FROM table WHERE eventname='{$_GET['eventname']}')); $info = $row['info']; print(nl2br($info)); ? // page footer HTML here Obviously you will need to change that to suit your site, and you may want to add some security to the $_GET variable being passed to the MySQL server to prevent attacks. Other than that, hope this helps. Regards Jasper Bryant-Greene Cabbage Promotions http://fatalnetwork.com/ [EMAIL PROTECTED] Eric Holmstrom wrote: Hi there, I have this. Table Name = events Fields = eventname, date, info. Example --- EVENTS --- eventname | date| info -- event1 | 0202 | info here -- event2 | 0303 | info here 2 The problem is that the field info has alot of text in it. When I print this out in an array it makes a huge page due to each event having alot of information. So im trying to make it so it will display the results like this. event10202infomation event20303infomation I want the word infomation to be hyperlinked, so if you click on it, it will display the information in the info field. The problem is I don't know how to make a hyperlink that grabs the correct infomation for each event. Any help at all will be very grateful for. Thankyou Eric Holmstrom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: progress in PHP
Steve Murphy mailto:[EMAIL PROTECTED] on Monday, December 22, 2003 1:03 PM said: Well its actually a pure PHP upload meter it just uses JS to open the window. You could make PHP open the window as well with a little tweaking. Unless I'm missing something here this is incorrect. PHP does not bother the client side except to send data, i.e. html/javascript/etc. On another note: A possible solution might be to load the popup page in an iframe instead of popping a new window. afaik you can't open a window with plain html without a manual click? chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: progress in PHP
Now that might interest me. So what has been added to the PHP codebase that makes this work? And what tweaking would I need to do? [Can't I just have it display in the current window? Why bother with a popup?] From rumors I've heard on the list a future version of PHP may have a progress bar function built in. Don't know if it's true or not but it would be nice. Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] post var check failing?
Not sure why it isn't checking my post vars correctly... any help is appreciated. Thanks in advance Jas while($a = mysql_fetch_array($x)) { list($_SESSION['id01'],$hn,$ma,$i,$v) = $a; } $_SESSION['search'] = ...new form with listed vars...; } elseif ((empty($_POST['hosts01'])) (empty($_POST['search'])) (!empty($_POST['hn'])) (!empty($_POST['ma'])) (!empty($_POST['i'])) (!empty($_POST['v']))) { unset($_SESSION['search']); // FiX POST VAR CHECK ! $_SESSION['search'] = ... show posted vars as successful submission ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Boolean Searches using PHP and using File System fgetss
I'm wondering if anyone knows of a good file system script that allows some one to do searches on files in a directory. For instance I'm storing resumes in folder defined on upload dates and so forth and want to be able to do searches through these files for keywords and would like to be able to do Boolean searches and hopefully return a brief description and perhaps a percentage relevance. What is very important is the Boolean thing as I need to be able to do searches like this AND that OR this AND NOT that Any ideas? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] overload() problem
Cliff Wells wrote: I'm trying to write a class for abstracting some aspects of database programming and am running into a problem: http://hashphp.org/pastebin.php?pid=567 Well, I kept hacking at it and changing the describe() method from this: // get a description of a table function describe($table) { $db = $this-db; $q = $db-prepare(SELECT * FROM $table LIMIT 0); $result = $db-execute($q); foreach ($result-tableInfo() as $c) $this-columns[$c['name']] = NULL; } to this: // get a description of a table function describe($table) { $db = $this-db; $columns = array(); $q = $db-prepare(SELECT * FROM $table LIMIT 0); $result = $db-execute($q); foreach ($result-tableInfo() as $c) $columns[$c['name']] = NULL; $this-columns = $columns; } seems to fix it. I can't see any reason why other than what appears to be general PHP brokenness. If anyone has a rational explanation as to why this is so I'd be grateful to hear it. Regards, Cliff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PROBLEMS WHEN EXTRACING DATA FROM MSSQL DATABASE WITH PHP
I am having a really unusual problem. In my database, I currently have string such as: I went to the store and bought some food. I then decided to go to the movies and I saw Bad Boy II. When I extract the data out of the database, the data always seems to get cutoff. In other words, I will only get the follow: I went to the store and bought some food. I then decided to go to the movies and Is there some type of variable I need to set in the php.in that control how long of a string you can have. It only seems to happen when I am storing long strings in my database. I am using a mssql database. I don't think it is a database issue because I am able to update the database just fine. When I check the database it contains all of the text. When I try to extract the data using php, everything seems to get cut off. Any ideas? Thanks, Dale -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] using PDI to pull from data already read into a variable?
I have written scripts to upload pdf files into mysql. I have the scripts created to access those files and produce them for the user on the fly. All well and good. Now I have a need to access one of those files and insert its contents into a new pdf report. I have purchased the PDFlib+PDI and want to pull the data from the variable returned from mysql. However, the function for openning the pdf document to be inserted is looking for a file on disk to access. Has anyone done this without writing the document to disk first and then openning it from there? It seems that pulling it from the db in a query and then handing it to the PDI functions would be less intensive than writing it out, parsing it, and then ultimately deleting it from disk again. Any help would be greatly appreciated... TIA Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HTTP headers, IE and downloading
Hi! Andreas Magnusson wrote: Have a look at: http://pear.php.net/package/HTTP_Download I looked at it and it's hard to see what it does differently from what I do... Use Ethereal or your own tracer to find out! And compare to a direct request to a real file! AFAIK the headers sent here are: 'Content-Type' = 'application/x-octetstream', (perhaps other) 'Cache-Control' = 'public', 'Accept-Ranges' = 'bytes', 'Connection'= 'close' And the first comment of: http://www.php.net/manual/en/function.session-cache-limiter.php Thanks, I've read that and I'm not using output compression. Did you try something like this: ?php header(Content-Type: application/pdf); header(Content-Disposition: inline; filename=foo.pdf); header(Accept-Ranges: bytes); header(Content-Length: $len); header(Expires: 0); header(Cache-Control: private); // header(Pragma: no-cache);//don't send this header!! ? What headers are sent at this moment? Could you post them? Perhaps you should not use ouput-compression, and look at the headers generated by PHP What headers are sent? Do you use sessions? I use sessions, and I've tried to send the same headers as the webserver sends if I download a file directly (rather than through PHP). It doesn't work... Maybe I should just create a temporary file and relocate the browser to it in case the browser is IE... If you send the same headers and the same data - there _can_not_ be any difference. How should your client recognize any difference? There _must_ be a difference! Use a very small file to test it, so you can compare the whole HTTP-Header + Body easily. you can see this using Mozilla + Live Headers, Ethereal, http://schroepl.net/cgi-bin/http_trace.pl ... Thanks, I've written my own HTTP header tracer in C++, but it hasn't been able to help me since the headers looks good to me... Oh, I could not know ;-) Kind Regards, Andreas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PROBLEMS WHEN EXTRACING DATA FROM MSSQL DATABASE WITH PHP
Is your field too small? MySQL doesn't complain when you give it a string longer than it can accept based on the field's size. It just cuts off what doesn't fit :-) -Original Message- From: Dale Hersh [mailto:[EMAIL PROTECTED] Sent: Monday, December 22, 2003 6:50 PM To: [EMAIL PROTECTED] Subject: [PHP] PROBLEMS WHEN EXTRACING DATA FROM MSSQL DATABASE WITH PHP I am having a really unusual problem. In my database, I currently have string such as: I went to the store and bought some food. I then decided to go to the movies and I saw Bad Boy II. When I extract the data out of the database, the data always seems to get cutoff. In other words, I will only get the follow: I went to the store and bought some food. I then decided to go to the movies and Is there some type of variable I need to set in the php.in that control how long of a string you can have. It only seems to happen when I am storing long strings in my database. I am using a mssql database. I don't think it is a database issue because I am able to update the database just fine. When I check the database it contains all of the text. When I try to extract the data using php, everything seems to get cut off. Any ideas? Thanks, Dale -- 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] PROBLEMS WHEN EXTRACING DATA FROM MSSQL DATABASE WITH PHP
Larry Brown mailto:[EMAIL PROTECTED] on Monday, December 22, 2003 3:59 PM said: Is your field too small? MySQL doesn't complain when you give it a string longer than it can accept based on the field's size. It just cuts off what doesn't fit :-) Uhh... he stated in his original email that he's using MSSQL (not MySQL) and that the data is being INSERTed completely and without error. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PROBLEMS WHEN EXTRACING DATA FROM MSSQL DATABASE WITH PHP
My bad, didn't read far enough... -Original Message- From: Chris W. Parker [mailto:[EMAIL PROTECTED] Sent: Monday, December 22, 2003 7:04 PM To: Larry Brown; Dale Hersh; PHP List Subject: RE: [PHP] PROBLEMS WHEN EXTRACING DATA FROM MSSQL DATABASE WITH PHP Larry Brown mailto:[EMAIL PROTECTED] on Monday, December 22, 2003 3:59 PM said: Is your field too small? MySQL doesn't complain when you give it a string longer than it can accept based on the field's size. It just cuts off what doesn't fit :-) Uhh... he stated in his original email that he's using MSSQL (not MySQL) and that the data is being INSERTed completely and without error. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: HTTP headers, IE and downloading
In hopes that this may be of help to you...I had a hell of a time getting IE to download pdfs that I create on the fly and finally with the help of a couple people I got the magic code which was... $len = strlen($buf); //buf was holding the pdf doc. header(Pragma: public); header(Expires: 0); header(Cache-Control: must-revalidate, post-check=0, pre-check=0); header(Content-type: application/pdf); header(Content-Length: $len); header(Content-Disposition: inline; filename=.$filename..pdf); header(Content-Transfer-Encoding: binary); and in addition had to set the link as a href=http://mysite.com/myphpPDFscript.php?pdf=anything.pdf and after all of that it worked. Which ones you may need is beyond me. I do not know enough about how the different browsers handle headers and really only needed to get that one functionality working for me. I hope examining it can help... Larry -Original Message- From: Andreas Magnusson [mailto:[EMAIL PROTECTED] Sent: Monday, December 22, 2003 1:44 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: HTTP headers, IE and downloading Thanks for your reply! Have a look at: http://pear.php.net/package/HTTP_Download I looked at it and it's hard to see what it does differently from what I do... And the first comment of: http://www.php.net/manual/en/function.session-cache-limiter.php Thanks, I've read that and I'm not using output compression. Perhaps you should not use ouput-compression, and look at the headers generated by PHP What headers are sent? Do you use sessions? I use sessions, and I've tried to send the same headers as the webserver sends if I download a file directly (rather than through PHP). It doesn't work... Maybe I should just create a temporary file and relocate the browser to it in case the browser is IE... you can see this using Mozilla + Live Headers, Ethereal, http://schroepl.net/cgi-bin/http_trace.pl ... Thanks, I've written my own HTTP header tracer in C++, but it hasn't been able to help me since the headers looks good to me... /Andreas -- 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] UNUSUAL PROBLEM WHEN WRITING TO THE SCREEN
For some reason when I echo data from my database, I can't display anything longer than 255 chars. As far as I can see, tt has nothing to do with my database. Is there something in the php.ini that limits how many chars you can write to the screen per variable. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: File Upload on a MAC-Browser didn't work
I had a similar problem, but never found an answer. In my situation, the browser hung when I uploaded a file greater than 800 records. I found a post that said I should echo something to the browser on a regular basis during the upload, but that didn't work. This is still of interest to me to solve. Perhaps we can together find a solution Chris Volker DåHn [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, The following script works on any browser on windows xp. But not on a mac (osx) It simply shows the temp-directoryname. Is anybody out there who could help me to fix this problem? How will the upload work with Safari? Thanks for your help. This is the form for the upload: form enctype=multipart/form-data method=POST name=NAForm action=IA.php??=SID? input type=file name=BildDatei maxlength=128 size=36 value=? echo $Bild; ? input type=hidden name=MAX_FILE_SIZE value=20480 The following site checks the uplad and copies the file to a specific folder: // if the Picture was uploaded if ($BildDatei!= AND is_uploaded_file($_FILES['BildDatei']['tmp_name'])) { // Check for JPG if ($_FILES['BildDatei']['type']=='image/pjpeg') { // Move File $TestFile=$UserCoverDir.$ISBNFeld..jpg; move_uploaded_file($_FILES['BildDatei']['tmp_name'], $TestFile); } } else { echo Save unsuccesfull; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can't upload file greater than 11kb
I've got a situation where I want to upload a file to a server then enter the data in that file into mysql. I have used this well documented upload form form enctype=multipart/form-data action=_URL_ method=POST Send this file: input name=userfile type=file input type=submit value=Send File /form script on many php servers. However I am on one now which is not allowing me to upload a file greater than 12kb. I know the upload_max_filesize is 2M but something else is stopping the upload and I don't have a clue what it is. I know you should include input type=hidden name=MAX_FILE_SIZE value=3 in the above form but that is only a convenience for the user. This particular server is running php as a cgi module. Thanks Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] UNUSUAL PROBLEM WHEN WRITING TO THE SCREEN
On Mon, 2003-12-22 at 20:34, Dale Hersh wrote: For some reason when I echo data from my database, I can't display anything longer than 255 chars. As far as I can see, tt has nothing to do with my database. Is there something in the php.ini that limits how many chars you can write to the screen per variable. Your database field is probably varchar instead of text. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] UNUSUAL PROBLEM WHEN WRITING TO THE SCREEN
-Original Message- From: Dale Hersh [mailto:[EMAIL PROTECTED] Sent: Monday, December 22, 2003 8:34 PM To: [EMAIL PROTECTED] Subject: [PHP] UNUSUAL PROBLEM WHEN WRITING TO THE SCREEN For some reason when I echo data from my database, I can't display anything longer than 255 chars. As far as I can see, tt has nothing to do with my database. Is there something in the php.ini that limits how many chars you can write to the screen per variable. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php It has to be the field length of your database. PHP has no limitations like this that I have heard of or encountered. If it's a mysql database, check to see what type of field it is: TINYTEXT, TEXT, MEDIUMTEXT, or LONGTEXT; or perhaps TINYBLOB, BLOB, MEDIUMBLOB, or LONGBLOB. The limits on the field sizes are as follows: TINYTEXT maximum length of 255 TEXT maximum length of 65535 MEDIUMTEXT maximum length of 16777215 LONGTEXT maximum length of 4294967295 Thanks, Jake McHenry Nittany Travel MIS Coordinator http://www.nittanytravel.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] UNUSUAL PROBLEM WHEN WRITING TO THE SCREEN
On Tuesday, December 23, 2003, at 12:34 PM, Dale Hersh wrote: For some reason when I echo data from my database, I can't display anything longer than 255 chars. As far as I can see, tt has nothing to do with my database. Is there something in the php.ini that limits how many chars you can write to the screen per variable. Sounds more like the mysql field is a varchar255, rather than maybe a mediumtext, and only the first 255 chars are getting inserted into the DB? But I could be horribly wrong :) Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HTTP headers, IE and downloading
Hi! Andreas Magnusson wrote: I'm writing a script to view/download an email-attachment. If the file happens to be an MS Word document and the browser IE (only tried with 6.0), then the download fails. If I choose to download (Content-Disposition: attachment; filename=whatever.doc) then only a part of the file (2/3) is saved to disk. Of course viewing the file doesn't work either. It doesn't seem to matter what I set the Content-Type to since IE seems to ignore that anyway, however I've tried application/msword, application/octet-stream and some others. I've tried all the things said in the comments to the header-function in the online-docs at php.net. I know my Content-Length header is correct and the whole procedure works great with Netscape 7.0 and if the attachment is a zip-file or a jpeg-image it also works in both IE and Netscape. Once a user of the PHP Classes site reported a similar problem when downloading zip versions of the class archives. I report a problem to Winzip support people and sent me the following reply. Notice, in the PHP Classes site, downloads support byte range requests, which are used by download managers to fetch files in many chunks. It looks to me that the problem is due to a bug in IE as reported in the address below. We typically see this behaviour when the temporary internet files folder is full; you might try clearing some files from this location, either manually or via your browser's options. There's also a known issue with the internet explorer program; you might check the information available at the URL: http://support.microsoft.com/default.aspx?scid=kb;en-us;308090 Another possible explanation is that an Anti Virus product is involved; if the 'scan' of the archive is not completed when the browser 'passes' the file to WinZip, the result is a 'blank' WinZip window. I'd suggest temporarily disabling or reconfiguring your Anti virus software to avoid the behaviour. Regards, Andreas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Https
Hello, On 12/22/2003 05:26 AM, Homer wrote: Notice: fopen(): Unable to find the wrapper https - did you forget to enable it when you configured PHP? in C:\Inetpub\PostNuke-0.726\mpValidar.php on line 62 The line above says it all. I think the right scheme name is ssl, not https . Alternatively you may want to use the Curl library. It is a bit more complicated but using this HTTP client class it becomes much simpler and you can make more complex request like posting forms and handling cookies. http://www.phpclasses.org/httpclient -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] distinct values from a mulit-dimensional array
Can anyone pls tell me with an example on how to select distinct values from a multi-dimensional array. Moving distinct values into another array is ok. Thanks !
[PHP] Dilema
Hi everyone. Hopefully someone can help me out. Here is what I have: The user enters traveler names on page 1. blah blah on next couple. Page 7 shows hotel information. I have the array of travelers names being outputed into a select field on the page, all fine and dandy. Where I'm having a problem is, the user can enter as many hotels as they want, meaning the list of travelers will be displayed for each hotel added. In the array being transferred into my script via POST, they are all in one array. How can I separate each hotel into it's own array, or somehow separate the traveler names in the single array? I was thinking of making a 2 dimentional array, but not sure how I could do this. I know how to create the arrays, but not sure how I can do it in my situation. If anyone needs any more info, ask away. Thanks, Jake McHenry Nittany Travel MIS Coordinator http://www.nittanytravel.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php