[PHP] Re: Help understanding code...
Hi, It's a C Like Syntax (condition)?true:false; is like : if (condition) true else false regards. P.E. Baroiller Jeff McKeon [EMAIL PROTECTED] a écrit dans le message de news:[EMAIL PROTECTED] I've just picked up a more advanced book on PHP and it has a lot of example code in it. I understand most of it but some things I'm seeing I don't understand. Like the following... code: $couponcode = (! empty($_REQUEST['couponcode'])) ? $_REQUEST['couponcode'] : NULL; I think this is saying: If the global variable couponcode is not empty, then the variable '$couponcode' is equal to $_REQUEST['couponcode'] otherwise it gets a NULL value. What's throwing me is the use of the ! and ? and : If What I suspect is correct, I've never seen an if-then statement like this. If it is a replacement for an IF-Then statement then it's much cleaner and I'd like to use it. another one is: code: IF (!strcmp($operator, '+')) { $result = $num1 + $num2 } I've looked up strcmp() and know it's used to compair two strings. The $operator variable in the script that this was taken from is set to either -, +, * or /. What I don't understand here is what the ! in front of strcmp() means. Can anyone break down the code for me and explain the parts? thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 26 Sep 2003 08:49:58 -0000 Issue 2319
php-general Digest 26 Sep 2003 08:49:58 - Issue 2319 Topics (messages 163988 through 164018): Re: Understanding code.. again 163988 by: Jeff McKeon 163989 by: R'twick Niceorgaw 163990 by: Chris Sherwood 163991 by: Brad Pauly 163993 by: Jeff McKeon Re: PHP Editor - which to use? 163992 by: Jim Lucas 163994 by: Jim Lucas 164004 by: Roger B.A. Klorese Re: What to use? 163995 by: Tyler Lane 163996 by: Jeff McKeon 163997 by: Robert Cummings 163998 by: CPT John W. Holmes 163999 by: CPT John W. Holmes 164000 by: Eugene Lee 164003 by: Robert Cummings 164005 by: Ryan A Re: mysql.sock file location 164001 by: Donald Tyler Broken pipe: core_output_filter: writing data to the network 164002 by: Martin Greco Checking mail with `mail` 164006 by: Dan Phiffer Re: Help! the Error_Reporting doesn't work 164007 by: Curt Zirzow 164016 by: LuckyEagle 164017 by: Greg Beaver Re: One variable not equal to 2 values. 164008 by: Curt Zirzow 164009 by: Robert Cummings Private Mail System? 164010 by: Lee Herron QCS 164015 by: Ryan Thompson Re: Timezones and Daylight Savings Time 164011 by: Tom Rogers Weird replacing 164012 by: Anguz Web Design Form Passed Multidimension Array 164013 by: Keith Spiller 164014 by: Robert Cummings Re: Help understanding code... 164018 by: Baroiller Pierre-Emmanuel Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Ok, so if an argument is supplied to the function, the = null is ignored? Jeff -Original Message- From: Brad Pauly [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 4:09 PM To: Jeff McKeon Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Understanding code.. again Jeff McKeon wrote: Function Showmessage($msgvar = null) { echo $msgvar; } ? --snip-- What is the purpose in the function def of ($msgvar = null)?? Why not just function showmessage($msgvar)?? That sets a default value for $msgvar so you can call the function without an argument and it will not raise an error. - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- Jeff McKeon said the following on 9/25/2003 4:00 PM In the following code... --snip-- ?PHP $name = bob; Showmessage(hello $name); Exit; Function Showmessage($msgvar = null) { echo $msgvar; } ? --snip-- What is the purpose in the function def of ($msgvar = null)?? Why not just function showmessage($msgvar)?? It's to set a default value if no argument is passed to the function when called like Showmessage(); In this case $msgvar inside the function will have a null value. HTH R'twick ---End Message--- ---BeginMessage--- Yes the null is ignored when a var is passed -- SNIP-- Ok, so if an argument is supplied to the function, the = null is ignored? Jeff -- snip -- chris ---End Message--- ---BeginMessage--- Jeff McKeon wrote: Ok, so if an argument is supplied to the function, the = null is ignored? Yep. - Brad ---End Message--- ---BeginMessage--- Thanks all! Jeff -Original Message- From: Chris Sherwood [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 4:15 PM To: Jeff McKeon; [EMAIL PROTECTED] Subject: Re: [PHP] Understanding code.. again Yes the null is ignored when a var is passed -- SNIP-- Ok, so if an argument is supplied to the function, the = null is ignored? Jeff -- snip -- chris ---End Message--- ---BeginMessage--- Something else entirely. I guess you could call them helper scripts libraries. Example would be: You can program a script to create a switch statement and then have it prompt you for the number of case statements to add in and if you want them to break; or not. Things like that. Short cuts if you will.. Jim Lucas - Original Message - From: Roger B.A. Klorese [EMAIL PROTECTED] To: 'Jim Lucas' [EMAIL PROTECTED]; 'Chris W. Parker' [EMAIL PROTECTED]; 'jeffrey pearson' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 25, 2003 12:00 PM Subject: RE: RE: [PHP] PHP Editor - which to use? you can create so-called assistants... You can create a loop that asks in a table how many rows and columns do you want in that table. Then you can have it create the table with all your favorite default table settings, but while it is generating it, you could have it prompt you for any additional settings that you would like to have in the new table. That doesn't explain what internal scripting is. Do
[PHP] HTML mailing list
anyone know of a good HTML mailing list? sorry for the OT post. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to accept file through http from curl c program??
Hi there, Hopefully someone can shed some light for us on this. We have a client who is sending us a file through a C program which uses Curl. At our end we have a php script to accept the file passed through the form. This php script works fine using a browser however, it does not pick up what the C program sends to us. Our php is below, $_FILES contains zilch!! Any ideas?: foreach( $_FILES as $varname = $fileinfo ){ $filename = $fileinfo[name]; $tmpname = $fileinfo[tmp_name]; } $uploaddir = '/usr/local/nameofdir/; $uploadfile = $uploaddir. $_FILES['filename']['name']; if (move_uploaded_file($_FILES['filename']['tmp_name'], $uploadfile)) { $fp=fopen(brianLog1, w+); $string = HTTPS POST of Purchase Order SUCCESSFUL. File Name: .$_FILE['filename']['name'].\n; fwrite($fp, $string); } else { $fp=fopen(brianLog2, w+); $string = HTTPS POST Failed !* File Name: .$_FILES['filename']['name'].\nTmp Name: .$_FILES['filename']['tmp_name']; fwrite($fp, $string); } ?
RE: [PHP] How to accept file through http from curl c program??
At a first glance: $fp=fopen(brianLog1, w+); brianlog1 should either be in quotes if that's the name of the file and the file doesn't have an extension. Or maybe it's a variable in which case you'll need to put the $ in front of it.. Hope that helps Regards Chris -Original Message- From: Brian Moynihan [mailto:[EMAIL PROTECTED] Sent: 26 September 2003 10:25 To: [EMAIL PROTECTED] Subject: [PHP] How to accept file through http from curl c program?? Hi there, Hopefully someone can shed some light for us on this. We have a client who is sending us a file through a C program which uses Curl. At our end we have a php script to accept the file passed through the form. This php script works fine using a browser however, it does not pick up what the C program sends to us. Our php is below, $_FILES contains zilch!! Any ideas?: foreach( $_FILES as $varname = $fileinfo ){ $filename = $fileinfo[name]; $tmpname = $fileinfo[tmp_name]; } $uploaddir = '/usr/local/nameofdir/; $uploadfile = $uploaddir. $_FILES['filename']['name']; if (move_uploaded_file($_FILES['filename']['tmp_name'], $uploadfile)) { $fp=fopen(brianLog1, w+); $string = HTTPS POST of Purchase Order SUCCESSFUL. File Name: .$_FILE['filename']['name'].\n; fwrite($fp, $string); } else { $fp=fopen(brianLog2, w+); $string = HTTPS POST Failed !* File Name: .$_FILES['filename']['name'].\nTmp Name: .$_FILES['filename']['tmp_name']; fwrite($fp, $string); } ? If you are not the intended recipient of this e-mail, please preserve the confidentiality of it and advise the sender immediately of any error in transmission. Any disclosure, copying, distribution or action taken, or omitted to be taken, by an unauthorised recipient in reliance upon the contents of this e-mail is prohibited. Somerfield cannot accept liability for any damage which you may sustain as a result of software viruses so please carry out your own virus checks before opening an attachment. In replying to this e-mail you are granting the right for that reply to be forwarded to any other individual within the business and also to be read by others. Any views expressed by an individual within this message do not necessarily reflect the views of Somerfield. Somerfield reserves the right to intercept, monitor and record communications for lawful business purposes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to accept file through http from curl c program??
Thanks Chris but I don't think that is the issue as the file is being created and the script is running through. It's just that $_FILES contains no data which it should?? I is confused as they say because it works perfectly using the browser ... - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, September 26, 2003 12:29 PM Subject: RE: [PHP] How to accept file through http from curl c program?? At a first glance: $fp=fopen(brianLog1, w+); brianlog1 should either be in quotes if that's the name of the file and the file doesn't have an extension. Or maybe it's a variable in which case you'll need to put the $ in front of it.. Hope that helps Regards Chris -Original Message- From: Brian Moynihan [mailto:[EMAIL PROTECTED] Sent: 26 September 2003 10:25 To: [EMAIL PROTECTED] Subject: [PHP] How to accept file through http from curl c program?? Hi there, Hopefully someone can shed some light for us on this. We have a client who is sending us a file through a C program which uses Curl. At our end we have a php script to accept the file passed through the form. This php script works fine using a browser however, it does not pick up what the C program sends to us. Our php is below, $_FILES contains zilch!! Any ideas?: foreach( $_FILES as $varname = $fileinfo ){ $filename = $fileinfo[name]; $tmpname = $fileinfo[tmp_name]; } $uploaddir = '/usr/local/nameofdir/; $uploadfile = $uploaddir. $_FILES['filename']['name']; if (move_uploaded_file($_FILES['filename']['tmp_name'], $uploadfile)) { $fp=fopen(brianLog1, w+); $string = HTTPS POST of Purchase Order SUCCESSFUL. File Name: .$_FILE['filename']['name'].\n; fwrite($fp, $string); } else { $fp=fopen(brianLog2, w+); $string = HTTPS POST Failed !* File Name: .$_FILES['filename']['name'].\nTmp Name: .$_FILES['filename']['tmp_name']; fwrite($fp, $string); } ? If you are not the intended recipient of this e-mail, please preserve the confidentiality of it and advise the sender immediately of any error in transmission. Any disclosure, copying, distribution or action taken, or omitted to be taken, by an unauthorised recipient in reliance upon the contents of this e-mail is prohibited. Somerfield cannot accept liability for any damage which you may sustain as a result of software viruses so please carry out your own virus checks before opening an attachment. In replying to this e-mail you are granting the right for that reply to be forwarded to any other individual within the business and also to be read by others. Any views expressed by an individual within this message do not necessarily reflect the views of Somerfield. Somerfield reserves the right to intercept, monitor and record communications for lawful business purposes. -- 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] Vpopmail
hi i have a serious problem i want to create qmail user using vpopmail but all the function are for 4.0.5 - 4.2.3 only. what should i do now any help will be highly appreciated.Haseeb IncrediMail - Email has finally evolved - Click Here
Re: [PHP] Vpopmail
Hi, Saturday, September 27, 2003, 8:25:05 AM, you wrote: H hi i have a serious problem i want to create qmail user using vpopmail H but all the function are for 4.0.5 - 4.2.3 only. what should i do now any H help will be highly appreciated. H Haseeb H IncrediMail - Email has finally evolved - Click Here call up the vpopmail executables using system() calls should work just as well. Also probably more reliable as they will lock the qmail files before changing values. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] str_pad
This should be quite an easy task for some... say for example $line-dbranch has a value of 3 I know that 3 spaces will be added on to the end of $dbranch $dbranch = str_pad($line-dbranch_no, 6); so the value of $dbranch should look like 3 Is there anyway to right justify the 3 using str_pad .. example still put the 3 spaces in but at the beginning??? so it looks like 3 Chris
[PHP] Re: str_pad
$dbranch = str_pad($line-dbranch_no, 6, STR_PAD_LEFT); there's a aslo $dbranch = str_pad($line-dbranch_no, 6, STR_PAD_BOTH); and that pads it in the centre pete Chris Grigor wrote: This should be quite an easy task for some... say for example $line-dbranch has a value of 3 I know that 3 spaces will be added on to the end of $dbranch $dbranch = str_pad($line-dbranch_no, 6); so the value of $dbranch should look like 3 Is there anyway to right justify the 3 using str_pad .. example still put the 3 spaces in but at the beginning??? so it looks like 3 Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HTML mailing list
www.hotscripts.com Angelo Zanetti wrote: anyone know of a good HTML mailing list? sorry for the OT post. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_pad
of course, you can specify the optional argument STR_PAD_LEFT like: $dbranch = str_pad($line-dbranch_no, 6, '', STR_PAD_LEFT); Enjoy, Nitin - Original Message - From: Chris Grigor [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Friday, September 26, 2003 4:49 PM Subject: [PHP] str_pad This should be quite an easy task for some... say for example $line-dbranch has a value of 3 I know that 3 spaces will be added on to the end of $dbranch $dbranch = str_pad($line-dbranch_no, 6); so the value of $dbranch should look like 3 Is there anyway to right justify the 3 using str_pad .. example still put the 3 spaces in but at the beginning??? so it looks like 3 Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] best method to resize images
have a situation where clients will be uploading images via a web interface. We need to process these images to create thumbnails. In the past we have used image but have found that the output is somewhat less than desireable and limited to jpg. We would like to be able to soften the image prior to resize so it is a little clearer in the thumbnail, as well as have the option of working with gif, png, etc... Comments appreciated. Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to accept file through http from curl c program??
I don't really know much about Curl, but what it -sounds- like is that Curl isn't sending the proper headers/MIME types to the PHP script and PHP isn't putting the input into the $_FILES array. You might want to look in your $_GET or $_POST array for existance of the file to see if it's being sent there. Good luck. -M -Original Message- From: Brian Moynihan [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 6:44 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] How to accept file through http from curl c program?? Thanks Chris but I don't think that is the issue as the file is being created and the script is running through. It's just that $_FILES contains no data which it should?? I is confused as they say because it works perfectly using the browser ... - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, September 26, 2003 12:29 PM Subject: RE: [PHP] How to accept file through http from curl c program?? At a first glance: $fp=fopen(brianLog1, w+); brianlog1 should either be in quotes if that's the name of the file and the file doesn't have an extension. Or maybe it's a variable in which case you'll need to put the $ in front of it.. Hope that helps Regards Chris -Original Message- From: Brian Moynihan [mailto:[EMAIL PROTECTED] Sent: 26 September 2003 10:25 To: [EMAIL PROTECTED] Subject: [PHP] How to accept file through http from curl c program?? Hi there, Hopefully someone can shed some light for us on this. We have a client who is sending us a file through a C program which uses Curl. At our end we have a php script to accept the file passed through the form. This php script works fine using a browser however, it does not pick up what the C program sends to us. Our php is below, $_FILES contains zilch!! Any ideas?: foreach( $_FILES as $varname = $fileinfo ){ $filename = $fileinfo[name]; $tmpname = $fileinfo[tmp_name]; } $uploaddir = '/usr/local/nameofdir/; $uploadfile = $uploaddir. $_FILES['filename']['name']; if (move_uploaded_file($_FILES['filename']['tmp_name'], $uploadfile)) { $fp=fopen(brianLog1, w+); $string = HTTPS POST of Purchase Order SUCCESSFUL. File Name: .$_FILE['filename']['name'].\n; fwrite($fp, $string); } else { $fp=fopen(brianLog2, w+); $string = HTTPS POST Failed !* File Name: .$_FILES['filename']['name'].\nTmp Name: .$_FILES['filename']['tmp_name']; fwrite($fp, $string); } ? If you are not the intended recipient of this e-mail, please preserve the confidentiality of it and advise the sender immediately of any error in transmission. Any disclosure, copying, distribution or action taken, or omitted to be taken, by an unauthorised recipient in reliance upon the contents of this e-mail is prohibited. Somerfield cannot accept liability for any damage which you may sustain as a result of software viruses so please carry out your own virus checks before opening an attachment. In replying to this e-mail you are granting the right for that reply to be forwarded to any other individual within the business and also to be read by others. Any views expressed by an individual within this message do not necessarily reflect the views of Somerfield. Somerfield reserves the right to intercept, monitor and record communications for lawful business purposes. -- 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] best method to resize images
See the image magick tools (http://www.imagemagick.org/) and their API to PHP (http://pear.php.net/package-info.php?package=imagick) -Mensaje original- De: Dave [Hawk-Systems] [mailto:[EMAIL PROTECTED] Enviado el: viernes, 26 de septiembre de 2003 14:32 Para: [EMAIL PROTECTED] Asunto: [PHP] best method to resize images Importancia: Baja have a situation where clients will be uploading images via a web interface. We need to process these images to create thumbnails. In the past we have used image but have found that the output is somewhat less than desireable and limited to jpg. We would like to be able to soften the image prior to resize so it is a little clearer in the thumbnail, as well as have the option of working with gif, png, etc... Comments appreciated. Dave -- 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] free php + mysql hosting ?
hi , i 'm looking for a free php + mysql hosting thanks . Fatih Olcer. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Urgent Help
Hello, my name is anson, I am a year 2 student in Hong Kong Ive. I have decided to do a final year project by using php to make a wireless ordering system for restaurants. In my project, I decide to use php scripts to sent the order content or some information to different printers. I have 3 printers with differet Ip address. My question is can I use php script to send information to an intended IP printer? If it can be achieved, then what command I should use? or is there any example I can find in php.net? I am looking forward to hearing from you reply. Thanks for your kind attention = Ho King Man, Anson _ :[EMAIL PROTECTED] http://ringtone.yahoo.com.hk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Passed Multidimension Array
I am trying to find out how to pass a multidimensional array within a hidden input of a form. Would it be something like this? input type='hidden' name='all_links' value='$all_links' Any advice would be forever appreciated... Here's a recycled reply from a similar question last month. To pass an array in a form, you should serialize it and encode it, then after receiving it you decode it and unserialize it. The example assumes register_globals is on: $portable_array = base64_encode(serialize($array)); You can then pass $portable_array as a form hidden input value. To turn it back into an array: $array = unserialize(base64_decode($portable_array)); -- Lowell Allen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php, mysql hosting cheap,no ads (0-t)
Hey guys, Have picked up a large hosting package which is really great but cant afford to have it for long at its current price. So have decided to share/partition...If anyones intrested in really cheap hosting you'll get 20mb space 2 mysql dbs 350mb bandwidth php (duh) cgi-bin etc etc No ads. for $2 a month. NOTE: no porn (pictures, cartoons etc) no spaming. Can only accept paypal. Can also do java (jsp/servlets) but i think they have a setup fee for that. Anyone intrested..am just a mail away. Sorry for this ad . Cheers, -Ryan We will slaughter you all! - The Iraqi (Dis)information ministers site http://MrSahaf.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] best method to resize images
PEAR has a class for image manipluation, http://pear.php.net. Also there was an excellent class on phpclasses.org that allows you to easily crop, resize, shrink, etc, etc, I can't remember its name but I used it for a while. Dave [Hawk-Systems] wrote: have a situation where clients will be uploading images via a web interface. We need to process these images to create thumbnails. In the past we have used image but have found that the output is somewhat less than desireable and limited to jpg. We would like to be able to soften the image prior to resize so it is a little clearer in the thumbnail, as well as have the option of working with gif, png, etc... Comments appreciated. Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session info stored on server
What's actually stored on the server when using sessions? I've built a content management system on a commercial host, PHP 4.3.2, Apache 1.3.28, and use session_save_path() to specify a directory. When someone logs in, I check the username and password against the database, and save username as a session variable -- $valid_user = $username; session_register(valid_user); If I examine the directory specified by session_save_path(), I see something like sess_4f5d...0367. Where's the session variable valid_user? Is it an array element of sess_whatever, or are session variables stored in memory with only the ID stored on the server? A related question -- I thought that by specifying a directory with session_save_path(), the session data would not be subject to garbage collection. However, when I examine the directory specified, I don't see any creation dates more than 24 hours old, and I know there have been instances where the Mac OS X Entourage/Internet Explorer bug have caused sessions to fail, so the user never logged out, and session_unregister() and session_destroy() were never called for those sessions. Why aren't those sessions still listed in the sessions directory? Thanks for any insights. -- Lowell Allen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Urgent Help
Hello Ho, If you are using a printer that is postscript enabled (like HP LaserJet's) it is easy. Simply convert whatever you want to print to a postscript file (there are several utilities on freshmeat.net they do this) and then using PHP open a socket to the JetDirect card and send the data. HP's JetDirect port is 9100. You could possibly install LPR or CUPS on your PHP server and use the printer that way as well. Jason ho anson wrote: Hello, my name is anson, I am a year 2 student in Hong Kong Ive. I have decided to do a final year project by using php to make a wireless ordering system for restaurants. In my project, I decide to use php scripts to sent the order content or some information to different printers. I have 3 printers with differet Ip address. My question is can I use php script to send information to an intended IP printer? If it can be achieved, then what command I should use? or is there any example I can find in php.net? I am looking forward to hearing from you reply. Thanks for your kind attention = Ho King Man, Anson _ :[EMAIL PROTECTED] http://ringtone.yahoo.com.hk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to accept file through http from curl c program??
Thanks Mike, I set the content type to be text/xml in the C program. Just don't understand it at all. There appears to be no reason why it's not working. Thanks for your help so far, any more suggestions? Brian. - Original Message - From: Mike Brum [EMAIL PROTECTED] To: 'Brian Moynihan' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, September 26, 2003 1:36 PM Subject: RE: [PHP] How to accept file through http from curl c program?? I don't really know much about Curl, but what it -sounds- like is that Curl isn't sending the proper headers/MIME types to the PHP script and PHP isn't putting the input into the $_FILES array. You might want to look in your $_GET or $_POST array for existance of the file to see if it's being sent there. Good luck. -M -Original Message- From: Brian Moynihan [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 6:44 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] How to accept file through http from curl c program?? Thanks Chris but I don't think that is the issue as the file is being created and the script is running through. It's just that $_FILES contains no data which it should?? I is confused as they say because it works perfectly using the browser ... - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, September 26, 2003 12:29 PM Subject: RE: [PHP] How to accept file through http from curl c program?? At a first glance: $fp=fopen(brianLog1, w+); brianlog1 should either be in quotes if that's the name of the file and the file doesn't have an extension. Or maybe it's a variable in which case you'll need to put the $ in front of it.. Hope that helps Regards Chris -Original Message- From: Brian Moynihan [mailto:[EMAIL PROTECTED] Sent: 26 September 2003 10:25 To: [EMAIL PROTECTED] Subject: [PHP] How to accept file through http from curl c program?? Hi there, Hopefully someone can shed some light for us on this. We have a client who is sending us a file through a C program which uses Curl. At our end we have a php script to accept the file passed through the form. This php script works fine using a browser however, it does not pick up what the C program sends to us. Our php is below, $_FILES contains zilch!! Any ideas?: foreach( $_FILES as $varname = $fileinfo ){ $filename = $fileinfo[name]; $tmpname = $fileinfo[tmp_name]; } $uploaddir = '/usr/local/nameofdir/; $uploadfile = $uploaddir. $_FILES['filename']['name']; if (move_uploaded_file($_FILES['filename']['tmp_name'], $uploadfile)) { $fp=fopen(brianLog1, w+); $string = HTTPS POST of Purchase Order SUCCESSFUL. File Name: .$_FILE['filename']['name'].\n; fwrite($fp, $string); } else { $fp=fopen(brianLog2, w+); $string = HTTPS POST Failed !* File Name: .$_FILES['filename']['name'].\nTmp Name: .$_FILES['filename']['tmp_name']; fwrite($fp, $string); } ? If you are not the intended recipient of this e-mail, please preserve the confidentiality of it and advise the sender immediately of any error in transmission. Any disclosure, copying, distribution or action taken, or omitted to be taken, by an unauthorised recipient in reliance upon the contents of this e-mail is prohibited. Somerfield cannot accept liability for any damage which you may sustain as a result of software viruses so please carry out your own virus checks before opening an attachment. In replying to this e-mail you are granting the right for that reply to be forwarded to any other individual within the business and also to be read by others. Any views expressed by an individual within this message do not necessarily reflect the views of Somerfield. Somerfield reserves the right to intercept, monitor and record communications for lawful business purposes. -- 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] Session info stored on server
Lowell Allen wrote: What's actually stored on the server when using sessions? I've built a content management system on a commercial host, PHP 4.3.2, Apache 1.3.28, and use session_save_path() to specify a directory. When someone logs in, I check the username and password against the database, and save username as a session variable -- $valid_user = $username; session_register(valid_user); If I examine the directory specified by session_save_path(), I see something like sess_4f5d...0367. Where's the session variable valid_user? Is it an array element of sess_whatever, or are session variables stored in memory with only the ID stored on the server? Open sess_4f5d...0367 in any text editor and you will see your variable there. A related question -- I thought that by specifying a directory with session_save_path(), the session data would not be subject to garbage collection. However, when I examine the directory specified, I don't see any creation dates more than 24 hours old, and I know there have been instances where the Mac OS X Entourage/Internet Explorer bug have caused sessions to fail, so the user never logged out, and session_unregister() and session_destroy() were never called for those sessions. Why aren't those sessions still listed in the sessions directory? session_start() runs garbage collector in current session save path directory. The plus is you are not affected by other virtual hosts on the same server. Thanks for any insights. -- Lowell Allen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP 4.3.3 Install, Errors??
I finally have my installation of PHP 4.3.3 to work, thanks to your help and a couple other people on IRC. For knowledge sack here's how I resolve the problem. Installed port/packages of... png-1.2.5p1 jpeg-6b gd-1.8.3 (built in library of PHP would not work for me) ImageMagick-5.2.9 zlib (build in. standard part of OpenBSD, /usr/lib/) To resolve the config: error: fix png.h not found. error I was unable to do this without making a symbolic link. cd /usr/local/include; ln -s libpng/*. This would crate a symbolic link of each file in /usr/local/include/libpng in /usr/local/include. Than run configure, and everything was just fine. ./configure --with-mysql --with-xml --with-apxs --without-pear --with-config-file-path=/var/www/conf --with-zlib --with-zlib-dir=/usr --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-gd=/usr/local make make install Thanks for the help! Unless you need PEAR, you're fine. Try configuring --without-pear. You should really be doing this anyways unless actually need PEAR. Evan Nemerson On Thursday 11 September 2003 02:10 pm, Adam Douglas wrote: Hi. I have a machine that's been freshly installed with PHP 4.1.1. I wanted to upgrade it to PHP 4.3.3. So I did the following below as SU and received the below errors. Is this something I should be worried about? How can I resolve the errors? Never have had this happen before in the past. I ran phpinfo() and it shows PHP 4.3.3, but is the install of PHP okay? If you require any additional information let me know, thanks! # make install Installing PHP CLI binary:/usr/local/bin/ Installing PHP CLI man page: /usr/local/man/man1/ Installing PHP SAPI module: apache [activating module `php4' in /var/www/conf/httpd.conf] cp libs/libphp4.so /usr/lib/apache/modules/libphp4.so chmod 755 /usr/lib/apache/modules/libphp4.so cp /var/www/conf/httpd.conf /var/www/conf/httpd.conf.bak cp /var/www/conf/httpd.conf.new /var/www/conf/httpd.conf rm /var/www/conf/httpd.conf.new Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20020429/ Installing PEAR environment: /usr/local/lib/php/ Parse error: parse error in /usr/files/storage/Software/php-4.3.3/pear/package-Archive_Tar .xml on line 1 *** Error code 255 Stop in /usr/files/storage/Software/php-4.3.3 (line 263 of Makefile). *** Error code 1 Stop in /usr/files/storage/Software/php-4.3.3 (line 269 of Makefile). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session info stored on server
What's actually stored on the server when using sessions? I've built a content management system on a commercial host, PHP 4.3.2, Apache 1.3.28, and use session_save_path() to specify a directory. When someone logs in, I check the username and password against the database, and save username as a session variable -- $valid_user = $username; session_register(valid_user); If I examine the directory specified by session_save_path(), I see something like sess_4f5d...0367. Where's the session variable valid_user? Is it an array element of sess_whatever, or are session variables stored in memory with only the ID stored on the server? Open sess_4f5d...0367 in any text editor and you will see your variable there. I can't. I'm unable to open or download or change the permissions. Is it an array? A related question -- I thought that by specifying a directory with session_save_path(), the session data would not be subject to garbage collection. However, when I examine the directory specified, I don't see any creation dates more than 24 hours old, and I know there have been instances where the Mac OS X Entourage/Internet Explorer bug have caused sessions to fail, so the user never logged out, and session_unregister() and session_destroy() were never called for those sessions. Why aren't those sessions still listed in the sessions directory? session_start() runs garbage collector in current session save path directory. The plus is you are not affected by other virtual hosts on the same server. So if I want to create sessions that last indefinitely (as least as far as the server is concerned), do I need to write my own session functions that use a database to store the session ID? -- Lowell Allen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php_execute_script
Hi! Is there any sample code available how to use properly this API ? zend_file_handle file_handle; file_handle.type = ZEND_HANDLE_FILENAME; file_handle.filename = c:\php\hello.php; file_handle.free_filename = 0; file_handle.opened_path = NULL; php_execute_script( file_handle TSRMLS_CC ); While using above code in embed example shipped with PHP source I get an error: Unknown(0) : Warning - Unknown(c:\php\hello.php): failed to create stream: No such file or directory Unknown(0) : Warning - Unknown(): Failed opening 'c:\php\sql.php' for inclusion (include_path='.;c:\php4\pear') Can anybody share some light on using php_execute_script ?---BeginMessage--- Hi! Is there any sample code available how to use properly this API ? zend_file_handle file_handle; file_handle.type= ZEND_HANDLE_FILENAME; file_handle.filename= c:\php\hello.php; file_handle.free_filename = 0; file_handle.opened_path = NULL; php_execute_script( file_handle TSRMLS_CC ); While using above code in embed example shipped with PHP source I get an error: Unknown(0) : Warning - Unknown(c:\php\hello.php): failed to create stream: No such file or directory Unknown(0) : Warning - Unknown(): Failed opening 'c:\php\sql.php' for inclusion (include_path='.;c:\php4\pear') Can anybody share some light on using php_execute_script ?---End Message--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] str_pad
Just learning PHP and figuring out all the syntax and stuff. Anyway I had a question about the code example in this post... What does the - do in: $dbranch = str_pad($line-dbranch_no, 6, '', STR_PAD_LEFT); Is dbranch_no a class I don't know about? Thanks, Jeff -Original Message- From: Nitin [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 8:05 AM To: Chris Grigor; php Subject: Re: [PHP] str_pad of course, you can specify the optional argument STR_PAD_LEFT like: $dbranch = str_pad($line-dbranch_no, 6, '', STR_PAD_LEFT); Enjoy, Nitin - Original Message - From: Chris Grigor [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Friday, September 26, 2003 4:49 PM Subject: [PHP] str_pad This should be quite an easy task for some... say for example $line-dbranch has a value of 3 I know that 3 spaces will be added on to the end of $dbranch $dbranch = str_pad($line-dbranch_no, 6); so the value of $dbranch should look like 3 Is there anyway to right justify the 3 using str_pad .. example still put the 3 spaces in but at the beginning??? so it looks like 3 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] str_pad
On Fri, 2003-09-26 at 11:00, Jeff McKeon wrote: Just learning PHP and figuring out all the syntax and stuff. Anyway I had a question about the code example in this post... What does the - do in: $dbranch = str_pad($line-dbranch_no, 6, '', STR_PAD_LEFT); Is dbranch_no a class I don't know about? $line is an instance of some class (not shown in the above). dbranch is a member variable of the class, and subsequently an instance variable of the object $line. The - is how you access methods and variables in objects. HTH, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_pad
No, $line is an object (class instance) and dbranch_no is a property of the object. www.php.net/oop Jeff McKeon wrote: Just learning PHP and figuring out all the syntax and stuff. Anyway I had a question about the code example in this post... What does the - do in: $dbranch = str_pad($line-dbranch_no, 6, '', STR_PAD_LEFT); Is dbranch_no a class I don't know about? Thanks, Jeff -Original Message- From: Nitin [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 8:05 AM To: Chris Grigor; php Subject: Re: [PHP] str_pad of course, you can specify the optional argument STR_PAD_LEFT like: $dbranch = str_pad($line-dbranch_no, 6, '', STR_PAD_LEFT); Enjoy, Nitin - Original Message - From: Chris Grigor [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Friday, September 26, 2003 4:49 PM Subject: [PHP] str_pad This should be quite an easy task for some... say for example $line-dbranch has a value of 3 I know that 3 spaces will be added on to the end of $dbranch $dbranch = str_pad($line-dbranch_no, 6); so the value of $dbranch should look like 3 Is there anyway to right justify the 3 using str_pad .. example still put the 3 spaces in but at the beginning??? so it looks like 3 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] str_pad
On Fri, 2003-09-26 at 11:18, Robert Cummings wrote: On Fri, 2003-09-26 at 11:00, Jeff McKeon wrote: Just learning PHP and figuring out all the syntax and stuff. Anyway I had a question about the code example in this post... What does the - do in: $dbranch = str_pad($line-dbranch_no, 6, '', STR_PAD_LEFT); Is dbranch_no a class I don't know about? $line is an instance of some class (not shown in the above). dbranch is Should say dbranch_no 8) a member variable of the class, and subsequently an instance variable of the object $line. The - is how you access methods and variables in objects. HTH, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_pad
It gives dbranch_no field in $line array $line-dbranch_no replaces the value of 'dbranch_no' field stored in '$line' array. Enjoy Nitin - Original Message - From: Jeff McKeon [EMAIL PROTECTED] To: Nitin [EMAIL PROTECTED]; Chris Grigor [EMAIL PROTECTED]; php [EMAIL PROTECTED] Sent: Friday, September 26, 2003 8:30 PM Subject: RE: [PHP] str_pad Just learning PHP and figuring out all the syntax and stuff. Anyway I had a question about the code example in this post... What does the - do in: $dbranch = str_pad($line-dbranch_no, 6, '', STR_PAD_LEFT); Is dbranch_no a class I don't know about? Thanks, Jeff -Original Message- From: Nitin [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 8:05 AM To: Chris Grigor; php Subject: Re: [PHP] str_pad of course, you can specify the optional argument STR_PAD_LEFT like: $dbranch = str_pad($line-dbranch_no, 6, '', STR_PAD_LEFT); Enjoy, Nitin - Original Message - From: Chris Grigor [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Friday, September 26, 2003 4:49 PM Subject: [PHP] str_pad This should be quite an easy task for some... say for example $line-dbranch has a value of 3 I know that 3 spaces will be added on to the end of $dbranch $dbranch = str_pad($line-dbranch_no, 6); so the value of $dbranch should look like 3 Is there anyway to right justify the 3 using str_pad .. example still put the 3 spaces in but at the beginning??? so it looks like 3 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] str_pad
Thanks all! This is definitely one of the most helpfull mailing lists I belong to. Jeff -Original Message- From: Nitin [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 11:26 AM To: Jeff McKeon; php Subject: Re: [PHP] str_pad It gives dbranch_no field in $line array $line-dbranch_no replaces the value of 'dbranch_no' field stored in '$line' array. Enjoy Nitin - Original Message - From: Jeff McKeon [EMAIL PROTECTED] To: Nitin [EMAIL PROTECTED]; Chris Grigor [EMAIL PROTECTED]; php [EMAIL PROTECTED] Sent: Friday, September 26, 2003 8:30 PM Subject: RE: [PHP] str_pad Just learning PHP and figuring out all the syntax and stuff. Anyway I had a question about the code example in this post... What does the - do in: $dbranch = str_pad($line-dbranch_no, 6, '', STR_PAD_LEFT); Is dbranch_no a class I don't know about? Thanks, Jeff -Original Message- From: Nitin [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 8:05 AM To: Chris Grigor; php Subject: Re: [PHP] str_pad of course, you can specify the optional argument STR_PAD_LEFT like: $dbranch = str_pad($line-dbranch_no, 6, '', STR_PAD_LEFT); Enjoy, Nitin - Original Message - From: Chris Grigor [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Friday, September 26, 2003 4:49 PM Subject: [PHP] str_pad This should be quite an easy task for some... say for example $line-dbranch has a value of 3 I know that 3 spaces will be added on to the end of $dbranch $dbranch = str_pad($line-dbranch_no, 6); so the value of $dbranch should look like 3 Is there anyway to right justify the 3 using str_pad .. example still put the 3 spaces in but at the beginning??? so it looks like 3 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
[PHP] Test Links...
Greetings All, I am creating a 'links' page and was wondering if there was a way in PHP to test the response of an outside link? I'm sure everyone here has clicked on a links page link and have a No Page Found error because no one is keeping the links uptodate. I was wondering if there was a way when a link was clicked to test the link first to see if it is still active. If it isn't active, I would like to remove the link from my database. Is there a command that tests the results of link? Thanks, Doug Coning American Web Studio http://www.americanwebstudio.com HTML / FLASH / PHP / MYSQL / FILEMAKER
Re: [PHP] Test Links...
Doug Coning said the following on 9/26/2003 12:15 PM Greetings All, I am creating a 'links' page and was wondering if there was a way in PHP to test the response of an outside link? I'm sure everyone here has clicked on a links page link and have a No Page Found error because no one is keeping the links uptodate. I was wondering if there was a way when a link was clicked to test the link first to see if it is still active. If it isn't active, I would like to remove the link from my database. Is there a command that tests the results of link? Thanks, Doug Coning Hi doug, try something like the function given here http://shiflett.org/dev/php_post.phps and check the returned headers .. there will be a field which will contain the status code (200 for successful / 404 for page not found etc). HTH R'twick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session info stored on server
Open sess_4f5d...0367 in any text editor and you will see your variable there. I can't. I'm unable to open or download or change the permissions. Is it an array? A serialized array, yes. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Test Links...
Ive used curl to test stuff out with too...however, if on link i like to use wget to test it out. You might not have that option but I have seen others use fopen or file_get_contents. HTH, BigDog On Fri, 2003-09-26 at 10:15, Doug Coning wrote: Greetings All, I am creating a 'links' page and was wondering if there was a way in PHP to test the response of an outside link? I'm sure everyone here has clicked on a links page link and have a No Page Found error because no one is keeping the links uptodate. I was wondering if there was a way when a link was clicked to test the link first to see if it is still active. If it isn't active, I would like to remove the link from my database. Is there a command that tests the results of link? Thanks, Doug Coning American Web Studio http://www.americanwebstudio.com HTML / FLASH / PHP / MYSQL / FILEMAKER -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Integrating Various Languages in PHP
I just picked up a copy of the PHP Architect magazine this month (http://www.phparch.com) and they had an article about compiling PHP in such a way that you can call Java code from within PHP. How many other languages does PHP support like this? Can I use Perl, C++, or other languages without any problems from within PHP? -Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Weird replacing
I figured it out already. if the array has http://example.com/bbs/index.php?board=1 http://example.com/bbs/index.php?board=1;action=display;thread=12 3 then, the str_replace of that one with the other one that has the symbols changed, will be http://example.com/bbs/index.php/board-1 but it'll ALSO change the other one! http://example.com/bbs/index.php/board-1;action=display;thread=12 3 so when str_replace is looking for a match for the second url, it doesn't find it, cause it's not the same anymore I added this, right before the for loop, so larger strings will be replaced first and shorter last. rsort($match_spider, SORT_STRING); Thanks for listening to me while I was trying to figure it out anyway :) Cristian Anguz Web Design wrote: Hi, I wrote a code to change the urls in my forum, to a new format. I did it with output buffering and inside it, I used preg_replace_callback, which worked great for me. But I shared this code with the forum program community and there's a person that can't make it work. He says his Apache gets caught up in a loop or something. So I looked for an alternative to preg_replace_callback. The way I did it is with preg_match_all and then changed each element in the array and saved the changed elements in a new array, then I just str_replace using the arrays as find/replace. This solutions worked fine, almost. I use two functions to do changes to the urls, one to make them relative and the other to change symbols in the query, to something more friendly to search-engine spiders. The function to make them relative works great with the new method, as it did with preg_replace_callback, but the other function, the one to replace symbols in the query, is acting in an odd way. Here's function ?php function spider_url($match){ if(!strstr($match['2'], 'action') || strstr($match['2'], 'display') || strstr($match['2'], 'messageindex')) return $match['1'] . '/' . str_replace(array(=, ;, ), array(-, _, _), $match['2']); return $match['0']; } if I call it with this ?php /// $scripturl is the var that has the url to the forum script, like http://example.com/bbs/index.php $buffer = preg_replace_callback('/(' . preg_quote($scripturl, '/') . ')\?([\w;=~+%]+)/i', 'spider_url', $buffer); it works great and the url http://example.com/bbs/index.php?board=1;action=display;thread=12 3;start=1 changes to http://example.com/bbs/index.php/board-1_action-display_thread-12 3_start-1 but if I do it with this ?php preg_match_all('/(' . preg_quote($scripturl, '/') . ')\?([\w;=~+%]+)/i', $buffer, $match_spider, PREG_SET_ORDER); for($i = 0; $i count($match_spider); $i++){ $arr1_spider[$i] = $match_spider[$i]['0']; $arr2_spider[$i] = spider_url($match_spider[$i]); } $buffer = str_replace($arr1_spider, $arr2_spider, $buffer); then the url comes out like this http://example.com/bbs/index.php/board-1;action=display;thread=12 3;start=1 It changes just the first part, up to the semicolon... I did other tests and there was one where changed everything up to the semicolon right before 'star' I can't understand what's going on, so if someone has a clue, please tell me. Thank you very much in advance for taking your time reading this. Cristian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Integrating Various Languages in PHP
[snip] I just picked up a copy of the PHP Architect magazine this month (http://www.phparch.com) and they had an article about compiling PHP in such a way that you can call Java code from within PHP. How many other languages does PHP support like this? Can I use Perl, C++, or other languages without any problems from within PHP? [/snip] I haven't done it with PERL, but we do have a couple of C++ DLLs that we call with PHP for various functions. A good API goes a long way to proper use. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Test Links...
lol...if on linux... On Fri, 2003-09-26 at 12:35, Ray Hunter wrote: Ive used curl to test stuff out with too...however, if on link i like to use wget to test it out. You might not have that option but I have seen others use fopen or file_get_contents. HTH, BigDog On Fri, 2003-09-26 at 10:15, Doug Coning wrote: Greetings All, I am creating a 'links' page and was wondering if there was a way in PHP to test the response of an outside link? I'm sure everyone here has clicked on a links page link and have a No Page Found error because no one is keeping the links uptodate. I was wondering if there was a way when a link was clicked to test the link first to see if it is still active. If it isn't active, I would like to remove the link from my database. Is there a command that tests the results of link? Thanks, Doug Coning American Web Studio http://www.americanwebstudio.com HTML / FLASH / PHP / MYSQL / FILEMAKER -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php, mysql hosting cheap,no ads (0-t)
Hey Jason, Thanks for replying. Probably a bit late but we offer well powered hosting starting at just $9.95 a month, 250 MB storage space bandwidth is 5 GB/month, 15 POP 3 accounts and 15 FTP accounts, 2 databases, PHP 4.3.3 (upgraded regularly, Turck MMCache installed, Perl, PHP MyAdmin, PHP PgAdmin. We offer a full 30 day money back guarantee. I really dont think you could have offered me what i'm getting for example: 3gb space, 80 gb bandwidth, unlimted mail boxes, unlimted ftp accounts, unlimited databases, php 4.3.3,ZEND, perl, phpmyadmin,frontpage,java,ssl,webstats, multiple domains under a master contol panel, domain aliasing and a lot morebut i'm sure you not really intrested :-D Since it sounds like you already setup one account I'd give you the first month at 1/2 cost or possibly free. Actually have set up 8 domains alreadybut am intrested to know what you are offering and can you match the above + at what price? Reply to my e-mail or go to http://www.shadonet.com Nice site though. Cheers, -Ryan Jason Sheets Ryan A wrote: Hey guys, Have picked up a large hosting package which is really great but cant afford to have it for long at its current price. So have decided to share/partition...If anyones intrested in really cheap hosting you'll get 20mb space 2 mysql dbs 350mb bandwidth php (duh) cgi-bin etc etc No ads. for $2 a month. NOTE: no porn (pictures, cartoons etc) no spaming. Can only accept paypal. Can also do java (jsp/servlets) but i think they have a setup fee for that. Anyone intrested..am just a mail away. Sorry for this ad . Cheers, -Ryan We will slaughter you all! - The Iraqi (Dis)information ministers site http://MrSahaf.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $_SESSION stuffs that come with php.ini
I have been building the website for 6 months with everything and I didn't have hte php.ini on it. Just didn't realize it, so I create the php.ini that come from php.ini_dist that came with php source code. Now the $_SESSION doesn't work. I'm not able to make the php.ini to be like the one that php work without it. So, anyone know what is the default session configuration? Thanks... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: $_SESSION stuffs that come with php.ini
Is this the one??? http://us3.php.net/session Thanks... Scott Fletcher [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have been building the website for 6 months with everything and I didn't have hte php.ini on it. Just didn't realize it, so I create the php.ini that come from php.ini_dist that came with php source code. Now the $_SESSION doesn't work. I'm not able to make the php.ini to be like the one that php work without it. So, anyone know what is the default session configuration? Thanks... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: $_SESSION stuffs that come with php.ini
Alright that work now Don't know why does the php.ini default is not what it should be... I found a few that aren't on the list in php.ini, but hte most important thing right now is that it is fixed... Scott Fletcher [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is this the one??? http://us3.php.net/session Thanks... Scott Fletcher [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have been building the website for 6 months with everything and I didn't have hte php.ini on it. Just didn't realize it, so I create the php.ini that come from php.ini_dist that came with php source code. Now the $_SESSION doesn't work. I'm not able to make the php.ini to be like the one that php work without it. So, anyone know what is the default session configuration? Thanks... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail(); and embedding pictures
I am wondering if it is possible to embed pictures into email messages using this function. Thanx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail(); and embedding pictures
[snip] I am wondering if it is possible to embed pictures into email messages using this function. [/snip] I'm wondering if anyone ever tests this stuff. ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] What is the proper way to use mysql db on a multipage site?
I sent this to php-db with no reply, so I'll try it here then... -Original Message- From: Daevid Vincent [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 24, 2003 4:21 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] What is the proper way to use mysql db on a multipage site? I've been coding with PHP and mySQL for years. And this part has never sat right with me and finally I'm getting the nerve to ask how the pros out there do this... What I do is have a db.php file that contains: $db = mysql_connect (localhost,username,password) or die (Could not connect to SQL server.); mysql_select_db (mydb,$db) or die (Could not select Database); Then at the top of every page, I require_once(db.php); But it just seems so wasteful to keep making that mysql_connect(). Isn't there a way to store the $db result so I don't have to keep connecting. And how about the mysql_select_db() part too? Since I'm going to stay in the same db most of the time. I thought I read that I can't use a $_SESSION for it, and that's the only way I know of to have it be available on each page? Daevid Vincent http://daevid.com -- PHP Database 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] What is the proper way to use mysql db on a multipage site?
Mostly a matter of preference I would say. Cheers, Rob. On Fri, 2003-09-26 at 16:10, Daevid Vincent wrote: I sent this to php-db with no reply, so I'll try it here then... -Original Message- From: Daevid Vincent [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 24, 2003 4:21 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] What is the proper way to use mysql db on a multipage site? I've been coding with PHP and mySQL for years. And this part has never sat right with me and finally I'm getting the nerve to ask how the pros out there do this... What I do is have a db.php file that contains: $db = mysql_connect (localhost,username,password) or die (Could not connect to SQL server.); mysql_select_db (mydb,$db) or die (Could not select Database); Then at the top of every page, I require_once(db.php); But it just seems so wasteful to keep making that mysql_connect(). Isn't there a way to store the $db result so I don't have to keep connecting. And how about the mysql_select_db() part too? Since I'm going to stay in the same db most of the time. I thought I read that I can't use a $_SESSION for it, and that's the only way I know of to have it be available on each page? Daevid Vincent http://daevid.com -- PHP Database 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 -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] header ('Content-type...') does not work properly if session_start initiated...
Hello, I have a strange problem with a download script. Here is the situation: On my development server, the php is 4.0.6 while on the application server it is 4.3.2. I created a very simple code for opening pdf in browser. the main part of it is like following: ? session_start (); ... $docPath = '/path/to/file_name.pdf'; $pdftmp_name = 'tmp_name.pdf'; header ('Cache-Control: no-store, no-cache, must-revalidate'); header ('Content-Type: application/pdf'); header ('Content-disposition: inline; filename=' . $pdftmp_name); header ('Content-length: ' . filesize ($docPath)); readfile ($docPath); ? This code is working perfect on development server. However on the application server, it will first ask for confirm downloading then report error saying that cannot download. I checked the code line by line and found that if remove the first line session_start () then it will work in the correct way. However session is required for this script. I don't understand why it works OK on the development server but not for application server. Thanks in advance for all help! Alex Shi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail(); and embedding pictures
People send HTML e-mail each day with images using PHP...there are numerous discussion on the archive. If you are using plain text e-mail you cannot see images. -Original Message- From: Igor Frankovic [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 3:30 PM To: Jay Blanchard Subject: RE: [PHP] mail(); and embedding pictures I tried that but it doesn't work. You can see why if you use outlook and embed a picture. Send it to yourself and then view the source code of the email. -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 3:28 PM To: Igor Frankovic Subject: RE: [PHP] mail(); and embedding pictures You have to use HTML and include the image with an image tag -Original Message- From: Igor Frankovic [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 3:20 PM To: Jay Blanchard Subject: RE: [PHP] mail(); and embedding pictures Unless I missed something. I can recall seeing anything that mentions image embedding. Like I said, I am looking for any kind of advice -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 3:17 PM To: Igor Frankovic Subject: RE: [PHP] mail(); and embedding pictures Have you read the manual concerning HTML e-mail? -Original Message- From: Igor Frankovic [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 3:09 PM To: Jay Blanchard Subject: RE: [PHP] mail(); and embedding pictures Well as long as you can suggest a way of embedding pictures into emails...that'll do :-) -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 3:07 PM To: Iggy; [EMAIL PROTECTED] Subject: RE: [PHP] mail(); and embedding pictures [snip] I am wondering if it is possible to embed pictures into email messages using this function. [/snip] I'm wondering if anyone ever tests this stuff. ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What is the proper way to use mysql db on a multipage site?
It does seem wasteful, but you have to make sure there is a connection before you query a database. What if the user goes out to lunch? Should you maintain an open database connection for an hour? No, that's a lot of overhead. What you can do is change it from mysql_connect to mysql_pconnect. That will make it a persistent connection, which may be what you are looking for. It actually leaves the connection open after it's done using, which is just what I said you don't want to do. But what PHP does is reuse open connections to the database. You could have 30 users visiting your site, but only 5 active at any one time. PHP will then use only 5 database connections. You are still making the connection call, but PHP will just say OK, I already have one I can use and here is it's id. On Friday, September 26, 2003, at 04:10 PM, Daevid Vincent wrote: I've been coding with PHP and mySQL for years. And this part has never sat right with me and finally I'm getting the nerve to ask how the pros out there do this... What I do is have a db.php file that contains: $db = mysql_connect (localhost,username,password) or die (Could not connect to SQL server.); mysql_select_db (mydb,$db) or die (Could not select Database); Then at the top of every page, I require_once(db.php); But it just seems so wasteful to keep making that mysql_connect(). Isn't there a way to store the $db result so I don't have to keep connecting. And how about the mysql_select_db() part too? Since I'm going to stay in the same db most of the time. I thought I read that I can't use a $_SESSION for it, and that's the only way I know of to have it be available on each page? -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: $_SESSION stuffs that come with php.ini
Session auto start is not enabled as default because it is a performance drain. It is much more efficient to use session_start() only when you need it. The easiest way to do things is usual the worst. (Most inefficient) -Original Message- From: Scott Fletcher [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 2:47 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: $_SESSION stuffs that come with php.ini Alright that work now Don't know why does the php.ini default is not what it should be... I found a few that aren't on the list in php.ini, but hte most important thing right now is that it is fixed... Scott Fletcher [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is this the one??? http://us3.php.net/session Thanks... Scott Fletcher [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have been building the website for 6 months with everything and I didn't have hte php.ini on it. Just didn't realize it, so I create the php.ini that come from php.ini_dist that came with php source code. Now the $_SESSION doesn't work. I'm not able to make the php.ini to be like the one that php work without it. So, anyone know what is the default session configuration? 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] mail(); and embedding pictures
[snip] OK, apparently you are not reading my emails. I said I already did that but that it didn't work. Putting the file name in the IMG SRC tag simply doesn't work. At least not in that format. By putting an img tag in the HTML I am not that dumb. I realize that people send HTML message every day using PHP. What I would like to know is HOW do they embed images. People send HTML e-mail each day with images using PHP...there are numerous discussion on the archive. If you are using plain text e-mail you cannot see images. I tried that but it doesn't work. You can see why if you use outlook and embed a picture. Send it to yourself and then view the source code of the email. You have to use HTML and include the image with an image tag Unless I missed something. I can recall seeing anything that mentions image embedding. Like I said, I am looking for any kind of advice Have you read the manual concerning HTML e-mail? Well as long as you can suggest a way of embedding pictures into emails...that'll do :-) I am wondering if it is possible to embed pictures into email messages using this function. I'm wondering if anyone ever tests this stuff. ;) [/snip] Folks please reply to the list when responding, e-mails responding only to the sender may get ignored, delaying answers to your questions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header ('Content-type...') does not work properly if session_start initiated...
* Thus wrote Alex Shi ([EMAIL PROTECTED]): Hello, I have a strange problem with a download script. Here is the situation: On my development server, the php is 4.0.6 while on the application server it is 4.3.2. I created a very simple code for opening pdf in browser. the main part of it is like following: ? session_start (); ... $docPath = '/path/to/file_name.pdf'; $pdftmp_name = 'tmp_name.pdf'; header ('Cache-Control: no-store, no-cache, must-revalidate'); header ('Content-Type: application/pdf'); header ('Content-disposition: inline; filename=' . $pdftmp_name); header ('Content-length: ' . filesize ($docPath)); readfile ($docPath); ? This code is working perfect on development server. However on the application server, it will first ask for confirm downloading then report error saying that cannot download. I checked the code line by line and found that if remove the first line session_start () then it will work in the correct way. However session is required for this script. I don't understand why it works OK on the development server but not for application server. I'm not even sure how session_start() can even do a thing like that. Unless you have a problem with headers already sent, error. There was a discussion on this a few weeks back here, but unfortantly I didn't follow the thread. hmm.. i think i just rememberd that it might had to do with making sure that session.cache_limiter being set as 'nocache'. Search the archives, the answer is there i believe. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What is the proper way to use mysql db on a multipage site?
--- Daevid Vincent [EMAIL PROTECTED] wrote: But it just seems so wasteful to keep making that mysql_connect(). Isn't there a way to store the $db result so I don't have to keep connecting. http://www.php.net/mysql_pconnect Hope that helps. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail(); and embedding pictures
[snip] No, but it wouldn't do me any good anyway. I am not trying to link to a picture residing somewhere else. I am trying to EMBED it. [/snip] And snip your replies! Found in a google search...go figure Probably the easiest way to do this is to use a mail class PHPMailer http://phpmailer.sourceforge.net The disadvantage of this method is that you are sending the complete image with each mail which will cost you bandwidth. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header ('Content-type...') does not work properly if session_start initiated...
Curt Zirzow wrote: hmm.. i think i just rememberd that it might had to do with making sure that session.cache_limiter being set as 'nocache'. Search the archives, the answer is there i believe. Curt You are close, it was session_cache_limiter('private_no_expire'); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header ('Content-type...') does not work properly if session_start initiated...
Curt Zirzow wrote: hmm.. i think i just rememberd that it might had to do with making sure that session.cache_limiter being set as 'nocache'. Search the archives, the answer is there i believe. Curt You are close, it was session_cache_limiter('private_no_expire'); So, this function should be called before session_start ()? I will try... thanks! Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header ('Content-type...') does not work properly if session_start initiated...
Curt Zirzow wrote: hmm.. i think i just rememberd that it might had to do with making sure that session.cache_limiter being set as 'nocache'. Search the archives, the answer is there i believe. Curt You are close, it was session_cache_limiter('private_no_expire'); You are right, it is working perfect now! Thanks a bunch! Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What is the proper way to use mysql db on a multipage site?
On Friday 26 September 2003 3:54, Chris Shiflett wrote: http://www.php.net/mysql_pconnect If you have even moderate load on your server mysql_pconnect is going to really hurt performance. The best method I have found is to just make sure the connection code is only in one file and then included into each of your scripts. No matter what, every page load from the webserver that needs database connectivity is going to have to connect to the database. -Jackson Hope that helps. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- jackson miller cold feet creative 615.321.3300 / 800.595.4401 [EMAIL PROTECTED] cold feet presents Emma the world's easiest email marketing Learn more @ http://www.myemma.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] static class call..
Is there a way that a method within a Class, when called statically, can access a property of that Class? Class Foo { var $_TintBaz = 9; function getBaz() { return Foo::_TintBaz; // -- line 8 } } echo Foo::getBaz(); This returns... Parse error: parse error, unexpected ';', expecting '(' in test 02.php on line 8 And of course, can't use 'return Foo::_TintBaz;' in a statically called Class. Is there any hope? Thanks Walter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Search Submission Tool
Im putting together a free web based tool available to anyone who wants to automatically submit their website to multiple search engines at the same time. I know this has been done before, but I haven't done it and its pretty much a learning experience for me. It is currently functioning, and I will be adding some additional search engines, but I was wondering if anyone would be willing to take a look and offer any suggestions for improvement. I apoligize if this is in the incorrect forum, but im looking for as much feedback as possible. Thanks, Erich Kolb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: static class call..
Hi Walter, Not until PHP 5 Class Foo { static $_TintBaz = 9; } echo Foo::$_TintBaz; in PHP 4, you can kludge this: Class Foo { function getBaz($set = null) { static $_TintBaz = 9; if (!is_null($set)) { $_TintBaz = $set; } return $_TintBaz; } } Greg -- phpDocumentor http://www.phpdoc.org Jswalter wrote: Is there a way that a method within a Class, when called statically, can access a property of that Class? Class Foo { var $_TintBaz = 9; function getBaz() { return Foo::_TintBaz; // -- line 8 } } echo Foo::getBaz(); This returns... Parse error: parse error, unexpected ';', expecting '(' in test 02.php on line 8 And of course, can't use 'return Foo::_TintBaz;' in a statically called Class. Is there any hope? Thanks Walter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php