Re: [PHP] store array into session variable and get it back later
how about: $bci = $_SESSION['bc']; foreach($bci-crumb as myCrumb) { echo br/value['name'] :.$myCrumb['name'].br/; echo br/value['link'] :.$myCrumb['link'].br/; echo br/value['id'] : .$myCrumb['id'].br/; } You are wanting to loop through the crumbs rather than looping objects. There is only one object you are sending over through the session and multiple crumbs right? On Wed, 2008-10-01 at 17:04 +0200, Alain Roger wrote: later on i try to use the content of this array, bt without success. Here is what i do: $bci = array($_SESSION['bc']); array_push($bci,$_SESSION['bc']); foreach($bci as $key=$value) { echo bci : .$bci[$key]['name']; echo br/; } how can i get the 'name' value for each row in this session stored array ? thx. ... The function you need to look into is called serialize. http://www.php.net/manual/en/function.serialize.php //frank This is what i did afterall, but when i unserialize it like this way: $bci = unserialize($_SESSION['bc']); foreach($bci as $key=$value) { echo bci : .$key; echo br/; } i get absolutely the same result as the code below. in fact $key returns me the 2 variables member of the Class. but not the value stored inside them. any idea ? so here is what i've decided to use: for ($row=0;$row=count($bci-crumb);$row++) { echo br/value[$row]['name'] : .$bci-crumb[$row]['name'].br/; echo br/value[$row]['link'] : .$bci-crumb[$row]['link'].br/; echo br/value[$row]['id'] : .$bci-crumb[$row]['id'].br/; } and it works like a charm. but how can i optimize it ? i mean foreach could do the work better ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fsockopen in phpmailer and tls
On Sat, 2008-09-06 at 14:53 -0400, Robert Cummings wrote: On Sat, 2008-09-06 at 14:38 -0400, Larry Brown wrote: On Sat, 2008-09-06 at 14:06 -0400, Robert Cummings wrote: On Sat, 2008-09-06 at 14:02 -0400, Larry Brown wrote: OK. So I broke down and re-created my mail server due to its age. I am now running the latest sendmail and it is still failing. The message in the sendmail log is ...remoteMachineIP] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA A little research is leading me to believe the client (php client script) opened the socket but didn't send anything. Now the certificate that I'm using for the server is a self signed certificate. Evolution asked if I wanted to accept the certificate when I first connected and I did. After which it worked fine. Is there a setting I must enable to accept unknown certificates when a site is first connected to? Any other ideas? Sounds like an email client issue and most likely may differ for each and every one of them. Cheers, Rob. -- I am the email client. In this case which is what I'm trying to figure out. The script fails with the original string I posted: PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:func(143):reason(267) in /opt/scriptsMain/include/class.smtp.php on line 122 I'm using the smtpmailer class and it is trying to execute fsockopen. So to simplify troubleshooting I used the following code: if(fsockopen(tls://serverName,25,$errno,$errstr, 30)) { echo Made it!\n; } else { echo Nope!\n; echo $errno.\n; echo $errstr.\n; } I get the above warning from PHP and $errno has 0 as a value and there is $errstr is empty. PHP is v5.2.6 and phpinfo shows that ssl and tls support are both compiled in. Ah, I see, I misunderstood when you mentioned Evolution. Sorry, I can't really help you, you're in foreign territory to me :/ Cheers, Rob. For posterity and to thank Robert... I have determined that the mechanism in PHP does not allow you to specify tls for a connection that initially starts off as a clear text connection. When you set up sendmail to use tls for smtp auth it allows a connecting client to send connection details specifying tls at which point it will start talking tls. PHP expects the connection to be dedicated tls. So if you specify in sendmail to use a separate port for tls and you point PHP to that port it works like a champ. Thanks to Robert for at least giving it a shot. Hopefully this will be helpful to the next poor soul... Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fsockopen in phpmailer and tls
On Fri, 2008-09-05 at 00:58 -0400, Robert Cummings wrote: On Thu, 2008-09-04 at 23:20 -0400, Larry Brown wrote: I am having a ball of a time trying to figure this one out... If anyone has dealt with this before I'd love to get some morsels of wisdom from you... I am trying to connect to a postfix server I have set up remotely using smtp auth with tls. The postfix appears to be configured correctly at this point. I can telnet to port 25 and it will list tls as an option as the howto describes it should. I try to connect from php and get: PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:func(143):reason(267) in /opt/scriptsMain/include/class.smtp.php on line 122 I've googled this and someone seems very knowledgeable about it yet describes the solution in a way that a mere mortal like myself can't follow. He states in part: Look at the error message: error:1408F10B:SSL routines:func(143):reason(267) Take the reason code (267) and determine the error: grep 267 /usr/include/openssl/ssl.h /usr/include/openssl/ssl.h:#define SSL_R_WRONG_VERSION_NUMBER 267 Now google for SSL_R_WRONG_VERSION_NUMBER... ...So in your server method configuration you must put: SSL_CTX *ctx = SSL_CTX_new (SSLv23_server_method()) to correctely analyse the first client_hello message instead of SSL_CTX *ctx = SSL_CTX_new (SSLv3_server_method()) which i suppose you did So is he talking about modifying the source code in postfix and rebuilding it? Have any of you guys dealt with this?... By the way, when I started out I had a typo in the postfix config for the path to the certificates for ssl and was getting the same error message. It wasn't until I saw in the postfix mail log that it couldn't read the cert. So that was fixed but I continue to get the same message which I'm now thinking might be a red herring. Possibly a complete waste of your time... but maybe you need to configure this setting: smtp_tls_mandatory_protocols http://www.postfix.org/postconf.5.html Cheers, Rob. -- OK. So I broke down and re-created my mail server due to its age. I am now running the latest sendmail and it is still failing. The message in the sendmail log is ...remoteMachineIP] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA A little research is leading me to believe the client (php client script) opened the socket but didn't send anything. Now the certificate that I'm using for the server is a self signed certificate. Evolution asked if I wanted to accept the certificate when I first connected and I did. After which it worked fine. Is there a setting I must enable to accept unknown certificates when a site is first connected to? Any other ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fsockopen in phpmailer and tls
On Sat, 2008-09-06 at 14:06 -0400, Robert Cummings wrote: On Sat, 2008-09-06 at 14:02 -0400, Larry Brown wrote: OK. So I broke down and re-created my mail server due to its age. I am now running the latest sendmail and it is still failing. The message in the sendmail log is ...remoteMachineIP] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA A little research is leading me to believe the client (php client script) opened the socket but didn't send anything. Now the certificate that I'm using for the server is a self signed certificate. Evolution asked if I wanted to accept the certificate when I first connected and I did. After which it worked fine. Is there a setting I must enable to accept unknown certificates when a site is first connected to? Any other ideas? Sounds like an email client issue and most likely may differ for each and every one of them. Cheers, Rob. -- I am the email client. In this case which is what I'm trying to figure out. The script fails with the original string I posted: PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:func(143):reason(267) in /opt/scriptsMain/include/class.smtp.php on line 122 I'm using the smtpmailer class and it is trying to execute fsockopen. So to simplify troubleshooting I used the following code: if(fsockopen(tls://serverName,25,$errno,$errstr, 30)) { echo Made it!\n; } else { echo Nope!\n; echo $errno.\n; echo $errstr.\n; } I get the above warning from PHP and $errno has 0 as a value and there is $errstr is empty. PHP is v5.2.6 and phpinfo shows that ssl and tls support are both compiled in. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fsockopen in phpmailer and tls
I am having a ball of a time trying to figure this one out... If anyone has dealt with this before I'd love to get some morsels of wisdom from you... I am trying to connect to a postfix server I have set up remotely using smtp auth with tls. The postfix appears to be configured correctly at this point. I can telnet to port 25 and it will list tls as an option as the howto describes it should. I try to connect from php and get: PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:func(143):reason(267) in /opt/scriptsMain/include/class.smtp.php on line 122 I've googled this and someone seems very knowledgeable about it yet describes the solution in a way that a mere mortal like myself can't follow. He states in part: Look at the error message: error:1408F10B:SSL routines:func(143):reason(267) Take the reason code (267) and determine the error: grep 267 /usr/include/openssl/ssl.h /usr/include/openssl/ssl.h:#define SSL_R_WRONG_VERSION_NUMBER 267 Now google for SSL_R_WRONG_VERSION_NUMBER... ...So in your server method configuration you must put: SSL_CTX *ctx = SSL_CTX_new (SSLv23_server_method()) to correctely analyse the first client_hello message instead of SSL_CTX *ctx = SSL_CTX_new (SSLv3_server_method()) which i suppose you did So is he talking about modifying the source code in postfix and rebuilding it? Have any of you guys dealt with this?... By the way, when I started out I had a typo in the postfix config for the path to the certificates for ssl and was getting the same error message. It wasn't until I saw in the postfix mail log that it couldn't read the cert. So that was fixed but I continue to get the same message which I'm now thinking might be a red herring. -- Larry Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fun with SOAP.
I'm not sure how it looks etc with with soapui but I noticed you mentioning you don't want to mess with nusoap. I've used nusoap for both client and server uses for years and I'm really impressed with how easily it works. Using $soapInstance-request and $soapInstance-response the xml is displayed where you can see how it was created based on the array you fed the instance before sending for your message. It makes troubleshooting much easier for me. That being said I don't send attachments. However just doing a quick google on nusoap attachments (without the quotes) has mention of people sending MIME attachments and one listing an issue with DIME encoded attachments yet another explaining that he solved the DIME encoded issue and referred to wrox book open source webservices page 315 which is an on-line book. Sorry no quick silver bullet, but I would highly recommend looking at nusoap if only as a test. Larry On Wed, 2008-04-30 at 08:21 -0400, Eric Butera wrote: On Wed, Apr 30, 2008 at 7:35 AM, Eric Butera [EMAIL PROTECTED] wrote: On Tue, Apr 29, 2008 at 5:07 PM, Nathan Nobbe [EMAIL PROTECTED] wrote: i know this has nothing to do w/ getting it to work w/ php, eric, but have you tried hitting the service w/ soap ui? http://www.soapui.org/ although its written in java, its an indispensable testing tool, imho, and i always give it a shot when im having soap troubles. i might try to see if you can get a successful response from the service w/ it. -nathan Hi Nathan! Thanks for the reply. I'm download it as we speak. Hopefully it'll give me some sort of answer as to what is going on. I really haven't found out enough about the SOAP standard enough to know what is expected behavior, etc. I know I can see all of the raw data there, just ext/soap doesn't seem to like the multi-part. Maybe soapUI will give me some sort of answer for this. After using soapUI I've determined that the SOAP response gives back an envelope and has one attachment. Does anyone know if the SOAP extension can handle attachments? I'd really rather not mess around with nusoap or the pear soap package. I don't see anywhere on the manual where it is possible to download attachments. Hopefully someone else has dealt with this before. -- Larry Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] validating mysql bound date
Doesn't checkdate() do the sanity check for a valid date? On Fri, 2008-03-07 at 10:08 -0600, Richard Lynch wrote: Something like this, perhaps: preg_match('/^((19|20)[0-9]{2})-([0-1]?[0-9])-([0-3]?[0-9])$/', $input, $date_parts); var_dump($date_parts); This doesn't completely rule out bogus dates such as 2008-02-30 however. I think MySQL would just convert that to MAR 1, 2008 anyway... But if you want that degree of comparison: list(,$year, $month, $day) = $date_parts; $unix = mktime(1, 0, 0, $month, $day, $year); list($y, $m, $d) = date('Y-m-d', $unix); if ($year != $y || $month != $m || $day != $d){ //handle invalid date input here } If you do all of that (which is really 5 lines of code) you should be pretty sure it's a correct/valid date. On Tue, March 4, 2008 10:12 pm, Larry Brown wrote: Thanks, I ended up doing: $incomingQuestDatePieces = explode(-, $incomingQuestDate ); if(checkdate($incomingQuestDatePieces[1],$incomingQuestDatePieces[2], $incomingQuestDatePieces[0])) { return true; } else { return false; } I was just wondering since a lot of people have to verify correct format of the date when working with mysql that there might be some built in that is faster etc. Thanks though... On Wed, 2008-03-05 at 14:34 +1100, Chris wrote: Larry Brown wrote: Its been a long week already... -MM-DD. On Tue, 2008-03-04 at 20:16 -0500, Larry Brown wrote: Does anyone know if there is a builtin function for checking the formatting of an incoming date to verify it is /MM/DD. I know how to convert between formats but want a quick way to check an incoming variable to ensure it will be handled properly by mysqld. I normally provide dropdown fields for each (except the year which is a text-field) and put it together how I need it. Validate each part separately and you're off and racing. If you accept any date you'll probably have to split it up first but the principles will be the same. $date = '-00-00'; // if they didn't use exactly two dashes? invalid if (substr_count($date, '-') !== 2) { die(Invalid date); } list($year, $month, $day) = explode('-', $date); if (strlen($year) != 4) { die(Invalid year); } and so on. -- Larry Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Larry Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] validating mysql bound date
Does anyone know if there is a builtin function for checking the formatting of an incoming date to verify it is /MM/DD. I know how to convert between formats but want a quick way to check an incoming variable to ensure it will be handled properly by mysqld. Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] validating mysql bound date
Its been a long week already... -MM-DD. On Tue, 2008-03-04 at 20:16 -0500, Larry Brown wrote: Does anyone know if there is a builtin function for checking the formatting of an incoming date to verify it is /MM/DD. I know how to convert between formats but want a quick way to check an incoming variable to ensure it will be handled properly by mysqld. Larry -- Larry Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] validating mysql bound date
Thanks, I ended up doing: $incomingQuestDatePieces = explode(-, $incomingQuestDate ); if(checkdate($incomingQuestDatePieces[1],$incomingQuestDatePieces[2], $incomingQuestDatePieces[0])) { return true; } else { return false; } I was just wondering since a lot of people have to verify correct format of the date when working with mysql that there might be some built in that is faster etc. Thanks though... On Wed, 2008-03-05 at 14:34 +1100, Chris wrote: Larry Brown wrote: Its been a long week already... -MM-DD. On Tue, 2008-03-04 at 20:16 -0500, Larry Brown wrote: Does anyone know if there is a builtin function for checking the formatting of an incoming date to verify it is /MM/DD. I know how to convert between formats but want a quick way to check an incoming variable to ensure it will be handled properly by mysqld. I normally provide dropdown fields for each (except the year which is a text-field) and put it together how I need it. Validate each part separately and you're off and racing. If you accept any date you'll probably have to split it up first but the principles will be the same. $date = '-00-00'; // if they didn't use exactly two dashes? invalid if (substr_count($date, '-') !== 2) { die(Invalid date); } list($year, $month, $day) = explode('-', $date); if (strlen($year) != 4) { die(Invalid year); } and so on. -- Larry Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reading incoming xml
I am running apache with php. I set up a curl script to send an xml request to the php page I'm authoring and want to handle the xml on the incoming message. My $_POST array is empty though. Is there some other place I should be looking? $_SERVER shows the incoming message as a post but again the data isn't there. Does apache/php place the xml in some other location for me to access? Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reading incoming xml
I'm sending from a php cli with: $post = '?xml version=1.0 encoding=UTF-8?Data'.$vendorCompanyID.'/Data'; $message = generatePage($page, $post); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,'https://myserver/mytestpage.php'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 4); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $message); $data=curl_exec($ch); I've the server page (mytestpage.php) set up as: echo hello\n; print_r($_SERVER); where I replace SERVER with POST etc and I can't find the string '?xml version=1.0 encoding=UTF-8?Data'.$vendorCompanyID.'/Data' in the $data output. I do get the hello so I know I am hitting the server and when it is set to $_SERVER as listed above I get the expected array but $_POST is empty. Larry On Sat, 2008-03-01 at 16:59 -0500, Nathan Nobbe wrote: On Sat, Mar 1, 2008 at 4:12 PM, Larry Brown [EMAIL PROTECTED] wrote: I am running apache with php. I set up a curl script to send an xml request to the php page did you use a request header to somehow set a mime type to indicate youre looking for xml? could you show us this request, im not sure how to request for xml specifically.. My $_POST array is empty though. is this on the system where the xml will be sent from? you have to populate the post fields in the request by using the curl option CURLOPT_POST to indicate you are posting, and CURLOPT_POSTFIELDS, to pass an array of parameters that will be used as post fields. then the $_POST array will be populated on the provider system. Is there some other place I should be looking? $_SERVER shows the incoming message as a post but again the data isn't there. still curious if youre looking on the consumer (system sending curl request) or the provider, (system providing the xml data via response). Does apache/php place the xml in some other location for me to access? depending on how you configure curl, the data can be in different places. the easiest way (i think) is to use the CURLOPT_RETURNTRANSFER option. then the response will be returned from curl_exec() (rather than a boolean success flag). here is sample code from a consumer and a provider; theyre up on my server so you can try using the consumer if you want. CONSUMER --- ?php $curlHandle = curl_init('http://nathan.moxune.com/postXml.php'); curl_setopt_array($curlHandle, array( CURLOPT_RETURNTRANSFER = true, CURLOPT_POST = true, CURLOPT_POSTFIELDS = array( 'token' = 1 ) )); $response = curl_exec($curlHandle); if(!empty($response)) { try { $sxml = new SimpleXmlElement($response); echo $sxml-asXML(); } catch(Exception $e) { die($e-getMessage()); } } ? PROVIDER - ?php if($_POST['token'] == 1) { ? someString moreHere lessHere / /moreHere /someString ?php } ? -nathan -- Larry Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reading incoming xml
Thanks for the help Nathan. What I'm looking for though is how to accept and read the incoming XML the way I was sending it in curl. I am currently using that curl mechanism on the cli to connect to another remote XML server successfully. I want to keep that side of the equation the same. I need to find out if I can access the incoming data on the server side. I don't need or want to use curl on the server side. I just want to handle the incoming XML. How does SOAP and XML-RPC get to the incoming XML? Is the incoming SOAP and XML-RPC packages arriving in html posts? I tried looking at the nusoap code to determine this to no avail. Larry On Sat, 2008-03-01 at 18:08 -0500, Nathan Nobbe wrote: hmm, it looks to me like you want to post a bunch of raw data to the server. im not sure exactly how to do that w/ the php curl functions... everything ive seen uses CURLOPT_POSTFIELDS to supply an associative array of data to be posted. in this case you could easily send you data across by choosing a name for the index, something like 'postdata', anything will do, then it will be accessible on the system youre posting to via $_POST['postdata']. also, inlooking at your usage of CURLOPT_CUSTOMREQUEST, i dont believe youre using it correctly, i think youre just supposed to put a string representing the desired http method in there, so something like 'HEAD', 'PUT', or in this case 'POST'. then you would supply the data as i said earlier, using CURLOPT_POSTFIELDS. so in all, i think something like this would work for you, and also, in reading the warning about CURLOPT_CUSTOMREQUEST, you might just go with CURLOPT_POST = true, since you arent using an obscure http method. im not sure exactly how to determine if the server supports this method or not. anyway, i found this in 'man curl_easy_setopt' (thats the manpage for the c function php uses for the CURLOPT_CUSTOMREQUEST option). Many people have wrongly used this option to replace the entire request with their own, including multiple headers and POST contents. While that might work in many cases, it will cause libcurl to send invalid requests and it could possibly confuse the remote server badly. Use CURLOPT_POST and CUR- LOPT_POSTFIELDS to set POST data. Use CURLOPT_HTTPHEADER to replace or extend the set of headers sent by libcurl. Use CURLOPT_HTTP_VERSION to change HTTP version. -nathan -- Larry Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reading incoming xml
The incoming message to the server is: POST /vendorXML.html HTTP/1.0 MIME-Version: 1.0 Content-type: text/html Content-length: 114 Content-transfer-encoding: text Request-number: 1 Document-type: Request Interface-Version: Test 1.4 Connection: close ?xml version=1.0 encoding=UTF-8?DatavendorCompanyID/Data Larry On Sat, 2008-03-01 at 18:08 -0500, Nathan Nobbe wrote: hmm, it looks to me like you want to post a bunch of raw data to the server. im not sure exactly how to do that w/ the php curl functions... everything ive seen uses CURLOPT_POSTFIELDS to supply an associative array of data to be posted. in this case you could easily send you data across by choosing a name for the index, something like 'postdata', anything will do, then it will be accessible on the system youre posting to via $_POST['postdata']. also, inlooking at your usage of CURLOPT_CUSTOMREQUEST, i dont believe youre using it correctly, i think youre just supposed to put a string representing the desired http method in there, so something like 'HEAD', 'PUT', or in this case 'POST'. then you would supply the data as i said earlier, using CURLOPT_POSTFIELDS. so in all, i think something like this would work for you, and also, in reading the warning about CURLOPT_CUSTOMREQUEST, you might just go with CURLOPT_POST = true, since you arent using an obscure http method. im not sure exactly how to determine if the server supports this method or not. anyway, i found this in 'man curl_easy_setopt' (thats the manpage for the c function php uses for the CURLOPT_CUSTOMREQUEST option). Many people have wrongly used this option to replace the entire request with their own, including multiple headers and POST contents. While that might work in many cases, it will cause libcurl to send invalid requests and it could possibly confuse the remote server badly. Use CURLOPT_POST and CUR- LOPT_POSTFIELDS to set POST data. Use CURLOPT_HTTPHEADER to replace or extend the set of headers sent by libcurl. Use CURLOPT_HTTP_VERSION to change HTTP version. -nathan -- Larry Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] reading incoming xml
This is what I was looking for. Thank you. I could not change the client since that client is being used for other servers in its current configuration. All I needed was a way to get to the XML string coming in. $postText = trim(file_get_contents('php://input'); worked perfectly. Now that I have this blob of XML I can give it to simpleXML or another parser I was recently shown to work with it. I'm surprised it was so difficult to find. $GLOBALS['HTTP_RAW_POST_DATA'] was empty by the way and that I'd seen before. Also, sorry if I threw anyone off by referring to the other server the client works with as an XML server. I only referred to it as such because it is a server that accepts XML input and responds with XML output to a number of clients. It is not used as a typical html server for browsing etc. Anyway, I was looking to get a hold of the raw data coming in and it looks like this was it. I really do appreciate the help... Larry On Sat, 2008-03-01 at 22:06 -0500, Andrés Robinet wrote: You can get what you post either with: $postText = trim(file_get_contents('php://input'); Or with: $postText = $GLOBALS[HTTP_RAW_POST_DATA]; About HTTP_RAW_POST_DATA http://us2.php.net/manual/en/reserved.variables.php Read the notes here http://us2.php.net/variables.predefined It should be noted that $HTTP_RAW_POST_DATA only exists if the encoding type of the data is -not- the default of application/x-www.form-urlencoded, and so, to accessing raw post data from an HTTP form requires setting enctype= in your HTML. So, if $RAW_POST_DATA doesn't exist, it is because you should be able to use $_POST (unless you set PHP to always populate raw post data in php.ini). The preferred method is, however, to read 'php://input' Then after you get the XML body, you must use one of the XML extensions available in PHP to parse the XML data (search for it as it's not part of this help pack ;) ). Regards, Rob(inet) Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: Saturday, March 01, 2008 9:43 PM To: Nathan Nobbe Cc: php Subject: Re: [PHP] reading incoming xml The incoming message to the server is: POST /vendorXML.html HTTP/1.0 MIME-Version: 1.0 Content-type: text/html Content-length: 114 Content-transfer-encoding: text Request-number: 1 Document-type: Request Interface-Version: Test 1.4 Connection: close ?xml version=1.0 encoding=UTF-8?DatavendorCompanyID/Data Larry On Sat, 2008-03-01 at 18:08 -0500, Nathan Nobbe wrote: hmm, it looks to me like you want to post a bunch of raw data to the server. im not sure exactly how to do that w/ the php curl functions... everything ive seen uses CURLOPT_POSTFIELDS to supply an associative array of data to be posted. in this case you could easily send you data across by choosing a name for the index, something like 'postdata', anything will do, then it will be accessible on the system youre posting to via $_POST['postdata']. also, inlooking at your usage of CURLOPT_CUSTOMREQUEST, i dont believe youre using it correctly, i think youre just supposed to put a string representing the desired http method in there, so something like 'HEAD', 'PUT', or in this case 'POST'. then you would supply the data as i said earlier, using CURLOPT_POSTFIELDS. so in all, i think something like this would work for you, and also, in reading the warning about CURLOPT_CUSTOMREQUEST, you might just go with CURLOPT_POST = true, since you arent using an obscure http method. im not sure exactly how to determine if the server supports this method or not. anyway, i found this in 'man curl_easy_setopt' (thats the manpage for the c function php uses for the CURLOPT_CUSTOMREQUEST option). Many people have wrongly used this option to replace the entire request with their own, including multiple headers and POST contents. While that might work in many cases, it will cause libcurl to send invalid requests and it could possibly confuse the remote server badly. Use CURLOPT_POST and CUR- LOPT_POSTFIELDS to set POST data. Use CURLOPT_HTTPHEADER to replace or extend the set of headers sent by libcurl. Use CURLOPT_HTTP_VERSION to change HTTP version. -nathan -- Larry Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Larry Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe
[PHP] XML encoding variable simpleXML on Linux
I am using PHP on Linux to communicate with an XML peer. I pull and push documents from and to their server. On the console I use UTF-8 as far as I can tell. When I send these documents should my leading tag read: ?xml versionnn=1.0 encoding=UTF-8? or is the encoding done by PHP and how do I know what it is encoded to? TIA Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML encoding variable simpleXML on Linux
It is not that I want to generate the document in UTF-8. I just need to specify the correct encoding. My assumption that it was UTF-8 based on what my command line settings are is obviously incorrect. How can I tell what php is encoding in by default? Larry On Fri, 2008-02-22 at 17:20 +0100, Bojan Tesanovic wrote: encoding=UTF-8 doesn't guarantee that XML is encoded in UTF-8 its only purpose is to tell XML parser how to decode that XML document . it is responsibility of document creator to ensure that XML is proper UTF-8 document . on PHP side when creating XML there are number of functions to ensure UTF-8 strings though there are some issues in PHP5 , and one of the main features of upcoming PHP6 is to address UTF-8 Issues that current PHP has. some of UTF functions utf8_encode — Encodes an ISO-8859-1 string to UTF-8 string utf8_encode ( string $data ) On Feb 22, 2008, at 4:52 PM, Larry Brown wrote: I am using PHP on Linux to communicate with an XML peer. I pull and push documents from and to their server. On the console I use UTF-8 as far as I can tell. When I send these documents should my leading tag read: ?xml versionnn=1.0 encoding=UTF-8? or is the encoding done by PHP and how do I know what it is encoded to? TIA Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bojan Tesanovic http://www.classicio.com/ http://www.real-estates-sale.com/ -- Larry Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] accessing one object's attribute from another
Hi all, I've be developing with a structured approach for a long time and am working at improving my site by adding some classes etc. I however, am running into an odd thing that I can't figure out what a reasonable search syntax would yield the desired solution. The problem is as follows: class a { var $thisVar; ... } class b { function hello() { echo $first-thisVar; } } $first = new a(); $first-thisVar = world; $second = new b(); $second-hello(); There are a number of variables and methods that are common throughout the user's session that I'm storing in object $first. Class b has nothing in common with a except that it needs a couple of the variables stored in the object that is hanging around in the session. Is $first-thisVar the wrong way to reference that variable? How can I get to it? TIA, Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] accessing one object's attribute from another
On Mon, 2007-09-10 at 12:45 +1000, Chris wrote: Larry Brown wrote: Hi all, I've be developing with a structured approach for a long time and am working at improving my site by adding some classes etc. I however, am running into an odd thing that I can't figure out what a reasonable search syntax would yield the desired solution. The problem is as follows: class a { var $thisVar; ... } class b { function hello() { echo $first-thisVar; } } $first = new a(); $first-thisVar = world; $second = new b(); $second-hello(); There are a number of variables and methods that are common throughout the user's session that I'm storing in object $first. Class b has nothing in common with a except that it needs a couple of the variables stored in the object that is hanging around in the session. Is $first-thisVar the wrong way to reference that variable? How can I get to it? $first doesn't exist to $second - you need to make it so it knows what it is. class b { var $first; function __construct($first) { $this-first = $first; } function hello() { echo $this-first-thisVar; } } then you: $first = new a(); $second = new b($first); $second-hello(); -- Postgresql php tutorials http://www.designmagick.com/ Thanks Chris and Robert, these both should work fine and was just what I was looking for. Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] foreach loop changed after 4.3 - 4.4 upgrade
Yes, tested and verified. It was the accelerator. They have multiple binaries, one for each version of PHP. Matching the new binary to the new version of PHP solved this problem. Thanks again. Larry On Tue, 2005-08-23 at 20:35, Larry Brown wrote: Sorry, that last one went out without a comment. I think this is most likely the cause. I haven't dug back into it yet to verify, but it makes the most sense. Thanks everyone... Larry On Tue, 2005-08-23 at 05:30, Ford, Mike wrote: -Original Message- From: Larry Brown To: php Sent: 23/08/05 02:28 Subject: [PHP] foreach loop changed after 4.3 - 4.4 upgrade I had a foreach loop working on an array as such: $multiarray = array(array('person','person'),array('another','another')) the array was put through foreach($multiarray as $subArray){ do something with array } on each loop I would see $subArray= array([0] = 'person',[1] = 'person') and then $subArray= array([0] = 'another',[1] = 'another') In other cases person might have some other value in the [1] position. (it is being used in a function to create a select statement). After the upgrade from 4.3 to 4.4 though each iteration gives... array([0] = array([0] = 'person', [1] = 'person'),[1] = 0) and array([0] = array([0] = 'another', [1] = 'another'),[1] = 1) You have an out-of-date code optimizer insatalled -- install the latest version of whichever one you are using. This is a known incompatibility -- a quick search in the bugs database would have found multiple entries about it (see, for instance, http://bugs.php.net/bug.php?id=30914, http://bugs.php.net/bug.php?id=31194, and at least a couple of dozen others). Cheers! Mike To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] foreach loop changed after 4.3 - 4.4 upgrade
On Tue, 2005-08-23 at 05:30, Ford, Mike wrote: -Original Message- From: Larry Brown To: php Sent: 23/08/05 02:28 Subject: [PHP] foreach loop changed after 4.3 - 4.4 upgrade I had a foreach loop working on an array as such: $multiarray = array(array('person','person'),array('another','another')) the array was put through foreach($multiarray as $subArray){ do something with array } on each loop I would see $subArray= array([0] = 'person',[1] = 'person') and then $subArray= array([0] = 'another',[1] = 'another') In other cases person might have some other value in the [1] position. (it is being used in a function to create a select statement). After the upgrade from 4.3 to 4.4 though each iteration gives... array([0] = array([0] = 'person', [1] = 'person'),[1] = 0) and array([0] = array([0] = 'another', [1] = 'another'),[1] = 1) You have an out-of-date code optimizer insatalled -- install the latest version of whichever one you are using. This is a known incompatibility -- a quick search in the bugs database would have found multiple entries about it (see, for instance, http://bugs.php.net/bug.php?id=30914, http://bugs.php.net/bug.php?id=31194, and at least a couple of dozen others). Cheers! Mike To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] foreach loop changed after 4.3 - 4.4 upgrade
Sorry, that last one went out without a comment. I think this is most likely the cause. I haven't dug back into it yet to verify, but it makes the most sense. Thanks everyone... Larry On Tue, 2005-08-23 at 05:30, Ford, Mike wrote: -Original Message- From: Larry Brown To: php Sent: 23/08/05 02:28 Subject: [PHP] foreach loop changed after 4.3 - 4.4 upgrade I had a foreach loop working on an array as such: $multiarray = array(array('person','person'),array('another','another')) the array was put through foreach($multiarray as $subArray){ do something with array } on each loop I would see $subArray= array([0] = 'person',[1] = 'person') and then $subArray= array([0] = 'another',[1] = 'another') In other cases person might have some other value in the [1] position. (it is being used in a function to create a select statement). After the upgrade from 4.3 to 4.4 though each iteration gives... array([0] = array([0] = 'person', [1] = 'person'),[1] = 0) and array([0] = array([0] = 'another', [1] = 'another'),[1] = 1) You have an out-of-date code optimizer insatalled -- install the latest version of whichever one you are using. This is a known incompatibility -- a quick search in the bugs database would have found multiple entries about it (see, for instance, http://bugs.php.net/bug.php?id=30914, http://bugs.php.net/bug.php?id=31194, and at least a couple of dozen others). Cheers! Mike To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] foreach loop changed after 4.3 - 4.4 upgrade
I had a foreach loop working on an array as such: $multiarray = array(array('person','person'),array('another','another')) the array was put through foreach($multiarray as $subArray){ do something with array } on each loop I would see $subArray= array([0] = 'person',[1] = 'person') and then $subArray= array([0] = 'another',[1] = 'another') In other cases person might have some other value in the [1] position. (it is being used in a function to create a select statement). After the upgrade from 4.3 to 4.4 though each iteration gives... array([0] = array([0] = 'person', [1] = 'person'),[1] = 0) and array([0] = array([0] = 'another', [1] = 'another'),[1] = 1) I find it hard to believe that I must rewrite every foreach loop in my application to adjust to this. After all everything I've read states that the 4.4 release was just a bug and security fix release. Has anyone seen this behaviour? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] foreach loop changed after 4.3 - 4.4 upgrade
I found that the only way to get the function to behave is to add the key... foreach($multiarray as $key=$subArray) Now it displays as it previously did where $subArray is concerned. Is there something I'm missing here? Was I the only person not using keys? On Mon, 2005-08-22 at 21:28, Larry Brown wrote: I had a foreach loop working on an array as such: $multiarray = array(array('person','person'),array('another','another')) the array was put through foreach($multiarray as $subArray){ do something with array } on each loop I would see $subArray= array([0] = 'person',[1] = 'person') and then $subArray= array([0] = 'another',[1] = 'another') In other cases person might have some other value in the [1] position. (it is being used in a function to create a select statement). After the upgrade from 4.3 to 4.4 though each iteration gives... array([0] = array([0] = 'person', [1] = 'person'),[1] = 0) and array([0] = array([0] = 'another', [1] = 'another'),[1] = 1) I find it hard to believe that I must rewrite every foreach loop in my application to adjust to this. After all everything I've read states that the 4.4 release was just a bug and security fix release. Has anyone seen this behaviour? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[suspicious - maybe spam] [PHP] [suspicious - maybe spam] detecting a leading hyphen from post data
I know this is pretty petty, but it is a sunday and I'm missing this for some reason... I'm trying to detect a leading hyphen in an element of an array. I've been using strpos to find strings and if getting 1 as the result, I know it was at the beginning of the string. However, -, \-, nor /^-/ give me a hit? Could someone throw me a bone here? Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Printing invoices
I would highly recommend pdf. I use it for different reports. I use pdflib which my employer has gratiously afforded; however, I believe there is an open source version. I don't know how well it works, but pdflib creates some really attractive results. Larry. On Sun, 2004-06-20 at 19:33, Manuel Lemos wrote: Hello, On 06/20/2004 08:30 PM, Bskolb wrote: Could someone direct me to a printing solution from a static document that would render variable data elements to be sent to a printer queue? I was thing perhaps of an RTF for the static page, but can't seem to locate any way of inserting the variable data, then spit out each occurrance to a printer. If HTML would not do, how about sending in PDF as attachament? You may want to try this class that can either send HTML messages or messages with attachments: http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail() problem
Sounds like a problem for the maintainers of the spam blocking software? You can't correct the problem with the headers if you don't know what the spam software is objecting to. It may be objecting to the fact that the source is 127.0.0.1? -Original Message- From: Rick [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 02, 2004 8:35 PM To: [EMAIL PROTECTED] Subject: [PHP] mail() problem Hi All, Does anyone know a good format for sending email using the mail() function that doesnt get stopped by antispam software? I need to send and email from my sever when a new member creates an account, this ive done but my email gets binned straight away? must be the headers? Regards Rick -- 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] Simple preg I think
That works for me... $testVal = this is the ./command; if(preg_match(/\.\//i, $testVal)) { echo hello; } This printed hello, then I removed the slash and it did not match and did not print hello. Sounds like it is a logic problem, or the variable is not arriving as you expected. -Original Message- From: Dave Carrera [mailto:[EMAIL PROTECTED] Sent: Sunday, May 30, 2004 6:55 AM To: [EMAIL PROTECTED] Subject: [PHP] Simple preg I think Hi List, How do I match an accordance of ./ in a string (without the quotes) ? I have tried preg_match(/\.\//i, $str); Which I thought would work , as per the manual, but no joy. Any help or guidance is appreciated Thank you in advance Dave C --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.692 / Virus Database: 453 - Release Date: 28/05/2004 -- 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] array key starting with digit ending with string
I have an unusual situation where I have to communicate with an MS based soap server. They have named one of their variables with a name leading with a 1 such as 1variable. Nusoap loads the variable descriptions from the wsdl document and compares the variable names I am trying to send with the ones listed in the wsdl. In this process my sent to the function is something like $data = array('thisvar'=$myFirstVar,'thatvar'=$mySecondVar,'1othervar'=$myLastVar ). Later when the variable names are cycled through on a loop the following test is used... if($data[$currentVarNameInCycle]) { do something } Is there some way force the recognition of the key when it leads with a digit? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] session var puzzle
In the last pair of examples where it fails, you know you are first assigning the value of $Data['ID'] to the $_SESSION['CategoryID'] and the over-writing that value with the value of intval($Data['ID'])? Why are you assigning $Data['ID'] to it if you are going to overwrite it? If those other tests work then I doubt that it is a session problem. I'd double-check to make sure that $Data['ID'] is holding a reasonable value. -Original Message- From: Kathleen Ballard [mailto:[EMAIL PROTECTED] Sent: Sunday, April 18, 2004 6:46 PM To: [EMAIL PROTECTED] Subject: [PHP] session var puzzle Dear list, I am sorry for the second posting, but this is going to drive me to drink something other than lattes! I have one page, index.php. when it calls mod_sub, a directory type of page is printed. Here I am trying to set a session var of the most recently selected category to allow the user to return the to same place in the directory. when I do this: $_SESSION['CategoryID'] = 230; in mod_sub then in mod_profile: print($_SESSION['CategoryID']); will print 230 when I do this: $Tmp = 230; $_SESSION['CategoryID'] = $Tmp; in mod_sub in mod_profile: print($_SESSION['CategoryID']); will print 230 BUT, when I do this: $_SESSION['CategoryID'] = $Data['ID']; in mod_sub $_SESSION['CategoryID'] = intval($Data['ID']); in mod_profile: print($_SESSION['CategoryID']); will print '' and 0 I am setting several other session variables throughout the code without any unexpected behavior. I have even tried changing the index to something odd in case I am resetting 'CategoryID' somewhere and forgotten it. But no matter what I try, once I set it = $Data['ID'] I get the odd result. BTW, if I print $_SESSION['CategoryID'] from mod_sub right after setting, it holds the expected value. This is really frustrating, I must be missing something basic about the way session vars can be set. Kathleen -- 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] how to validate a domain
According to google there are several soap services that offer whois. It looks like a lot of them are old outdated links, however some still seem to exist. I'm not sure how anyone could ever profit from free soap services unless they gave the service for free for long enough to become the standard and then start to charge. I'm guessing that is why a lot of the older links no longer exist. http://wavendon.dsdata.co.uk/axis/services/WhoisData?wsdl responded to generate the schema. I don't know if they search all of the domain names or not either. Larry -Original Message- From: Vail, Warren [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 13, 2004 9:45 PM To: 'Elliot J. Balanza'; [EMAIL PROTECTED] Subject: RE: [PHP] how to validate a domain If you register as a domain name reseller, your registrar provider will usually provide you access to checking which domains that are available, sometimes beyond the usual .com/.net/.org/ etc. top level domain. you should be able to Google a list. I don't know of any that are free anymore. Warren Vail -Original Message- From: Elliot J. Balanza [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 13, 2004 7:21 PM To: [EMAIL PROTECTED] Subject: [PHP] how to validate a domain I used to use a socket to whois database to validate if a domain name is available or not. Now i can't do that cause whois requires different parameters does anyone knows how i can validate if a domain name is available or not true .php? Vamp -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] $HTTP_SESSION_VARS still holds original values even after unset?
Something else in your code is messing you up if you cannot change the value after setting it in the first place. This happens all the time in my code as my client makes decisions along the way. Try a small test creating a session variable, displaying it, changing it, and redisplaying it. If it does not show the change, post the test code so we might be able to tell why it fails. Provided you can change the variable, you should be able to create a loop that sets all the variables to or some base values etc. Larry -Original Message- From: Andy B [mailto:[EMAIL PROTECTED] Sent: Sunday, April 04, 2004 6:03 PM To: [EMAIL PROTECTED] Subject: [PHP] $HTTP_SESSION_VARS still holds original values even after unset? how would you empty all the contents of $HTTP_SESSION_VARS when you dont need them anymore but still keep the current session running? the problem seems to be that when i try to fill them with something else (dont need the original values anymore) but need new ones without destroying the session itself they wont fill with new things. unset($HTTP_SESSION_VARS); does nothing to help at all because they still have the same values that they were originally filled with (and not to mention they are still in the session)... anybody have any ideas how to delete or empty out the array but keep the session active ?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php as default value in html
When someone pulls up a form and fills it out, they subsequently submit that form. When submitting a form your browser creates a one on one connection with the server where the server inputs the data from your form before or after the next person without mixing the two. (no matter if the two submitted simultaneously it know who is who) -Original Message- From: Andy B [mailto:[EMAIL PROTECTED] Sent: Sunday, April 04, 2004 1:35 PM To: [EMAIL PROTECTED] Subject: [PHP] php as default value in html is there any way to keep multiple users using the same form from mixing up variables I have no idea what you mean here. if user #1 logs in and starts using a form and then user #2 logs in and starts using the same one as user #1, say by chance they submit it at the same time... is there any way to keep the forms from overwriting each other... -- 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] debug on build
Does anyone know what --enable-debug gives you when building php? Does this hinder normal operation of php or just take a small hit in performance to be able to render more debug information when needed? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Let's start a php-advanced list!
what do you guys think of using a tag for discussion messages? This way people that don't want to weed out lengthy discussions and attachments etc can filter them out of list messages. A tag such as discussion in the subject line? Just my two cents. Larry -Original Message- From: Marc Greenstock [mailto:[EMAIL PROTECTED] Sent: Saturday, March 06, 2004 7:57 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Let's start a php-advanced list! Interesting topic, However I don't necessarily agree that newbie's wont get their question answered. There are a lot of helpfully people out there, a lot of them are advanced in their programing but find the satisfaction of helping, or mentoring someone into advanced programming who is less advanced. I know that when i started I posted messages at phpbuilder in the newbie area. I found more often than not I would get a response from someone who cared, and would treat a newbie for what he or she is rather than a just a plain old idiot. My point is; yes advanced users would be separated from beginners, but most of the questions asked in the beginners list would be answered by advanced programmers looking for a bit of 'fuzzy wazzies' :) Two thumbs up for the idea. Marc Ryan A wrote: This has come up many times before and I really don't think it will work. Splitting advanced users from beginners means that there will be nobody to answer the beginner questions which means they will get posted to the advanced list where the people with the answers are. It is a self-defeating separation. Having everyone in one big lump means that both camps and all the camps in between learn from each other. The other question is who decides what is advanced? Chances are what you think is advanced may seem trivial to me, or vice-versa. -Rasmus True, When I started learning PHP one of the guys who answered most of the questions for me and a lot of people was Capt John Holmes, now that dude knows a load of php (I mean that as a complement). If there was an advanced list he would probably be in it and very unlikely that he would also be in the newbie list to help which would have made my learning curve that much harder. Some other guys who are really helpful and advanced are Jason, Chris, Chris, David to name a few..take all of them out and put them in the advanced list...and the newbies, not-so-newbies etc will follow just coz we have no choice when we run into problems. If only newbies and average knowledge dudes are in the not advance list it wont work coz the blind leading the blind does not work. My $0.2 Cheers, -Ryan -- 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] Re: RFC: Job listings
I don't see how it could be to anyone's disadvantage. As a matter of fact, I think that it would be great to also have it available as a soap service as well. If people well versed in different open source projects were able to be listed on each projects' sites and provide soap service as well, anyone could create an all-encompassing list of open source tallent at any one place on the web and pull from all of the resources. Sounds great for the unemployed and the employers. -Original Message- From: Ben Ramsey [mailto:[EMAIL PROTECTED] Sent: Sunday, March 07, 2004 8:05 PM To: [EMAIL PROTECTED]; Anders Hellström Subject: [PHP] Re: RFC: Job listings Anders, I think this really depends on how we get the word out to employers about this service. I, for one, hope to use the new Atlanta PHP (http://www.atlphp.org) group as a resource not only to educate and network PHP developers, but as a way to bring knowledge of PHP to the business world in the southeastern US. I think that local user groups worldwide will need to take part in promoting such a thing to the local business owners. -Ben Anders Hellström wrote: Hi, I'm one of the volunteers working on PHPCommunity.org. There's been some talk about having a Job Listings section on the site, something along the lines of jobs.perl.org, and We're wondering how much interest there is in such a service. I'm sure all the unemployed PHP developers on the list would like it, if companies actually used it. So the biggest question is probably if companies looking to hire PHP developers would use it. I would really appreciate it if you could reply to this message, off-list, if you're interested in this or have anything to say on the topic. Please mention in what way you're interested, if you're in a position to hire people, looking for work, etc. Anything you feel is relevant. All comments are welcome, both positive and negative. I can be reached at [EMAIL PROTECTED] Looking forward to reading your comments! Thanks in advance, -- Regards, Ben Ramsey http://benramsey.com http://www.phpcommunity.org/wiki/People/BenRamsey -- 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] scope problem
Apparently I'm having some kind of meltdown here. Can anyone explain the logic behind why the following variable has the original value and how I can pull/push the value to access it at the end? while loop { $variable = 100; while loop { switch($othervar) { case 1: $variable = $variable + 100; break; case 2: $variable = $variable + 200; break; case 3: $variable = $variable + 300; break; } echo $variable.br; } echo brThe final value is .$variable.br; } This gives values something to the tune of... 200 400 700 100 I usually have variables set outside of a while loop that increment based on the contents of the loop and I could swear that they hold the value on the other side of the loop. I don't usually use break; in my scripts unless I'm using switch. However, I would think that if using break was throwing me, that the value wouldn't print on each cycle of the loop. TIA Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] scope problem
Thanks for the help, but it turned out to be the nut on top of the keyboard! Something I missed. Good to know my concept of scope with php is still healthy (at least). Thanks -Original Message- From: Richard Davey [mailto:[EMAIL PROTECTED] Sent: Friday, March 05, 2004 11:17 AM To: PHP List Subject: Re: [PHP] scope problem Hello Larry, Friday, March 5, 2004, 4:01:39 PM, you wrote: LB This gives values something to the tune of... LB 200 LB 400 LB 700 LB 100 Hard to say with so little code, but... Your first where loop is probably running twice, i.e. resetting variable back to 100 after the 2nd (internal) where loop has finished modifying it. Move $variable = 100 above the first where loop and see what happens. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- 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] [Q] Problems invoking a PHP script - Have no hair left to pull - Please help [:-)
is the html code you have listed below the file register_new_member.php? Is it in the same directory as the previously successful script? -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Michael T. Peterson Sent: Tuesday, February 10, 2004 9:48 PM To: [EMAIL PROTECTED] Subject: [PHP] [Q] Problems invoking a PHP script - Have no hair left to pull - Please help [:-) I have a registration form which collects some data then, when the user clicks the submit button sends the data to a second page (a PHP script). The problem I'm having is getting my webserver (apache) to invoke the PHP scrip to process the data. What's so baffling about this is that I've already written another, similar facility ( a login form which sends user supplied info to php script for authentication). The login app works great. The registration app doesn't even tho' the registration app is semantically and syntactally identical to the login app. I think what's happening is I'm missing something really simple. Does anyone have any suggestions as to what I need to be looking for? I've been at this for about 5 hours now and am going crazy looking at this [very simple] code. Finally, in my php.ini file display_errors is set to ON (But no errors are displayed or written to error log). Here's the form code fragment in the file member_registration_form.html: ... form name=member_registration_form method=post action=register_new_member.php ... And here's the preamble and the PHP block in the file, register_new_member.php: html head titleNew member registration/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body hr h1Registration Results/h1 hr ?php print( Hello world.);// This doesn't get executed. ? /body /html Again, no are any errors displayed or logged. Any help would be greatly appreciated. Cheers, Michael -- 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] SQL help
Correct me if I'm wrong...PLEASE.. but, I believe you are looking for... SELECT * FROM user_data left join image_data on user_data.User_ID=image_data.User_ID where image_data.Default_Img = 'Yes' GROUP BY user_data.User_ID I haven't used enum('Yes','No') so I'm taking your word for the fact that you are restricting your selection to values of 'Yes' works as anticipated. As long as there is a one to one relationship on user id I believe the left join works for this. Larry -Original Message- From: Marc Greenstock [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 10, 2004 9:53 PM To: [EMAIL PROTECTED] Subject: [PHP] SQL help Hi all here's my problem, I have two tables: 'user_data' and 'image_data' obviously user_data has all the user information and image_data has all the image information in image_data are the fields: Image_ID int(11), User_ID int(11) and Default_Img enum('Yes','No'). Users can have as many images as they like, but it is optional. I want to select from user_data and image_data and get the results based upon the rest of the query. The problem is my sql is only pulling out the users with images and ignoring the rest my sql looks like this: SELECT * FROM user_data, image_data WHERE user_data.User_ID = image_data.User_ID AND image_data.Default_Img = 'Yes' GROUP BY user_data.User_ID thanks for your help. -- 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] check if user session exists
I don't know of a function, but you could possibly read the directory where the SID files are stored. I use sessions a lot; however, I've not tried to accomplish this. I don't know if by default you can read the SID directory from a script or if this is blocked for security reasons or not. If not, you could read the directory, match the SIDs from your list and go from there. There is no way of knowing if the person is still actively using the SID this way though. Larry. -Original Message- From: Christian Calloway [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 9:28 AM To: [EMAIL PROTECTED] Subject: [PHP] check if user session exists Given a set of session id's, is it possible to query whether a given session exists. I am not talking about the current user session, instead I am referring to any and all possible user sessions currently in play. For example: if (session_exists($sessionId)) doSomething(); I've been looking very hard for this one and haven't found an answer at all. Any ideas? -- 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] Session troubles
I know I may be displaying severe ignorance, but I have to ask... What do you mean by this page also uses paging? What is paging? Larry -Original Message- From: DL [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 03, 2004 4:20 PM To: [EMAIL PROTECTED] Subject: [PHP] Session troubles Hi all, I am using PHP v4.12, and here is the scenario. I have one page, index.php with a form that has a searchfield (dropdown) and searchcriteria (textbox). When submitted I want to populate two session variables with the form values of searchfield and searchcriteria. This page also uses paging, and whenever I click next, my session variables seem to die. I have globals turned on. So basically, we the page initially loads I display all the results from a db query. Paging works fine. If someone submits the form, I want to populate two session variables and build a new sql statment based on the user input. Clickling next or previous should retain the same search results until the user submits the form again or those session variables expire. Help please. Cheers, David -- 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] Seems Simple enough
you need one of the to if's to be either $Balance =1 elseif($Balance 1000) or $Balance 1 elseif($Balance = 1). Yours has the first saying everything equal to or greater than 10001 which 1 is not else everything less than or equal to which 1 is not. =) Larry -Original Message- From: Christopher J. Crane [mailto:[EMAIL PROTECTED] Sent: Monday, January 26, 2004 11:29 AM To: [EMAIL PROTECTED] Subject: [PHP] Seems Simple enough I have these lines of code, that I thought was simple enough, but it doesn't work how I thought. The Variable $Balance is set to 1 in the database, and I thought it would be outputed as purple or the be found true of the else part of the code. It comes out as red or the elseif part of the code. if($Balance = 10001) { echo font color=\green\\$$Balance/fontbr\n; } elseif($Balance = ) { echo font color=\red\\$$Balance/fontbr\n; } else { echo font color=\purple\\$$Balance/fontbr\n; } I originally had it as follows, but that didn't work either. if($Balance 1) { echo font color=\green\\$$Balance/fontbr\n; } elseif($Balance 1) { echo font color=\red\\$$Balance/fontbr\n; } else { echo font color=\purple\\$$Balance/fontbr\n; } -- 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] Variables not working!
It is most likely globals. Access the variables by... echo $_GET['fname']; or $_POST['fname']; if you are using post which it doesn't appear you do. Larry PS it is adviseable to leave globals alone in php.ini since it is set that way for security concerns. -Original Message- From: Kaushan [mailto:[EMAIL PROTECTED] Sent: Monday, January 19, 2004 10:44 AM To: [EMAIL PROTECTED] Subject: [PHP] Variables not working! Hi, I am new to PHP scripting and struggling with the following problem. I have two files, an HTML file and a PHP file. HTML file contains a form with one text field and a submit button. When a user pressed the submit button, it calls the php file (form action=test.php ...). What the php file does is just echo back the text received from html file to the user again. Name of the text field is 'fname'. When I used this variable in the php file (as $fname) it does not contain the value of the text field. Query-string appended to the url during the submission is also correct. I checked for all syntax errors, but the codings are perfect. Do I have to change php.ini file to fix this problem. Could anyone can help me to solve this problem. Kaushan -- 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] Is this possible ?
Toby's solution still holds in this scenario. Actually exactly has you have rem'ed out. You get back two components to the array, first array[0] holds the concatenated string you made with the while loop and the second array[1] holds the total number of result rows from your query. Larry -Original Message- From: Dave Carrera [mailto:[EMAIL PROTECTED] Sent: Sunday, January 18, 2004 6:11 AM To: 'Toby Irmer' Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Is this possible ? Thanks Toby, But I forgot to mention something that makes retuning an array not usable in the context of my needs. ? Function MyFunc() { if(isset($_POST[var])){ $sql = mysql_query(select * from table_name where field=\$_POST[var]\); $num = mysql_num_rows($sql); // I want to use this result outside this function in another function elsewhere. While($rows = mysql_fetch_array($sql){ $returnsomething .=blah blah; } } return $returnsomething; // return array($returnsomething, $num); // your suggested answer } // list($text, $numrows) = MyFunc(); // Your suggested answer ? As you can see with my ammeded example I am already returning and array. I thought I could cast the result $num into the $GLOBAL array for use later but that dose not seem to work or be do able. I could relicate the function and call it something else say MyFunc2() but that seems a waste of code and mysql connection load when I am already retrieving the var I want to use. Any further ideas are appreciated. Dave C -Original Message- From: Toby Irmer [mailto:[EMAIL PROTECTED] Sent: 18 January 2004 10:29 To: Dave Carrera; [EMAIL PROTECTED] Subject: Re: [PHP] Is this possible ? One way: ? Function MyFunc() { if(isset($_POST[var])){ $sql = mysql_query(select * from table_name where field=\$_POST[var]\); $num = mysql_num_rows($sql); // I want to use this result outside this function. $returnsomething =blah blah; } return array($returnsomething, $num); } list($text, $numrows) = MyFunc(); ? hth toby - Original Message - From: Dave Carrera [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, January 18, 2004 11:22 AM Subject: [PHP] Is this possible ? Hi List, I have a function that makes a call to mysql based on certain vars. ---example Function MyFunc(){ if(isset($_POST[var])){ $sql = mysql_query(select * from table_name where field=\$_POST[var]\ ); $returnsomething =blah blah; } return $returnsomething; } And that all works fine no probs here but. I want to use a result somewhere in my script that is not returned by return. Let me show you... ---example Function MyFunc(){ if(isset($_POST[var])){ $sql = mysql_query(select * from table_name where field=\$_POST[var]\ ); $num = mysql_num_rows($sql); // I want to use this result outside this function. $returnsomething =blah blah; } return $returnsomething; } So $num contains a number that I want to use outside the function which is not covered by return. I know return stops a script and returns what I want it to return but how do I send out of the function the var I want. I have tried $GLOBAL[var]=$num; but that dont work, but I thought I would'nt anyway just tried it and yes I know I have to declare it inside my new function using global $var; to use it. So I ask is this achiveable or how can I do this. Thank you in advance Dave C --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004 -- 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] Image Header Issues
try adding showpicture.php?pid=111384img=x.jpg to the end even though you aren't using that variable, IE may see that the type is jpg here. I have this same problem/workaround in place right now for a script that wouldn't work with IE without it for downloading pdf. (pdf was generated on the fly) -Original Message- From: Bob Eldred [mailto:[EMAIL PROTECTED] Sent: Saturday, January 17, 2004 12:00 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Image Header Issues Again, it is *not* that known issue. That's the very first thing I checked. If that were the issue, jpgs from other sources would also not save properly. But they do, as I've stated several times. Thanks, though. Bob - Original Message - From: Brian V Bonini [EMAIL PROTECTED] To: Bob Eldred [EMAIL PROTECTED] Cc: PHP Lists [EMAIL PROTECTED] Sent: Saturday, January 17, 2004 7:28 AM Subject: Re: [PHP] Image Header Issues This is a known issue with IE. And it is in their knowledge base. If I recall the fix is to clear the cache, cookies, and broken/corrupt objects. -- 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] Image Header Issues
Since putting .jpg solved the problem for me, I'm ok with that work around, but you're right. I'm using session_start() on all of my scripts. That's also good to know that it doesn't fail without that function so I have a better idea of where to look, the next time I have header problems. Thanks Larry -Original Message- From: Toby Irmer [mailto:[EMAIL PROTECTED] Sent: Saturday, January 17, 2004 5:12 PM To: Larry Brown; Bob Eldred; PHP List Subject: Re: [PHP] Image Header Issues I have the same problem. Strange: I have a session_start(); before the header... if I take that out, the image will download as a JPG... so maybe if you find a way to do things in this script without starting the session first... toby - Original Message - From: Larry Brown [EMAIL PROTECTED] To: Bob Eldred [EMAIL PROTECTED]; PHP List [EMAIL PROTECTED] Sent: Saturday, January 17, 2004 6:32 PM Subject: RE: [PHP] Image Header Issues try adding showpicture.php?pid=111384img=x.jpg to the end even though you aren't using that variable, IE may see that the type is jpg here. I have this same problem/workaround in place right now for a script that wouldn't work with IE without it for downloading pdf. (pdf was generated on the fly) -Original Message- From: Bob Eldred [mailto:[EMAIL PROTECTED] Sent: Saturday, January 17, 2004 12:00 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Image Header Issues Again, it is *not* that known issue. That's the very first thing I checked. If that were the issue, jpgs from other sources would also not save properly. But they do, as I've stated several times. Thanks, though. Bob - Original Message - From: Brian V Bonini [EMAIL PROTECTED] To: Bob Eldred [EMAIL PROTECTED] Cc: PHP Lists [EMAIL PROTECTED] Sent: Saturday, January 17, 2004 7:28 AM Subject: Re: [PHP] Image Header Issues This is a known issue with IE. And it is in their knowledge base. If I recall the fix is to clear the cache, cookies, and broken/corrupt objects. -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Image Header Issues
Giving up sessions for one simple issue sounds a bit drastic. I'll dig up the header information I'm sending that the x.pdf addition helped me with and send them to you if you'd like. I can't see anything as strong/secure as sessions to manage authentication as well as a dozen other performance benefits. Larry. -Original Message- From: Bob Eldred [mailto:[EMAIL PROTECTED] Sent: Saturday, January 17, 2004 11:30 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Image Header Issues OK, that's it. The session_start() is the issue. Unfortunately, the img=x.jpg didn't help. Now I've got to figure out some sorta security without using sessions. Thanks, for at least pointing me in the right direction. Now if we could figure out why this would be happening, that would be great. Bob - Original Message - From: Toby Irmer [EMAIL PROTECTED] To: Larry Brown [EMAIL PROTECTED]; Bob Eldred [EMAIL PROTECTED]; PHP List [EMAIL PROTECTED] Sent: Saturday, January 17, 2004 2:11 PM Subject: Re: [PHP] Image Header Issues I have the same problem. Strange: I have a session_start(); before the header... if I take that out, the image will download as a JPG... so maybe if you find a way to do things in this script without starting the session first... toby - Original Message - From: Larry Brown [EMAIL PROTECTED] To: Bob Eldred [EMAIL PROTECTED]; PHP List [EMAIL PROTECTED] Sent: Saturday, January 17, 2004 6:32 PM Subject: RE: [PHP] Image Header Issues try adding showpicture.php?pid=111384img=x.jpg to the end even though you aren't using that variable, IE may see that the type is jpg here. I have this same problem/workaround in place right now for a script that wouldn't work with IE without it for downloading pdf. (pdf was generated on the fly) -Original Message- From: Bob Eldred [mailto:[EMAIL PROTECTED] Sent: Saturday, January 17, 2004 12:00 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Image Header Issues Again, it is *not* that known issue. That's the very first thing I checked. If that were the issue, jpgs from other sources would also not save properly. But they do, as I've stated several times. Thanks, though. Bob - Original Message - From: Brian V Bonini [EMAIL PROTECTED] To: Bob Eldred [EMAIL PROTECTED] Cc: PHP Lists [EMAIL PROTECTED] Sent: Saturday, January 17, 2004 7:28 AM Subject: Re: [PHP] Image Header Issues This is a known issue with IE. And it is in their knowledge base. If I recall the fix is to clear the cache, cookies, and broken/corrupt objects. -- 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 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] Re: Session expiry issues in IE, still.
Interesting point. After all, to remove a cookie you simply give it an expire time in the past. However, it should only explain the lack of cookie receipt. Since the user is able to surf for a period of time on the site before getting the boot, I wouldn't think it would apply. In the last post it sounded like it is not at 5 min but rather expiring very speradically. I bet there is a particular page that is killing them. Perhaps one of the re-writes or something. I would take IE and start traversing the site to see if you can't localize it to one area when it happens.(or more in particular where you just came from when it dropped). Larry PS if you have a dev site to work on, and the session checks are in a header, try changing the header to display the session ID and watch it for a change while you surf it. -Original Message- From: Matthew Weier O'Phinney [mailto:[EMAIL PROTECTED] Sent: Monday, January 05, 2004 9:08 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: Session expiry issues in IE, still. * Tarrant Costelloe [EMAIL PROTECTED]: I wrote to the list a couple of days ago about issues Planet-Tolkien.com members were experiencing with Internet Explorer, where their PHP based $_SESSION seemed to be expiring very speradically, where as Mozilla and Opera browsers this issue was not occuring and they would stay logged-in. It would appear this is a bit of a lost subject and little is known as to why this might be happening on the list. Something I read in the past week while investigating session issues of my own is that you can run into problems using cookie-based sessions with IE if your server's clock is behind the client machine's clock -- IE is particularly sensitive to this particular situation, and expires the cookies -- which leaves the person using IE without a session. -- Matthew Weier O'Phinney Webmaster and IT Specialist National Gardening Association 802-863-5251 x156 mailto:[EMAIL PROTECTED] http://www.garden.org http://www.kidsgardening.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
RE: [PHP] Submit Button Refresh Problem?
we need more code than ? makeArrays(); ?... By the looks of that alone, it appears that you have that inserted into the html somewhere around the submit button. If that is the case, the function will run every time you load the page. You have to set a trigger to determine whether it should run or not. For instance, the form in which the submit button is in can have a variable such as input type=hidden name=executeRand value=1 so that when you hit submit, that value is sent to the target of the form, (which I take it is this same page). The code around the function in php could be... if($executeRand == 1){ makeArrays(); } You'll need a second form around your other submit along with a variable for it to send etc. Hope that helps Larry -Original Message- From: wknit [mailto:[EMAIL PROTECTED] Sent: Monday, January 05, 2004 8:22 AM To: [EMAIL PROTECTED] Subject: [PHP] Submit Button Refresh Problem? I have a php file that contains all the functions that I run on the page that is displayed, self-contained. The main function is ? makeArrays(); ? I am invoking that function with a Submit button OnClick event. Whenever I click the button, the page refreshes and the function runs just fine displaying a dynamically generated random sequence of numbers. The problem is the page refresh itself. When the page first loads the function runs and it shouldn't, the display should be blank until the button is clicked. This is a problem because I have another button that will be coded to write the data generated to a database, at present that function is empty, however when I click that button the page refreshes again and the number data changes. How do I keep the page from refreshing on load and apparently self clicking the form button, and how do I keep the page from refreshing and running the 'makearrays' function when I click the 'writedata' function? When the 'writedata' function is invoked from a button click only that function should be called and the data from the previous page should be returned to the page again (same).. i.e. the random number sequence does not change. Thanks! -- 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] PHP, Server-Side?
You can create a soap server. I have one set up, the client side runs a function which is translated into xml sent to the other server (in my case over ssl) the other server translates to php, executes the function and returns the results. You create the actual code for the function on the server and give the client details on what the function does and what data it requires. If you build both it is very easy. The client has no other options but to run the function name while supplying the data. ex. server... function pullLatestReport($login,$password,$howfarback) { check db for authentication... if auth correct to run this function run do queries nec. for request return result. else return error } As you can see the server has total control over what gets executed, soap is designed to be platform independant. .net, java etc. can be used as the client. Of course that is only a added benefit since you are making both ends. I use nusoap which is all php and isn't too hard to figure out. Larry. -Original Message- From: Tarrant Costelloe [mailto:[EMAIL PROTECTED] Sent: Sunday, January 04, 2004 11:31 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP, Server-Side? php-general, I was wondering if it is possible with PHP to create a snippet of code which could execute on one server but be stored of a different server? Basic premise is to sell a product written in PHP which people could include on their site but not be able to edit or see the code, maybe by using some kind of include(), url() or snippet method? In Fellowship, Tarrant -- 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] PHP Accelerator Support?
I use the accelerator, but I don't have a lot of users. I use it to protect confidential information in the event the web server screws up and starts displaying my scripts instead of parsing them etc. It works smooth as silk for me though. I just can't tell you anything about high volume performance. Larry -Original Message- From: mastershay [mailto:[EMAIL PROTECTED] Sent: Sunday, January 04, 2004 7:05 PM To: [EMAIL PROTECTED] Subject: [PHP] PHP Accelerator Support? Hello, I have spent hours searching the web for any kind of support regarding Ioncube's PHP Accelerator. We are interested in using it in conjuction with some Cyrus servers and Squirrel Mail, but cannot seem to find any kind of support whatsoever. The number of users is planned to be in the thousands, so any kind of help would be much appreciated. Thanks. -- 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] PHP $_SESSION Expiring in IE
I use sessions with IE all the time without such a problem. Are there any points in the program that redirect the user off site and back or something with that affect that IE might be handling in a wierd way? Do you have pages that detect the browser and feed alternate content based on the browser? If so do you always run the session_start before these checks? -Original Message- From: Tarrant Costelloe [mailto:[EMAIL PROTECTED] Sent: Saturday, January 03, 2004 10:27 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP $_SESSION Expiring in IE Hello, I have recently launched the new Planet-Tolkien.com, one would think that writing a message board from scratch and a dynamic weather system, a simple session login would be the least of my problems right? Wrong. It would appear that for Mozilla and Opera keep a $_SESSION is not an issue and the $_SESSION is continued until the member logs out. However when members are using Internet Explorer browser (most versions it seems), they can go around the site for varied amounts of time, usually less than five minutes and then their $_SESSION will expire!!?? I cannot for the life of me figure out why a server side $_SESSION would expire on IE but not for MOZ or Opera but it is, and I need to figure out why and how can I fix this. REF. All login information is saved as such: session_save_path($path/sessions); session_start(); $_SESSION['session_memberID']=$session_memberID; $_SESSION['session_username']=$session_username; $_SESSION['session_groupID']=$membergroup; In Fellowship, Tarrant -- 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] No cookie is being set?
shouldn't $row[member_id] be $row['member_id']. In case anyone can profit from this, when I find a function doesn't work right and I am using variables in its execution I run an echo/die combination immediately before the function to verify the data being fed to it is as it should be. In this example... ... $id = $_SESSION[user]; echo setcookie(\memberlogin\, .$id., .time() +60*60*24*365.);; die(); setcookie... What does this yeild? -Original Message- From: Cesar Aracena [mailto:[EMAIL PROTECTED] Sent: Friday, January 02, 2004 2:28 AM To: [EMAIL PROTECTED] Subject: [PHP] No cookie is being set? Hi again, I have the following code to first start a session and then write a cookie... is that so hard? Well it is starting the session but the cookie is not being set. see: $row = mysql_fetch_array($result); $_SESSION[user] = $row[member_id]; if ($_POST[autologin] == yes) { $id = $_SESSION[user]; setcookie(memberlogin, $id, time()+60*60*24*365); header(Location: $CFG-wwwroot); exit(); } else { header(Location: $CFG-wwwroot); exit(); } What can it be? No error is posted. Thanks in advanced, Cesar Aracena -- 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] Array into $_SESSION
session_register(user); session_register(authLevel); session_register(sessionExpire); $user=$userDataFromForm; $authLevel = $authLevelFromDB; $sessionExpire = time() + 3600; etc... -Original Message- From: Cesar Aracena [mailto:[EMAIL PROTECTED] Sent: Friday, January 02, 2004 2:11 AM To: [EMAIL PROTECTED] Subject: [PHP] Array into $_SESSION Hi all, can somebody remind me how to propperly insert not just one but many variables into a $_SESSION handle? php manual doesn't explain it very well. It just says that it can be done. Thanks in advanced, Cesar Aracena -- 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] Array into $_SESSION
Sorry, my bad. This is the Register Globals on version... with RegisterGlobals off you would simply use.. $_SESSION['user'] = $userDataFromForm; $_SESSION['authLevel'] -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: Friday, January 02, 2004 11:33 AM To: Cesar Aracena; PHP List Subject: RE: [PHP] Array into $_SESSION session_register(user); session_register(authLevel); session_register(sessionExpire); $user=$userDataFromForm; $authLevel = $authLevelFromDB; $sessionExpire = time() + 3600; etc... -Original Message- From: Cesar Aracena [mailto:[EMAIL PROTECTED] Sent: Friday, January 02, 2004 2:11 AM To: [EMAIL PROTECTED] Subject: [PHP] Array into $_SESSION Hi all, can somebody remind me how to propperly insert not just one but many variables into a $_SESSION handle? php manual doesn't explain it very well. It just says that it can be done. Thanks in advanced, Cesar Aracena -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] urlencoding.
How about this one? Add it to an include for the site and use it whenever you have an error check. function goBack($newSite,$errMsg) { $send = ; foreach($_GET as $key=$value) { $send = $send..$key.=.$value; } $goTo = urlencode($newSite.?errMsg=.$errMsg.$send); header(Location: $goTo); die(); } if(there is a problem with the data) { $errorMessage = some error; goBack($HTTP_REFERER,$errorMessage); } I'd have to test the $HTTP_REFERER part, but I don't see why it wouldn't work. I like the die() in there so I can just use an if statement at the beginning without having to indent the rest of the script. Especially if you have a lot of error checks. -Original Message- From: Chris W [mailto:[EMAIL PROTECTED] Sent: Monday, December 29, 2003 12:02 PM To: [EMAIL PROTECTED] Subject: [PHP] urlencoding. Let me give a quick background. I am a very experienced programmer but I haven't done much php and only a little web development in perl. I am now creating a web site with Apache, php and MySQL. I am having the user fill out a form and then save the data in MySQL. Before I save the data I do a few checks and if there is a problem I do a redirect back to the form and send all the data back so they don't have to fill out the whole form again. Here is some sample code I use to build my redirect url $UserID = $_POST['UserID']; $Password1 = $_POST['Password1']; $Password2 = $_POST['Password2']; $Email = $_POST['Email']; $FName = $_POST['FName']; $LName = $_POST['LName']; do checking of data here. if(there is a problem with the data){ $ErrorMsg = some error; $redirectStr = $httpHost/CreateAccount.php?; $redirectStr .= UserID= . urlencode(stripslashes($UserID)); $redirectStr .= Password= . urlencode(stripslashes($Password)); $redirectStr .= Email= . urlencode(stripslashes($Email)); $redirectStr .= FName= . urlencode(stripslashes($FName)); $redirectStr .= LName= . urlencode(stripslashes($LName)); $redirectStr .= ErrorMsg= . urlencode($ErrorMsg); header(Location: $redirectStr); exit; } My problem is that any field that contains a double quote, all data after the first double quote is missing from the form field. When I look at the long URL I do see a %22 where the are supposed to be, and all other data is there too. Any Ideas? If there is a better way to do this feel free to suggest a change in my whole method here. Just as a note validation of the UserID has to be done on the server side, to check for duplicates in the MySQL db. I would also welcome insight on standard techniques to make sure the user isn't trying to break the code by sending bogus data. I am already checking that the data isn't longer than I am expecting. Chris W -- 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] Setting a 'life-time' clock to a displayed information
The timer on the client browser would have to be done in some client-side language. On the server side you can place any order information that is out with a supplier in a db field along with the time it was pulled. When the next supplier submits a request, the db is parsed for pending jobs whose time has gone over the 30 minutes. If it has, then provide the same information to this supplier and update the record to show who it is out with. If there are none that have gone over the 30 then generate a new set for this supplier and record the time it was provided and the supplier it was given to. When the supplier publishes the completed information, check to make sure it was in time, if it was in time remove the entry from the db so that it isn't given back out. If it is too late you can generate an error page and start back over if he still wants to try. Note there may be some additional steps necessary to make sure that two suppliers aren't trying get an expired entry at the same instance where there is a fraction of a second between checking the time on the record and taking the record where both check the time and take the same record. You will probably have to use locking on the db to avoid this. Larry -Original Message- From: ike strong [mailto:[EMAIL PROTECTED] Sent: Thursday, January 01, 2004 9:44 AM To: [EMAIL PROTECTED] Subject: [PHP] Setting a 'life-time' clock to a displayed information Hi all, I'm interested in finding out a way to set a time limit to a displayed information - i.e. the displayed information will sieze to appear to a viewer's browser once a set time period is reached. What I'm trying to achieve is a situation whereby a certain 'info' (like an order!) would only appear to a target viewer (like a supplier!) for example (say) 30 minutes and if that viewer did not react within the set time, the information will sieze to appear to his/her browser so that the same information could be forwarded to the next viewer (supplier)on the list. The setting of time approach is to avoid having two people working on the same information at the same time. I'd really appreciate any hint/help Thanks in advance Ike __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.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] PHP New Year
Happy New year all! Looking forward to bigger better things this year. Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How do I protect downloadable files?
You could have your authorization info in the mysql db including file locations that are stored along with the authorization level necessary to download them. If the person is authenticated to download the file, the php script uses the file location info from the db to open the file and generate the headers necessary to start the download. This way the end user never has to have direct access to the download directory and you don't have to copy the file into a temporary directory. Larry -Original Message- From: news.php.net [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 30, 2003 2:13 PM To: [EMAIL PROTECTED] Subject: [PHP] How do I protect downloadable files? Hello, I have wrtten a PHP based web site with a MySql backend and now I want to password protect downloadable files. I have logon and session handling taken care of but I can't figure out how to only allowed those who are currently logged in and above a certain security level to access the downloadable content and prevent bookmarking of the file location for redownloading. Currently I have a .htaccess file to protect the files but then you need to enter a User ID and password a second time. I would prefer a single signon solution. I have considered copying the files to a temporary area each time someone wants to download it and then erase it when the session is killed but these files can be large (20-100 mb) and I would rather not do all of that copying if possible. Creating unique symlinks would be easier but my development machine is Windows and my server is FreeBSD and I can't create file links under Windows. Plus, my FreeBSD server is not near me so remote development is difficult. Thanks to anyone with any ideas, Andrew -- 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] How do I protect downloadable files?
Time for them to upgrade to OSX... I've not tried to crack that nut. Is there anyone here who has successfully managed headers for Mac users? It's hard to believe it hasn't been done. -Original Message- From: Kim Steinhaug [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 30, 2003 8:04 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] How do I protect downloadable files? However I forgot to mention, all theese header tricks are real swell indeed, but you should get hold of a friend on a macintosh. The method I use doesnt work on the macintosh, so for the mac users we just serve the files as is, meaning they accually dont get protected... The other methods aswell should be tested on macintosh systems just to be sure. -- Kim Steinhaug --- There are 10 types of people when it comes to binary numbers: those who understand them, and those who don't. --- Kim Steinhaug [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I would go for the 3rd alternative. There are several ways to stream the file with the use of headers. This way you can validate the user securely with your logon system, and you can place the files outside the viewable web content. Typically oputside your www / public_html folder. I use this myself in an application I use, streaming files at 50MB does not use alot of resources at all, atleast not the way I use. My use for the script is to serve high resolution images to several customers, often TIF images up to 50MB and larger. Heres the code I use : $distribution= filepathonserver; if ($fd = fopen ($distribution, r)){ $size=filesize($distribution); $fname = basename ($distribution); header(Pragma: ); header(Cache-Control: ); header(Content-type: application/octet-stream); header(Content-Disposition: attachment; filename=\.$fname.\); header(Content-length: $size); while(!feof($fd)) { $buffer = fread($fd, 2048); print $buffer; } fclose ($fd); exit; } -- Kim Steinhaug --- There are 10 types of people when it comes to binary numbers: those who understand them, and those who don't. --- Apz [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Tue, 30 Dec 2003, news.php.net wrote: Creating unique symlinks would be easier but my development machine is Windows and my server is FreeBSD and I can't create file links under Windows. Plus, my FreeBSD server is not near me so remote development is difficult. 1) windows has symlinks since win2000, however they are named Junctions. I would recommend visiting sysinternals.com and getting junctions tool (win2k/xp/2k3 - miscalenous). Hey, it even comes with source! 2) another way is to make a redirect, so you do: getFile.php?file=something.zip and in your code you do: ? include _mylibs.php if (userLoggedIn()) header Location: .$_REQUEST[file]; else echo Only Valid People Can Login; ? 3) final way is to pass through the file yourself. Safest way, but potentially more resource hungry than the two above in your code you do: ? include _mylibs.php if (userLoggedIn()) { header(Content-type: application/octet-stream); header(Content-Disposition: attachment; . filename=.$_REQUEST[file]); readfile($_REQUEST[file]); } else echo Only Valid People Can Login; ? recommended reads: http://www.php.net/manual/en/function.header.php further recommended things to checkout: freshmeat , and search for anti leecher scripts. /apz, bringing joy to the world -- 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] HTML via echo or not
I agree. I think embedding the ?php ? tags is messy and harder to follow. I do however, treat echo like print. ie echo The thought would \have\ to be clear.; I've not use CR,. I'll have to look at that. Thanks -Original Message- From: Robin Kopetzky [mailto:[EMAIL PROTECTED] Sent: Monday, December 29, 2003 8:02 PM To: PHP General Subject: [PHP] HTML via echo or not Good evening. I'm probably going to stir up a hornet's nest but have a question. Does using echo for ALL html pages mean I have a sick mind? Example: echo CR, 'HTML', CR, ' BODY', CR, ' etc...'; I like the look. It's more readable, gives me a better view of variables as they are all single-quoted and stand out nicely in my editor. No messy jumping into and out of php. I have looked at a bunch of php code written by others and HEREDOC looks stupid with everything jammed against the left side of the screen, php tags within HTML breaks up the flow of properly formatted HTML, which I firmly require for all of my code, and just doesn't look right. 'print' makes you add \ to all of the HTML attributes but the 'echo' method makes everything look like php! Since all your doing is dumping text to the output subsystem, there shouldn't be any speed decrease in the code. Yes, I know, there are advocates for every kind of method to display HTML code but just wanting to get others opinions on the subject. If you wish, email me off-list @ sparkyk-AT-blackmesa-isp.net. Cheers! Robin 'Sparky' Kopetzky Black Mesa Computers/Internet Service Grants, NM 87020 -- 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] programming the onclick() event in an anchor
You can place form tags around the anchors and use hidden tags and send via post so the variable is not obvious. A user reading the source would see this though... echo form name=\form1\ action=\https://this.site.com/somePage.php\; method=\post\\n; echo a onClick=\this.form.submit();\SomeLinkText/a\n; echo input type=\hidden\ name=\variable\ value=\.$value.\\n; echo /form\n; I'm not sure off the top of my head if the anchor tag must have any other description. You might be able to use onChange instead of onClick to include selection by using the keyboard, but I'm not sure if the anchor tag responds to onChange. You'd have to try it out. Larry. -Original Message- From: Evan Nemerson [mailto:[EMAIL PROTECTED] Sent: Thursday, December 25, 2003 2:59 AM To: Peter Walter; [EMAIL PROTECTED] Subject: Re: [PHP] programming the onclick() event in an anchor On Wednesday 24 December 2003 08:06 pm, Peter Walter wrote: I have written a session-enabled php page which displays a table of search results. The first column in the table contains anchor links to www.mydomain.com/mypage?seqno= where seqno is a variable I would like to pass when the anchor is clicked. However, I do not wish the ?seqno= to display in the url of the browser. After googling a lot, it appears that I can use JavaScript to set a session variable in the I doubt it- otherwise it would be pretty easy to set, say $_SESSION['logged_in'] onclick() event, but I have not been able to find an example of how to But you /can/ use JS to set a cookie, which can be retrieved (and stored in a session variable if you want) by PHP. http://www.webreference.com/js/column8/ http://us4.php.net/manual/en/reserved.variables.php#reserved.variables.cooki es do it. Does anyone have experience doing this? Sample code would be greatly appreciated. http://www.webreference.com/js/column8/functions.html Peter -- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en -- There is a certain right by which we may deprive a man of life, but none by which we may deprive him of death. -Nietzsche -- 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] Can't upload file greater than 11kb
The input type=hidden ... is more than a convenience for the client. It must be before the ...type=file... tag and after form.. (at least with Mozilla Firebird as the client) If you have it in there and remember it is in bytes not kb and set it to a size large enough the script accepting the file will show $_FILE['name'] and it will show $_FILE['tmp_name'] having the temporary file. Then you take that hidden tag out and do the same the $_FILE['tmp_name'] variable will be empty since it did not recieve the file. So I know at least in my case that the hidden field has to be there. Larry -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Monday, December 22, 2003 8:55 PM To: [EMAIL PROTECTED] Subject: [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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: progress in PHP
How does perl show progress of the upload if it is a server side scripting language and php can't do it because it is server side? -Original Message- From: Manuel Lemos [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 23, 2003 12:46 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: progress in PHP Hello, On 12/23/2003 03:31 PM, James Kaufman wrote: Join the 11,000 people who use megaupload progress bar (with a little help from perl) http://www.sourceforge.net/projects/megaupload/ I tried. It wasn't worth all the perl mods I would to have had to install to make it work. Check out http://pear.laurent-laville.org/HTML_Progress/. It is a pure php approach to displaying a progress bar. I haven't used it, but the demos look good. This a different thing. This is meant to track progress of server side tasks. File uploading is a client side task. Unfortunately, AFAIK there is no way to handle streams of HTTP requests. Therefore, there is no way to handle upload progress with a PHP only solution. The Raditha megaupload solution is based on a combination of Perl with PHP. It is probably the solution that uses more PHP but the hard work is done using Perl. -- 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 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
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
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
RE: [PHP] File upload problem
According to the documentation you have to have the maxfilesize tag before the input tag. -Original Message- From: Dino Costantini [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 17, 2003 6:34 PM To: [EMAIL PROTECTED] Subject: [PHP] File upload problem i'm trying to write a page which allows user to upload file. theese are my sources but they didn't work, anyone could help me? -form.html form action=upload.php method=post enctype=multipart/form-data input type=file name=upfile input type=hidden name=MAX_FILE_SIZE value=1 input type=submit value=Invia il file /form upload.php--- ?php // QUESTE RIGHE RENDONO LO SCRIPT COMPATIBILE CON LE VERSIONI // DI PHP PRECEDENTI ALLA 4.1.0 if(!isset($_FILES)) $_FILES = $HTTP_POST_FILES; if(!isset($_SERVER)) $_SERVER = $HTTP_SERVER_VARS; /* VARIABILI DA SETTARE / // Directory dove salvare i files Uploadati ( chmod 777, percorso assoluto) $upload_dir = $_SERVER[DOCUMENT_ROOT] . /esempi; // Eventuale nuovo nome da dare al file uploadato $new_name = ciao.dino; // Se $new_name è vuota, il nome sarà lo stesso del file uploadato $file_name = ($new_name) ? $new_name : $_FILES[upfile][name]; if(trim($_FILES[upfile][name]) == ) { die(Non hai indicato il file da uploadare !); } if(@is_uploaded_file($_FILES[upfile][tmp_name])) { @move_uploaded_file($_FILES[upfile][tmp_name], $upload_dir/$file_name) or die(Impossibile spostare il file, controlla l'esistenza o i permessi della directory dove fare l'upload.); } else { die(Problemi nell'upload del file . $_FILES[upfile][name]); } echo L'upload del file . $_FILES[upfile][name] . è avvenuto correttamente; ? --- upload.php doesn't upload anything and doesn't output any error message. i don't think it's an apache problem, because this is the only page that doesn't work. -- 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] mysql load_file retreival
I have set up a script to recieve a pdf file and store it in a mysql db using update db set field=load_file('fileIncludingFile') where id=$id. Afterwards I can see the file has been uploaded into the blob field successfully and without errors. Now I want to get the file back out. I set up a script with select field from db where id=$id and used mysql_query followed by mysql_fetch_row and did echo header(Content-type: application/pdf); and then echo result[0]; where result was the row fetched. I get the prompt to open with pdf but pdf fails. I have magicquotes on but I understand that the load_file() function within mysql does the escaping etc. How can I un-escape the data? The only thing I saw on the mysql manual is on how to use load_file_infile/load_file_outfile which does not apply to this. Can someone lend a hand here? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] sessions problem
Make sure you have session_start(); at the beginning of each script you run from the time you start inserting variables to the time you want the session to end. -Original Message- From: Nitin [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 10:48 AM To: PHP-General Subject: [PHP] sessions problem hi all, i'm just starting to use sessions. i've a problem, i started session and assigned variables to $HTTP_SESSION_VARS i can very well see these vars in my next script, but i need to get back to first script for some working, and strangely i dont find these vars there. any help or suggestions Nitin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql load_file retreival
Oops, my bad on the post. I am not sending echo header...just header(... I thought, based on reading from mysql that it did escape certain characters. I'll start looking at other possibilities... -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 1:24 PM To: PHP List Subject: RE: [PHP] mysql load_file retreival LOAD_FILE() shouldn't be escaping the data. Are you actually calling : echo header()? the header function should not be echoed. header('Content-type: application/pdf'); echo result[0]; -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 9:29 AM To: PHP List Subject: [PHP] mysql load_file retreival I have set up a script to recieve a pdf file and store it in a mysql db using update db set field=load_file('fileIncludingFile') where id=$id. Afterwards I can see the file has been uploaded into the blob field successfully and without errors. Now I want to get the file back out. I set up a script with select field from db where id=$id and used mysql_query followed by mysql_fetch_row and did echo header(Content-type: application/pdf); and then echo result[0]; where result was the row fetched. I get the prompt to open with pdf but pdf fails. I have magicquotes on but I understand that the load_file() function within mysql does the escaping etc. How can I un-escape the data? The only thing I saw on the mysql manual is on how to use load_file_infile/load_file_outfile which does not apply to this. Can someone lend a hand here? -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql load_file retreival
Thanks for the help. I went through a troubleshooting phase that started with writing the raw data from the mysql client to disk. Checking the size it was apparent that it was much too small. I tried running my script with a smaller pdf and it worked. It turns out that blob has a max of 64k. A tad small for general use for holding graphics. I changed to a mediumblob which is either 12 or 16 meg, I'm not sure off the top of my head now but, that is plenty for my needs. I did end up changing the behaviour of my script though. Instead of writing to a file and using load_file, I recieved the file on upload, base64 encoded it and stored it directly to the db. Then on retrieval, unencoded and handed it off with content type, size, name, and application information in the header. It works very nicely. Thanks again... Larry -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 3:49 PM To: PHP List Subject: RE: [PHP] mysql load_file retreival Try looking at the data that's supposed to be outputing the pdf. Something may be failing somewhere and you might see an error message. If you don't see any error messages and are apparently seeing gthe pdf data, check for whitespace outside php tags and any extraneous echo's or print's, that would very likely cause the pdf to not be able to be read properly. Chris -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 10:36 AM To: Chris; PHP List Subject: RE: [PHP] mysql load_file retreival Oops, my bad on the post. I am not sending echo header...just header(... I thought, based on reading from mysql that it did escape certain characters. I'll start looking at other possibilities... -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 1:24 PM To: PHP List Subject: RE: [PHP] mysql load_file retreival LOAD_FILE() shouldn't be escaping the data. Are you actually calling : echo header()? the header function should not be echoed. header('Content-type: application/pdf'); echo result[0]; -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 9:29 AM To: PHP List Subject: [PHP] mysql load_file retreival I have set up a script to recieve a pdf file and store it in a mysql db using update db set field=load_file('fileIncludingFile') where id=$id. Afterwards I can see the file has been uploaded into the blob field successfully and without errors. Now I want to get the file back out. I set up a script with select field from db where id=$id and used mysql_query followed by mysql_fetch_row and did echo header(Content-type: application/pdf); and then echo result[0]; where result was the row fetched. I get the prompt to open with pdf but pdf fails. I have magicquotes on but I understand that the load_file() function within mysql does the escaping etc. How can I un-escape the data? The only thing I saw on the mysql manual is on how to use load_file_infile/load_file_outfile which does not apply to this. Can someone lend a hand here? -- 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 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] mysql load_file retreival
I was following the example given on the php site that someone was using to break down large files. They base64 encoded the file while reading it in, broke it into pieces (while inputing the pieces into the db), then re-animated it so to speak afterwards by reversing the process. I get the impression that encoding the file will leave it in a state that is palatable to the database (no quotes,commas,slashes etc) and it seemed that since the example worked that way that I'd follow suit. Plus, if I decided that the file sizes should be split up, I could ultimately simply change a line of code or so and split it up. It is only from a lack of thorough understanding of exactly what characters can be found in a pdf file when viewed as a single string for the database that I don't step out and design something of which I have not seen an example. Plus I figure that I should learn from people out there of whom many have spent many hours beating their head against a wall looking for a solution and are later willing to share that as an example to save others time. -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 5:55 PM To: PHP List Subject: RE: [PHP] mysql load_file retreival Gald to hear it works now. Are you base64 encoding it for any particular reason? Seems to me that it would waste a lot of db space as base64 encoding adds quite a bit to the filesize. Chris -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 2:16 PM To: Chris; PHP List Subject: RE: [PHP] mysql load_file retreival Thanks for the help. I went through a troubleshooting phase that started with writing the raw data from the mysql client to disk. Checking the size it was apparent that it was much too small. I tried running my script with a smaller pdf and it worked. It turns out that blob has a max of 64k. A tad small for general use for holding graphics. I changed to a mediumblob which is either 12 or 16 meg, I'm not sure off the top of my head now but, that is plenty for my needs. I did end up changing the behaviour of my script though. Instead of writing to a file and using load_file, I recieved the file on upload, base64 encoded it and stored it directly to the db. Then on retrieval, unencoded and handed it off with content type, size, name, and application information in the header. It works very nicely. Thanks again... Larry -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 3:49 PM To: PHP List Subject: RE: [PHP] mysql load_file retreival Try looking at the data that's supposed to be outputing the pdf. Something may be failing somewhere and you might see an error message. If you don't see any error messages and are apparently seeing gthe pdf data, check for whitespace outside php tags and any extraneous echo's or print's, that would very likely cause the pdf to not be able to be read properly. Chris -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 10:36 AM To: Chris; PHP List Subject: RE: [PHP] mysql load_file retreival Oops, my bad on the post. I am not sending echo header...just header(... I thought, based on reading from mysql that it did escape certain characters. I'll start looking at other possibilities... -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 1:24 PM To: PHP List Subject: RE: [PHP] mysql load_file retreival LOAD_FILE() shouldn't be escaping the data. Are you actually calling : echo header()? the header function should not be echoed. header('Content-type: application/pdf'); echo result[0]; -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 9:29 AM To: PHP List Subject: [PHP] mysql load_file retreival I have set up a script to recieve a pdf file and store it in a mysql db using update db set field=load_file('fileIncludingFile') where id=$id. Afterwards I can see the file has been uploaded into the blob field successfully and without errors. Now I want to get the file back out. I set up a script with select field from db where id=$id and used mysql_query followed by mysql_fetch_row and did echo header(Content-type: application/pdf); and then echo result[0]; where result was the row fetched. I get the prompt to open with pdf but pdf fails. I have magicquotes on but I understand that the load_file() function within mysql does the escaping etc. How can I un-escape the data? The only thing I saw on the mysql manual is on how to use load_file_infile/load_file_outfile which does not apply to this. Can someone lend a hand here? -- 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 General Mailing List (http://www.php.net
[PHP] nusoap
Does anyone here have any solid experience with nusoap? Their list has low volume and I am finding it difficult to find any useable examples or descriptions of real life uses and how to configure the server/client. In particular I'm currently trying to figure out the correct syntax to produce wsdl using $server-wsdl-addComplexType(... to describe an array of the form... array([0]=343454[1]=SMITH[2]=BOB[3]=1969-03-17[4]=234343444[5]2003-11-11 13:23:02) where data types are string,string,string,date,string,datetime It appears that the complexType would be a struct although this is actually an array. I just need someone who has had experience with this toolkit for a couple of issues. Thanks for any assistance, Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php temp table question (for mysql)
I'm now finding that persistent connections is allowing the temp table to remain. I have a sql query that creates the table and another that joins the temp table to another for a result set that I use. If I press refresh on the browser window I get an error that the sql query creating the table fails. I prepend a query that removes the table before the sql that creates it and then hit refresh and the query works. If I close the browser thus ending the session and reopen the browser and log in, the script fails to remove the temp table since it hasn't been created yet (and must have been removed). I changed my method of connecting to use mysql_connect instead of mysql_pconnect and removed the drop temp sql and it loads and reloads fine. Perhaps it is the combination of mysql_pconnect with sessions that creates this problem. -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Monday, October 27, 2003 4:43 PM To: Larry Brown; PHP List Subject: Re: [PHP] php temp table question (for mysql) From: Larry Brown [EMAIL PROTECTED] Does anyone know whether the use of persistent connections with php will allow a temp table created by a script to linger around No, the table will still be removed at the end of the script whether you use persistant connections or not. and cause a problem with the next execution of the script when it tries to create the temp table Temporary tables are unique for that specific question. So you can have the same script creating the same temporary table and 100 people hit it without issues. Each script creates it's own temporary table with a unique name that only that connection has access to. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDFlib not working with explorer based on PHP created file in memory
If anyone can help, please... I have a page that points to a PHP page that dynamically creates a pdf file using PDFlib. The page uses a link such as site.com/page.php?variable=value. That in turn executes the script that uses the variable/value to pull info from the db and generate the page. The result is that when you click the link you are prompted to save or open the document. By openning the document you are presented with the pdf by acrobat. This is seemless with Mozilla. However, on IE it hangs with the message Getting File information:. If you try to save it you get another error. I have read some information indicating that the problem is with the length parameter not being sent. However, the page I'm using was off an example someone provided and it already has what seems to be the fix for page length. The code that creates the file is as follows... $p = PDF_new(); if(PDF_open_file($p, ) == 0) { die(Error: .PDF_get_errmsg($p)); } ...body goes here... PDF_end_page($p); PDF_close($p); $buf = PDF_get_buffer($p); $len = strlen($buf); header(Content-type: application/pdf); header(Content-Length: $len); header(Content-Disposition: inline; filename=filename.pdf); print $buf; PDF_delete($p); Again, this is only a problem with m$ IE. I know this is one of the largest toolkits (PDFlib) in use for creating well defined printable documents so I can't believe that this is not a common problem or that I am doing something really wrong. Someone on PDFlib's mailing list once mentioned sending the document for download via chunks instead of getting the length except he wrote something in C/C++ to accomplish it in his app. Is there some way to tell the browser to accept via chunks in php? Does the above header look right for IE? Any help would be greatly appreciated... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PDFlib not working with explorer based on PHP created file in memory
My apologies for waisting anyone's time. I found the posting in the archives that had the correct code to use. -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 3:39 PM To: PHP List Subject: [PHP] PDFlib not working with explorer based on PHP created file in memory If anyone can help, please... I have a page that points to a PHP page that dynamically creates a pdf file using PDFlib. The page uses a link such as site.com/page.php?variable=value. That in turn executes the script that uses the variable/value to pull info from the db and generate the page. The result is that when you click the link you are prompted to save or open the document. By openning the document you are presented with the pdf by acrobat. This is seemless with Mozilla. However, on IE it hangs with the message Getting File information:. If you try to save it you get another error. I have read some information indicating that the problem is with the length parameter not being sent. However, the page I'm using was off an example someone provided and it already has what seems to be the fix for page length. The code that creates the file is as follows... $p = PDF_new(); if(PDF_open_file($p, ) == 0) { die(Error: .PDF_get_errmsg($p)); } ...body goes here... PDF_end_page($p); PDF_close($p); $buf = PDF_get_buffer($p); $len = strlen($buf); header(Content-type: application/pdf); header(Content-Length: $len); header(Content-Disposition: inline; filename=filename.pdf); print $buf; PDF_delete($p); Again, this is only a problem with m$ IE. I know this is one of the largest toolkits (PDFlib) in use for creating well defined printable documents so I can't believe that this is not a common problem or that I am doing something really wrong. Someone on PDFlib's mailing list once mentioned sending the document for download via chunks instead of getting the length except he wrote something in C/C++ to accomplish it in his app. Is there some way to tell the browser to accept via chunks in php? Does the above header look right for IE? Any help would be greatly appreciated... -- 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] php temp table question
Does anyone know whether the use of persistent connections with php will allow a temp table created by a script to linger around and cause a problem with the next execution of the script when it tries to create the temp table again? Also if it does present a problem with the next script execution trying to create the temp table again, if I drop the temp table at the end of the script will I still have problems if the script is run by two client in tandem? For instance two people connect, both hit the script at about the same time. One script creates the temp table and before it can drop the table the second script tries to create the table. Will it see the table created by the other script? Again the use of persistent connections would be a the heart of this I would think. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php temp table question (for mysql)
Does anyone know whether the use of persistent connections with php will allow a temp table created by a script to linger around and cause a problem with the next execution of the script when it tries to create the temp table again? Also if it does present a problem with the next script execution trying to create the temp table again, if I drop the temp table at the end of the script will I still have problems if the script is run by two client in tandem? For instance two people connect, both hit the script at about the same time. One script creates the temp table and before it can drop the table the second script tries to create the table. Will it see the table created by the other script? Again the use of persistent connections would be a the heart of this I would think. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP with Frames (cont.)
Are you trying to access variables between frames or just get a php script to run when it is one frame. I have php pages running in frames in a number of places. You could not access variables between the frames though. You would have to use a client side script to do that. You could have something like javascript deal with passing variable around on the client's browser and then ultimately post the result back to the server in a form etc. -Original Message- From: rich [mailto:[EMAIL PROTECTED] Sent: Monday, October 27, 2003 2:23 PM To: [EMAIL PROTECTED] Subject: [PHP] PHP with Frames (cont.) No, he's right - this is an issue. Do variables persist between PHP files? In the attached scripts I have a login page which directs the user, on a sucessful login, to a front page which is a frameset. The login.php opens a connection to a MySQL database ($connection) but once the browser has been re-directed to the frame-root.html page this variable is no longer available. Kb wrote: Hi, Does anyone know why my PHP pages won't work in Frames? I have 5 frames, each of which are displaying PHP pages.and none of the PHP code works. If I run the code outside of Frames it works fine! I've can't find any decent references for PHP in Frames. Your help would be appreciated. Thanks Kevin -- UEA/MUS::Record Library -- UEA/MUS::Record Library -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] else needed?
On if statements, I periodically don't want anything to happen if the requisite is not met. In most cases just writing the statement in the format if (this) { do that; } and nothing more will work. However, I periodically get weird results with this and found the only fix was to do a... if (this) {do that;}else{echo ;} I try using continue in the else but get errors about using continue on level 1 or something to that affect. I'm assuming that continue is only used in loops. It's amazing how far I can code things without these little foundation level bits of information ;-) Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] console script html tags?
How can I rid myself of the html tags around error messages when writing console scripts? (Besides avoiding errors) Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Client script opensource plea
This, most certainly OT, is a plea for fellow developers oriented in OpenSource solutions to help resolve a problem in case you have dealt with it before. I have written a PHP app that uses function keys at times to help speed data processing for my client VIA javascript. This app works fine when the client is using IE or Netscape on the windows platform. However, when the client is on Linux, the function keys are not being captured on Mozilla or Netscape. I presented this problem in my Javascript mailing list and on the RedHat mailing list and no one seems to have had any experience dealing with it and consequently I haven't a work around. My apologies for presenting a clearly OT question, but I know there are a ton of experienced developers here and I reaching for someone who might have dealt with this. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php mysql array question
Is there any php function to pull a query into an array? I know there is a way to get the first row of the results in an array, but I'm having to loop through each row pushing the row onto an array to get the result I'm looking for and it seems like a lot of code for something that I would think is used a lot. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] IE Pagelength issue
I found the problem. The script was creating each table within the previous table. Apparently there is a limit of 25 nested levels for IE. I separated each table and it loads all of them ok. Thanks John, Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: Sunday, June 08, 2003 8:48 PM To: PHP List Subject: RE: [PHP] IE Pagelength issue Yes, the entire page is visible when selecting view source. And again, it does view ok in Mozilla. I will try breaking the table into smaller tables and see if that is it. I won't have access till Tuesday. If anyone has any other ideas feel free to throw in. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 9:37 PM To: 'Larry Brown'; 'PHP List' Subject: RE: [PHP] IE Pagelength issue If you view source in IE, do you see the entire page? If so, then it's an IE display issue. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 7:30 PM To: [EMAIL PROTECTED]; PHP List Subject: RE: [PHP] IE Pagelength issue Example is a page that displays the concerts and bands at each concert for a given spectator. Table one gives information on the spectator and has a field that lists the concert events he/she has been to. Table two lists concerts along with location information and date along with bands and then another table that lists band information. There are several loops, the first one is while $spectator... and within it a while $concert... and within it a while $band... So the resulting page can have user information then a list with concert bands, concert bands, concert bands, for each he/she has been to. The one we are having a problem with has 27 concerts and IE stops at 25 and Mozilla goes all the way to the 27th. I will try and split each concert into its own table. Just as a not each concert listed gives the option to edit the concert information and a way to edit the band information in addition to removing any one of them. So there are various buttons throughout. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 6:08 PM To: 'Larry Brown'; 'PHP List' Subject: RE: [PHP] IE Pagelength issue I am running into a strange problem. I have a script that parses a database for results. It cycles through the data one record at a time looking for matches to the query. Up til now I haven't had any problems as the results have been limited in length. Now I have one that has a significant length and the bottom is cut off on IE6. I haven't tried any earlier versions of IE but Mozilla loads the entire page without this problem. Has anyone run across this? Is there a way around it? Just as an additional note: the page has one continuous table so another potential problem would be a limit to the length of a table? Probably and IE feature of only being able to handle a certain table size. The way around it would be to end the table and start another every so many rows... or split your rows up into Prev/Next pages... Did I read correctly that you're selecting an entire database and then using PHP to match criteria? Are you using a WHERE clause to do the sorting? Sounds like you may be going about this the wrong way... if not, carry on. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.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 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] IE Pagelength issue
Yes, the entire page is visible when selecting view source. And again, it does view ok in Mozilla. I will try breaking the table into smaller tables and see if that is it. I won't have access till Tuesday. If anyone has any other ideas feel free to throw in. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 9:37 PM To: 'Larry Brown'; 'PHP List' Subject: RE: [PHP] IE Pagelength issue If you view source in IE, do you see the entire page? If so, then it's an IE display issue. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 7:30 PM To: [EMAIL PROTECTED]; PHP List Subject: RE: [PHP] IE Pagelength issue Example is a page that displays the concerts and bands at each concert for a given spectator. Table one gives information on the spectator and has a field that lists the concert events he/she has been to. Table two lists concerts along with location information and date along with bands and then another table that lists band information. There are several loops, the first one is while $spectator... and within it a while $concert... and within it a while $band... So the resulting page can have user information then a list with concert bands, concert bands, concert bands, for each he/she has been to. The one we are having a problem with has 27 concerts and IE stops at 25 and Mozilla goes all the way to the 27th. I will try and split each concert into its own table. Just as a not each concert listed gives the option to edit the concert information and a way to edit the band information in addition to removing any one of them. So there are various buttons throughout. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 6:08 PM To: 'Larry Brown'; 'PHP List' Subject: RE: [PHP] IE Pagelength issue I am running into a strange problem. I have a script that parses a database for results. It cycles through the data one record at a time looking for matches to the query. Up til now I haven't had any problems as the results have been limited in length. Now I have one that has a significant length and the bottom is cut off on IE6. I haven't tried any earlier versions of IE but Mozilla loads the entire page without this problem. Has anyone run across this? Is there a way around it? Just as an additional note: the page has one continuous table so another potential problem would be a limit to the length of a table? Probably and IE feature of only being able to handle a certain table size. The way around it would be to end the table and start another every so many rows... or split your rows up into Prev/Next pages... Did I read correctly that you're selecting an entire database and then using PHP to match criteria? Are you using a WHERE clause to do the sorting? Sounds like you may be going about this the wrong way... if not, carry on. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IE Pagelength issue
I am running into a strange problem. I have a script that parses a database for results. It cycles through the data one record at a time looking for matches to the query. Up til now I haven't had any problems as the results have been limited in length. Now I have one that has a significant length and the bottom is cut off on IE6. I haven't tried any earlier versions of IE but Mozilla loads the entire page without this problem. Has anyone run across this? Is there a way around it? Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] IE Pagelength issue
Just as an additional note: the page has one continuous table so another potential problem would be a limit to the length of a table? Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 1:55 PM To: PHP List Subject: [PHP] IE Pagelength issue I am running into a strange problem. I have a script that parses a database for results. It cycles through the data one record at a time looking for matches to the query. Up til now I haven't had any problems as the results have been limited in length. Now I have one that has a significant length and the bottom is cut off on IE6. I haven't tried any earlier versions of IE but Mozilla loads the entire page without this problem. Has anyone run across this? Is there a way around it? Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- 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] IE Pagelength issue
Example is a page that displays the concerts and bands at each concert for a given spectator. Table one gives information on the spectator and has a field that lists the concert events he/she has been to. Table two lists concerts along with location information and date along with bands and then another table that lists band information. There are several loops, the first one is while $spectator... and within it a while $concert... and within it a while $band... So the resulting page can have user information then a list with concert bands, concert bands, concert bands, for each he/she has been to. The one we are having a problem with has 27 concerts and IE stops at 25 and Mozilla goes all the way to the 27th. I will try and split each concert into its own table. Just as a not each concert listed gives the option to edit the concert information and a way to edit the band information in addition to removing any one of them. So there are various buttons throughout. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Saturday, June 07, 2003 6:08 PM To: 'Larry Brown'; 'PHP List' Subject: RE: [PHP] IE Pagelength issue I am running into a strange problem. I have a script that parses a database for results. It cycles through the data one record at a time looking for matches to the query. Up til now I haven't had any problems as the results have been limited in length. Now I have one that has a significant length and the bottom is cut off on IE6. I haven't tried any earlier versions of IE but Mozilla loads the entire page without this problem. Has anyone run across this? Is there a way around it? Just as an additional note: the page has one continuous table so another potential problem would be a limit to the length of a table? Probably and IE feature of only being able to handle a certain table size. The way around it would be to end the table and start another every so many rows... or split your rows up into Prev/Next pages... Did I read correctly that you're selecting an entire database and then using PHP to match criteria? Are you using a WHERE clause to do the sorting? Sounds like you may be going about this the wrong way... if not, carry on. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.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] mysql field getting cut off
If anyone can help I seem to be stuck on a problem getting a mysql field inserted correctly. For instance the first page would have a field such as... input type=text name=field size=12 info that is placed into the field is St. Petersburg, FL (without the quotes) the php code for the statement... $query = insert into table values( $variable, '$field', $variable2 ); This is where there are 3 fields in the table and the second is the one I want populated with St. Petersburg, FL. It ends up with St. (I'm not sure if the period makes it). I have verified that the entire statement arrives at the php script in the variable $field and I have used the mysql client to give the same command with St. Petersburg, FL as the value and it accepts it without a problem. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql field getting cut off
That, indirectly, is exactly what happened. I have a subsequent screen for modifying the results. I must have gone back into that screen to change something else and since it only pulled the St. when I applied it it changed the field in the database. Thanks a lot. It seemed weird. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2003 9:44 PM To: 'Larry Brown'; 'PHP List' Subject: RE: [PHP] mysql field getting cut off If anyone can help I seem to be stuck on a problem getting a mysql field inserted correctly. For instance the first page would have a field such as... input type=text name=field size=12 info that is placed into the field is St. Petersburg, FL (without the quotes) the php code for the statement... $query = insert into table values( $variable, '$field', $variable2 ); This is where there are 3 fields in the table and the second is the one I want populated with St. Petersburg, FL. It ends up with St. (I'm not sure if the period makes it). I have verified that the entire statement arrives at the php script in the variable $field and I have used the mysql client to give the same command with St. Petersburg, FL as the value and it accepts it without a problem. When you run a SELECT from the command line, do you only see St. in the column? What kind of column is it? Are you sure it's not fine in the database and you're just showing it like: input type=text value=$value name=field which will end up like input type=text value=St. Petersburg, FL name=field and will only show St. in the text box... ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.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] table cell space under image in IE
Has anyone had to address this problem before? I've created a table and placed an image inside. The image is around 12 pxl high and when the table is displayed in Mozilla the cell border is up against the image on all sides. On IE however, the top of the image is up against the cell border but the bottom has aprox 10pxl of space. It is only there with the images, only under the image, and only in IE (I've only checked v6). If anyone has seen this and has an idea of how to fix it, PLEASE let me know. I've tried setting cellspacing=0, cellpadding=0, and setting spacing to a range of sized to see the effect and the smallest size it will move to is approx 10pxls below the bottom of the image. Very frustrating! I know this is not exactly on topic but I produce all html by php and I don't want to go out and add myself to an html list (if there is such a thing). TIA Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] table cell space under image in IE
Here is essentially what view source yields. I have to use INPUT TYPE=image in order to have the image highlighted via client side code. But from what I've read this is part of the html standard. TR TD ALIGN=left COLSPAN=3 HEIGHT=20 B1 - 50/B FORM NAME=Second ACTION=https://website/file.php; METHOD=post INPUT TYPE=hidden NAME=lstnumrows VALUE=50 /TD TD ALIGN=left CELLPADDING=0 CELLSPACING=0 HEIGHT=20 COLSPAN=5 INPUT TYPE=image NAME=pic2 ID=pic2 BORDER=0 SRC=Blankleft.gif INPUT TYPE=image NAME=pic3 ID=pic3 BORDER=0 SRC=Forwardu.gif onClick=document.Second.submit(); onMouseOver=change_it('pic3') onMouseOut=change_back('pic3') /FORM /TD /TR Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2003 12:07 PM To: Larry Brown; PHP List Subject: Re: [PHP] table cell space under image in IE Has anyone had to address this problem before? I've created a table and placed an image inside. The image is around 12 pxl high and when the table is displayed in Mozilla the cell border is up against the image on all sides. On IE however, the top of the image is up against the cell border but the bottom has aprox 10pxl of space. It is only there with the images, only under the image, and only in IE (I've only checked v6). If anyone has seen this and has an idea of how to fix it, PLEASE let me know. I've tried setting cellspacing=0, cellpadding=0, and setting spacing to a range of sized to see the effect and the smallest size it will move to is approx 10pxls below the bottom of the image. Very frustrating! Do you have your code like tdimg/td with no other whitespace? IE might be displaying a space or whitespace for some reason, whereas other browsers will ignore it. I know this is not exactly on topic but I produce all html by php and I don't want to go out and add myself to an html list (if there is such a thing). Oh man... How horrible would that be?!? an HTML list??? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: table cell space under image in IE
I just posted the code and have the tags on separate lines for clarity, but in the source they are on the same line with no space between the tags. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: Roman Sanchez [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2003 12:11 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: table cell space under image in IE If you write tdimage src='yourimage.gif' /td the CR-LF before /td counts as an space wich wraps to the next line. It might be helpful to write tdimage src='yourimage.gif'/td (in the same line) instead. I know this is not exactly on topic but I produce all html by php and I don't want to go out and add myself to an html list (if there is such a thing). Frankly, it´s not on topic at all and no matter how you produce the final html output you should know how to deal with it. -- 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] table cell space under image in IE
What kind of @%#$%#! is that? Why would they have /form take up visible space? Hmm, I guess I'll have to find a new angle or hide the closing form beyond the table. Thanks... Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: Roman Sanchez [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2003 12:40 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] table cell space under image in IE TR TD ALIGN=left COLSPAN=3 HEIGHT=20 B1 - 50/B FORM NAME=Second ACTION=https://website/file.php; METHOD=post INPUT TYPE=hidden NAME=lstnumrows VALUE=50 /TD TD ALIGN=left CELLPADDING=0 CELLSPACING=0 HEIGHT=20 COLSPAN=5 INPUT TYPE=image NAME=pic2 ID=pic2 BORDER=0 SRC=Blankleft.gif INPUT TYPE=image NAME=pic3 ID=pic3 BORDER=0 SRC=Forwardu.gif onClick=document.Second.submit(); onMouseOver=change_it('pic3') onMouseOut=change_back('pic3') /FORM /TD /TR You don'y say which cell has the problem but, apart from placing the closing td right after the image try to move the closing form tag out from the table. At least in IE, /FORM _allways_ produces that extra space no matter what you do unless you use style sheets to set the form's bottom-margin yourself. -- 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] Version 5?
Someone mentioned a facet of version 5 to be expected that I am really looking forward to. Does anyone know what the release target date is? I didnt see any mention of it on php.net. Larry S. Brown Dimension Networks, Inc. (727) 723-8388
[PHP] deciperhing oop
Can someone who is used to using php oop help me figure out why this fails? I know there are probably a thousand classes already designed to do this and probably 100 times more efficient, but this is how I learn. From what I've read this should work but there is obviously something I'm missing. Quick problem description: Trying to set up class to connect to mysql db. Already used a procedural test successfully connecting to db. Error is displayed as... Warning: mysql_select_db(): supplied argument is not a valid MySQL - Link resource in /var/www/html/oop.php on line 67 Database Selection to main failed. Code: Class dbConnect { var $machine; var $port; var $user; var $password; var $query; var $result; var $dbase; var $db; var $sel; function dbConnect($machine,$port,$user,$password) { $this-machine = $machine; $this-port = $port; $this-user = $user; $this-password = $password; $db = mysql_pconnect ($machine,$user,$password) if (!$db) { die (Initial connection to DB failed.) } $this-db = $db; } function setDbase($dbase) { $this-dbase = $dbase; $sel = mysql_select_db($dbase,$db); if(!$db) { die (Database Selection to $dbase failed.); } } } $dbn = new dbConnect(localhost,3306,bob,hjhyt4kl5); $dbn-setDbase(main); So why can't I use $db? Isn't the statement $this-db=$db making it available to the setDbase function? Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] deciperhing oop
Thank you everyone for helping. I didn't know you have to put $this- in front of all variables in the class. You learn something new every day ( I thought you only needed to use that once to make the variable available everywhere in the class up till now). Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: Jim Lucas [mailto:[EMAIL PROTECTED] Sent: Monday, March 03, 2003 6:50 PM To: Larry Brown; PHP List Subject: Re: [PHP] deciperhing oop the second argument in the mysql_select_db call in not in scope. you should be using $this-db instead of $db Jim - Original Message - From: Larry Brown [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Monday, March 03, 2003 2:52 PM Subject: [PHP] deciperhing oop Can someone who is used to using php oop help me figure out why this fails? I know there are probably a thousand classes already designed to do this and probably 100 times more efficient, but this is how I learn. From what I've read this should work but there is obviously something I'm missing. Quick problem description: Trying to set up class to connect to mysql db. Already used a procedural test successfully connecting to db. Error is displayed as... Warning: mysql_select_db(): supplied argument is not a valid MySQL - Link resource in /var/www/html/oop.php on line 67 Database Selection to main failed. Code: Class dbConnect { var $machine; var $port; var $user; var $password; var $query; var $result; var $dbase; var $db; var $sel; function dbConnect($machine,$port,$user,$password) { $this-machine = $machine; $this-port = $port; $this-user = $user; $this-password = $password; $db = mysql_pconnect ($machine,$user,$password) if (!$db) { die (Initial connection to DB failed.) } $this-db = $db; } function setDbase($dbase) { $this-dbase = $dbase; $sel = mysql_select_db($dbase,$db); if(!$db) { die (Database Selection to $dbase failed.); } } } $dbn = new dbConnect(localhost,3306,bob,hjhyt4kl5); $dbn-setDbase(main); So why can't I use $db? Isn't the statement $this-db=$db making it available to the setDbase function? Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- 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