[PHP] Connecting binary php together
Hi I'm thinking about the best way to connect a c(++) binary with the php interpreter. I thought the best solution is to use a shared library which has been built by php. Is libphp4.so always the same or are the libraries for apache / apache2 / roxen / etc different ? I think the parameter --with-apxs or whatever is just given so that php knows what it has to do, right ? -- I won't pay Bill's -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Connecting binary php together
Not exactly sure what you mean here. Do you mean you'd like to get a C or C++ library to work inside PHP, or get PHP to work inside of a C or C++ app/library? If it's the former, then you want to build an extension to PHP. There are lots of examples in the ext directory. If it's the latter, then look at sapi/embed, which lets you cram the PHP interpreter into any sort of application or library. It's still experimental, but it's a step in the right direction. J Stephan Seidt wrote: Hi I'm thinking about the best way to connect a c(++) binary with the php interpreter. I thought the best solution is to use a shared library which has been built by php. Is libphp4.so always the same or are the libraries for apache / apache2 / roxen / etc different ? I think the parameter --with-apxs or whatever is just given so that php knows what it has to do, right ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] My first post
Hi Victor, Welcome to the wonderful world of PHP! I'm new in PHP. Could you point me where can i download a sample script about how can i paginate some results? PHP essentially exists to output HTML. You cannot paginate in HTML (although there is some fancy CSS that could be employed). Sorry, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] URL vars in URL var?
I'm trying to pass a URL as a var in a URL: The url var should equal: http://www.someothersite.com/index.php?something=somethingx=100y=200 And I'm passing it to this URL: http://www.somesite.com/index.php?var=val So if I use: http://www.somesite.com/index.php?var=valurl=http://www.someothersite.com/i ndex.php?something=somethingx=100y=200 The problem is, if I echo $url; I get the following: http://www.someothersite.com/index.php?something=something So the vars after the in the url var are being truncated, I'm assuming that they are treated as vars of the main URL. Any help appreciated, Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL vars in URL var?
http://www.php.net/manual/en/function.urlencode.php Pass it through that function (or one of the others) on: http://www.php.net/manual/en/ref.url.php On Tue, 2002-12-03 at 12:01, Shawn McKenzie wrote: I'm trying to pass a URL as a var in a URL: The url var should equal: http://www.someothersite.com/index.php?something=somethingx=100y=200 And I'm passing it to this URL: http://www.somesite.com/index.php?var=val So if I use: http://www.somesite.com/index.php?var=valurl=""> ndex.php?something=somethingx=100y=200 The problem is, if I echo $url; I get the following: http://www.someothersite.com/index.php?something=something So the vars after the in the url var are being truncated, I'm assuming that they are treated as vars of the main URL. Any help appreciated, Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP] Re: Connecting binary php together
Ok, I will see what --with-embed is going to show me ;) On Tue, 03 Dec 2002 11:41:19 -0500 J Smith [EMAIL PROTECTED] wrote: Not exactly sure what you mean here. Do you mean you'd like to get a C or C++ library to work inside PHP, or get PHP to work inside of a C or C++ app/library? If it's the former, then you want to build an extension to PHP. There are lots of examples in the ext directory. If it's the latter, then look at sapi/embed, which lets you cram the PHP interpreter into any sort of application or library. It's still experimental, but it's a step in the right direction. J Stephan Seidt wrote: Hi I'm thinking about the best way to connect a c(++) binary with the php interpreter. I thought the best solution is to use a shared library which has been built by php. Is libphp4.so always the same or are the libraries for apache / apache2 / roxen / etc different ? I think the parameter --with-apxs or whatever is just given so that php knows what it has to do, right ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- I won't pay Bill's -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL vars in URL var?
Great thanks! Since I'm doing this from an anchor or in the browser location bar, I just replaced the in the url var with %26. Works great! -Shawn Adam Voigt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... http://www.php.net/manual/en/function.urlencode.php Pass it through that function (or one of the others) on: http://www.php.net/manual/en/ref.url.php On Tue, 2002-12-03 at 12:01, Shawn McKenzie wrote: I'm trying to pass a URL as a var in a URL: The url var should equal: http://www.someothersite.com/index.php?something=somethingx=100y=200 And I'm passing it to this URL: http://www.somesite.com/index.php?var=val So if I use: http://www.somesite.com/index.php?var=valurl=http://www.someothersite.com/i ndex.php?something=somethingx=100y=200 The problem is, if I echo $url; I get the following: http://www.someothersite.com/index.php?something=something So the vars after the in the url var are being truncated, I'm assuming that they are treated as vars of the main URL. Any help appreciated, Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: print to file
Thank you! I feel like an idiot, kept getting it mixed up with perl. :) Bryan On Tue, 3 Dec 2002, Thomas Seifert wrote: | |$fp=fopen(filename,a); |fputs($fp,text to the file); |fclose($fp); | | |Regards, | |Thomas | |On Mon, 2 Dec 2002 15:52:23 -0800 (PST) [EMAIL PROTECTED] (Bryan Koschmann - Gkt) |wrote: | | Okay, this is probably stupid, but how do you print to a file? | | Thanks, | | Bryan | | | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql, php, checkbox
It works, but just for the first row selected from the table. I think that the problem is that the checkboxes are declared inside a while loop. If i declare manually all checkboxes it works. Any ideas ? Or maybe I'm doing something wrong? echo form method=\post\ action=\selectare.php?ids[]\; echo input type=\Submit\ value=\Trimite\; /* Connecting, selecting database */ $link = mysql_connect(localhost, root, adrian) or die(Could not connect); print Connected successfully; mysql_select_db(menagerie) or die(Could not select database); /* Performing SQL query */ $query = SELECT * FROM reclamatie; $result = mysql_query($query) or die(Query failed); /* Printing results in HTML */ echo table border=1; echo trtd/tdtdID/tdtdSubject/tdtdOpen/tdtdClose/td/tr; while($row = MySQL_fetch_array($result)) { echo trtdforminput type=\checkbox\ method=\post\ name=\ids[]\ value=\{$row['id']}\/form/td; echo tda href=\lowerframe.php?id={$row['id']}\ target=\lowerframe\{$row['id']}/a/td; echo td{$row['subject']}/td; echo td{$row['open']}/td; echo td{$row['close']}/td/tr; } echo /table; /* Free resultset */ mysql_free_result($result); /* Closing connection */ mysql_close($link); echo /form; ? ### //selectare.php (just displays the id's of selected checkboxes) //$useri=$_POST['useri']; $ids=$_POST['ids']; reset($ids); while (list ($key, $value) = each ($ids)) { echo $valuebr /\n; } ? # As I said, when I select the first checkbox, I get the id, but when I select any other checkbox, I get the errors PHP Notice: Undefined index: ids in selectare.php PHP Warning: Variable passed to each() is not an array or object in selectare.php - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: 'Adrian Partenie' [EMAIL PROTECTED]; 'php' [EMAIL PROTECTED] Sent: Thursday, November 28, 2002 5:54 PM Subject: RE: [PHP] mysql, php, checkbox I'm displaying the content of a mysql table with autoincrement index. I want to be able to select the each row from the table using the check boxes. In order to do that, i want to assign to each checkbox the name=index of selected row. I assign to the checkboxes the value of selected id, but I can't retreiveit later for further processing. My code looks like this $query = SELECT * FROM reclamatie; $result = mysql_query($query) or die(Query failed); /* Printing results in HTML */ echo table border=1; echo trtd/tdtdID/tdtdSubject/tdtdOpen/tdtdClose/td/tr ; while($row = MySQL_fetch_array($result)) { echo trtdforminput type=\checkbox\ method=\post\ name=\{$row['id']}\/form/td; // ?? It looks like your naming it as a number, which won't work for PHP. You want to name all of your checkboxes the same, with a [] on the name to make the results an array in PHP. ... name=id[] value={$row['id']} Then, you'll have $_POST['id'][x] as an array in PHP. Only the checkboxes that were selected will be in the array, from zero to however many were checked. The value of $_POST['id'][x] will be whatever was in the value=... part of the HTML checkbox... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to handle so called expired sessions??
Ive just been getting myself deep into using sessions. Sessions are working as it should except for one condition. Say I log into the site, and the session is started, and I don't do anything for the next 30 mins, then go back to the site. Im temporarily logged out, but because the session cookie is still good, the next page load logs me back in. How do the people who use sessions handle this type of scenario?? Whether your logged back in or not is dependant on your program. Once you are gone for over X minutes, your session file is deleted. So, even though the cookie is still good, the session will not have any data. What's usually done is to check for a certain session value, like $_SESSION['logged_in'] and if it's present, then continue, otherwise force the user to log back in again. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] preg_replace works on normal string but not with a string build from a file
take a look at the following code basic problem is, it works with the custom build string in the script but not if get the code from a file. I allways used ereg_replace but after installing a newer version of php (4.2.2) it became very slow, so now I'm trying preg_replace please help !!! kind regards Jeroen olthof, ?php $opentag = '!-- #LOOP-START:aaa --'; $closetag = '!-- #LOOP-END:aaa --'; // building the string in this script will give the wanted result $string = '?xml version=1.0 encoding=iso-8859-1?'; [snip] $string .= '/html'; // building the string from a text file won't give the wanted result; // uncomma the next file for testing // $string = implode(false,@file('./loadlooptest2.html')); echo p--result--/p\n\n\n; echo $result = preg_replace(/.*$opentag(.*)$closetag.*/, '\\1',$string); echo \n\n\np--modified/p\n\n\n; echo $modified_template = ereg_replace($opentag.*$closetag, '{replaced}', $string); Well, that string and the file aren't exactly the same. The file has newlines in it, the string you're creating does not. So in the string, it's all on the same line, while it's on separate lines in the file. Preg_replace may be looking for that pattern on a single line. The /m modifier may help in this circumstance, I'm not sure though. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imagick v0.9.0.1 RELEASED
imagick, the PHP ImageMagick module, has been moved and can be found here: http://pear.php.net/package-info.php?pacid=76 All releases will occur at this location from now on. The site: http://magick.communityconnect.com/ Will continue to point to the above PHP URL. Christian and I released version 0.9.0.1. It contains support for image lists and almost all of the image processing functions - image effects, special effects, etc. Contact either myself or Christian ([EMAIL PROTECTED]) if you have comments, suggestions or to report bugs. Thanks. -- Michael C. Montero Chief Technology Officer Community Connect Inc. Co-founder [EMAIL PROTECTED] -=-=-=-=-= Community Connect Inc. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- The Premier Source of Interactive Online Communities149 Fifth Avenue http://www.CommunityConnectInc.com/ New York, NY 10010 http://www.AsianAvenue.com/ http://www.BlackPlanet.com/ Click into Asian AmericaThe World Is Yours http://www.MiGente.com/ http://www.DiversityJobMarket.com/ The Power of LatinosIn partnership with The New York Times - Your Message May Appear Below This Line -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Searchable archive
Hello, Could anyone please point me to a searcheble archive of this mailing list. Thanks guys. Mohan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Searchable archive
At 08:58 04.12.2002, Mohanaraj spoke out and said: [snip] Hello, Could anyone please point me to a searcheble archive of this mailing list. Thanks guys. [snip] http://marc.theaimsgroup.com/?l=php-general This is listed at the PHP home page, when clicking on mailing lists, general/Archive(yes). -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Searchable archive
http://marc.theaimsgroup.com/?l=php-general is for the general list, other archive locations for other lists can be found at: http://www.php.net/mailing-lists.php Happy Searching! Mohanaraj wrote: Hello, Could anyone please point me to a searcheble archive of this mailing list. Thanks guys. Mohan --Joseph Guhlin http://www.bahwi.cc/ Web Developer / Unix Consultant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] formating numbers date
I'm curious how I change the number of decimal places displayed, and also changing the date / time structures before displaying them with an echo command. Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] re: ini_set() / Jason Wong / dynamically setting this?
Matt -- ...and then Matt Babineau said... % % Hi everyone: Hi! ... % % I am working on a website, and I have a shared hosting account on a % win2k machine. When I upload from my local machine to the shared hosting % machine I have to change a variable on each of my pages that gives me % the proper path to including the necessary files to execute the page % properly. If I don't I get an error. What I've done is put a bit of code in each of my scripts # this will let us figure out where we are and then always source the right include stuff! # it does not work with symlinks (__FILE__ reports the *target*) # you must have a full env tree in your devel tree; we now look exclusively in $DEVELDIR if set if ( ereg(/home/sites/\.php/,__FILE__) )# are we *somewhere* in our usual master tree? { $DEVELDIR = preg_replace(|/.*/home/sites/\.php(.*)/[^/]*$|,\\1,__FILE__) ; } # get the working dir and then I work from my base development tree with a include(/home/sites/.php$DEVELDIR/includestuff.inc);# include our various files require(/home/sites/.php$DEVELDIR/ImageInformation.class.php); and away I go. I replicate my build directory anywhere under the .php dir and everything else knows where it is and thus where to find the other files in the same version. This may be helpful; good luck! HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg88211/pgp0.pgp Description: PGP signature
Fw: [PHP] formating numbers date
To change the number of decimal places look into the number_format() function. To change the date/time structure the date() function will do what you need. Search for both on www.php.net -Kevin - Original Message - From: Jeff Bluemel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 03, 2002 1:11 PM Subject: [PHP] formating numbers date I'm curious how I change the number of decimal places displayed, and also changing the date / time structures before displaying them with an echo command. Jeff -- 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] x as a multiplier
Code: $newwidth . x . $newheight What I want to get out is a string, like 89x115. All I am getting though, is one number, even though if I do this $newwidth . x . $newheight It prints out just fine. What is going on here? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] x as a multiplier
Is it possible you're mistaken somehow? x isn't an operator in PHP. Executing $a x $b will give you a parse error. Anything in quotes is automatically casted as a string. -Kevin - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 03, 2002 3:20 PM Subject: [PHP] x as a multiplier Code: $newwidth . x . $newheight What I want to get out is a string, like 89x115. All I am getting though, is one number, even though if I do this $newwidth . x . $newheight It prints out just fine. What is going on here? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cold Fusion conversion issues: app vars and cached queries
My company is looking to move our site away from Cold Fusion due to the cost. We had talked about JSP, but I would highly prefer PHP. After evaluation, with the generic database functions now supporting Oracle in CVS, I think this might be a possibility. However, there are 2 concerns I have in converting from Cold Fusion. 1) Application variables 2) Cached queries I've seen some solutions to both problems, but mainly I want the solution to meet one and ideally both of the following qualifications. First, I don't want to have to use an add in module. I'd like to only use core PHP functions and modules that are part of the full PHP distribution and not SRM or other add-on modules. Second, I'd prefer not to have to serialize the results, save as a file, and read the file as updates would seem to become more difficult on higher load systems with having to update files. Updates to our cached queries and application variables generally only occur a few times a day. These issues above as well as things like not being able to centrally configure a database connection by using an alias for the name are areas PHP lacks in comparision to Cold Fusion. Our CF application gets installed at client sites. Using PHP, it would require a code change in a db connect file to change the DB connection information where it really should be configurable in a central PHP conf file. Even with this being said, I'd like to use PHP for our application if the 2 issues above can be resolved. Thanks in advance, Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] x as a multiplier
I don't think he's trying to multiply, I think he wants to print #x#, like 800x600 or 1024x768, etc... Adam On Tue, 3 Dec 2002, Kevin Stone wrote: Is it possible you're mistaken somehow? x isn't an operator in PHP. Executing $a x $b will give you a parse error. Anything in quotes is automatically casted as a string. -Kevin - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 03, 2002 3:20 PM Subject: [PHP] x as a multiplier Code: $newwidth . x . $newheight What I want to get out is a string, like 89x115. All I am getting though, is one number, even though if I do this $newwidth . x . $newheight It prints out just fine. What is going on here? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] POST data
Can someone tell me how I can access data from a POST? I don't mean the variables because the data I'm getting doesn't have any. I have a client that is doing a simple HTTP Post to a server and appending xml data right after the header. I need access to the xml blob. Thanks, Brian - Brian (Be sure to remove the # symbol before replying to my email address) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] POST data
At 23:47 03.12.2002, Brian Duke said: [snip] Can someone tell me how I can access data from a POST? I don't mean the variables because the data I'm getting doesn't have any. I have a client that is doing a simple HTTP Post to a server and appending xml data right after the header. I need access to the xml blob. [snip] Not sure if this gives you the posted data, but you could try $_SERVER['QUERY_STRING']. Or simply print_r the $_SERVER array to check if it is available. -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Anybody knows LWC::UserAgent (Perl) equivalent for PHP ?
message the same as the subject :) i need something for PHP to work with site that requires cookies. And i hate to handle HTTP header and all those Coocies by my self :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] x as a multiplier
Exactly. But it's only giving me one of the numbers without the space between the numbers and the x. -Original Message- From: Adam Williams [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 03, 2002 3:48 PM To: Kevin Stone Cc: John Meyer; [EMAIL PROTECTED] Subject: Re: [PHP] x as a multiplier I don't think he's trying to multiply, I think he wants to print #x#, like 800x600 or 1024x768, etc... Adam On Tue, 3 Dec 2002, Kevin Stone wrote: Is it possible you're mistaken somehow? x isn't an operator in PHP. Executing $a x $b will give you a parse error. Anything in quotes is automatically casted as a string. -Kevin - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 03, 2002 3:20 PM Subject: [PHP] x as a multiplier Code: $newwidth . x . $newheight What I want to get out is a string, like 89x115. All I am getting though, is one number, even though if I do this $newwidth . x . $newheight It prints out just fine. What is going on here? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_replace works on normal string but not with a string build from a file
Thx, I had created a workarround, withs was looping through every line of the file and doing a rtrim. But your hint pointed me to the better solution The modifier m alone didn't do the job, because I uses a dot to match any character. But without the s modifier it will not match a new line. So both modifiers gets it all to work! Thx for the tip! Kind regards Jeroen Olthof, John W. Holmes [EMAIL PROTECTED] schreef in bericht 000801c29af6$a1a28450$7c02a8c0@coconut">news:000801c29af6$a1a28450$7c02a8c0@coconut... take a look at the following code basic problem is, it works with the custom build string in the script but not if get the code from a file. I allways used ereg_replace but after installing a newer version of php (4.2.2) it became very slow, so now I'm trying preg_replace please help !!! kind regards Jeroen olthof, ?php $opentag = '!-- #LOOP-START:aaa --'; $closetag = '!-- #LOOP-END:aaa --'; // building the string in this script will give the wanted result $string = '?xml version=1.0 encoding=iso-8859-1?'; [snip] $string .= '/html'; // building the string from a text file won't give the wanted result; // uncomma the next file for testing // $string = implode(false,@file('./loadlooptest2.html')); echo p--result--/p\n\n\n; echo $result = preg_replace(/.*$opentag(.*)$closetag.*/, '\\1',$string); echo \n\n\np--modified/p\n\n\n; echo $modified_template = ereg_replace($opentag.*$closetag, '{replaced}', $string); Well, that string and the file aren't exactly the same. The file has newlines in it, the string you're creating does not. So in the string, it's all on the same line, while it's on separate lines in the file. Preg_replace may be looking for that pattern on a single line. The /m modifier may help in this circumstance, I'm not sure though. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] x as a multiplier
At 23:20 03.12.2002, John Meyer said: [snip] Code: $newwidth . x . $newheight What I want to get out is a string, like 89x115. All I am getting though, is one number, even though if I do this $newwidth . x . $newheight It prints out just fine. What is going on here? [snip] Not sure what you mean here, you say you only get one number, but it prints out fine? However, this gives exactly what you want: code pre?php $a = 1024; $b = 768; $s = $a . 'x' . $b;// create a string echo $s; echo \n{$a}x{$b}\n; // or print it directly ? /pre /code Output for both cases: 1024x768 1024x768 -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] x as a multiplier
Adam, I know this. In reaction to the subject of John's post I cleared up the fact that x can not be acting as a multiplier becuase it is not an operator. My suggestion was that there may something else in his code that is causing the confusion.. making it look like it's doing something that it's not actually doing. Does that make more sense? :-\ John, please copy and paste the output of the following experiment.. $a = 1; $b = 2; echo $ax$b; echo $a.x.$b; echo $a.'x'.$b; -Kevin - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 03, 2002 3:59 PM Subject: RE: [PHP] x as a multiplier Exactly. But it's only giving me one of the numbers without the space between the numbers and the x. -Original Message- From: Adam Williams [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 03, 2002 3:48 PM To: Kevin Stone Cc: John Meyer; [EMAIL PROTECTED] Subject: Re: [PHP] x as a multiplier I don't think he's trying to multiply, I think he wants to print #x#, like 800x600 or 1024x768, etc... Adam On Tue, 3 Dec 2002, Kevin Stone wrote: Is it possible you're mistaken somehow? x isn't an operator in PHP. Executing $a x $b will give you a parse error. Anything in quotes is automatically casted as a string. -Kevin - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 03, 2002 3:20 PM Subject: [PHP] x as a multiplier Code: $newwidth . x . $newheight What I want to get out is a string, like 89x115. All I am getting though, is one number, even though if I do this $newwidth . x . $newheight It prints out just fine. What is going on here? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Anybody knows LWC::UserAgent (Perl) equivalent for PHP?
Haha, working on this same problem myself, right now. I used curl. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $base . $page . '?' . $query); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_COOKIE, $_SESSION['session']); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $buffer = curl_exec($ch); curl_close($ch); It's pulling in data from the $_SESSION for the cookie, but read up and you can see how to put in your own cookies. Some more info at php.net/curl it's not very friendly there though, but once you get the idea you'll go far. Some examples(not many, I might add) over at: http://curl.haxx.se/libcurl/php/examples/ Hope this helps. As far as without curl, can't really help you there. Others can I'm sure. Vincnetas Vienozinskis wrote: message the same as the subject :) i need something for PHP to work with site that requires cookies. And i hate to handle HTTP header and all those Coocies by my self :) --Joseph Guhlin http://www.bahwi.cc/ Web Developer / Unix Consultant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Prevent storing data when reload
Hello, I have a php-page whith a form-schema which stores data to a mysql-database on submit. (The schema posts data to the same page (php-self).) When I reload the page the data gets stored once more. I'm sure this is a well known problem. Are there any smart tricks to prevent this from happening? Thanks! Lars -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Howto: run local script to update remote script
I was wondering how I could have a local PHP (4.2.3) script running on Apache 1.3.27 / WinXP Pro send my current local IP address to a remote server running PHP 4.1.2, RedHat 7.3 Apache 1.3.26.. In the Linux based script, I'd want it to basically display my current IP address to friends who know the remote URL to connect to my FTP/HTTP server(s) and grab mp3s, etc.. I'm a complete newbie, and in my php.net/google.com searches the only thing I've come across is something called a CRON Job.. From my little experience and understanding, I've always thought a Cron Job was something that only was valid on *nix platforms and not Win32.. Am I mistaken? My remote linux server has a dedicated IP, although my Win32 machine obviously doesn't.. I assume this would make it easier to communicate from local to remote? From my little understanding, I assume the local script would need to place my IP address in a variable (within say: ipaddy.inc) and the remote script would be updated as the variable was read from ipaddy.inc when someone visited the page..? If anyone could point me to a tutorial, function name(s) or offer some code to get me started, I'd greatly appreciate it.. Apache PHP load on my local (Win32) machine when it boots and it's always running.. I just can't get past the auto-run-a-local-php-script area for the most part.. TIA.. Take care.. peace.. eriol -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Prevent storing data when reload
yep have the submit got to another page and then have a header location in there to go back to the original page that the form is on -Original Message- From: Lars Espelid [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 4 December 2002 10:17 AM To: [EMAIL PROTECTED] Subject: [PHP] Prevent storing data when reload Hello, I have a php-page whith a form-schema which stores data to a mysql-database on submit. (The schema posts data to the same page (php-self).) When I reload the page the data gets stored once more. I'm sure this is a well known problem. Are there any smart tricks to prevent this from happening? Thanks! Lars -- 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] Prevent storing data when reload
When I reload the page the data gets stored once more. I'm sure this is a well known problem. Are there any smart tricks to prevent this from happening? Yes, and they get discussed on this list almost daily... a quick search would have helped. 1. the script that does all the validating and inserting SHOULD NOT send any output to the browser... after insert, put in a header(Location: script.php?action=thanks) style redirect. This means that if the user hits refresh, they will only be refreshing the thanks page, NOT the insert page, because it never gets to the browser. Yes, this can all be done in one script, it may need some re-organisation though. 2. when generating the HTML form, include a hidden field with a unique string in it. Insert this string with the rest of the form data, and make sure that this string is only inserted once... so, if they hit refresh, you'll know that the form has already been submitted, and the data already inserted, so don't insert it again :) Cheers Justin French http://Indent.com.au Web Development Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Server
Thanks for the info... As it turns out, I am just a blithering idiot... I didn't know that I had to create a separate user... As I said, that shows my newbieness... However, this has lead me to another question... The default database, mysql, comes with a users file already... How do I create that in a new database?? Or can I just copy the existing to a new database? Chase Jason Wong [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Tuesday 03 December 2002 23:09, Chase wrote: I am the first to admit that this question belongs on a MySQL newsgroup instead of here, but I can't seem to find a newsgroup that will answer me... www.mysql.com Here is a newbie question. I am running a Win2K Advanced Server with IIS 5?, PHP4, and MySQLmax 3.23.53. I am by no means experienced in setting up any of these items, but my simple question is, how do I determine the name of the MySQL server so I can get PHP to connect to it? If they're all on the same server use 'localhost'. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* My father was a God-fearing man, but he never missed a copy of the New York Times, either. -- E.B. White */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cold Fusion conversion issues: app vars and cachedqueries
on 04/12/02 6:23 AM, Steve W ([EMAIL PROTECTED]) wrote: These issues above as well as things like not being able to centrally configure a database connection by using an alias for the name are areas PHP lacks in comparision to Cold Fusion. Our CF application gets installed at client sites. Using PHP, it would require a code change in a db connect file to change the DB connection information where it really should be configurable in a central PHP conf file. If you're installing the App on various servers, clearly there needs to be SOME form of configuration upon installation... the document root could be in a different place, the database username and password stuff could be different, permissions could be different, etc etc. Generally this is achieved with an include()'d file, which keep all your config vars in one spot. Since a heap of my sites run on shared servers, I don't like the idea of central shared configs -- well, at least not above the config settings in php.ini and at .htaccess level. Speaking of which, PHP can be configured to automatically include a certain file at the top and bottom of every script that gets run. I think the php.ini directive is auto-prepend, or something like that... Perhaps this also address' your application variables question too? Even with this being said, I'd like to use PHP for our application if the 2 issues above can be resolved. I'm not up-to-speed with CF, so I can't address your exact issues, but I know that there are thousands of large enterprise sites running PHP (yahoo for example), so there MUST be a way to achieve everything you need. Justin French http://Indent.com.au Web Development Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date
Hi, please could someone tell me how i can return a month in text from an int ie getMonth(12) How about: $Months = array( , 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ); echo $Months[12]; // Dec Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Server
mysql-database contains all the system tables and users. Users are only inserted there and defined for which database they are made. As Jason suggested, look at mysql.com they have a fine manual with tutorials and long descriptions which lead to easy solutions to create users. i.e. search for the grant-statement. Thomas On Tue, 3 Dec 2002 16:56:40 -0700 [EMAIL PROTECTED] (Chase) wrote: Thanks for the info... As it turns out, I am just a blithering idiot... I didn't know that I had to create a separate user... As I said, that shows my newbieness... However, this has lead me to another question... The default database, mysql, comes with a users file already... How do I create that in a new database?? Or can I just copy the existing to a new database? Chase Jason Wong [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Tuesday 03 December 2002 23:09, Chase wrote: I am the first to admit that this question belongs on a MySQL newsgroup instead of here, but I can't seem to find a newsgroup that will answer me... www.mysql.com Here is a newbie question. I am running a Win2K Advanced Server with IIS 5?, PHP4, and MySQLmax 3.23.53. I am by no means experienced in setting up any of these items, but my simple question is, how do I determine the name of the MySQL server so I can get PHP to connect to it? If they're all on the same server use 'localhost'. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* My father was a God-fearing man, but he never missed a copy of the New York Times, either. -- E.B. White */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] formating numbers date
ok - I've been looking through this... the number_format is working great (actually I finally found that function right before I read your response), but the date format doesn't seem to allow me to pass it a date. Jeff Kevin Stone [EMAIL PROTECTED] wrote in message 01ff01c29b0b$381e2380$6601a8c0@kevin">news:01ff01c29b0b$381e2380$6601a8c0@kevin... To change the number of decimal places look into the number_format() function. To change the date/time structure the date() function will do what you need. Search for both on www.php.net -Kevin - Original Message - From: Jeff Bluemel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 03, 2002 1:11 PM Subject: [PHP] formating numbers date I'm curious how I change the number of decimal places displayed, and also changing the date / time structures before displaying them with an echo command. Jeff -- 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] POST data
Can someone tell me how I can access data from a POST? I don't mean the variables because the data I'm getting doesn't have any. I have a client that is doing a simple HTTP Post to a server and appending xml data right after the header. I need access to the xml blob. In php.ini, there is this setting: ; Always populate the $HTTP_RAW_POST_DATA variable. ;always_populate_raw_post_data = On It's off by default. You could turn it on and then use that variable to get all of the data, possibly. I think it would be $GLOBALS['HTTP_RAW_POST_DATA'] with register globals off? Search the PHP site for more info on it. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Show Folder Contents in Form
I finally got around to checking this thing out. Doesn't work... I'm getting these errors: Warning: readdir(): supplied argument is not a valid Directory resource in c:\inetpub\wwwroot\checker\admin\add_module.php on line 136 Warning: Wrong datatype in usort() call in c:\inetpub\wwwroot\checker\admin\add_module.php on line 142 Any ideas why and how to fix it? - Original Message - From: Nick Eby [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, December 02, 2002 4:16 PM Subject: [PHP] Re: Show Folder Contents in Form you could first read the files and their modified-dates into an array; sort the array; and finally build a select widget from the array... function sortByTime($a, $b) { if ($a[time] == $b[time]) return 0; return ($a[time] $b[time]) ? -1 : 1; } while (false !== ($file = readdir(/some/directory/))) { if ($file != . $file != ..) $files[] = array(file = $file, time = filectime(/some/directory/.$file)); } usort($files, sortBytime); echo select; while (list(,$filearr) = each($files)) echo option value=\.$filearr[file].\.$filearr[file]. .$filearr[time]; Stephen [EMAIL PROTECTED] wrote in message 000901c29a46$590a2320$0200a8c0@melchior">news:000901c29a46$590a2320$0200a8c0@melchior... Hello, Is it possible, and if so how, to get the filenames and last edited time/date, then display them in a select field in a form for a user to select? I'd need to show them in order of most recently edited to last edited. How can this be done if it can? Thanks, Stephen Craton http://www.melchior.us Life is a gift from God. Wasting it is like destroying a gift you got from the person you love most. -- http://www.melchior.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Show Folder Contents in Form
Nevermind, I fixed it. But now I have another problem. One, my select box has some sub-directories. How cna I filter those out? It is also showing a bunch of numbers. I included a screenshot of the select box. The following is the code: ?php function sortByTime($a, $b) { if ($a[time] == $b[time]) return 0; return ($a[time] $b[time]) ? -1 : 1; } if($handle = opendir('/Inetpub/wwwroot/checker/modules/')) { while (false != ($file = readdir($handle))) { if ($file != . $file != ..) $files[] = array(file = $file, time = filectime(/Inetpub/wwwroot/checker/modules/.$file)); } usort($files, sortBytime); echo select; while (list(,$filearr) = each($files)) { echo option value=\.$filearr[file].\.$filearr[file]..$filearr[time]; } echo /select; } ? - Original Message - From: Stephen [EMAIL PROTECTED] To: Nick Eby [EMAIL PROTECTED] Cc: PHP List [EMAIL PROTECTED] Sent: Tuesday, December 03, 2002 8:28 PM Subject: Re: [PHP] Re: Show Folder Contents in Form I finally got around to checking this thing out. Doesn't work... I'm getting these errors: Warning: readdir(): supplied argument is not a valid Directory resource in c:\inetpub\wwwroot\checker\admin\add_module.php on line 136 Warning: Wrong datatype in usort() call in c:\inetpub\wwwroot\checker\admin\add_module.php on line 142 Any ideas why and how to fix it? - Original Message - From: Nick Eby [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, December 02, 2002 4:16 PM Subject: [PHP] Re: Show Folder Contents in Form you could first read the files and their modified-dates into an array; sort the array; and finally build a select widget from the array... function sortByTime($a, $b) { if ($a[time] == $b[time]) return 0; return ($a[time] $b[time]) ? -1 : 1; } while (false !== ($file = readdir(/some/directory/))) { if ($file != . $file != ..) $files[] = array(file = $file, time = filectime(/some/directory/.$file)); } usort($files, sortBytime); echo select; while (list(,$filearr) = each($files)) echo option value=\.$filearr[file].\.$filearr[file]. .$filearr[time]; Stephen [EMAIL PROTECTED] wrote in message 000901c29a46$590a2320$0200a8c0@melchior">news:000901c29a46$590a2320$0200a8c0@melchior... Hello, Is it possible, and if so how, to get the filenames and last edited time/date, then display them in a select field in a form for a user to select? I'd need to show them in order of most recently edited to last edited. How can this be done if it can? Thanks, Stephen Craton http://www.melchior.us Life is a gift from God. Wasting it is like destroying a gift you got from the person you love most. -- http://www.melchior.us -- 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] Prevent storing data when reload
put if (!isset($blocker)) { your form goes here within your form add print input type=hidden name=blocker value=1 end your form } With this, your input form is on the page when the page first loads (and $blocker is not set), but disapears when the data is submitted and the page reloads. Even if the user hits the refresh button on the browser, the $blocker variable is still set and the form doesn't reapear. You can chain up a bunch of these and accomplish with one page what would have taken several. Hope this helps, Hugh - Original Message - From: Lars Espelid [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 03, 2002 3:17 PM Subject: [PHP] Prevent storing data when reload Hello, I have a php-page whith a form-schema which stores data to a mysql-database on submit. (The schema posts data to the same page (php-self).) When I reload the page the data gets stored once more. I'm sure this is a well known problem. Are there any smart tricks to prevent this from happening? Thanks! Lars -- 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[2]: [PHP] How to handle so called expired sessions??
Hi, Wednesday, December 4, 2002, 4:01:07 AM, you wrote: Ive just been getting myself deep into using sessions. Sessions are working as it should except for one condition. Say I log into the site, and the session is started, and I don't do anything for the next 30 mins, then go back to the site. Im temporarily logged out, but because the session cookie is still JWH good, the next page load logs me back in. How do the people who use sessions handle this type of scenario?? JWH Whether your logged back in or not is dependant on your program. Once JWH you are gone for over X minutes, your session file is deleted. So, even JWH though the cookie is still good, the session will not have any data. JWH What's usually done is to check for a certain session value, like JWH $_SESSION['logged_in'] and if it's present, then continue, otherwise JWH force the user to log back in again. JWH ---John Holmes... Not quite that simple as the cleanup proccess may not have run and the data is still sitting there, I use msession so I am not sure if the normal session stuff will return expired data after it expires and before it is deletedmsession does so I hacked it to cleanup if expired data is requested. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] How to handle so called expired sessions??
I've noticed this as well with the things I've been doing for sessions. They way I understand it is that the server side session storing values is supposed to expire after a certain lenght of time. I currently have this at default so I think it should expire after 24 mins. The cleanup is done within php itself so nothing is cleaned up until php is called again. Is this correct? If so, I have sessions located within my /tmp directory that are over 3 weeks old and have been there ever since they were first created. Ed On Wed, 4 Dec 2002, Tom Rogers wrote: Hi, Wednesday, December 4, 2002, 4:01:07 AM, you wrote: Ive just been getting myself deep into using sessions. Sessions are working as it should except for one condition. Say I log into the site, and the session is started, and I don't do anything for the next 30 mins, then go back to the site. Im temporarily logged out, but because the session cookie is still JWH good, the next page load logs me back in. How do the people who use sessions handle this type of scenario?? JWH Whether your logged back in or not is dependant on your program. Once JWH you are gone for over X minutes, your session file is deleted. So, even JWH though the cookie is still good, the session will not have any data. JWH What's usually done is to check for a certain session value, like JWH $_SESSION['logged_in'] and if it's present, then continue, otherwise JWH force the user to log back in again. JWH ---John Holmes... Not quite that simple as the cleanup proccess may not have run and the data is still sitting there, I use msession so I am not sure if the normal session stuff will return expired data after it expires and before it is deletedmsession does so I hacked it to cleanup if expired data is requested. -- regards, Tom -- 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: Re[2]: [PHP] How to handle so called expired sessions??
I have a similar problem only my sessions expire once you leave the site, even for a second. I'm not so experienced with cookies so how can I fix this? - Original Message - From: Tom Rogers [EMAIL PROTECTED] To: John W. Holmes [EMAIL PROTECTED] Cc: 'Gerard Samuel' [EMAIL PROTECTED]; 'php-gen' [EMAIL PROTECTED] Sent: Tuesday, December 03, 2002 9:52 PM Subject: Re[2]: [PHP] How to handle so called expired sessions?? Hi, Wednesday, December 4, 2002, 4:01:07 AM, you wrote: Ive just been getting myself deep into using sessions. Sessions are working as it should except for one condition. Say I log into the site, and the session is started, and I don't do anything for the next 30 mins, then go back to the site. Im temporarily logged out, but because the session cookie is still JWH good, the next page load logs me back in. How do the people who use sessions handle this type of scenario?? JWH Whether your logged back in or not is dependant on your program. Once JWH you are gone for over X minutes, your session file is deleted. So, even JWH though the cookie is still good, the session will not have any data. JWH What's usually done is to check for a certain session value, like JWH $_SESSION['logged_in'] and if it's present, then continue, otherwise JWH force the user to log back in again. JWH ---John Holmes... Not quite that simple as the cleanup proccess may not have run and the data is still sitting there, I use msession so I am not sure if the normal session stuff will return expired data after it expires and before it is deletedmsession does so I hacked it to cleanup if expired data is requested. -- regards, Tom -- 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] My first post
Hi, Tuesday, December 3, 2002, 7:37:20 AM, you wrote: VE Hi. VE I'm new in PHP. Could you point me where can i download a sample script VE about how can i paginate some results? VE TIA Here is a class that will create a google like pagination of results if that is what you are after :) ? class page_class { var $count = 0; //total pages var $start = 0; //starting record var $pages = 0; //number of pages available var $page = 1; //current page var $maxpages; //shows up to 2 * this number and makes a sliding scale var $show; //number of results per page function page_class($count=0,$show=5,$max=9){ $this-count = $count; $this-show = $show; $this-maxpages = $max; ($this-count % $this-show == 0)? $this-pages = intval($this-count/$this-show) :$this-pages intval($this-count/$this-show) +1; if(!empty($_GET['search_page'])){ $this-page = $_GET['search_page']; $this-start = $this-show * $this-page - $this-show; } } function get_limit(){ $limit = ''; if($this-count $this-show) $limit = 'LIMIT'.$this-start.','.$this-show; return $limit; } function make_head_string($pre){ $r = $pre.' '; $end = $this-start + $this-show; if($end $this-count) $end = $this-count; $r .= ($this-start +1).' - '.$end.' of '.$this-count; return $r; } function make_page_string($words,$pre='Result Page:'){ $r = $pre.' '; if($this-page 1){ $y = $this-page - 1; $r .= 'a href='.$_SERVER['PHP_SELF'].'?search_page='.$y.$words.'Previous/anbsp;'; } $end = $this-page + $this-maxpages-1; if($end $this-pages) $end = $this-pages; $x = $this-page - $this-maxpages; $anchor = $this-pages - (2*$this-maxpages) +1; if($anchor 1) $anchor = 1; if($x 1) $x = 1; if($x $anchor) $x = $anchor; while($x = $end){ if($x == $this-page){ $r .= 'span class=s'.$x.'/spannbsp;'; } else{ $r.= 'a href='.$_SERVER['PHP_SELF'].'?search_page='.$x.$words.''.$x.'/anbsp;'; } $x++; } if($this-page $this-pages){ $y = $this-page + 1; $r .= 'a href='.$_SERVER['PHP_SELF'].'?search_page='.$y.$words.'Next/anbsp;'; } return $r; } } //Usage mysql_connect(**.**.**.**, **, ) or die (mysql_error()); $Query = SELECT COUNT(*) AS cnt FROM tabletosearch WHERE fieldtosearch LIKE '% .$searchword. %'; $query = mysql_query($Query) or die(mysql_error()); $row = mysql_fetch_array($result); $count = $row['cnt']; if($count 0){ //start class total number of results,number of results to show,max number of pages on a sliding scale (ends up as 2x this number..ie 20) $page = new page_class($count,5,10); $limit = $page-get_limit(); $Query2= SELECT * FROM tabletosearch WHERE fieldtosearch LIKE '% .$searchword. %' ORDER BY whatever ASC .$limit; $result = mysql_query($Query2) or die(mysql_error()); $hstring = $page-make_head_string('Results'); $pstring = $page-make_page_string(amp;searchword=.$searchword.amp;whatever=.$whatever);//add the other variables to pass to next page in a similar fashion echo tabletrtd.$hstring./td/tr; while($row = mysql_fetch_array($result)){ echo trtd.$show_data_here./td/tr; } echo trtd.$pstring./td/tr/table; } ? Note: the search variables on subsequent pages will be passed by GET method -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re[2]: [PHP] How to handle so called expired sessions??
I've noticed this as well with the things I've been doing for sessions. They way I understand it is that the server side session storing values is supposed to expire after a certain lenght of time. I currently have this at default so I think it should expire after 24 mins. The cleanup is done within php itself so nothing is cleaned up until php is called again. Is this correct? If so, I have sessions located within my /tmp directory that are over 3 weeks old and have been there ever since they were first created. The default way sessions are set up is that there is a one percent chance that the cleanup process will be triggered on each request. Maybe you've just never hit that 1% ? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re[2]: [PHP] How to handle so called expired sessions??
Wednesday, December 4, 2002, 4:01:07 AM, you wrote: Ive just been getting myself deep into using sessions. Sessions are working as it should except for one condition. Say I log into the site, and the session is started, and I don't do anything for the next 30 mins, then go back to the site. Im temporarily logged out, but because the session cookie is still JWH good, the next page load logs me back in. How do the people who use sessions handle this type of scenario?? JWH Whether your logged back in or not is dependant on your program. Once JWH you are gone for over X minutes, your session file is deleted. So, even JWH though the cookie is still good, the session will not have any data. JWH What's usually done is to check for a certain session value, like JWH $_SESSION['logged_in'] and if it's present, then continue, otherwise JWH force the user to log back in again. JWH ---John Holmes... Not quite that simple as the cleanup proccess may not have run and the data is still sitting there, I use msession so I am not sure if the normal session stuff will return expired data after it expires and before it is deletedmsession does so I hacked it to cleanup if expired data is requested. Okay, so what's your question? The cookie and data is still there, but it's expired? How? As far as I know it's not expired until it is deleted. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[4]: [PHP] How to handle so called expired sessions??
Hi, Wednesday, December 4, 2002, 1:04:07 PM, you wrote: S I have a similar problem only my sessions expire once you leave the site, S even for a second. I'm not so experienced with cookies so how can I fix S this? S - Original Message - S From: Tom Rogers [EMAIL PROTECTED] S To: John W. Holmes [EMAIL PROTECTED] S Cc: 'Gerard Samuel' [EMAIL PROTECTED]; 'php-gen' S [EMAIL PROTECTED] S Sent: Tuesday, December 03, 2002 9:52 PM S Subject: Re[2]: [PHP] How to handle so called expired sessions?? Hi, Wednesday, December 4, 2002, 4:01:07 AM, you wrote: Ive just been getting myself deep into using sessions. Sessions are working as it should except for one condition. Say I log into the site, and the session is started, and I don't do anything for the next 30 mins, then go back to the site. Im temporarily logged out, but because the session cookie is still JWH good, the next page load logs me back in. How do the people who use sessions handle this type of scenario?? JWH Whether your logged back in or not is dependant on your program. Once JWH you are gone for over X minutes, your session file is deleted. So, S even JWH though the cookie is still good, the session will not have any data. JWH What's usually done is to check for a certain session value, like JWH $_SESSION['logged_in'] and if it's present, then continue, otherwise JWH force the user to log back in again. JWH ---John Holmes... Not quite that simple as the cleanup proccess may not have run and the S data is still sitting there, I use msession so I am not sure if the normal session S stuff will return expired data after it expires and before it is S deletedmsession does so I hacked it to cleanup if expired data is requested. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php You will have to put phpinfo(32); at the top of your page and see what the browser is sending for session info sounds like it is not sending the session cookie. Are you using apache style authentication? netscape will not send a cookie and auth info together (at least that is what I have noticed when I tried that style of authenticating and eventually abandoned it :) -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to make a individual submit...
howdy i have got me a form, that when submitted is effectlively only one variable, but when i submit it, it grabs the last field displayed instead of the one selected.. normally this would be easy but I think because I have it inside a loop it's playing havock on me.. -[form code in side the while loop] - // print all records in the DB while ($myrow = mysql_fetch_array($res)): $count++;? trtddiv align='center' font class=content?//=$myrow['id'] echo $count;?/font /div/tdtdnbsp;/tdtd div align='justify'font class=content ?=$myrow['uname']?/font/div/tdtdfont class=content?=$myrow['firstname']?/font/td tdfont class=content?=$myrow['lastname']?/font/tdtdfont class=content?=$myrow['company']?/font/td tdfont class=contentinput type=hidden name=number value=?=$myrow['id']?input type=submit name=usubmit value=send// pass on $myrow['id'] to next page /font/td/tr ? endwhile; ? --- --[processing code of the form]-- function usubmit(){ $id = $_POST['number']; $res=mysql_query(SELECT * from users WHERE id='$id'); $num = mysql_numrows($res) or die ( Header(Location: logerror.php?op=log_error) ); $email = mysql_result($res, 0, 'email'); $passwd = mysql_result($res, 0, 'passwd'); $uname = mysql_result($res, 0, 'uname'); $fname = mysql_result($res, 0, 'firstname'); if(!$boo){ echo mysql_error(); } else { //test output of values echo $id; // show's id to be the last id in the DB echo br; echo $email; echo br; echo $uname; echo br; echo $passwd; echo br; echo $fname; echo br; } --- Cheers Peter the only dumb question is the one that wasn't asked -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[4]: [PHP] How to handle so called expired sessions??
Hi, Wednesday, December 4, 2002, 1:33:03 PM, you wrote: No question :) It's just that this is what the original question was about and why I suggested doing his own sesssion timeout check as the deleting proccess is too unreliable to depend on for timeout handling. PHP will quite happily return stale data which could be bad in a login type of situation. JWH Okay, so what's your question? The cookie and data is still there, but JWH it's expired? How? As far as I know it's not expired until it is JWH deleted. JWH ---John Holmes... -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] how to make a individual submit...
i have got me a form, that when submitted is effectlively only one variable, but when i submit it, it grabs the last field displayed instead of the one selected.. normally this would be easy but I think because I have it inside a loop it's playing havock on me.. -[form code in side the while loop] - // print all records in the DB while ($myrow = mysql_fetch_array($res)): $count++;? trtddiv align='center' font class=content?//=$myrow['id'] echo $count;?/font /div/tdtdnbsp;/tdtd div align='justify'font class=content ?=$myrow['uname']?/font/div/tdtdfont class=content?=$myrow['firstname']?/font/td tdfont class=content?=$myrow['lastname']?/font/tdtdfont class=content?=$myrow['company']?/font/td tdfont class=contentinput type=hidden name=number value=?=$myrow['id']?input type=submit name=usubmit value=send// pass on $myrow['id'] to next page /font/td/tr ? endwhile; ? --- Okay, so you've got a bunch of hidden elements all with the same name and a bunch of submit buttons with the same name. Which number do you expect the submit button you choose to send? It's only going to choose the last one, since that was the last number that was given a value. The easy way to do this would be to just send the value you're after as the value of your submit button. input type=submit name=number value=?=$myrow['id'] Or, you could put form tags within your code above, so each hidden element and submit button is it's own form. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re[4]: [PHP] How to handle so called expired sessions??
No question :) It's just that this is what the original question was about and why I suggested doing his own sesssion timeout check as the deleting proccess is too unreliable to depend on for timeout handling. PHP will quite happily return stale data which could be bad in a login type of situation. Okay. I think I thought you were the original poster. How do you know it's returning stale data, though? If the cookie is valid, and there is still a session file (or data in memory), then why is it stale or expired. Maybe I'm just missing something here. If it's expired because you think it's too old, then you track your own timestamps and do your own cleanup. Is that what you're saying? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Whimper, help :)
Martin, Anyone, I'm desperate :( PHP isn't sending my SQL correctly. It's not a MySQL problem. It's my PHP syntax. Debugging: http://ccl.flsh.usherb.ca/print/print.html?search=%26quot%3Bready+maria%26quot%3B $sql = 'SELECT ... FROM '.$table.' WHERE MATCH ... AGAINST (\'ready maria\' IN BOOLEAN MODE) ORDER BY id asc'; Yay ... :) it works!!! (http://ccl.flsh.usherb.ca/print/display.test.inc.phps) If I copy paste this SQL into PHPMyAdmin, it works. BUT IT WON'T WORK IN PHP. The code belows echos $sql correctly, but MySQL thinks it received: +ready +maria not ready maria See: http://ccl.flsh.usherb.ca/print/index.html?search=%26quot%3Bready+maria%26quot%3B $sql = 'SELECT ... FROM '.$table.' WHERE MATCH ... AGAINST (\''.stripslashes($search).'\' IN BOOLEAN MODE) ORDER BY id asc'; $sql = SELECT ... FROM `$table` WHERE MATCH ... AGAINST ('.stripslashes($search).' IN BOOLEAN MODE) ORDER BY id asc; See (http://ccl.flsh.usherb.ca/print/display.table.inc.phps) What is the correct PHP syntax to get MySQl to read my SQl correctly? What am I f***ing up? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[6]: [PHP] How to handle so called expired sessions??
Hi, Wednesday, December 4, 2002, 1:59:11 PM, you wrote: JWH Okay. I think I thought you were the original poster. How do you know JWH it's returning stale data, though? If the cookie is valid, and there JWH is still a session file (or data in memory), then why is it stale or JWH expired. Maybe I'm just missing something here. If it's expired because JWH you think it's too old, then you track your own timestamps and do your JWH own cleanup. Is that what you're saying? Yes exactly, common problem is someone logs in but doesn't log out and the session is open to everyone, session timeout is supposed to help prevent these cases or at least reduce the chance. But of course the main use of session timeout is to frustrate developers who take more than 40 mins to suss out the next bit of code -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Whimper, help :)
Hi, Wednesday, December 4, 2002, 2:06:36 PM, you wrote: JTJ Martin, JTJ Anyone, JTJ I'm desperate :( PHP isn't sending my SQL correctly. It's not a MySQL problem. It's my PHP syntax. JTJ Debugging: JTJ http://ccl.flsh.usherb.ca/print/print.html?search=%26quot%3Bready+maria%26quot%3B JTJ $sql = 'SELECT ... FROM '.$table.' WHERE MATCH ... AGAINST JTJ (\'ready maria\' IN BOOLEAN MODE) ORDER BY id asc'; JTJ Yay ... :) it works!!! (http://ccl.flsh.usherb.ca/print/display.test.inc.phps) JTJ If I copy paste this SQL into PHPMyAdmin, it works. JTJ BUT IT WON'T WORK IN PHP. The code belows echos $sql correctly, but MySQL thinks it received: JTJ +ready +maria JTJ not JTJ ready maria JTJ See: http://ccl.flsh.usherb.ca/print/index.html?search=%26quot%3Bready+maria%26quot%3B JTJ $sql = 'SELECT ... FROM '.$table.' WHERE MATCH ... AGAINST JTJ (\''.stripslashes($search).'\' IN BOOLEAN MODE) ORDER BY id JTJ asc'; JTJ $sql = SELECT ... FROM `$table` WHERE MATCH ... AGAINST JTJ ('.stripslashes($search).' IN BOOLEAN MODE) ORDER BY id JTJ asc; JTJ See (http://ccl.flsh.usherb.ca/print/display.table.inc.phps) JTJ What is the correct PHP syntax to get MySQl to read my SQl correctly? JTJ What am I f***ing up? JTJ John If you are looking for in a string just quote it with ' example $like = 'ready maria'; $ sql = SELECT .. WHERE LIKE '$like'; no need to escape anything -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Prevent storing data when reload
Lars Espelid [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... When I reload the page the data gets stored once more. if (record already exists) { echo hey you hit reload! } else { [save record to database] } - Steve Yates - I know a good tagline when I steal one. ~ Taglines by Taglinator - www.srtware.com ~ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Whimper, help :)
Tom, Anyone, No I'm not looking for a , I'm trying to pass double quotes into MySQL. Like I said, it works when debugging: http://ccl.flsh.usherb.ca/print/print.html?search=%26quot%3Bready+maria%26quot%3B http://ccl.flsh.usherb.ca/print/display.test.inc.phps but fails when I try to pass my double quotes in: http://ccl.flsh.usherb.ca/print/index.html?search=%26quot%3Bready+maria%26quot%3B http://ccl.flsh.usherb.ca/print/display.table.inc.phps $sql = SELECT id,AU,ST,BT,AT FROM `$table` WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST ('.stripslashes($search).' IN BOOLEAN MODE) ORDER BY id asc; I already have the input type=text name=search $search I have tried many variations. If you are looking for in a string just quote it with ' example $like = 'ready maria'; $ sql = SELECT .. WHERE LIKE '$like'; no need to escape anything -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Whimper, help :)
what are the field types in the mysql DB? -Original Message- From: John Taylor-Johnston [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 4 December 2002 4:13 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Whimper, help :) Tom, Anyone, No I'm not looking for a , I'm trying to pass double quotes into MySQL. Like I said, it works when debugging: http://ccl.flsh.usherb.ca/print/print.html?search=%26quot%3Bready+ maria%26quot%3B http://ccl.flsh.usherb.ca/print/display.test.inc.phps but fails when I try to pass my double quotes in: http://ccl.flsh.usherb.ca/print/index.html?search=%26quot%3Bready+ maria%26quot%3B http://ccl.flsh.usherb.ca/print/display.table.inc.phps $sql = SELECT id,AU,ST,BT,AT FROM `$table` WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST ('.stripslashes($search).' IN BOOLEAN MODE) ORDER BY id asc; I already have the input type=text name=search $search I have tried many variations. If you are looking for in a string just quote it with ' example $like = 'ready maria'; $ sql = SELECT .. WHERE LIKE '$like'; no need to escape anything -- 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: mcrypt 2.4.x - trouble with small data fields?
Is there a minimum field size for using mcrypt? Boy I feel dumb now. :) My answer was in my post. Mcrypt returns a string that is usually longer than the original string, since the return has to be a multiple of the block size used. So a 2-character string takes blocksize characters when encrypted. Mcrypt also apparently needs the extra characters when decrypting. - Steve Yates - If at first you don't succeed, lower your standards. ~ Taglines by Taglinator - www.srtware.com ~ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Not able to connect to FTP server
Hi friends, I am having a DSL Internet connectivity in our office and my PC is connected to Internet using a HTTP/FTP Proxy(192.168.0.10) and the browser(Mozilla) in my PC is configured to connect to net through the proxy When I tried to connect to our ftp site using the following script, I have received the message that Unable to connect. But the same script is working fine with a direct modem connection. The script is // connect to ftp server if(!($ftp=ftp_connect(ftp.dirw.net))) { print(Unable to connectbr); exit; } Please suggest me on how to connect to the ftp site using the proxy server. Regards, Vinod.B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Whimper, help :)
Peter Houchin wrote: Mostly varchar(255) and a couple of text. (I may have one longtext). But should that make a difference? Like I said, I can run the same SQL in PHPMyAdmin (a MySQL interface) and I get the correct reponse. But pass it through PHP and kablooey. Won't work? John what are the field types in the mysql DB? -Original Message- From: John Taylor-Johnston [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 4 December 2002 4:13 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Whimper, help :) Tom, Anyone, No I'm not looking for a , I'm trying to pass double quotes into MySQL. Like I said, it works when debugging: http://ccl.flsh.usherb.ca/print/print.html?search=%26quot%3Bready+ maria%26quot%3B http://ccl.flsh.usherb.ca/print/display.test.inc.phps but fails when I try to pass my double quotes in: http://ccl.flsh.usherb.ca/print/index.html?search=%26quot%3Bready+ maria%26quot%3B http://ccl.flsh.usherb.ca/print/display.table.inc.phps $sql = SELECT id,AU,ST,BT,AT FROM `$table` WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST ('.stripslashes($search).' IN BOOLEAN MODE) ORDER BY id asc; I already have the input type=text name=search $search I have tried many variations. If you are looking for in a string just quote it with ' example $like = 'ready maria'; $ sql = SELECT .. WHERE LIKE '$like'; no need to escape anything -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- John Taylor-Johnston - If it's not open-source, it's Murphy's Law. ' ' ' Collège de Sherbrooke: ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/ - Université de Sherbrooke: http://compcanlit.ca/ 819-569-2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with session variables
I'm running PHP 4.3 on a Windows .net server with Apache 2. Please look at the following code as I cannot figure out what I'm doing wrong. Page1. session_start(); session_register(step); $step=1; header(location: page_A.php); Page_A. session_start(); extract($_SESSION); $step=2; header(location: page_B.php); Page_B. session_start(); extract($_SESSION); print($step); Output is always 1. I thought that session variables were global? What am I doing wrong?
Re: [PHP] Cold Fusion conversion issues: app vars and cached queries
--- Steve W [EMAIL PROTECTED] wrote: My company is looking to move our site away from Cold Fusion due to the cost. We had talked about JSP, but I would highly prefer PHP. After evaluation, with the generic database functions now supporting Oracle in CVS, I think this might be a possibility. However, there are 2 concerns I have in converting from Cold Fusion. 1) Application variables 2) Cached queries I can possibly field the first one. ColdFusion has server, application, session, and client scopes, right? Each have their own unique characteristics about them. However, if you speak with the top Macromedia engineers, you will see that client variables are preferred in most cases for high-traffic applications. Server, application, and session variables must be locked with cflock to solve synchronization problems, and cflock under load can present some noticeable bottlenecks. CF's client variables are basically identical to PHP session variables. Rather than having a variable scope such as client.foo, PHP has an array $_SESSION[foo]. PHP, by default, stores session variables on the local filesystem, so you will want to alter this behavior if you are developing for a clustered environment (which I assume you will be). You have much more flexibility in PHP to alter its default session management mechanism than you have flexibility in the cfapplication tag, but it is not nearly as quick and convenient to do so (especially for using a data store for session storage). However, once you do this once, you will find that programming for the PHP environment is no more difficult than for ColdFusion, and you will probably learn to appreciate the flexibility. I am not aware of an equivalent feature to ColdFusion's cached queries, but perhaps someone else can speak up on that one. I've seen some solutions to both problems, but mainly I want the solution to meet one and ideally both of the following qualifications. First, I don't want to have to use an add in module. I'd like to only use core PHP functions and modules that are part of the full PHP distribution and not SRM or other add-on modules. If you use PHP's built-in session management, you will have no problems with this. Your code will include any logic you add to alter the default behavior, such as in the case of using a central data store for session variables. If you write your own utility, which is pretty trivial, you will also not run into any trouble. I honestly do not care for either PHP or ColdFusion's built-in session management, so I prefer the flexibility PHP gives me to alter its. When developing ColdFusion applications for high-profile sites, I often implement my own mechanism. These issues above as well as things like not being able to centrally configure a database connection by using an alias for the name are areas PHP lacks in comparision to Cold Fusion. ColdFusion definitely makes managing database connections easier. PHP has no equivalent to the cfadministrator, so many things like this are easier with CF. However, I think you will find that PHP has a slight edge in performance in this regard, even when using native drivers (which you should, of course) in CF. I cannot rightly comment on PHP's Oracle support, however, as I have never used it. Our CF application gets installed at client sites. Using PHP, it would require a code change in a db connect file to change the DB connection information where it really should be configurable in a central PHP conf file. There are differences, no doubt. I understand your point; you let your clients configure their database connection with cfadministrator and assign it a name that your code uses in its cfquery tags. This makes code quite portable. With PHP, it is not too much more trouble to ask them to assign it a username, password, and name (of the database). Otherwise, you can do like many people do and allow your clients to configure and/or install your application according to their own environment. Meaning, you don't write cfadministrator in PHP, but you do let them change database access credentials and any other basic configuration by using your application. Even with this being said, I'd like to use PHP for our application if the 2 issues above can be resolved. I wouldn't look to people being excited about trying to match features with ColdFusion. PHP and CF are simply different. In a survey done a year or two ago (around the time CF 5 came out, I believe), PHP was rated as the most flexible and efficient, and CF was rated as the easiest for beginners and therefore generally more productive. Most PHP developers would prefer to be free from all of the bloat that would be necessary to make it as easy to administer as CF. Also, remember that a big difference stems from the fact that CF is a separate process. PHP (when used as an Apache module, for example) is nothing in and of itself. You really just have a more intelligent Web server that can parse PHP files.
Re: [PHP] Whimper, help :)
http://ccl.flsh.usherb.ca/print/print.html?search=%26quot%3Bready+maria%26quot%3B http://ccl.flsh.usherb.ca/print/index.html?search=%26quot%3Bready+maria%26quot%3B I blame PHP. Can't be MySQL. echo $sql displays the EXACT same thing. Debugging ... Works jdaxell.ccl = 2 records found: $sql = 'SELECT id,AU,ST,BT,AT FROM '.$table.' WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST (\'ready maria\' IN BOOLEAN MODE) ORDER BY id asc'; http://ccl.flsh.usherb.ca/print/display.test.inc.phps Doesn't work - Resembles +ready +maria $sql = SELECT id,AU,ST,BT,AT FROM $table WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST ('.stripslashes($search).' IN BOOLEAN MODE) ORDER BY id asc; http://ccl.flsh.usherb.ca/print/display.table.inc.phps Doesn't work - Resembles +ready +maria $sql = SELECT id,AU,ST,BT,AT FROM .$table. WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST ('.stripslashes($search).' IN BOOLEAN MODE) ORDER BY id asc; http://ccl.flsh.usherb.ca/print/display.table.inc.phps Doesn't work - Resembles +ready +maria $sql = 'SELECT id,AU,ST,BT,AT FROM '.$table.' WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST (\''.stripslashes($search).'\' IN BOOLEAN MODE) ORDER BY id asc'; http://ccl.flsh.usherb.ca/print/display.table.inc.phps :0 John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Whimper, help :)
http://ccl.flsh.usherb.ca/print/print.html?search=%26quot%3Bready+maria%26quot%3B http://ccl.flsh.usherb.ca/print/index.html?search=%26quot%3Bready+maria%26quot%3B I blame PHP. Can't be MySQL. echo $sql displays the EXACT same thing. Debugging ... Works jdaxell.ccl = 2 records found: $sql = 'SELECT id,AU,ST,BT,AT FROM '.$table.' WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST (\'ready maria\' IN BOOLEAN MODE) ORDER BY id asc'; http://ccl.flsh.usherb.ca/print/display.test.inc.phps Doesn't work - Resembles +ready +maria $sql = SELECT id,AU,ST,BT,AT FROM $table WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST ('.stripslashes($search).' IN BOOLEAN MODE) ORDER BY id asc; http://ccl.flsh.usherb.ca/print/display.table.inc.phps Doesn't work - Resembles +ready +maria $sql = SELECT id,AU,ST,BT,AT FROM .$table. WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST ('.stripslashes($search).' IN BOOLEAN MODE) ORDER BY id asc; http://ccl.flsh.usherb.ca/print/display.table.inc.phps Doesn't work - Resembles +ready +maria $sql = 'SELECT id,AU,ST,BT,AT FROM '.$table.' WHERE MATCH (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO) AGAINST (\''.stripslashes($search).'\' IN BOOLEAN MODE) ORDER BY id asc'; http://ccl.flsh.usherb.ca/print/display.table.inc.phps :0 John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP not reporting errors, but hangs!!
On Wednesday 04 December 2002 11:55 am, Siva Kumar wrote: About 3 months back I posted the following message to the list: On Saturday 12 October 2002 12:11 pm, Siva Kumar wrote: I am running Apache/PHP with Postgresql. For the past one day, whenever there is an error in the php script, instead of reporting the error, the page takes forever to load. Normal html pages load properly. Now we found what causes the problem. By default debugger.enable is set to false in the php_ini. Somehow, the value got changed to 'true' (don't know how) resulting in the problem described above. The debugger started in the background whenver a page with error is called, and the browser does not show the page. When the value is reset to 'false' it works as expected. Can someone explain, how the value can change on its own. (This has happened for the second time yesterday). Best regards, Siva Ma Siva Kumar, BSG LeatherLink, Chennai, India. http://www.leatherlink.net/ -- Ma Siva Kumar, BSG LeatherLink, Chennai, India. +91 44 6215110 +91 44 7170019 [EMAIL PROTECTED] http://www.leatherlink.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with session variables
On Wednesday 04 December 2002 14:12, Manuel Ochoa wrote: I'm running PHP 4.3 on a Windows .net server with Apache 2. Please look at the following code as I cannot figure out what I'm doing wrong. Page1. session_start(); session_register(step); $step=1; header(location: page_A.php); Page_A. session_start(); extract($_SESSION); $step=2; header(location: page_B.php); Page_B. session_start(); extract($_SESSION); print($step); Output is always 1. I thought that session variables were global? What am I doing wrong? If register_globals is disabled then you DO NOT use the session_register(), session_unregister() functions. You set them directly using: $_SESSION['step'] = 2 You remove them using: unset($_SESSION['step']) If register_globals is enabled THEN you use the session_register(), session_unregister() functions. In which case in your examples above, the use of extract($_SESSION) is meaningless, and you need to session_register('step'), then $step = 2. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* You have taken yourself too seriously. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] request for help/advice (xml content management)
Hello, I am the creator of eNetwizard Content Management Server, an open source content management system using the LAMP suite. I am getting ready for its first major release and have come across some problems that I need to address first... I'm not really sure where to start this is such a *huge* project... Some preliminary information about the project can be found here: http://projects.enetwizard.net/cmserver.ehtml http://sourceforge.net/docman/display_doc.php?docid=12504group_id=59790 Content is stored as XML in files within a matrix folder. eNetwizard defines several scopes allowing templates and content to be generated on the fly in a scopeable manner. For example, any website at enetwizard.net has the same look and feel because of the domain scope matrix file; I have made this file publicly accessible if you go here: http://www.enetwizard.net/matrix1.php Another scope is the page scope which is where the main content for a page is located, so for the default page at enetwizard.net, it looks like this file: http://www.enetwizard.net/matrix2.php This allows the server to automatically assemble and render content in a variety of formats as you can see here: http://www.enetwizard.net/default.exml (as XML) http://www.enetwizard.net/default.ehtml (as HTML) This is the main idea behind general content stored by the server -- there are other ways of doing things that are even more advanced but they will not be discussed here. In order for this to work, I created an xmldoc class that can assemble all of the files together and create the file accordingly. It is then outputted via the server class. Examples of these files are here: http://www.enetwizard.net/xmldoc.php http://www.enetwizard.net/server.php Worth noting, the matrix files can contain PHP code, which is evaluated in the xmldoc class to create an actual XML document. These two classes are in their elementary forms. And they already have more issues than can be tolerated for such an advanced content management system. First of all, I cannot use the character anywhere because of the fact it is an XML file. This creates a serious problem and must be addressed. Secondly, any errors that exist in a matrix file will effectively break the page. This too is a major issue that muse be addressed, especially since it conflicts with the website wizard (which is responsible for managing existing and new content). I believe there must be a smarter way to do this and I would like any feedback one might have in this arena. I believe using regex's might be a better solution, especially since some unique tags, such as a WIZARD tag must replace be replaced by the xmldoc class with the actual content of the wizard it is referencing, same scenario for the OBJECT tag (which are customizable web applications), etc. At present this cannot work the way I have it set up. I cannot make a public release until this is fixed stably and fully productive. I am looking for someone who can help me with this XML stuff, and other competent programmers who would like to volunteer for this project. And I'm always interested in those who can translate both the localization files (eNetwizard supports any language) and the main network (enetwizard.net) into other languages. Please contact me if you can help. Thanks! If you have any questions, please feel free to ask them. Robert Samuel White eNetwizard Technical Services 284 Walnut Highland, Michigan 48357 +1 (248) 889-6363 www.rswfire.com www.enetwizard.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Show Folder Contents in Form
On Wednesday 04 December 2002 09:41, Stephen wrote: Nevermind, I fixed it. But now I have another problem. One, my select box has some sub-directories. How cna I filter those out? It is also showing a bunch of numbers. I included a screenshot of the select box. The following is the code: ?php function sortByTime($a, $b) { if ($a[time] == $b[time]) return 0; return ($a[time] $b[time]) ? -1 : 1; } if($handle = opendir('/Inetpub/wwwroot/checker/modules/')) { while (false != ($file = readdir($handle))) { if ($file != . $file != ..) To filter out directories add an extra check here using is_dir(). $files[] = array(file = $file, time = filectime(/Inetpub/wwwroot/checker/modules/.$file)); } Your bunch of numbers is the file creation date and originates from the above and assigned to your SELECT box further down. usort($files, sortBytime); echo select; while (list(,$filearr) = each($files)) { echo option value=\.$filearr[file].\.$filearr[file]..$filearr[time]; } echo /select; } ? It's all very well asking for help and receiving some code in return. You have to take some time out to understand what the code is actually doing instead of just blindly using it. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I have always noticed that whenever a radical takes to Imperialism, he catches it in a very acute form. -- Winston Churchill, 1903 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] formating numbers date
On Wednesday 04 December 2002 08:29, Jeff Bluemel wrote: ... but the date format doesn't seem to allow me to pass it a date. Your code? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Information Processing: What you call data processing when people are so disgusted with it they won't let it be discussed in their presence. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Not able to connect to FTP server
Hi friends, I am having a DSL Internet connectivity in our office and my PC is connected to Internet using a HTTP/FTP Proxy(192.168.0.10) and the browser(Mozilla) in my PC is configured to connect to net through the proxy When I tried to connect to our ftp site using the following script, I have received the message that Unable to connect. But the same script is working fine with a direct modem connection. The script is // connect to ftp server if(!($ftp=ftp_connect(ftp.dirw.net))) { print(Unable to connectbr); exit; } Please suggest me on how to connect to the ftp site using the proxy server. Regards, Vinod.B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Instalaciñon PHP
Hoa a todos, Deseo hacer uso de PHP para crear formularios con la finalidad de acceder a una base de datos MySQL 3.23.53a (todo sobre Linux). Tengo instalado ahora mismo RADIUS y MySQL e iba a decidirme a montar PHP. He estadoobservando las indicaciones de instalación y la verdad, soy bastante novato en el entorno Linux, y ya me he visto con problemas para instalar lo anterior. Alguien podría echarme una mano indicándome las opciones necesarias para la instalción, así como los cambio que deba efectuar sobre el servidor web Apache? Muchisimas gracias
Re: [PHP] How to handle so called expired sessions??
I was the original poster to this topic. Quite suprised it continued.. I have my sessions stored in a database, thus I thought the problem was there, but have come to realise, that is how sessions behave naturally. I originally thought, that the expired session garbage collection dumps stale sessions, if the user is away after the default 24 minutes. But in my case, it does, but since the user still has a valid session cookie containing valid data, the session is brought back from the dead even if hours has passed, and the browser hasn't closed. Not desirable for me. As Tom pointed out to me, (which I haven't gotten around to do as yet) in not so many words - 1. When the user logs in assign a session variable to lets say time() + 600 (10 mins in the future). 2. Each page load, refresh the session variable in step 1 *if* the session variable references a future timestamp. 3. If on a page load, the session variable references a past (older than time() - 600) timestamp, core dump the session data - $_SESSION = array(); to /dev/null, hell, whatever makes you happy... Although I haven't gotten around to using these steps, it seems like it would work for what Im trying to achieve. John W. Holmes wrote: No question :) It's just that this is what the original question was about and why I suggested doing his own sesssion timeout check as the deleting proccess is too unreliable to depend on for timeout handling. PHP will quite happily return stale data which could be bad in a login type of situation. Okay. I think I thought you were the original poster. How do you know it's returning stale data, though? If the cookie is valid, and there is still a session file (or data in memory), then why is it stale or expired. Maybe I'm just missing something here. If it's expired because you think it's too old, then you track your own timestamps and do your own cleanup. Is that what you're saying? ---John Holmes... -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Prevent storing data when reload
On Wednesday 04 December 2002 07:39, Justin French wrote: When I reload the page the data gets stored once more. I'm sure this is a well known problem. Are there any smart tricks to prevent this from happening? Yes, and they get discussed on this list almost daily... a quick search would have helped. If only browser makers made their browsers behaved properly according to specs. Most of these page refreshing problems occur when people use the BACK button after they filled in a form (probably to see what they filled in). In stupid browsers like IE and Mozilla it _forces_ you to repost the data. IOW the back button doesn't really go back, to the previous state, like what the specs say it should do. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Above all else -- sky. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] x as a multiplier
Hi, try $newwidth. x .$newheight instead. It's important to put the spaces inside the - ...don't know the word :-) If it's still not working you could try settype($newwidth, string); settype($newheight, string); echo $newwidth. x .$newheigt; but I think, this is not necessary! HTH, Bastian Exactly. But it's only giving me one of the numbers without the space between the numbers and the x. $newwidth . x . $newheight -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Does using msql_select_db excessively burn resources?
I plan to have my sites using several databases, but there is a common database they must all use. Obviously I'll have to use mysql_select_db each time I change the database I wish to use. Does this simply select the database and hold it as a variable until a query is made, or does it load it in a way that would potentially slow things down? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] hiding php
Because its better to have someone waste time trying known hacks for a platform I don't have than to have the same person not know the platform and start spending time figuring out what it is right off the bat. That will not work.. try the following: telnet yourserve 80 and than type GET / HTTP1.0 and press Enter twice You'll see the server response which will tell anybody that the server is Apache and even the operation system it runs at. Regards, Serge -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Date problem
At 18:44 02/12/2002 -0500, John W. Holmes wrote: Can you help me for this ? Yeah, I already did: Perhaps you could throw a clue my way, in that case. I have an actor database (mySQL again) which has actor dates of birth in '-MM-DD' format. I want to be able to query against that ignoring the year: * give me actors who have birthdays in the next five days * give me actors whose birthdays fall between two dates (ie: Aries) I've got pretty much everything else working but this one's *really* playing with my head. :-( I know I should've employed a db engineer! :) James. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pear vs Phplib vs adodb
I'm looking to choose a set of library code principally for database functions. So far checked out Pear, Phplib and adodb which all appear to be well crafted and easy to use. Irrespective of differences in the actual functions provided (which of course are well documented) can anyone briefly compare and contrast them from experience working with 2 or more such libraries in a production environment in terms of robustness and speed (I appreciate that speed tests have put adodb top, then phplib and finally Pear, but have people found such differences to be very noticeable and if so under what specific circumstances?) Cheers, David Eisenhart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] hiding php
Actually.. You can turn off header responses in both apache and php. Inside the php.ini you will find: [ expose_php = Off ] In the ini-dist its even switched off by default. In the apache httpd.conf file you can set the following: [ ServerSignature On ] I believe you may also find some help in mod_headers. In short you can do alot with the configuration to mask what you are running on what platform. If you are running FreeBSD you can even get it to emulate the SYN packets (used for TCP operating system fingerprinting) of alternative OS's (eg: Red Hat [why you would want people to think you'd run RH, to I dont know] / Solaris). Questions? Because its better to have someone waste time trying known hacks for a platform I don't have than to have the same person not know the platform and start spending time figuring out what it is right off the bat. That will not work.. try the following: telnet yourserve 80 and than type GET / HTTP1.0 and press Enter twice You'll see the server response which will tell anybody that the server is Apache and even the operation system it runs at. -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software Systems Engineer First Creative -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] object method overloading
can you do method overloading in php as you can in java? Javier _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] easiest way to get 1st and last dates of the month?
-Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: 03 December 2002 05:31 I'm looking to get a unix timestamp for the first and last day of a month, given a timestamp. But so far everything i've come up with has been wy too many lines of trickery -- especially for the last day of the month (which isn't always 31) Any ideas or snippets of code floating around? In addition to other solutions, this may or may not be appropriate depending on how you're handling your dates, but on the manual page for mktime is the following: The last day of any given month can be expressed as the 0 day of the next month, not the -1 day. Both of the following examples will produce the string The last day in Feb 2000 is: 29. $lastday = mktime (0,0,0,3,0,2000); echo strftime (Last day in Feb 2000 is: %d, $lastday); $lastday = mktime (0,0,0,4,-31,2000); echo strftime (Last day in Feb 2000 is: %d, $lastday); Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Validating get and post data
-Original Message- From: Beth Gore [mailto:[EMAIL PROTECTED]] Sent: 03 December 2002 02:12 However bizarrely this seems to behave incorrectly, as it cuts out 0 as well. Can anyone explain why it does this? function stripnum($rawinput) { for($x=0;$x strlen($rawinput);$x++) { $c = substr($rawinput,$x,1); switch($c){ case ($c chr(47) and $c chr(58)): $output .=$c; break; default: echo escaped character at .$x; break; } } return $output; } I just can't find the bug in my code at all, Well, that's just not the way the switch statement works! The value of the expression after each case is compared for equality to the expression after switch -- so, in this case, you have the equivalent of: if ($c == ($c chr(47) and $c chr(58))) and I think you can figure out why that gives the wrong answer! In fact, switch doesn't work well for this kind of test, as you'd have to write it as: switch ($c): case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': $output .= $c; break; default: echo escaped character at .$x; break; endswitch; You're much better off here with a straight if/else. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] hiding php
-Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED]] Sent: 03 December 2002 07:02 Because its better to have someone waste time trying known hacks for a platform I don't have than to have the same person not know the platform and start spending time figuring out what it is right off the bat. Well, if you *really* wnat to get hem going, you could send .jsp and .cfm (and any others you can think of) through PHP as well!! Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date problem
On Tuesday 03 December 2002 18:29, James Coates wrote: Perhaps you could throw a clue my way, in that case. I have an actor database (mySQL again) which has actor dates of birth in '-MM-DD' format. I want to be able to query against that ignoring the year: * give me actors who have birthdays in the next five days Assuming the column holding the the birthday is called 'birthday': a) you have to work out the date in 5 days time: DATE_ADD(CURRENT_DATE, INTERVAL 5 DAY) b) You have to transform the birthdays so that they are for the current year (so instead of 1981-04-01 it becomes 2002-04-01) CONCAT(YEAR(CURRENT_DATE), '-', MONTH(birthday), '-', DAYOFMONTH(birthday)) c) Combine both into your query: SELECT *, CONCAT(YEAR(CURRENT_DATE), '-', MONTH(birthday), '-', DAYOFMONTH(birthday)) as current_birthday FROM table WHERE current_birthday = CURRENT_DATE AND current_birthday = DATE_ADD(CURRENT_DATE, INTERVAL 5 DAY) ** Untested ** use with extreme caution. * give me actors whose birthdays fall between two dates (ie: Aries) This one is easy, use the BETWEEN clause in your SELECT statement. Consult manual for details. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Intuition, however illogical, is recognized as a command prerogative. -- Kirk, Obsession, stardate 3620.7 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] writing to mysql using php
Hi, I'm relatively new to PHP and mySQL. I currently have a simple table created within a MySQL database. And I have a php script that connects to the database, presents a form for the user to fill in, and then writes that record to the table. Instead... is it possible, to write to multiple records at once using a tabular view rather than one record at a time with a columnar view ? Many Thanks, Shams -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] does anybody know PHPlib's source site?
Hi All. does anybody know PHPlib's source site? or may be you can tell me which template engine is more efficient or usefull or comfortable? Alexander A. Savenkov System Administrator mailto:[EMAIL PROTECTED] JSC Terminal GMB http://www.terminalgmb.ru -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem: Only 1 fsockopen() connection for apache at a time.
Hello all. I have a script that uses fsockopen() to connect to a remote server/port and from what i am seeing mod_php4 with apache only allows 1 fsockopen connection at a time and will que the other fsockopen calls and then process them when the one before it has closed. Is there a way round this? What i am after is for somebody to be able to goto the php page which will then connect via fsockopen to the other server do its send/read stuff and then produce the output. At the moment if one pages takes a bit of time to finish the remote connection then all the other apache processes just sit there and wait for it. The remote server only ever gets 1 connection at a time even though there are free connections available. Has anybody else seen this or know of a way around it. -- Regards, William Bailey. Pro-Net Internet Services Ltd. http://www.pro-net.co.uk http://wb.pro-net.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail with CC and BCC
PHP server = Win 2000 SP2/php 4.1.2 SMTP server = Netscape Messenger 4.15 (declare on php.ini) Why CC and BCC never receive mail ? The header 'TO' is correct : see CC and BCC ! The header : From : . CC: [EMAIL PROTECTED] BCC: [EMAIL PROTECTED] I try severals classes I have found (PHP Classes), no good result ! Help please -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] hiding php
[Larry Brown] Because its better to have someone waste time trying known hacks for a platform I don't have than to have the same person not know the platform and start spending time figuring out what it is right off the bat. [Mike Ford] Well, if you *really* wnat to get hem going, you could send .jsp and .cfm (and any others you can think of) through PHP as well!! If your gong down that road, you could use an arbitrary extension to pipe through php so that at the simplist level (the URL) the technology isnt misinformed (eg: .cfm as cold fusion), but at a blank completely, eg: http://your-server.com/some.script With .script being parsed by php, but the outside world not knowing what technology you are using behind the scenes. Very simple, yet very effective way of blindfolding the end user. -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software Systems Engineer First Creative -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php5 features?
Zeev Suraski wrote an article on the subject. You can find it at http://www.devx.com/webdev/Article/10007 From: ed [mailto:[EMAIL PROTECTED]] Hi all. I was wondering if there are resources on the web that will help me get an idea of the changes and new features that will be in php5. I'm particularly interested in what's gonna be added or changed to php in regards to its OOP capabilities. __ Brad Young Director, Product Marketing [EMAIL PROTECTED] www.zend.com Zend - The PHP Company -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [SEMI-OT] Making secure flash high scoring?
Sorry for the semi-ot post, but this is both a flash and php question, and I'm not a member of any flash lists, so I decided to post it here. Anyway, I have a game site with virtual pets, virtual shops, user accounts, etc. One feature request I get alot is flash games. I could find someone to make them, but I'm not sure about ways of making the score submitting secure. Any thoughts? -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail with CC and BCC
On Tuesday 03 December 2002 20:09, Alain ROMERO wrote: PHP server = Win 2000 SP2/php 4.1.2 SMTP server = Netscape Messenger 4.15 (declare on php.ini) Why CC and BCC never receive mail ? The header 'TO' is correct : see CC and BCC ! The header : From : . CC: [EMAIL PROTECTED] BCC: [EMAIL PROTECTED] Headers need to be separated by \r\n. But it is much more convenient to use a ready-made class instead ... I try severals classes I have found (PHP Classes), no good result ! ... try phpmailer (www.phpclasses.org). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* If I am elected no one will ever have to do their laundry again! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] variable num of function args
hi all, is it possible to somehow have a function which takes a variable number of arguments (with some kind of key association) which can then be converted to variables? i am sick of continually having to go back and add empty parameters to functions in use. an example would be.. function test1() { extract(func_arg_keys()); print $this; } test1($test = 1, $this = 2); // output 2 i know something similar can be done like this... function test2() { extract($arr); print $this; } test2($arr = array( test = 1, this = 2 )); // output 2 is there another ... better or cleaner way? having something like this inbuilt into php would appear to be an excellent to allow functions to easily expand without having to go revisit already used instances of the function many thanks christian ps sorry if this has been discussed before -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: variable num of function args
ooops that should be... function test2($arr) { extract($arr); print $this; } test2($arr = array( test = 1, this = 2 )); // output 2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need advice on template engine
Hi PHP. Suggest me which template engine is more popular? I try select engine for me but I alredy become involved in that number different version Alexander A. Savenkov System Administrator mailto:[EMAIL PROTECTED] JSC Terminal GMB http://www.terminalgmb.ru -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 3 Dec 2002 13:41:08 -0000 Issue 1741
php-general Digest 3 Dec 2002 13:41:08 - Issue 1741 Topics (messages 126791 through 126846): Re: dynamic arraynames 126791 by: Floyd Baker Re: printing array 126792 by: . Edwin 126793 by: Matt Re: IIS 5 126794 by: . Edwin Validating get and post data 126795 by: Beth Gore 126802 by: Matt 126803 by: . Edwin 126804 by: John W. Holmes 126806 by: . Edwin 126822 by: Tom Rogers 126825 by: Tom Rogers 126833 by: Ford, Mike [LSS] Re: PHP --with-dbm enabled??? 126796 by: . Edwin Need advice on downloading files and databases 126797 by: Dara Dowd 126819 by: Jason Wong PHP and the PDFlib 126798 by: Ryan Smaglik 126799 by: Morgan Hughes 126807 by: Marco Tabini Re: Browser going to page twice? 126800 by: Leif K-Brooks Comment Threading 126801 by: Beth Gore 126818 by: Philip Hallstrom How to handle so called expired sessions?? 126805 by: Gerard Samuel 126820 by: Tom Rogers 126823 by: Gerard Samuel [JOB] Senior Developer (PHP/Perl/Java/SQL), Washington DC Area 126808 by: Alok K. Dhir Re: PDF Help Please 126809 by: Larry Brown Can't get this right 126810 by: John Taylor-Johnston hiding php 126811 by: Larry Brown 126812 by: Peter Houchin 126813 by: Rasmus Lerdorf 126816 by: Justin French 126821 by: Larry Brown 126824 by: Jason Wong 126827 by: Serge A. 126830 by: Dan Hardiker 126834 by: Ford, Mike [LSS] 126840 by: Dan Hardiker Re: Show Folder Contents in Form 126814 by: . Nilaab easiest way to get 1st and last dates of the month? 126815 by: Justin French 126817 by: Justin French 126832 by: Ford, Mike [LSS] Does using msql_select_db excessively burn resources? 126826 by: Rob Paxon Re: Date problem 126828 by: James Coates 126835 by: Jason Wong Pear vs Phplib vs adodb 126829 by: David Eisenhart object method overloading 126831 by: Javier Montserat writing to mysql using php 126836 by: Shams does anybody know PHPlib's source site? 126837 by: Alexander A. Savenkov Problem: Only 1 fsockopen() connection for apache at a time. 126838 by: William Bailey mail with CC and BCC 126839 by: Alain ROMERO 126843 by: Jason Wong Re: php5 features? 126841 by: Brad Young [SEMI-OT] Making secure flash high scoring? 126842 by: Leif K-Brooks variable num of function args 126844 by: christian haines 126845 by: christian haines need advice on template engine 126846 by: Alexander A. Savenkov 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--- Just want to thank everyone and tell how it finally came out... I was making way to much of this and went into difficult concepts too quickly. That's where the problem came from. Trying to build on earlier mistakes. We already had an array for the column names so a suggestion that I use one single array for all the data columns works out the best. Now I'm unwinding that one long array according to how many name fields there are in each row. As each process is done, the fields are there in the original column order, no matter how big the x-y grid is. The data from the 'basic' column arrays is also going to be included in the single array too. I'm not a wiz by any means so creating the best application 'method' can be rough no matter what I know about the individual functions. The *single* array just never dawned on me. Thanks for the help... :-) Floyd On Fri, 29 Nov 2002 11:47:56 -, you wrote: -Original Message- From: Floyd Baker [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 17:09 OK, I think I'm finally beginning to understand what you're up to, and it seems to me everyine's been making rather heavy weather of it so far! The user's choice is made from a drop down list of available items, prior to running the routine itself. The choices are predetermined and kept in a personal table to be called by the routine. This part is finished to the point of putting the needed column names at the top of the input columns on the form. The choices are fixed spellings to match formula if-then's, etc. If this is the case, couldn't you use 2-dimensional arrays with the column names as the first dimension, and the values relating to it in the second dimension? So you'd have something like $user['colour'][0] $user['hobby'][0] $user['etc'][0] $user['colour'][1] $user['hobby'][1] $user['etc'][1]
Re: [PHP] need advice on template engine
http://smarty.php.net seems polular J on 04/12/02 12:40 AM, Alexander A. Savenkov ([EMAIL PROTECTED]) wrote: Hi PHP. Suggest me which template engine is more popular? I try select engine for me but I alredy become involved in that number different version Alexander A. Savenkov System Administrator mailto:[EMAIL PROTECTED] JSC Terminal GMB http://www.terminalgmb.ru Justin French http://Indent.com.au Web Development Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php