[PHP] Re: excel output question
Single quote everything should work. Jake McHenry wrote: Hi everyone. I'm outputing payroll information to an excel csv file, and when anyone get's paid over 1k, the amount is split into two fields because of the comma in the amount. Is there anyway I can tell excel that this particular comma is not a deliminator? Thanks, Jake -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: How can I run php 5 beta 3 on windows?
On Fri, 2004-02-06 at 18:47, omer katz wrote: > Help!!! > "Omer Katz" <[EMAIL PROTECTED]> > :[EMAIL PROTECTED] > > Can I update PHPTraid's php files? I'm not sure I understand what you are having a problem with... -- Adam Bregenzer [EMAIL PROTECTED] http://adam.bregenzer.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: excel output question
- Original Message - From: "Paul Furman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, February 07, 2004 1:56 AM Subject: [PHP] Re: excel output question > Single quote everything should work. > > Jake McHenry wrote: > > > Hi everyone. I'm outputing payroll information to an excel csv file, and when anyone get's paid over 1k, the amount is split into two fields because of the comma in the amount. Is there anyway I can tell excel that this particular comma is not a deliminator? > > > > Thanks, > > Jake > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > like this? output = "'$fullname',,'$location',,'$regularhours','$vachours','$sickhours','$compho urs','$mischours','$wopyhours','$sefahours','$biweekly[0]','$adjustedtime',, ,,,'$sub401k ','$payrate','$gross5'\n"; That just filled my spreadshit with quotes around everything... still the amounts larger than 1k are in 2 columns.. did I do something wrong? Thanks, Jake -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems with ö or ä in script
When using ö or ä the hyperlinks or photo references does not work even though it point correct like "../banner/Jörns Gästehaus/mainphoto.jpg, i tried specialchars but this does not seem to work, can anyone tell me why? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Use a Server or Client Socket?
Hi all, I have this situation now that requires socket programming. But I am not sure how to realise the requirements in programming whether as a client or server The requirement is like this. I have to connect to an external server constantly to listen for incoming data. How can I make sure that the connection is there all the time? Upon receiving the message, I will have to response back an acknowledgement that the message is received. I can also send data to the server. From my requirements, I understand that there will only be one connection. Therefore the data exchange need not be in sequence. Currently, what I have is a server programmed using the socket library. Server logic : socket_create socket_bind socket_listen while(true) { socket_select if(new connection) { add to connections array } else { if(can read) { read incoming response back } else { //error or connection close if(error) { print error } else { print connection close remove from connections array } } } } I am planning to include a check somewhere in the codes for maintaining the connection between my server and the other server. Where should I place it? Also, I need to initiate a connection to the external server and then listen. Where should this piece of code be insert at? Is this the right approach? Or I am over killing by writing a server if this can be handle in easier manner. Hope that I have been clear in the above. Thanks for helping Ai Leen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] explode() an array and grep out a string
Hi all. Is it possible to explode an array and have it exclude a certain string. I currently have an array that is an ldapsearch that returns sub-accounts of a parent account. These accounts are then displayed so customer can either change the passwd or delete them.Thing is ldapsearch returns everymatch which includes the parent account, which is already listed on the page as the parent account. I would like to eliminate the second listing of the parent account where the sub-accounts are listed. This is where the array is collected: $search = ldap_search($connection,"dc=isp,dc=com", "ispParentAcct=$sessUsername"); $entries = ldap_get_entries($connection, $search); $num = $entries["count"]; if ($num) { $sessSubAccounts = ""; $i = 0; while ($i < $num) { $sessSubAccounts .= $entries[$i]["uid"][0] . "|"; $i++; } } One thing I would like to point out is that I did not have this problem before, but when I updated to a new version of openldap the following ldapsearch would no longer return the subaccounts: $search = ldap_search($connection,"dc=isp,dc=com", "homeDirectory=/home/$sessUsername/*"); Any idea why that may be? This is where the array is exploded: if ($sessSubAccounts) { $accounts = explode("|", $sessSubAccounts); while ($i < count($accounts) - 1) ?> TIA Bobby R. Cox Linux Systems Administrator Project Mutual Telephone [EMAIL PROTECTED] 208.434.7185 Fix the problem, not the blame. <>< -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: excel output question
I would do it like this: $build = " '%s','%s','%s','%s'\n"; $build = sprintf($build,$field1,$field2,$field3,$fieldN); you could also try escaping the comma. if this doesn't work you can always just dump to html tables and save the file as *.xls (excel spreadsheet); excel understands html tables and simple markup as spreadsheet data. ie: field1field2field3field4 value1value2value3value4 ~phillip "Jake McHenry" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > - Original Message - > From: "Paul Furman" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Saturday, February 07, 2004 1:56 AM > Subject: [PHP] Re: excel output question > > > > Single quote everything should work. > > > > Jake McHenry wrote: > > > > > Hi everyone. I'm outputing payroll information to an excel csv file, and > when anyone get's paid over 1k, the amount is split into two fields because > of the comma in the amount. Is there anyway I can tell excel that this > particular comma is not a deliminator? > > > > > > Thanks, > > > Jake > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > like this? > > output = > "'$fullname',,'$location',,'$regularhours','$vachours','$sickhours','$compho > urs','$mischours','$wopyhours','$sefahours','$biweekly[0]','$adjustedtime',, > ,,,'$sub401k > ','$payrate','$gross5'\n"; > > That just filled my spreadshit with quotes around everything... still the > amounts larger than 1k are in 2 columns.. > > did I do something wrong? > > Thanks, > Jake -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need a way to automate user logout
I used cron to do this as well; but i devised a much simpler, elegant solution that is cross-browser and event-based and not schedule-based. I basically have a javascript include file that instantiates a function that counts down in T-minus 10 minutes fashion. at 9:30 the browser pops a window and says "you appear to be inactive; would you like to continue working?" clicking on yes closes the popup and resets the timer; not clicking expires the popout which redirects the parent page to the logout. clicking on "log me out" basically circumvents the 30-second countdown straight to the logout. to handle the alt+F4-happy crowd i devised a way to pop a special logout window when the browser is closed. this child window destroys sessions and makes database logs; this window closes itself. this happened to work for me, YMMV. ~phillip jackson "Craig" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > I can write a script in > > perl, php, java, u name it, but how do I have it run on a set > > schedule? > > Thanks > > > > Christian > > you will want to use the cron command. run 'man cron' at a shell prompt > to > get the manual page that will explain the finer points. =) > > HTH, > Craig > > > -- > > 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] Re: include_once() isnt!
"Rob" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ive programmed with C/C++ for years and have recently started to dabble in > PHP. Ive written a multi-part script for a friend and Ive run into a > problem. > > Ive got 14 include files 3 of which are basic components that may or may not > be used by other components. One is an authorisation class, another is a > Dbase clas (For MySQL) and another is a file system component. > > Now heres the problem. My authorisation component uses the DBase component. > Some of my other components use the DBase component only some of the time > and the Auth and DBase components some of the time and the Auth component > some of the time. SO... In the Auth component ive included (via > include_once()) the DB component, because it needs it. NOW... in other > modules Ive included (via include_once()) the auth, DB, and gallery > components. > Heres where the problem lies. Each component is in a separate file, and when > I run the script, I get an arror saying I cant re-define the classes. > Which makes me believe that the include_once() function is trying to include > the other components even though they are already included. So, does that > mean that include_once() only works right when it is used in the same file? > It wont recognise that an include was already included in another include? > Have I confused you yet? I am. There may be a problem with include_once, something about where it's placed and so on... But anyway I would advise you to not generally rely on include_once() or require_once(). These are just meant to protect you from making an error, but you should check to see that you don't use include_once() on the same file many times. It's bad practice to include one file several times. One tip i would give you, is to set up one file, something like "define_classes.inc.php", which is responsable for including the classes and defining them. In this way you can just include define_classes.inc.php in the scripts where you need classes, and your work will be a lot more structured. I personally use this system on my web-site, and it does that i don't have to be worried about if I am getting the correct classes, because I get them all through define_classes.inc.php Eric -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: excel output question
- Original Message - From: "Phillip Jackson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, February 07, 2004 4:37 AM Subject: Re: [PHP] Re: excel output question > I would do it like this: > > $build = " '%s','%s','%s','%s'\n"; > $build = sprintf($build,$field1,$field2,$field3,$fieldN); > > you could also try escaping the comma. if this doesn't work you can always > just dump to html tables and save the file as *.xls (excel spreadsheet); > excel understands html tables and simple markup as spreadsheet data. > > ie: > > > > > field1field2field3field4 > > > value1value2value3value4 > > > > > > ~phillip > "Jake McHenry" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > - Original Message - > > From: "Paul Furman" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Saturday, February 07, 2004 1:56 AM > > Subject: [PHP] Re: excel output question > > > > > > > Single quote everything should work. > > > > > > Jake McHenry wrote: > > > > > > > Hi everyone. I'm outputing payroll information to an excel csv file, > and > > when anyone get's paid over 1k, the amount is split into two fields > because > > of the comma in the amount. Is there anyway I can tell excel that this > > particular comma is not a deliminator? > > > > > > > > Thanks, > > > > Jake > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > like this? > > > > output = > > > "'$fullname',,'$location',,'$regularhours','$vachours','$sickhours','$compho > > > urs','$mischours','$wopyhours','$sefahours','$biweekly[0]','$adjustedtime',, > > ,,,'$sub401k > > ','$payrate','$gross5'\n"; > > > > That just filled my spreadshit with quotes around everything... still the > > amounts larger than 1k are in 2 columns.. > > > > did I do something wrong? > > > > Thanks, > > Jake > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > This is in a simple while loop, data is coming from a mysql database. Creating a seperate function would too time consuming changing all of the existing code for what this page is doing. It orignally was in html form in an xls file, but when the file was opened, there were no cell borders anymore. If anyone can tell me how to turn on the cell boarders in an xls html outputted file, that would also work. This is the only reason I went back to a csv file. Thanks, Jake -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Use a Server or Client Socket?
Hi Tan, If you are connecting to another server you are using a client socket you do not need to make a server socket. If you need to listen for connections make use of a server socket. To give you an example your browser makes use of client sockets while apache makes use of server sockets. That is an over simplified view of things but hope it helps you understand things better. Generally working with client sockets is easier. best regards raditha Tan Ai Leen wrote: Hi all, I have this situation now that requires socket programming. But I am not sure how to realise the requirements in programming whether as a client or server The requirement is like this. I have to connect to an external server constantly to listen for incoming data. How can I make sure that the connection is there all the time? Upon receiving the message, I will have to response back an acknowledgement that the message is received. I can also send data to the server. From my requirements, I understand that there will only be one connection. Therefore the data exchange need not be in sequence. Currently, what I have is a server programmed using the socket library. Server logic : socket_create socket_bind socket_listen while(true) { socket_select if(new connection) { add to connections array } else { if(can read) { read incoming response back } else { //error or connection close if(error) { print error } else { print connection close remove from connections array } } } } I am planning to include a check somewhere in the codes for maintaining the connection between my server and the other server. Where should I place it? Also, I need to initiate a connection to the external server and then listen. Where should this piece of code be insert at? Is this the right approach? Or I am over killing by writing a server if this can be handle in easier manner. Hope that I have been clear in the above. Thanks for helping Ai Leen -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: excel output question
Jake McHenry wrote: That just filled my spreadsh**t with quotes around everything... still the amounts larger than 1k are in 2 columns.. did I do something wrong? Sorry it didn't work. Maybe double quotes? I've output data from MS Access that came out smothered in quotes and when importing to excel, the import wizard asks what string indicator is being used and strips those. Or maybe use something other than a comma as the separator & Excel will ask. Sounds like you may need to extract the values and strip the commas out before sending to CSV. I know Access database is much more obsessive about data types (string vs number) than PHP. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Beginner amazes self with image gallery script!
This PHP stuff is too cool! Thanks for getting me over the hump folks. Here's my work in progress: http://hills.ccsf.edu/~pfurma02/index.php?SCREEN=ecards.php Only the 'next' button works for now but still I'm darn impressed with myself . This will work on any folder of pictures with a subfolder of thumbs! (source code below) My question is, I'm updating the pages by creating a url back to the same script with some differing $_REQUEST settings for the page number (&PAGE=2) and on a smaller screen this bumps the page back to the top. Is there a better way to do this with some kind of update image function without getting into incompatible javascript or CSS or am I following normal procedure? Of course I'll want to be able to click each thumbnail to bring it into the big picture box, for now it's just displaying the first image on the page. Here's another example of such a thing that leads me to believe I'm on the right track: http://butterflies.bruciesusenetshit.info/butterflies # if the following is going to take an external url it'll need work if (!(chdir ($imagedir))){ print "invalid directory"; } $fh=opendir($imagedir); # extract & count pictures while ($file = readdir($fh)){ if (strstr ($file, '.jpg')){ $pictures[] = $file; } } # check picture sizes [LATER TASK] $thumbsize = 100; # verify if page number too high & loop back $pic_count = count($pictures); $pages = ($pic_count / 6); if ($page > $pages + 1) { $page = 1; $_REQUEST ['PAGE'] = "1"; } ?> Current gallery: "> back page: print "$url&PAGE=$next"; ?>"> next ; # while the picture number has not exceeded # the current page # and total images while ($pic_num <= ((6 * $page) - 1) and ($pic_num <= $pic_count - 1)){ ?> # create thumbnail image tags ?> alt="" border=0> $pic_num = $pic_num - 6 ?> # create large image tag #need to verify pic_num in last or empty page ?> " alt="click to select this image" border=0> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Beginner amazes self with image gallery script!
Paul Furman wrote: This PHP stuff is too cool! Thanks for getting me over the hump folks. Here's my work in progress: http://hills.ccsf.edu/~pfurma02/index.php?SCREEN=ecards.php Only the 'next' button works for now... ...Of course I'll want to be able to click each thumbnail to bring it into the big picture box... OK I got the thumb links working. : - ) Damn this PHP is cool! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 7 Feb 2004 16:35:47 -0000 Issue 2576
php-general Digest 7 Feb 2004 16:35:47 - Issue 2576 Topics (messages 177077 through 177096): Re: Cannot send mail after upgrading to OS X v10.3 177077 by: Jason Wong 177078 by: John Nichel fopen() Problems 177079 by: rabbit.cold-chaos.net 177080 by: Jason Wong excel output question 177081 by: Jake McHenry 177082 by: Joshua D. Drake 177083 by: Paul Furman 177085 by: Jake McHenry 177089 by: Phillip Jackson 177092 by: Jake McHenry 177094 by: Paul Furman Re: How can I run php 5 beta 3 on windows? 177084 by: Adam Bregenzer Problems with ö or ä in script 177086 by: Piet from South Africa Use a Server or Client Socket? 177087 by: Tan Ai Leen 177093 by: Raditha Dissanayake explode() an array and grep out a string 177088 by: Bobby R.Cox Re: Need a way to automate user logout 177090 by: Phillip Jackson Re: include_once() isnt! 177091 by: Eric Bolikowski Beginner amazes self with image gallery script! 177095 by: Paul Furman 177096 by: Paul Furman 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] -- --- Begin Message --- On Saturday 07 February 2004 11:39, gohaku wrote: > I am using OS X v10.3.2 and just discovered that I can't send mail > using the mail() function. > According to phpinfo(), PHP is configured with sendmail. AFAIK phpinfo() does not tell you whether whether mail capabilities has been compiled in. > I ran Postfix Enabler and still could not email myself. > What do I need to configure to get the mail() function to work? 1) check your php error logs 2) check your MTA logs -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Just because everything is different doesn't mean anything has changed. -- Irene Peter */ --- End Message --- --- Begin Message --- gohaku wrote: Hi everyone, I am using OS X v10.3.2 and just discovered that I can't send mail using the mail() function. According to phpinfo(), PHP is configured with sendmail. Before upgrading to v10.3, I did not check if the mail() function worked in v10.2 The script I'm using does work on other servers. Make sure the path to sendmail is correct in your php.ini. Ensure that sendmail is installed. Check to see if sendmail is running. Make sure sendmail is configured to relay for localhost. -- By-Tor.com It's all about the Rush http://www.by-tor.com --- End Message --- --- Begin Message --- I am using the below code (kind of sloppy..). I have tried for fopen r+, w, and w+, but no matter what I do, the file is always truncated, and previously entered data is erased. I have been unable to fix this. '; $d1 = date("l dS of F Y h:i:s A"); $divclose = ''; $some = " $divhead "; $some1 = $_POST['topic']; $some = " $some $some1 mailto:[EMAIL PROTECTED]>R.a.B.B.i.T - $d1 "; $some1 = $_POST['news']; $some = " $some $some1 $divclose"; $some = " $some "; $some = stripslashes($some); if (is_writable($filename)) { if (!$handle = fopen($filename, 'r+')) { echo "Cannot open file ($filename)"; } else { if (!fwrite($handle, $some)) { echo "Cannot write to file ($filename)"; } else { echo "Success, wrote data to file ($filename)"; fclose($handle); } } } else { echo "The file $filename is not writable"; } ?> --- End Message --- --- Begin Message --- On Saturday 07 February 2004 07:08, [EMAIL PROTECTED] wrote: > I am using the below code (kind of sloppy..). I have tried for fopen r+, > w, and w+, but no matter what I do, the file is always truncated, and > previously entered data is erased. I have been unable to fix this. Assuming that you're trying to add something to the end of an existing file: either fopen() using mode 'a' or use fseek(). -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* "In short, _N is Richardian if, and only if, _N is not Richardian." */ --- End Message --- --- Begin Message --- Hi everyone. I'm outputing payroll information to an excel csv file, and when anyone get's paid over 1k, the amount is split into two fields because of the comma in the amount. Is there anyway I can tell excel
Re: [PHP] Need a way to automate user logout
> I used cron to do this as well; but i devised a much simpler, elegant > solution that is cross-browser and event-based and not schedule-based. > > I basically have a javascript include file that instantiates a function that > counts down in T-minus 10 minutes fashion. at 9:30 the browser pops a > window and says "you appear to be inactive; would you like to continue > working?" clicking on yes closes the popup and resets the timer; not > clicking expires the popout which redirects the parent page to the logout. > clicking on "log me out" basically circumvents the 30-second countdown > straight to the logout. > > to handle the alt+F4-happy crowd i devised a way to pop a special logout > window when the browser is closed. this child window destroys sessions and > makes database logs; this window closes itself. > > this happened to work for me, YMMV. > > ~phillip jackson I've recently faced a similar issue. I lock CMS database records during editing so multiple users can't edit simultaneously. It's easy to unlock the records via PHP if the user goes to any other area of the CMS or if she logs out. The problem is that users often don't log out, and sometimes leave directly from an edit screen. I tried using the Javascript onunload event to open a new window which runs a PHP script to unlock the record then close itself, but that doesn't work if pop-up blocking software is being used. Does your method do something similar? Does it work with pop-up blocking? -- Lowell Allen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP5 Beta 3
Hi php-general, I have already PHP 4.3.1 running on my apache 2 webserver, on Linux. Now I've tried to make PHP 5 run, everything compiles well, I have set the same configuration parameters than for PHP 4, only additionally --disable-libxml because it wouldn't compile then. I added the line with libphp5.so (well it did by itself...) and restarted the webserver (graceful). Didn't work, .php was not sent to the php-engine. Then I commented the libphp4.so. No .php file was recognized to go through the php-engine... I uncommented the libphp4.so, so I have 2 libphp again, there, I had segmentation faults, and the webserver crashed... restarting the webserver only with php4 gave me following: [notice] Graceful restart requested, doing restart [notice] seg fault or similar nasty error detected in the parent process [warn] pid file /var/run/apache2/httpd.pid overwritten -- Unclean shutdown of previous Apache run? [notice] Apache/2.0.44 (Unix) PHP/4.3.1 configured -- resuming normal operations Well, my question: what's wrong? Here my config-parameters (config.nice): #! /bin/sh # # Created by configure './configure' \ '--disable-libxml' \ '--with-apxs2=/usr/local/apache2/bin/apxs' \ '--with-config-file-path=/usr/local/etc' \ '--enable-magic-quotes' \ '--with-bcmath' \ '--enable-exif' \ '--enable-shared=max' \ '--enable-rule=SHARED_CORE' \ '--with-mysql=/usr/local/mysql' \ "$@" Thanks for answering/helping... SvT -- Who is the ennemy? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [ERR] [PHP] PHP5 Beta 3
Transmit Report: To: [EMAIL PROTECTED], 402 Local User Inbox Full ([EMAIL PROTECTED]) --- Begin Message --- Hi php-general, I have already PHP 4.3.1 running on my apache 2 webserver, on Linux. Now I've tried to make PHP 5 run, everything compiles well, I have set the same configuration parameters than for PHP 4, only additionally --disable-libxml because it wouldn't compile then. I added the line with libphp5.so (well it did by itself...) and restarted the webserver (graceful). Didn't work, .php was not sent to the php-engine. Then I commented the libphp4.so. No .php file was recognized to go through the php-engine... I uncommented the libphp4.so, so I have 2 libphp again, there, I had segmentation faults, and the webserver crashed... restarting the webserver only with php4 gave me following: [notice] Graceful restart requested, doing restart [notice] seg fault or similar nasty error detected in the parent process [warn] pid file /var/run/apache2/httpd.pid overwritten -- Unclean shutdown of previous Apache run? [notice] Apache/2.0.44 (Unix) PHP/4.3.1 configured -- resuming normal operations Well, my question: what's wrong? Here my config-parameters (config.nice): #! /bin/sh # # Created by configure './configure' \ '--disable-libxml' \ '--with-apxs2=/usr/local/apache2/bin/apxs' \ '--with-config-file-path=/usr/local/etc' \ '--enable-magic-quotes' \ '--with-bcmath' \ '--enable-exif' \ '--enable-shared=max' \ '--enable-rule=SHARED_CORE' \ '--with-mysql=/usr/local/mysql' \ "$@" Thanks for answering/helping... SvT -- Who is the ennemy? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- End Message ---
[PHP] Re: Problems with ö or ä in script
It's because the HTML or HTTP or whateverdoesn't allow them.. :p -- // DvDmanDT MSN: dvdmandt¤hotmail.com Mail: dvdmandt¤telia.com "Piet From South Africa" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > When using ö or ä the hyperlinks or photo references does not work even > though it point correct like "../banner/Jörns Gästehaus/mainphoto.jpg, i > tried specialchars but this does not seem to work, can anyone tell me why? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] explode() an array and grep out a string
On Sat, 2004-02-07 at 03:09, Bobby R.Cox wrote: > Is it possible to explode an array and have it exclude a certain > string. I currently have an array that is an ldapsearch that returns > sub-accounts of a parent account. These accounts are then displayed so > customer can either change the passwd or delete them.Thing is > ldapsearch returns everymatch which includes the parent account, which > is already listed on the page as the parent account. I would like to > eliminate the second listing of the parent account where the > sub-accounts are listed. Try this: $parent_account = 'parent_name'; $ldap_results = array('account1','account2','parent_name'); $results = array_diff($ldap_results, array($parent_account)); $results will now have only account1 and account2. -- Adam Bregenzer [EMAIL PROTECTED] http://adam.bregenzer.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] include_once() isnt!
On Tue, 2004-02-03 at 17:04, Rob wrote: > Ive programmed with C/C++ for years and have recently started to dabble in > PHP. Ive written a multi-part script for a friend and Ive run into a > problem. > Heres where the problem lies. Each component is in a separate file, and when > I run the script, I get an arror saying I cant re-define the classes. > Which makes me believe that the include_once() function is trying to include > the other components even though they are already included. So, does that > mean that include_once() only works right when it is used in the same file? > It wont recognise that an include was already included in another include? > Have I confused you yet? I am. This is not an answer, but it is a solution. I don't ever rely on include_once. If someone else uses my include files they may not use include_once. Instead I use the old C/C++ trick of defines: I use the following structure for creating unique constants to prevent collisions: {projectname}_{classname}( include ? _INC:) A global class outside my projects: _CLASS_NAME The class FooBar in my Rule The World project: RULE_THE_WORLD_FOO_BAR The config include in my Rule The World project: RULE_THE_WORLD_CONFIG_INC -- Adam Bregenzer [EMAIL PROTECTED] http://adam.bregenzer.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FreeBSD to Linux -- PHP Issues
On 03-Feb-2004 Daryl Meese wrote: > Hello all, > > I am considering changing hosting providers and moving from FreeBSD > to > Linux. > > My question is are there any PHP related issues to moving (functions > that > don't work on Linux but do on FreeBSD, etc)? > > I doubt there are but have to cover the bases. > All functions, assuming they were configured, work the same. The only thing that isn't a one-for-one swap (that I've seen) is locale names: [Linux] nat221.dread$ ls | grep es_ es_AR es_ES [FreeBSD] localhost.dread$ ls | grep es_ es_ES.DIS_8859-15 es_ES.ISO8859-1 es_ES.ISO8859-15 es_ES.ISO_8859-1 es_ES.ISO_8859-15 So if you're part of the 99.9% that don't mess with locales, you should be OK. Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Checking if database has been setup
On 07-Feb-2004 Ryan A wrote: > but how do i check if the database/tables have > been setup? > SHOW DATABASES LIKE 'mydb'; SHOW TABLES FROM mydb LIKE 'mytable'; Check if a table exists: SELECT 1 FROM mydb.mytable LIMIT 1; Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Beginner amazes self with image gallery script!
> My question is, I'm updating the pages by creating a url back to the > same script with some differing $_REQUEST settings for the page number > (&PAGE=2) and on a smaller screen this bumps the page back to the top. > Is there a better way to do this with some kind of update image function > without getting into incompatible javascript or CSS or am I following > normal procedure? Paul, You're in luck. A List Apart just published yesterday a great article on displaying images without refreshing the entire page. http://www.alistapart.com/articles/imagegallery "It works as expected on IE5+ and Netscape 6+ on Windows and Mac. It also works in Safari and all the various flavors of Mozilla like Firebird and Camino." It might be a bit tricking making thetechnique dynamically driven with PHP, but it's doable. Have fun. Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot send mail after upgrading to OS X v10.3
On Feb 7, 2004, at 12:20 AM, John Nichel wrote: Hi everyone, I am using OS X v10.3.2 and just discovered that I can't send mail using the mail() function. According to phpinfo(), PHP is configured with sendmail. Before upgrading to v10.3, I did not check if the mail() function worked in v10.2 The script I'm using does work on other servers. Make sure the path to sendmail is correct in your php.ini. Ensure that sendmail is installed. Thank You. all I had to do was change one line in php.ini: From ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ;sendmail_path = To ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ;sendmail_path = sendmail -t -i -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to conver a string to float
Is there a possibility to convert a string like "10*500" (parsed from a XML-File) to a float? When i try to store this String in a float variable it only coverts the "10" but nothing after the "*"-sign, but i need the result of this expresison... Is there a function to calculate such string expressions? Thanx... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Beginner amazes self with image gallery script!
Hey, a quick update, I know not many people use opera but...i do, and this does not work on Opera 6.05. It degrades gracefully though, it goes straight to the image. HTH. Cheers, -Ryan On 2/7/2004 9:37:36 PM, Joseph Szobody ([EMAIL PROTECTED]) wrote: > > My question is, > I'm updating the pages by creating a url back to the > > same script with some differing $_REQUEST settings for the page number > > (&PAGE=2) and on a smaller screen this bumps the page back to the top. > > Is there a better way to do this with some kind of update image function > > without getting into incompatible javascript or CSS or am I following > > normal procedure? > > Paul, > > You're > in luck. A List Apart just published yesterday a great article on > displaying images without refreshing the entire page. > > http://www.alistapart.com/articles/imagegallery > > "It works as expected on IE5+ and Netscape 6+ on Windows and Mac. It also > works in Safari and all the various flavors of Mozilla like Firebird and > Camino." > > It might be a bit tricking making thetechnique dynamically driven with PHP, > > but it's doable. Have fun. > > Joseph > > -- > 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] function only available if PHP4 compiled using --enable-exif
Does this mean I need to recompile from source code? (seems an extreme measure to me but what do I know) Is that difficult to do on a windows machine? I see it in some phpinfo's out there like this: http://www.php.net/~jimw/info.php but that's not in mine or at school or most hosting companies I'd guess. I'm running 4.3.4 for this function: exif_read_data() http://us2.php.net/manual/en/function.exif-read-data.php Note: This function is only available in PHP 4 compiled using --enable-exif... Since PHP 4.3 user comment can automatically change encoding if PHP 4 was compiled using --enable-mbstring. This function does not require the GD image library. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to conver a string to float
Look at: exec() Be careful if you don't control the input of course. -Galen On Feb 7, 2004, at 7:56 AM, Sebastian wrote: Is there a possibility to convert a string like "10*500" (parsed from a XML-File) to a float? When i try to store this String in a float variable it only coverts the "10" but nothing after the "*"-sign, but i need the result of this expresison... Is there a function to calculate such string expressions? Thanx... -- 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] Re: function only available if PHP4 compiled using --enable-exif
If you're on Windows, you should see a file by the name of php_exif.dll in your PHP\extensions directory. It should've come with the distribution. Depending on the way your php.ini file is set up, you may either leave this file in its current location, or you may need to copy it to your windows\system32 folder. (I have extension_dir in my php.ini file set to c:\PHP\extensions\ so I left the file in that directory.) After checking that, remove the semi-colon (;) from the line before extension=php_exif.dll in the list of extensions in the php.ini file. Then, restart IIS. The extension should now work, and you didn't have to recompile anything. -Ben Paul Furman wrote: Does this mean I need to recompile from source code? (seems an extreme measure to me but what do I know) Is that difficult to do on a windows machine? I see it in some phpinfo's out there like this: http://www.php.net/~jimw/info.php but that's not in mine or at school or most hosting companies I'd guess. I'm running 4.3.4 for this function: exif_read_data() http://us2.php.net/manual/en/function.exif-read-data.php Note: This function is only available in PHP 4 compiled using --enable-exif... Since PHP 4.3 user comment can automatically change encoding if PHP 4 was compiled using --enable-mbstring. This function does not require the GD image library. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: function only available if PHP4 compiled using --enable-exif
Thanks. I could have sworn I searched php.ini for exif. I had to do both of the below to make it work. Ben Ramsey wrote: php.ini [extension_dir = "c:\PHP\extensions"] [uncomment] extension=php_exif.dll -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot send mail after upgrading to OS X v10.3
On Sunday 08 February 2004 05:53, gohaku wrote: > > Make sure the path to sendmail is correct in your php.ini. > > Ensure that sendmail is installed. > > Thank You. > all I had to do was change one line in php.ini: > > From > ; For Unix only. You may supply arguments as well (default: "sendmail > -t -i"). > ;sendmail_path = > To > ; For Unix only. You may supply arguments as well (default: "sendmail > -t -i"). > ;sendmail_path = sendmail -t -i Hang on a minute. Is the above copy and pasted and totally accurate? 1) Lines beginning with a semi-colon (;) are comments. Comments have no effect on the configuration. 2) sendmail_path defaults to 'sendmail -t -i' anyway -- just as the comments say. So basically you haven't made any changes to php.ini at all. So whatever got your mail working was because of something else that you had done. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* A bad sector disk error or a head crash occurs only after you've done several hours of work without making a backup -- DSP Paradox (Nolans Placebo) n4 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to conver a string to float
On Saturday 07 February 2004 23:56, Sebastian wrote: > Is there a possibility to convert a string like "10*500" (parsed from a > XML-File) to a float? > When i try to store this String in a float variable it only coverts the > "10" but nothing after the "*"-sign, but i need the result of this > expresison... Is there a function to calculate such string expressions? Not sure if there is a more elegant way but: $doo = "10*500"; eval('$dah = ' . $doo . ';'); echo $dah; -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* "Necessity is the mother of invention" is a silly proverb. "Necessity is the mother of futile dodges" is much nearer the truth. -- Alfred North Whitehead */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] refresh page (might be 0t)
Hey, Have run into a little problem...any help appreciated. Heres what I am doing: I give the client a control panel where he can add,edit and delete accounts, after each of the actions I have a link back to the index page of the contol panel...problem is, unless he presses the refresh button it shows him the same cached content. How do i force the browser to display the new updated accounts after and edit or the new list of accounts after a delete? I KNOW php is server side and this is a browser issue...but maybe this can be done with headers or something? Thanks, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot send mail after upgrading to OS X v10.3
On Feb 7, 2004, at 10:36 PM, Jason Wong wrote: So basically you haven't made any changes to php.ini at all. So whatever got your mail working was because of something else that you had done. I stand corrected. Now I don't remember what I did to fix this. I waited 5 minutes between sending test emails to myself. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: refresh page (might be 0t)
.htaccess file on the server maybe? I'm not at all sure though & you might not want to reload the page *every* time it's visited. Ryan A wrote: Hey, Have run into a little problem...any help appreciated. Heres what I am doing: I give the client a control panel where he can add,edit and delete accounts, after each of the actions I have a link back to the index page of the contol panel...problem is, unless he presses the refresh button it shows him the same cached content. How do i force the browser to display the new updated accounts after and edit or the new list of accounts after a delete? I KNOW php is server side and this is a browser issue...but maybe this can be done with headers or something? Thanks, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 8 Feb 2004 04:47:46 -0000 Issue 2577
php-general Digest 8 Feb 2004 04:47:46 - Issue 2577 Topics (messages 177097 through 177120): Re: Need a way to automate user logout 177097 by: Lowell Allen PHP5 Beta 3 177098 by: Safran von Twesla [ERR] [PHP] PHP5 Beta 3 177099 by: postmaster.hanmir.com PEAR DB 1.6.0RC5 released, please test it 177100 by: Daniel Convissor Compilation issue with php 5.00 and mysqli-extension 177101 by: Jochen Re: Problems with ö or ä in script 177102 by: DvDmanDT Re: explode() an array and grep out a string 177103 by: Adam Bregenzer Re: include_once() isnt! 177104 by: Adam Bregenzer Re: FreeBSD to Linux -- PHP Issues 177105 by: Don Read Re: Checking if database has been setup 177106 by: Don Read Re: Beginner amazes self with image gallery script! 177107 by: Joseph Szobody 177111 by: Ryan A Re: Cannot send mail after upgrading to OS X v10.3 177108 by: gohaku 177116 by: Jason Wong 177119 by: gohaku Re: [PHP-QA] Compilation issue with php 5.00 and mysqli-extension 177109 by: Marcus Boerger how to conver a string to float 177110 by: Sebastian 177113 by: Galen 177117 by: Jason Wong function only available if PHP4 compiled using --enable-exif 177112 by: Paul Furman 177114 by: Ben Ramsey 177115 by: Paul Furman refresh page (might be 0t) 177118 by: Ryan A 177120 by: Paul Furman 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] -- --- Begin Message --- > I used cron to do this as well; but i devised a much simpler, elegant > solution that is cross-browser and event-based and not schedule-based. > > I basically have a javascript include file that instantiates a function that > counts down in T-minus 10 minutes fashion. at 9:30 the browser pops a > window and says "you appear to be inactive; would you like to continue > working?" clicking on yes closes the popup and resets the timer; not > clicking expires the popout which redirects the parent page to the logout. > clicking on "log me out" basically circumvents the 30-second countdown > straight to the logout. > > to handle the alt+F4-happy crowd i devised a way to pop a special logout > window when the browser is closed. this child window destroys sessions and > makes database logs; this window closes itself. > > this happened to work for me, YMMV. > > ~phillip jackson I've recently faced a similar issue. I lock CMS database records during editing so multiple users can't edit simultaneously. It's easy to unlock the records via PHP if the user goes to any other area of the CMS or if she logs out. The problem is that users often don't log out, and sometimes leave directly from an edit screen. I tried using the Javascript onunload event to open a new window which runs a PHP script to unlock the record then close itself, but that doesn't work if pop-up blocking software is being used. Does your method do something similar? Does it work with pop-up blocking? -- Lowell Allen --- End Message --- --- Begin Message --- Hi php-general, I have already PHP 4.3.1 running on my apache 2 webserver, on Linux. Now I've tried to make PHP 5 run, everything compiles well, I have set the same configuration parameters than for PHP 4, only additionally --disable-libxml because it wouldn't compile then. I added the line with libphp5.so (well it did by itself...) and restarted the webserver (graceful). Didn't work, .php was not sent to the php-engine. Then I commented the libphp4.so. No .php file was recognized to go through the php-engine... I uncommented the libphp4.so, so I have 2 libphp again, there, I had segmentation faults, and the webserver crashed... restarting the webserver only with php4 gave me following: [notice] Graceful restart requested, doing restart [notice] seg fault or similar nasty error detected in the parent process [warn] pid file /var/run/apache2/httpd.pid overwritten -- Unclean shutdown of previous Apache run? [notice] Apache/2.0.44 (Unix) PHP/4.3.1 configured -- resuming normal operations Well, my question: what's wrong? Here my config-parameters (config.nice): #! /bin/sh # # Created by configure './configure' \ '--disable-libxml' \ '--with-apxs2=/usr/local/apache2/bin/apxs' \ '--with-config-file-path=/usr/local/etc' \ '--enable-magic-quotes' \ '--with-bcmath' \ '--enable-exif' \ '--enable-shared=max' \ '--enable-rule=SHARED_CORE' \ '--with-mysql=/usr/local/mysql' \ "$@" Thanks for answering/helping... SvT -- Who is the ennemy? --- End Message --- --- Begin Message --- Transmit Report: To: [EMAIL PROTECTED], 402 Local User Inbox Full ([EMAIL PROTECTED]) --- Begin Message --- Hi php-general, I have already PHP 4.3.1 running on my
Re: [PHP] how to conver a string to float
>> Is there a possibility to convert a string like "10*500" (parsed from a >> XML-File) to a float? When i try to store this String in a float >> variable it only coverts the "10" but nothing after the "*"-sign, but i >> need the result of this expresison... Is there a function to calculate >> such string expressions? Another possibility is to pipe the expression to bc, which could do the input check for you, and probably covers a lot of syntactic ground. Slightly less resource-efficient, but you don't have to reinvent the wheel (untested, unix only): $result = shell_exec("echo '${expr}' | bc"); - 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] refresh page (might be 0t)
On Sat, 2004-02-07 at 23:03, Ryan A wrote: > Heres what I am doing: > I give the client a control panel where he can add,edit and delete accounts, > after each of the actions I have a link back to > the index page of the contol panel...problem is, unless he presses the > refresh button it shows him the same cached content. > How do i force the browser to display the new updated accounts after and > edit or the new list of accounts after a delete? It sounds like you may want to set the page to not be cached. Here's what I use to prevent pages from being cached: function noCacheHeaders() { header('Expires: Tue, 1 Jan 1980 12:00:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0, no-transform'); header('Pragma: no-cache'); } This should prevent proxies, browsers, etc from caching your pages. -- Adam Bregenzer [EMAIL PROTECTED] http://adam.bregenzer.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to conver a string to float
On Sat, 2004-02-07 at 23:50, Michal Migurski wrote: > Another possibility is to pipe the expression to bc, which could do the > input check for you, and probably covers a lot of syntactic ground. > Slightly less resource-efficient, but you don't have to reinvent the > wheel (untested, unix only): > $result = shell_exec("echo '${expr}' | bc"); Both eval and piping to bc via the shell work but open up big security holes if you are not careful. If you have bcmath or gmp enabled in php I recommend looking at these functions: http://www.php.net/manual/en/function.gmp-mul.php http://www.php.net/manual/en/function.bcmul.php -- Adam Bregenzer [EMAIL PROTECTED] http://adam.bregenzer.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Use a Server or Client Socket?
Hi Raditha, Thanks, I have a better idea of how to write the codes. But I wonder, to check that the connection to the external server is on, where should I place the code? I need to do this every 10 minutes. If the connection is dropped, I have to reconnect. Where should I place this check? If I place it in the while(true) loop, I will be checking every few miliseconds rite? That will be too frequent. What about in another script? Will I be able to check that the connection is on? Regards, Ai Leen Raditha Dissanayake wrote: Hi Tan, If you are connecting to another server you are using a client socket you do not need to make a server socket. If you need to listen for connections make use of a server socket. To give you an example your browser makes use of client sockets while apache makes use of server sockets. That is an over simplified view of things but hope it helps you understand things better. Generally working with client sockets is easier. best regards raditha Tan Ai Leen wrote: Hi all, I have this situation now that requires socket programming. But I am not sure how to realise the requirements in programming whether as a client or server The requirement is like this. I have to connect to an external server constantly to listen for incoming data. How can I make sure that the connection is there all the time? Upon receiving the message, I will have to response back an acknowledgement that the message is received. I can also send data to the server. From my requirements, I understand that there will only be one connection. Therefore the data exchange need not be in sequence. Currently, what I have is a server programmed using the socket library. Server logic : socket_create socket_bind socket_listen while(true) { socket_select if(new connection) { add to connections array } else { if(can read) { read incoming response back } else { //error or connection close if(error) { print error } else { print connection close remove from connections array } } } } I am planning to include a check somewhere in the codes for maintaining the connection between my server and the other server. Where should I place it? Also, I need to initiate a connection to the external server and then listen. Where should this piece of code be insert at? Is this the right approach? Or I am over killing by writing a server if this can be handle in easier manner. Hope that I have been clear in the above. Thanks for helping Ai Leen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Use a Server or Client Socket?
Hi Raditha, Thanks, I have a better idea of how to write the codes. But I wonder, to check that the connection to the external server is on, where should I place the code? I need to do this every 10 minutes. If the connection is dropped, I have to reconnect. Where should I place this check? If I place it in the while(true) loop, I will be checking every few miliseconds rite? That will be too frequent. What about in another script? Will I be able to check that the connection is on? Regards, Ai Leen Raditha Dissanayake wrote: Hi Tan, If you are connecting to another server you are using a client socket you do not need to make a server socket. If you need to listen for connections make use of a server socket. To give you an example your browser makes use of client sockets while apache makes use of server sockets. That is an over simplified view of things but hope it helps you understand things better. Generally working with client sockets is easier. best regards raditha Tan Ai Leen wrote: Hi all, I have this situation now that requires socket programming. But I am not sure how to realise the requirements in programming whether as a client or server The requirement is like this. I have to connect to an external server constantly to listen for incoming data. How can I make sure that the connection is there all the time? Upon receiving the message, I will have to response back an acknowledgement that the message is received. I can also send data to the server. From my requirements, I understand that there will only be one connection. Therefore the data exchange need not be in sequence. Currently, what I have is a server programmed using the socket library. Server logic : socket_create socket_bind socket_listen while(true) { socket_select if(new connection) { add to connections array } else { if(can read) { read incoming response back } else { //error or connection close if(error) { print error } else { print connection close remove from connections array } } } } I am planning to include a check somewhere in the codes for maintaining the connection between my server and the other server. Where should I place it? Also, I need to initiate a connection to the external server and then listen. Where should this piece of code be insert at? Is this the right approach? Or I am over killing by writing a server if this can be handle in easier manner. Hope that I have been clear in the above. Thanks for helping Ai Leen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can I do this?
Can I include a script on another server doing this? $sql = 'SELECT * FROM '.$table.' where number like '.$number.';'; http://foo.com?list.php?number=16 include("http://elsewhere.com/list.php";); My $sql is error-ing - obviously. http://elsewhere.com/list.php is not receiving $number. Can I even do this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PEAR DB 1.6.0RC5 released, please test it
Hello Again: Another release of PEAR DB was made yesterday, 1.6.0RC5. The most important change was fixing the bug for people who use arrays for the DSN information when connecting. It also adds a new method called quoteIdentifier(), which is used for delimiting identifiers (such as field names and table names). I'm planning to issue the stable 1.6.0 release on Tuesday. So, please download the package and test it out. File bug reports if stuff doesn't work or is unclear. Download:http://pear.php.net/get/DB Manual: http://pear.php.net/manual/en/package.database.php Report Bugs: http://pear.php.net/bugs/report.php?package=DB Home Page: http://pear.php.net/package/DB Oh, and if you like the new features, the fixing of over 40 bugs, and/or the documentation improvements that have happened since 1.5.0RC2, take note of my "Wishlist" page at http://www.analysisandsolutions.com/donate/donate.htm The Financial Donations secition is now working again, too. Enjoy, --Dan PS: I'm not on the list. Just posting this as an announcement. -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y data intensive web and database programming http://www.AnalysisAndSolutions.com/ 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php