[PHP] REGISTER_SHUTDOWN_FUNCTION() -- Still Not Working.
REGISTER_SHUTDOWN_FUCNTION() still broke. http://bugs.php.net/bug.php?id=14542 This was suppose to be fixed for (Win32 platforms) in release 4.3.2, although I don't see it in the fix-log. I've been pushing to get this fixed for some time now (circa 2001.) If I knew C/C++, I'd hop in there and fix it myself, but I do not. So, please (I beg, I plea), if anyone knows of this error (see BUG report) and can fix this, you will be a GOD! Thanks, Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] REGISTER_SHUTDOWN_FUNCTION() BUG -- Please Fix.
I'm posting this here to give this BUG attention. It's a pretty serious one for Win32 users, and it would be great if it could be fixed *very quickly* -- I posted this in the Bug Reports on PHP.net on May 27th, 2002. Here's the link: http://bugs.php.net/bug.php?id=17461 I need to use this function to perform certain *required* tasks on a Timeout -- however (and please read the Bug Report, before replying) the Timeout functionality of this function DOES NOT work on Win32 builds. If your a C/C++ / PHP contributor and have a moment to look into this -- it would be great -- I would love to see this fixed in release 4.2.4 !!! Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] REGISTER_SHUTDOWN_FUNCTION() BUG -- Please Fix.
It's a bug. spoke to Rasmus at some length about just before i posted it in the bug report. The online help page is inaccurate in describing the full functionality of the function: http://www.php.net/manual/en/function.register-shutdown-function.php REGISTER_SHUTDOWN_FUNCTION() is suppose to kick-off when any one of the following things happen -- Exit, Error, TIMEOUT or User Abort. According to Rasmus, the TIMEOUT functionality of this function works fine under Linux -- however, it's not working under Win32 ! There apparently is another bug with this function -- you are suppose to be able to call more than one REGISTER_SHUTDOWN_FUNCTION(), and they are suppose to executed in-order... some people are reporting that only the first encountered REGISTER_SHUTDOWN_FUNCTION() is executed, then the script exits. Someone needs to go through this function, pretty thoroughly, and get it working correctly. Being able to run code on a timeout, user-abort or error is critical. Jason John Holmes [EMAIL PROTECTED] wrote in message 000401c25e43$7237e240$b402a8c0@mango">news:000401c25e43$7237e240$b402a8c0@mango... I'm not sure if that's a bug, it's more of a feature request. ---John Holmes... -Original Message- From: Jason Caldwell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 17, 2002 3:24 AM To: [EMAIL PROTECTED] Subject: [PHP] REGISTER_SHUTDOWN_FUNCTION() BUG -- Please Fix. I'm posting this here to give this BUG attention. It's a pretty serious one for Win32 users, and it would be great if it could be fixed *very quickly* -- I posted this in the Bug Reports on PHP.net on May 27th, 2002. Here's the link: http://bugs.php.net/bug.php?id=17461 I need to use this function to perform certain *required* tasks on a Timeout -- however (and please read the Bug Report, before replying) the Timeout functionality of this function DOES NOT work on Win32 builds. If your a C/C++ / PHP contributor and have a moment to look into this -- it would be great -- I would love to see this fixed in release 4.2.4 !!! Thanks Jason -- 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] Extracting Numbers from a string.
I need to extract the numbers only from a field. For example: I have an AMOUNT field and so that I can filter out any user typo's I would like to extract the numbers only. If the user enters $56.55 for example or just $56 then I would like to be able to remove the $ and the . keeping just the 56 or 5655. Can I use eregi_replace() to do this -- I've been trying but it doesn't seem to work right. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] creating .PS or .PRN *files* from the command line or php???
Does anyone know how to create .PS or .PRN files from the *command line* or PHP under Windows 2000 ??? Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP4 and MySql - Search Results Question?
I'm using PHP4 and MySQL -- I'm trying to write a small search engine -- got it working, however, what I'd like to do is return the TOTAL records found. You see, right now I am using LIMIT within my SQL -- so I only return 15 results at a time. How do I get the total (say for example there are 2000 records) -- do I need to COUNT(*) first, then perform another SELECT query for my search? Or, is there a PHP/MYSQL command that returns the total records matching my SELECT query irregardless of the LIMIT ?? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP4 and MySql - Search Results Question?
You cannot have COUNT(*) without having GROUP BY -- hence, by search query will not produce the desired results -- I'm thinking that there may be something within PHP or MySQL (a Function) that reports the total found for a query whether or not a LIMIT clause is used? Thanks Julio Nobrega [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... You could select everything, count the results, and just show 15 results. I am not sure that a COUNT() with LIMIT will perform the desired effect. -- Julio Nobrega Pode acessar: http://www.inerciasensorial.com.br Jason Caldwell [EMAIL PROTECTED] escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm using PHP4 and MySQL -- I'm trying to write a small search engine -- got it working, however, what I'd like to do is return the TOTAL records found. You see, right now I am using LIMIT within my SQL -- so I only return 15 results at a time. How do I get the total (say for example there are 2000 records) -- do I need to COUNT(*) first, then perform another SELECT query for my search? Or, is there a PHP/MYSQL command that returns the total records matching my SELECT query irregardless of the LIMIT ?? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP4 and MS Excel?
I would like to give my users the ability to send (to my website) a Microsoft Excel file, and then have my server (PHP code) extract that data and turn it into a TAB Delimited Text file -- is this possible with PHP? Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP4 and MS Excel?
So -- it looks like I can connect to Excel via COM -- buuutt... anyone have any examples or can anyone point me to any -- that show how to save-out an excel file as a TEXT (.csv) TAB Delimited file? I guess if there is a way to see each ROW in the Excel Spreadsheet -- then I can grab that data and easily save it out as a \t delimited file (I know how to do that) -- ***so, then*** I guess my real question is; how can I *see* the data using COM ??? I'm not too familiar with COM. Say I have an excel spreadsheet called Test.xls and it has three columns: Name:Salary:Expense: Jon Doe$63,000 $2,345 Jane Doe $65,234$3,256 and so on... Thanks Jason Jome [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I would like to give my users the ability to send (to my website) a Microsoft Excel file, and then have my server (PHP code) extract that data and turn it into a TAB Delimited Text file -- is this possible with PHP? http://groups.google.com/groups?hl=svlr=ie=ISO-8859-1q=data+from+excel+ph p Google is your friend. -Jome -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP4 and MS Excel?
Are you actually telling me how to SAVE an excel file as text (CSV) format THROUGH excel ? H Thanks (I guess...) But I learned how to do that, oh I dunno, about 20 years ago. My question was how to do it using PHP and COM. Brian V Bonini [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... file | save as then chose the format you want in the drop down box -Original Message- From: Jason Caldwell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 30, 2002 2:46 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: PHP4 and MS Excel? So -- it looks like I can connect to Excel via COM -- buuutt... anyone have any examples or can anyone point me to any -- that show how to save-out an excel file as a TEXT (.csv) TAB Delimited file? I guess if there is a way to see each ROW in the Excel Spreadsheet -- then I can grab that data and easily save it out as a \t delimited file (I know how to do that) -- ***so, then*** I guess my real question is; how can I *see* the data using COM ??? I'm not too familiar with COM. Say I have an excel spreadsheet called Test.xls and it has three columns: Name:Salary:Expense: Jon Doe$63,000 $2,345 Jane Doe $65,234$3,256 and so on... Thanks Jason Jome [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I would like to give my users the ability to send (to my website) a Microsoft Excel file, and then have my server (PHP code) extract that data and turn it into a TAB Delimited Text file -- is this possible with PHP? http://groups.google.com/groups?hl=svlr=ie=ISO-8859-1q=data+fro m+excel+ph p Google is your friend. -Jome -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP, MySQL multiple commands??
I'd like to be able to run a mysql_query() once while executing more than one mysql command... for example: while($row = mysql_fetch_array($result)) { $query_cmd = INSERT INTO tblTest1 (number) VALUES (1);; $query_cmd .= INSERT INTO tblTest2 (id, val) VALUES(LAST_INSERT_ID, 'some data');; mysql_query($query_cmd); } When I run code similar to that listed above, I get a mysql error error at line 1. -- however, if I run the INSERTS separately -- no error. Is there a way I can run multiple commands within one string? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Removing Empty Lines from Text??
Is there an elegant way to remove excess blank lines from my form data? For example; if someone enters the following text and then press' the Submit button: This is a some text This is more text, and yet even more What I want to do is remove the excess white space and make it look like this? This is a some text This is more text, and yet even more My users may press enter too many times and I want to ensure clean text and formatting. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Removing Empty Lines from Text??
neither worked. any other suggestions? Bb [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... replace that with $var = preg_replace(/\n+/,\n,$var); Bb [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... $var = preg_replace(/\n*/,\n,$var); Jason Caldwell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is there an elegant way to remove excess blank lines from my form data? For example; if someone enters the following text and then press' the Submit button: This is a some text This is more text, and yet even more What I want to do is remove the excess white space and make it look like this? This is a some text This is more text, and yet even more My users may press enter too many times and I want to ensure clean text and formatting. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] UNSET Arrays
i'm trying to unset an array element within my array -- my array looks like; $foo[0][magazine] $foo[0][subscription] $foo[0][term] $foo[0][rate] $foo[1][magazine] $foo[1][subscription] $foo[1][term] $foo[1][rate] and so forth -- when i call unset($foo[0]) for example, the entire array goes away, not just the [0] elements. how can i unset a multi-dimensional array? i have no problems using unset single-dimension arrays. thanks jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] UNSET Arrays
that didn't work. Mark [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... first try quoting your strings and see if that helps :) $foo[0][magazine] On Thu, 6 Jun 2002 18:04:47 -0700, Jason Caldwell wrote: i'm trying to unset an array element within my array -- my array looks like; $foo[0][magazine] $foo[0][subscription] $foo[0][term] $foo[0][rate] $foo[1][magazine] $foo[1][subscription] $foo[1][term] $foo[1][rate] and so forth -- when i call unset($foo[0]) for example, the entire array goes away, not just the [0] elements. how can i unset a multi-dimensional array? i have no problems using unset single-dimension arrays. thanks jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] UNSET Arrays
I was doing something wrong... ;) I figured it out. Sorry for the post -- it was one of those things that took me *forever* to figure it out and when I saw the problem I felt like an idiot -- oh well. Thanks anyway. Jason Jason Wong [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Friday 07 June 2002 09:04, Jason Caldwell wrote: i'm trying to unset an array element within my array -- my array looks like; $foo[0][magazine] $foo[0][subscription] $foo[0][term] $foo[0][rate] $foo[1][magazine] $foo[1][subscription] $foo[1][term] $foo[1][rate] and so forth -- when i call unset($foo[0]) for example, the entire array goes away, not just the [0] elements. how can i unset a multi-dimensional array? i have no problems using unset single-dimension arrays. You must be doing something wrong. unset($foo[0]) is correct and should work. If you're still having problems, post your real code. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* The value of a program is proportional to the weight of its output. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ob_start('gz_handler') and session_start()
Is there a way to make ob_start('gz_handler') work with session_start()? I got them each working independently -- however, when I try to compress a session -- my page just comes up blank. ? ob_start('gz_handler'); session_start(); // code and html ob_end_flush(); ob_end_clean(); ? Or, is there another alternative? -- I'd like to use sessions and I'd (definitely) like to compress my pages. Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: ob_start('gz_handler') and session_start()
I should add, that I also tried the code with session_start() first, then ob_start('gz_handler') -- neither way worked. Jason Jason Caldwell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is there a way to make ob_start('gz_handler') work with session_start()? I got them each working independently -- however, when I try to compress a session -- my page just comes up blank. ? ob_start('gz_handler'); session_start(); // code and html ob_end_flush(); ob_end_clean(); ? Or, is there another alternative? -- I'd like to use sessions and I'd (definitely) like to compress my pages. Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Register_Shutdown_Function ??
I just upgraded from 4.1.1 to 4.2.1 -- didn't fix the problem. I'd be curious to know if other Windows users are having the same problem. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Compressing my web pages?
I'm using IIS5.0 -- and PHP 4.2.1 -- I think there is a compression setting within IIS whereby the pages (before they are sent) are compressed, to be decompressed and then displayed by the browser (pending, of course, if that browser supports the HTTP 1.1 compression standard) -- My questions are; 1. How can I tell if IIS is compressing my PHP / HTML pages? 2. There are compression settings within the PHP.INI file -- what are these about, do I use these instead of the IIS compression?? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Output_Buffering ??
Can someone explain output_buffering to me? I looked on php.net -- but cannot find reference to it -- it's a setting in the PHP.INI file. In my *production* .ini version, the output_buffering tag is set to 4096 (4k) -- what exactly is the intent of this tag? What brought this question up was when I upgraded from 4.1.1 to 4.2.1, and this time decided to use the production level .ini file -- when I ran a script from my command line -- no output was appearing -- that is, I have print() functions throughout my looping script -- and it wasn't outputting -- I set the output_buffering tag to equal 0 -- and my looping script now displays the text I want it to. Is it that when a script exits or terminates that this 4k buffer gets flushed out (in this case) to my screen? What additional processing occurs if this tag is set to off, or 0 (zero) ? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Output_Buffering ??
Forget the question -- I found the link I needed: http://www.php.net/manual/en/function.ob-start.php Jason Caldwell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Can someone explain output_buffering to me? I looked on php.net -- but cannot find reference to it -- it's a setting in the PHP.INI file. In my *production* .ini version, the output_buffering tag is set to 4096 (4k) -- what exactly is the intent of this tag? What brought this question up was when I upgraded from 4.1.1 to 4.2.1, and this time decided to use the production level .ini file -- when I ran a script from my command line -- no output was appearing -- that is, I have print() functions throughout my looping script -- and it wasn't outputting -- I set the output_buffering tag to equal 0 -- and my looping script now displays the text I want it to. Is it that when a script exits or terminates that this 4k buffer gets flushed out (in this case) to my screen? What additional processing occurs if this tag is set to off, or 0 (zero) ? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ob_gzhandler? (compression)
Is there a listing somewhere that shows which web browsers support gz-encoded web pages? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ob_gzhandler encoding ???
Does anyone know how I can test (and see) if my ob_gzhandler() is working? I've written the following script, and run it from the command line to see the output -- hoping it's encoded -- it isn't -- so I want to make sure I'm doing it right. ? header(Accept-Encoding: gzip, deflate); ob_start(ob_gzhandler); ? some HTML code ? ob_end_flush(); ob_end_clean(); ? I save then run the file: C:php test.php Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: ob_gzhandler encoding ???
Will browsers that receive gzip encoded pages, transmit gzip encoded POST or GET data back? Jason Jason Caldwell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Does anyone know how I can test (and see) if my ob_gzhandler() is working? I've written the following script, and run it from the command line to see the output -- hoping it's encoded -- it isn't -- so I want to make sure I'm doing it right. ? header(Accept-Encoding: gzip, deflate); ob_start(ob_gzhandler); ? some HTML code ? ob_end_flush(); ob_end_clean(); ? I save then run the file: C:php test.php Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MSIE GZIP problem?
I have several browsers installed; NS4.x, NS6.02, Opera 6.x, and MSIE 6.0 -- I'm using gzip compression on my site through the ob_gzhandler. My pages seem to load fine, however, ONLY in MSIE when I REFRESH (i.e.. with the Refresh Button) the page seems to lose it's table or table format, and everything looks all jacked up. This ONLY happens on a page reload. The other browsers don't seem to have this problem -- I went to MS's Windows Update, and installed several updates, mostly Security updates -- there were no updates that spoke of a gzip / reload problem -- nonetheless, I applied all I could. After rebooting (again) -- I went back to my site with MSIE 6 -- hit reload and now the problem has gone away. Has anyone heard of the problem with MSIE 6? If this is a known problem; I'll have to perform some browser check to make sure I can gzip to that MSIE version 6 build (whatever) -- kind of a hassle. I just did a search on Technet, and could find no mention of it. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Register_Shutdown_Function ??
I'm playing with the register_shutdown_function -- it's seems to work fine if I call exit() within my script -- however, it doesn't seem to work when the script times-out. Anyone know why? It's supposed to work in the event of an error, time-out, user-abort, or script-exit. Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Register_Shutdown_Function ??
Here's my code: ? set_time_limit(1); function clean_up() { if(connection_status() TIMEOUT) print(Script timed out.\n); } register_shutdown_function(clean_up); while(1); ? Here's the message I get: (I should get Script timed out.) --- br bFatal error/b: Maximum execution time of 1 second exceeded in bC:\test999.php/b on line b14/bbr br bFatal error/b: Maximum execution time of 1 second exceeded in bC:\test999.php/b on line b7/bbr -- Jason Caldwell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm playing with the register_shutdown_function -- it's seems to work fine if I call exit() within my script -- however, it doesn't seem to work when the script times-out. Anyone know why? It's supposed to work in the event of an error, time-out, user-abort, or script-exit. Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Register_Shutdown_Function ??
It doesn't matter. I'm setting the output *not* to the browser, but to the command shell, where I am running the script from. If you look at the errors, you'll see 2 of them, one points to line 7, where the IF() command is -- the script terminates there... I've put error_log() and exec() functions in place of the print() function -- it doesn't make a difference -- the script just won't execute the function in the register_shutdown_function() -- The following script works great (see below) -- it seems that for some reason its a TIMEOUT issue (bug). Running the script below, I will get the output of the print() function -- as stated, from the command line. I understand that it wouldn't show up in the browser. If I replace the exit; command with say a while(1); where the script will loop indefinitely, the timeout, set by the set_time_limit(1) will stop the script, but again -- register_shutdown_function() seems to want to work as the function IS CALLED, but NEVER executed, and instead errors on the 1st line in the FUNCTION -- always on a TIMEOUT. Run this script from your command line (ie. C:php test.php) -- then change the set_time_limit(30) to set_time_limit(1), and replace the exit with a while(1) -- run the script again, you'll see what I mean. And, if you still don't believe me, replace the print() in the function with error_log('Script Terminated', 3, 'errorlog.txt'); and see if the errorlog.txt file is ever created -- it isn't. ? set_time_limit(30); function clean_up() { print(Script Terminated); } register_shutdown_function(clean_up); exit; ? If anyone can offer any reason why its doing this, please help -- thanks. Jason Cc Zona [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Jason Caldwell) wrote: Here's my code: ? set_time_limit(1); function clean_up() { if(connection_status() TIMEOUT) print(Script timed out.\n); } register_shutdown_function(clean_up); while(1); ? Here's the message I get: (I should get Script timed out.) No, you shouldn't/wouldn't, because--as is noted in the docs http://php.net/register-shutdown-function--no more output (print is specifically mentioned as an example) can be sent to the browser at that stage. Try sending youself an email, or logging to a file instead. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] bug in SLEEP() function...
Dunno if this has been mentioned or fixed in the latest release (I'm using PHP version 4.1.1) -- but, a script will not timeout until the sleep() function has finished it's duration -- for example: In my script, if I set set_time_limit(30) -- then later in the script I call a sleep(45) -- the script will not timeout until 45 seconds later, from the point at which the sleep() function was called. Now, being a conscious programmer -- I'd probably never set my sleep() function to exceed my default or defined timeout setting. However, the sleep value can be set via a $var -- and depending on what functions are performed -- I can see how, when a programmer wants his script to timeout within a certain amount of time and then it doesn't; can cause a problem -- in-fact, I can foree some sort of sleep-attack whereby a malicious hacker figures out that a particular script on a particular website has a dynamic $var for the sleep() function -- then s/he writes a script which calls the page many times --- injecting the $var (say for example: http://www.whateverweb.goo/home.php?t=65536, where $t is the time $var in the script; sleep($t); Effectively; in this case, the scripts won't timeout for 18 some hours. Filling up memory fast. Just FYI. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php.net sloooooooowwww
Anyone know why http://www.php.net is s incredibly slow today (all day) ??? Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php.net sloooooooowwww
Is there some place else I can download release 4.2.1 ??? www.php.net is dead slow, and us2.php.net is taking forever to prompt me for the download -- I keep getting hit with the Page Cannot be Displayed error. Looking for the Win32 binary. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Internet Explorer - BACK Button - Passwords?
Don't know if anyone can help me with this one: It's not directly a PHP question -- but maybe someone knows the fix? I have a form, when the user presses the submit button, I pass the form vars to my PHP checkform.php script -- which checks all the fields to make sure the user entered the correct values -- if the user missed something, then they are passed to my error page, which lists out the fields they need fix -- ideally, i would like them to press their browsers BACK button to return to the form, instead of reloading all their session data back into the form with a submit button on the error page -- too much data. So, in Netscape, when a user presses their BACK button all the fields are filled in just as they were filled in ... including the password field. However, in Internet Explorer, when the user presses their BACK button, all fields are good EXCEPT the password fields, which are bank ... so the user is forced to reenter their password info -- kinda annoying. Is there a HEADER or something or an IE fix anyone knows of that will force IE not to delete the password info in this manner? Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql question --
does anyone know how to copy a tables structure (only) within mysql? thanks. jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mysql question --
Got it figured out -- To export table structure: C: mysqldump -d {database name} {tables} sqltextfile.sql Then to import the new Table Structure: To import table structure / data C: mysql {database name} sqltextfile.sql Just a note: If you want to copy the structure of an existing table with the intent of creating *another* table in the same DB with the same structure, then make sure you edit the sqltextfile.sql file and change the CREATE TABLE {table name} to something else. For example: C: mysqldump -d mydb subscribers subscribers.sql ** edit the subscribers.sql text file and change the following line: CREATE TABLE subscribers to CREATE TABLE subscribers2 (or whatever) save... then C: mysql mydb subscribers.sql that's it... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP .PDF .ZIP ???
I need to automatically create a .PDF file from a *dynamically created* text file, then .ZIP that file up. Then *ultimately* have that file attached to an email and automatically sent. Can PHP do .PDF files? .ZIP Files? The caveat on the .PDF file is; it also needs to be locked (or password protected) like an EBOOK, where the end user will not be able to copy and paste out the contents -- I'm considering them not being able to print it also-- just the ability to view it on the screen. Can PHP help with all this? If so; if anyone has some sample code, that would be *very* helpful. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CCS Question -- anyone know?
I have several checkboxes on my webpage -- all within a particular table. It seems there is some weird spacing *around* the (or a) checkbox as I cannot tighten up my table and my text, that contain the checkboxes -- so, it looks like the table rows are spaced out just a little too much -- kinda annoying... Is there a checkbox CCS style that I can apply that will take away the spacing around a checkbox object? much like the DISPLAY: INLINE; CCS for the FORM tag. Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Program Looping ?
I've written a script that checks my email. However, when I run the script (from the command line) -- I want it to loop with a 5 minute delay and the ability to stop the program anytime by pressing a key on the keyboard (say) the ~ key. Anyone know how to do this? ? function check_mail() { // my email code is here } check_mail(); ? thanks. jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Frames?
I'm trying to pass vars into a php (html) file that uses FRAMES -- top, main and bottom. The TOP frame has my menu items. The MAIN frame will show the pages, and the BOTTOM frame will have my footer stuff -- Now, when I click on a menu item in the TOP frame I want the TOP and MAIN frames to update. My frame page is named: index.php and it links to head.php (goes in TOP frame), body.php (goes in MAIN frame), and footer.php (goes in BOTTOM frame.) So, what I tried (seems logical enough) is to simply call the INDEX.PHP file with some vars attached, like so a href=http://127.0.0.1/index.php?s=1 target=_topLoad Page/a Within the Index.php Frames Page (which the var gets passed to) the other pages don't seem to recognize the var and simply do nothing -- For example -- in the head.php file I have it update an image if s=1, and in the body.php file, if s=1 a certain page loads -- this all works fine without frames. Any suggestions -- I want to use frames if I can, and avoid Java. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP4 and POP Email ?
Is there a way I can * download * emails and save them to disk (as individual emails) with PHP? I know I can send (SMTP) -- but has anyone written a PHP program that receives emails? Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Removing an Array Element
How can I remove an Array Element from my Array? For example: $myArray = array('100'='jibberjabber','200'='morejibberjabber','0'=''); if(isset($myArray[0])) // here is where I want to purge Key[0] from the Array all together ; I check for the presence of Key[0], which may not be the first or last key in the array, so array_pop won't work... array_splice would be tricky and would like to avoid creating a FOREACH or FOR loop -- Basically, I just want to know if the Key is set, and if so -- remove it... is there a simple way to do this? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Removing an Array Element
That won't work, as that will only unset the *value* not the *element*. I think I have to do the following as there isn't a prebuilt PHP array function that does what I need -- the following should work fine: $myArray = array('100'='jibberjabber','200'='morejibberjabber','0'=''); if(isset($myArray[0])) { foreach($myArray as $key=$value) { if($key == 0) continue; $newArray[$key] = $value; } $myArray = $newArray; } Thanks though -- :-) Jason Julio Nobrega Trabalhando [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Basically, I just want to know if the Key is set, and if so -- remove it... unset();... -- Julio Nobrega A hora está chegando: http://toca.sourceforge.net Jason Caldwell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... How can I remove an Array Element from my Array? For example: $myArray = array('100'='jibberjabber','200'='morejibberjabber','0'=''); if(isset($myArray[0])) // here is where I want to purge Key[0] from the Array all together ; I check for the presence of Key[0], which may not be the first or last key in the array, so array_pop won't work... array_splice would be tricky and would like to avoid creating a FOREACH or FOR loop -- Basically, I just want to know if the Key is set, and if so -- remove it... is there a simple way to do this? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Netscape 6.1 problem and SELECT lists / FORMS
NS6.1 remembers the items that were selected in a SELECT list when I call the same page back with a header() function... normally this wouldn't be a problem -- however, in my case, I am (through PHP) printing all selected items to the top of the list, and all unselected items to the bottom -- this has the effect of showing all the users (right up front / top) all the selections they've made without having to scroll through the entire list -- Now, in NS4.x and IE5.x this functionality works fine. But in NS6.1 the items are pushed to the top alright, however, they aren't highlighted (ie. selected) -- looking at the source for the page, the SELECTED statement is in the option tag (as I said, it works fine in everything but NS6.1 :-) ) Through playing around, I discovered that with NS6.1 -- this is the result of the FORM NAME (ie. name=frmWhatever) -- I appended a random number at the end of the FORM NAME each time I pressed the submit button and the page was called back through a header() function. This seemed to fix the problem (ie. the items in the select list that were suppose to be selected, were!) -- however, all other items on my forms lost their data (again, only in NS6.1) -- so, if nothing else, I at least discovered that the FORM NAME plays a roll in this dysfunctionality. Now I ask you -- the great pool of knowledge -- any suggestions on how I can get NS6.1 forms to behave? Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] HTML SELECT Lists -- ???
I have a (multiple selection) select list on my web page -- My pages are setup with Save Go Back buttons (through sessions) -- in IE when I select multiple items (or any item) then go forward to the next page, then go back -- the items are still selected, but the select list starts at the top -- hence, I have to scroll down to see my selected items... just FYI -- I'm building the select lists (and what selected) programmatically -- when I say I Go Back -- I'm not using the browsers back button -- but instead the form button I created for this purpose. Now -- interestingly, in NS6 -- when I go back the select list starts at the *last* selected items, hence I am thrown into my selected choices -- this is desirable. Is there a way with PHP I can make IE kinda do the same thing? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: HTML SELECT Lists -- ??? -- SOLVED.
I wrote some code that will grab the selected items and place them at the top of the list, then list below that all unselected items -- it actually works pretty well and is (of course) browser independent. If anyone is curious on how this is done -- I've put some sample code below as an example: ? $states = array('ca'='California','nv' ='Navada','tx'='Texas','ri'='Rhode Island,'co'='Colorado'); $mySelections = 'ca,tx,ri'; $selectedItems = explode(',', $mySelections); /* This 1st FOREACH command builds the list showing only selected items (at the top) */ foreach($states as $key=$value) { if(in_array($key, $selectedItems)) { print('option value=' . $key . '' . selected .'' . $value); print(\n); } } /* This 2nd FOREACH command builds the list, omitting any SELECTED items */ foreach($states as $key=$value) { /* If $key is in the array $selectedItems then CONTINUE the loop here (skipping the print commands) */ if(in_array($key, $selectedItems)) continue; print('option value=' . $key . '' . $value); print(\n); } Thanks. Jason Caldwell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have a (multiple selection) select list on my web page -- My pages are setup with Save Go Back buttons (through sessions) -- in IE when I select multiple items (or any item) then go forward to the next page, then go back -- the items are still selected, but the select list starts at the top -- hence, I have to scroll down to see my selected items... just FYI -- I'm building the select lists (and what selected) programmatically -- when I say I Go Back -- I'm not using the browsers back button -- but instead the form button I created for this purpose. Now -- interestingly, in NS6 -- when I go back the select list starts at the *last* selected items, hence I am thrown into my selected choices -- this is desirable. Is there a way with PHP I can make IE kinda do the same thing? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] What attribute is used ... when a session will expire?
Just curious -- What system attribute is used to help in determining when a session file will be cleaned up (GTC) or in other words, deleted? Is it the delete time calculated based on the file's CREATED or MODIFIED time? Thanks Jason [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Forms and Netscape -- spacing problem -- Help!
I have wrapped around my web page, my form tag -- my pages are auto-expanding -- that is, always flush with the left, right, top and bottom of the users browser... in IE - the form tag (wrapped around the page) doesn't cause a problem -- however, in NS (4x - 6x) there is some additional space at the *bottom* of my page -- about an 1 (of white space.) Nesting the form tag deeper within my web page *is not* an option -- as the spacing caused by the form tag in NS jacks up other things -- so worse comes to worse, I'd rather it produce the white space at the bottom, than to influence my inner page design. So my question is; Can I programmatically (through PHP) make it so that (with the form tag where it is) in NS, the bottom table is flush with the bottom of the browser (hence, eliminating the extra space cause by the form tag)? Thanks Jason [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Auto-Stretch and the BACK - FORWARD buttons -- HELP!
I've also posted this question in a HTML news group -- but no response has come... so I'm hoping some here might have experienced this before and can be of assistance. --- My tables autostretch *with* the browser... when I click my submit button on (say) Page1/Form1 -- everything auto-stretches just fine on the next Page/Form (ie. my tables -- which are colored -- are flush with the right and left sides of my browser... which is IE 5.5) However, when I press my browsers BACK button, then FORWARD button the page is no longer *flush* on the right hand side (and I haven't resized the browser) -- I have to do a RELOAD / REFRESH to pull the page back in, then it's flush again -- this is highly annoying and I know I've seen other sites where this doesn't occur. It gets off about a 1/2 on the right side -- then all pages that follow are all off, unless I (of course) refresh. My BODY tag reads as follows: body width=800 bgcolor=#FF text=#00 leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 Any tips on how I can correct this? It needs to be flush irregardless if the user presses the BACK button or not. Thanks. Jason [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] FIXED -- !
Ahh -- it seems IE has it's own set of MARGIN parameters... RIGHTMARGIN LEFTMARGIN TOPMARGIN BOTTOMMARGIN Hence: This BODY tag will work for both IE and Netscape. leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0 marginwidth=0 marginheight=0 I was just using (previously): leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 Everything was working fine in Netscape (and seemingly in IE, only when I pressed the BACK or FORWARD buttons would it act-up.) Thanks Jason Ben Holt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... My BODY tag reads as follows: body width=800 bgcolor=#FF text=#00 leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 Any tips on how I can correct this? It needs to be flush irregardless if the user presses the BACK button or not. What is that width setting doing in your body tag? Is a width setting even recognized in a body tag? Assuming it is (and I have my doubts), if someone comes to your site with a browser window width higher or lower than 800 the browser will have to chose between your width setting and your margin settings. One of them will have to take priority because you can't have a width of 800 and a margin of 0 if the viewer's browser window is 1200 px wide... or 640 or any size other than 800 for that matter. - Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] YES -- THIS SERVER IS BACK UP!
T H A N K Y O U ! Jason
[PHP] Interesting Problem (Sessions and Cookies)
Is there a way to store users input on *another* page (i use frames), in hidden fields, then be able to update those hidden fields as the user goes along, also, be able to extract that data when a user returns back to a previous form? I'm thinking of using this instead of Sessions or Cookies. Basically a blank page that will hold all the data from the input fields, allowing a user (should they need to go back, say, to form1 to make some changes, when they click submit, form2 will still contain the data they previously entered and will not be blank, as is normally the case.) Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Regular Expression Help
I'm trying to figure out how to say with a Regular Expression how to check for the following characters in a phone number: ( ) - with a length between 1 and 20 -- I've tried the following and it doesn't seem to work. eregi(^([0-9]|\\(|\\)|\\-){1,20}$) I'm not interested in checking for a completely valid phone number... but instead checking to see if the phone number is numbers with or without the ( ) - characters. Plus, I think creating a Regex expr that can check for US and International formats would be too complex. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Passwords?
I have some field error checking going on ... and when a user (say) doesn't fill in a field correctly, my error page comes up telling them. They then must click on their browsers back button and make the changes. Now -- I have a password field, and when they click back, they are forced to re-enter their password -- this is annoying. My questions are: 1. Is there a way to make this stop happening? 2. Instead of the user clicking on their browsers back button, can I add a URL that provides the same functionality -- that will work in IE and Netscape? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Date (Year) .. adding..
I'm trying to figure out how to add to the year: for($x=0; $x20; $x++) { $year = date(Y + $x); print($year . \n); } I've tried several variations on the above and cannot get the year to come out. Any suggestions? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Parsing Phone Numbers
Is there a way I can modify a phone number programmatically -- for example, if I have the following phone number: 1234567890 Now there are no - or . separators... and I would like to automatically add them when the user hits submit... 123-456-7890 Also, I would like to account for optional International Codes... from 0001234567890 to 000-123-456-7890 Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] EREGI -- Help
I'm just trying to create a eregi expression that will evaluate a zip code... and I cannot get it to work... can anyone assist me with this? -- also, is there a site that shows regular expression examples for checking fields like, zip codes, phone numbers, etc... if(!(eregi((^[0-9]{5})(\\-([0-9]{4}$))?, $data))) $err[] = $desc . - Invalid Zip Code . $req; Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP Mail (SMTP)
There's a setting in the PHP.INI file called [Mail Function] - SMTP Can I programmatically set this? Or, am I for now restricted to this .INI entry? I'd like the option of sending to any one of my 3 mail servers, from one script. Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Multiple Selections?
I have a Multiple Selection HTML Field --- the user can select any number of items by holding down the CTRL key. When I submit my form to my (say) TestProg.php -- in the Hidden Input Field I only see the value for the *last* item I selected... how can I see all the items I selected? Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Hidden Input and Quotes?
If I have a text box and enter data into that text box with quotes around some of the text... and I want to throw that text into a HTML Hidden Input Field (on my next screen for example) -- the quotes will somehow jackup or truncate that text... because HTML uses quotes within in the Hidden Input Field. So my question is, should I (or, really, can I) encode it? My thinking is I want to encode it with the htmlspecialchars() function... however, eventually, all the data within the Hidden Input Boxes will be stored into my mySQL database, so I'll want to decode it before I send it (restoring the quotes)... is there a way to decode the htmlspecialchars() function? Or, is there a better way to do this (*without* creating a session)? -- I want to use Hidden Input Fields. Thanks Jason [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] MySQL and LIKE?
I'm trying to create a multiple pattern search using LIKE (in mySQL) -- the following doesn't seem to work and was wondering if someone knew of an easy efficient way of adding multiple search criteria. SELECT myTable.col FROM myTable, otherTable WHERE myTable.id = otherTable.ID AND otherTable.data LIKE (a.% or s.% or io.bean); So LIKE (a.% or s.% or io.bean);- doesn't seem to work like this. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Buttons and such...
I know this is off-topic -- please forgive me. But I figure someone here would know. I'm looking for some really nice *professional* looking (submit, logon, buy, help, etc) buttons for my website... I've done all kinds of searches on MSN and Yahoo -- found a ton of sites that offer all kinds of .gifs and .jpegs -- but I must say 99% of them are garbage. Any suggestions would be greatly appreciated. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Regular Expressions?
Thanks Brian! Very helpful. Is there a good website that covers Regular Expressions? Jason "Brian Clark" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi Jason, @ 1:43:19 AM on 4/20/2001, Jason Caldwell wrote: ... I want to match any of the following: 1.1 or a.a or . or .-- any number of digits (0-9) or alpha (a-z) on either side of the dot. if(eregi("^([0-9][a-z]\.[0-9][a-z]", $myArray[x])) Your parentheses are slightly wrong. if( eregi( "^ ( /* unmatched parens */ [0-9][a-z] /* only matches one digit or character */ \. /* matches period */ [0-9][a-z] /* only matches one digit or character */ ", $myArray[x] ) /* syntax error :) */ ) Is this correct? I think I'm missing something. You want something like this: ?php /* eregi("^([[:alnum:]]+\.[[:alnum:]]+)", $myArray[x]) */ $string = 'aaa.aaa'; $string_2 = 'aa'; print(eregi("^([[:alnum:]]+\.[[:alnum:]]+)", $string) ? 'matched' : 'no match'); print(eregi("^([[:alnum:]]+\.[[:alnum:]]+)", $string_2) ? 'matched' : 'no match'); ? Thanks. Jason -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Regular Expressions?
I'm a little lost as to the exact function of the following: ^ and $ I noticed in the example below... that when I added the $ to the end of the expression, I wasn't able anymore to put a non-alphanumeric character in the end, for example (without the $) I was able to enter the following and get a 'match' aaa.a! -- matched aaa.! -- no match after I put the $ on the end aaa.a! -- no match aaa.aa32 -- match... So, am I to understand that the ^ and $ are used to tell the expression that it *must* match what the expression expects? I guess why I'm so confused is because -- I thought when you create an expression, that it must match the parameters of that expression... then what are the ^ $ for?? It's like to create an expression, but it truly won't work unless you have it turned on with ^ $ characters. Thanks. Jason "Brian Clark" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi Jason, @ 1:43:19 AM on 4/20/2001, Jason Caldwell wrote: ... I want to match any of the following: 1.1 or a.a or . or .-- any number of digits (0-9) or alpha (a-z) on either side of the dot. if(eregi("^([0-9][a-z]\.[0-9][a-z]", $myArray[x])) Your parentheses are slightly wrong. if( eregi( "^ ( /* unmatched parens */ [0-9][a-z] /* only matches one digit or character */ \. /* matches period */ [0-9][a-z] /* only matches one digit or character */ ", $myArray[x] ) /* syntax error :) */ ) Is this correct? I think I'm missing something. You want something like this: ?php /* eregi("^([[:alnum:]]+\.[[:alnum:]]+)", $myArray[x]) */ $string = 'aaa.aaa'; $string_2 = 'aa'; print(eregi("^([[:alnum:]]+\.[[:alnum:]]+)", $string) ? 'matched' : 'no match'); print(eregi("^([[:alnum:]]+\.[[:alnum:]]+)", $string_2) ? 'matched' : 'no match'); ? Thanks. Jason -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Regular Expressions?
Actually ordered that very book (earlier) tonight on Amazon. Looking forward to getting it. Thanks. "Brian Clark" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi Jason, @ 2:19:48 AM on 4/20/2001, Jason Caldwell wrote: Thanks Brian! No problemo. Very helpful. Is there a good website that covers Regular Expressions? There is a GNU Regular Expressions Document out there somewhere if you want to know most of it inside an out (google.com will probably take you to it). It's real dry, to say the least. There's also PCRE (Perl Compatible Regular Expressions). That's of course if you know Perl (ree: perlre). You didn't ask about books, but I have to recommend _Mastering Regular Expressions_ (ISBN: 1565922573); Without reading that, I'd be lost. Hmm, let's see.. PHP Builder's article: http://www.phpbuilder.com/columns/dario19990616.php3 The perlre perldoc: http://www.perl.com/CPAN-local/doc/manual/html/pod/perlre.html Regular expressions section of the grep manual: http://www.gnu.org/manual/grep-2.4/html_node/grep_6.html#SEC7 That may be enough to get you off to a very good start. There has to be some better tutorials out there, but I just can't find any tonight. (To tell you the truth, I'd buy the book) -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Regular Expressions?
Thats what the book said too... but what I'm confused about is the word START and END -- at what point does the start end, and the end begin? If you look at my example below aaa.a! -- matched aaa.! -- no match after I put the $ on the end aaa.a! -- no match aaa.aa32 -- match... It looks like the ^ and $ are actually needed it you want the expression to work correctly *at all*. Thanks. Jason ""Jack Dempsey"" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... if you put ^ at the start of your regexp, that means you want the start of the string to match your expression...$ is used for the end of the string... -jack -Original Message- From: Jason Caldwell [mailto:[EMAIL PROTECTED]] Sent: Friday, April 20, 2001 2:41 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Regular Expressions? I'm a little lost as to the exact function of the following: ^ and $ I noticed in the example below... that when I added the $ to the end of the expression, I wasn't able anymore to put a non-alphanumeric character in the end, for example (without the $) I was able to enter the following and get a 'match' aaa.a! -- matched aaa.! -- no match after I put the $ on the end aaa.a! -- no match aaa.aa32 -- match... So, am I to understand that the ^ and $ are used to tell the expression that it *must* match what the expression expects? I guess why I'm so confused is because -- I thought when you create an expression, that it must match the parameters of that expression... then what are the ^ $ for?? It's like to create an expression, but it truly won't work unless you have it turned on with ^ $ characters. Thanks. Jason "Brian Clark" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi Jason, @ 1:43:19 AM on 4/20/2001, Jason Caldwell wrote: ... I want to match any of the following: 1.1 or a.a or . or .-- any number of digits (0-9) or alpha (a-z) on either side of the dot. if(eregi("^([0-9][a-z]\.[0-9][a-z]", $myArray[x])) Your parentheses are slightly wrong. if( eregi( "^ ( /* unmatched parens */ [0-9][a-z] /* only matches one digit or character */ \. /* matches period */ [0-9][a-z] /* only matches one digit or character */ ", $myArray[x] ) /* syntax error :) */ ) Is this correct? I think I'm missing something. You want something like this: ?php /* eregi("^([[:alnum:]]+\.[[:alnum:]]+)", $myArray[x]) */ $string = 'aaa.aaa'; $string_2 = 'aa'; print(eregi("^([[:alnum:]]+\.[[:alnum:]]+)", $string) ? 'matched' : 'no match'); print(eregi("^([[:alnum:]]+\.[[:alnum:]]+)", $string_2) ? 'matched' : 'no match'); ? Thanks. Jason -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Regular Expressions?
Brian -- Sorry if I seem dense. Your answer (although probably right on target) leaves me still confused :-) The example you gave me: $string = '.'; print(eregi("^([[:alnum:]]+\.[[:alnum:]]+)", $string) ? 'matched' : 'no match'); Now with your example (above) the following MATCHED (when, I think it shouldn't have:) (example 1) .a! .a#$% .a23!% The following did NOT match. (example 2) a!. a%!. .!a34 Now when I took your example and added the $ at the end, like so: print(eregi("^([[:alnum:]]+\.[[:alnum:]]+)$", $string) ? 'matched' : 'no match'); Everything that MATCHED in example 1 no longer matched, and in-fact, just everything I wanted to match -- matched -- ie. just letters and numbers. So... even though I had the [:alnum:] tag in the end -- without the $ at the end it seems pointless? So, I guess my (dense) question is -- why? Why doesn't it just work with the [:alnum:] tag? I'm assuming ALNUM stands for Alpha-Numeric *only*? "Brian Clark" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi Jason, @ 2:40:34 AM on 4/20/2001, Jason Caldwell wrote: I'm a little lost as to the exact function of the following: ^ and $ ^ beginning of a string. $ end of a string. I noticed in the example below... that when I added the $ to the end of the expression, I wasn't able anymore to put a non-alphanumeric character in the end, for example (without the $) I was able to enter the following and get a 'match' aaa.a! -- matched Matches the expression with one or more alnum's before the \. and one or more after the \. ! is [:punct:] aaa.! -- no match No alnum after the \. If you want to match that, replace the + with a * after I put the $ on the end aaa.a! -- no match Doesn't match the expression \.[[:alnum:]]+$ aaa.aa32 -- match... So, am I to understand that the ^ and $ are used to tell the expression that it *must* match what the expression expects? Yep; more precisely, ^[something]$ matches the whole string. -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Regular Expressions?
Ahh It makes more sense now. Thanks. Jason "Brian Clark" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi Jason, @ 3:08:06 AM on 4/20/2001, Jason Caldwell wrote: Sorry if I seem dense. Your answer (although probably right on target) leaves me still confused :-) No problem at all. The example you gave me: $string = '.'; print(eregi("^([[:alnum:]]+\.[[:alnum:]]+)", $string) ? 'matched' : 'no match'); Now with your example (above) the following MATCHED (when, I think it shouldn't have:) (example 1) .a! Matches because there is *at least* one alnum after the \. It doesn't care about the ! as long as it found the a. .a#$% Ditto here. .a23!% Ditto here. The following did NOT match. (example 2) a!. This didnt' match because of ^[[:alnum:]]+\. There's a [:punct:] between the [:alnum:] and the \. a%!. Ditto here. .!a34 No [:alnum:] after the \. Your expression asks for *at least one* [:alnum:] Changing + to * would make that match. Now when I took your example and added the $ at the end, like so: print(eregi("^([[:alnum:]]+\.[[:alnum:]]+)$", $string) ? 'matched' : 'no match'); Everything that MATCHED in example 1 no longer matched, Right, because it had a [:punct:] before the end of the string and you forced it to only pick up [:alnum:]'s -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ENUM or SET and PHP
Actually did that... plus sacrificed several small rodents, rubbing their internal organs all over the manual... in hopes that the PHP Gods would be kind and giving went into a cave for 12 years, then came back out ... having learned and understood much... but still no SET or ENUM. I've since burned the manual, and tattooed PHP on my forehead. Jason "Christian Reiniger" [EMAIL PROTECTED] wrote in message 01042013284106.00621@chrisbig">news:01042013284106.00621@chrisbig... On Thursday 19 April 2001 21:56, you wrote: Does PHP sport an ENUM or SET statement? Print out the PHP manual, place it on the altar of your local church, run around it 42 times dressed in ritual aborigine war fashion, sacrifice the caffeine-rich fruits of a south american plant by crushing them and pouring boiling water over the resulting dust. And when you're done with that, take the manual and read it. Thus you will find enlightenment. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Google results 1-10 of about 142,000,000 for e. Search took 0.18 seconds. - http://www.google.com/search?q=e -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PERL vs. PHP
If I know PHP will I *basically* know PERL? Looking at some PERL code... it looks nearly identical. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PERL vs. PHP
Ramus Lerdof, Are you the Ramus that created PHP? If so, just want to say -- THANKS! -- PHP is the coolest thing since Delphi !!! Really Love it! Jason "Rasmus Lerdorf" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... PHP was started as a suite of perl programs... it is heavily influenced by perl. if you understand PHP and are comfortable with it, you should not have any problems learning Perl. Not quite. I prototyped the initial parser with a Perl program (pre version 1), but the "suite" as you call it was all written in C. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] ENUM or SET and PHP
Does PHP sport an ENUM or SET statement? Or, equivalent? Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP and Ranges
is there a way to compare a value to a preset range. for example; $preset_ range = [0...65535] $a[0] = "12"; $a[1] = "198"; $a[2] = "B"; $ac = count($a); for($x=0; $x $ac; $x++) { if($a[$x] != $preset_range) { $valid = 0; } else { valid = 1; } print($valid . "\n"); } output should look like: 1 1 0 how is this accomplished in PHP? thanks. jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Last Element in an Array?
Is there a command which will tell me that it is the last in an array? When I use END it just gives me the value IN the array... I want to know when I hit the last element in an array... This is driving me crazy... Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Regular Expressions?
I'm looking to compare if my array values match any digits or alpha characters with a dot between them... so, if I think I understand Regular Expressions (from what I could gather from PHP.net and Core PHP Programming by Leon Atkinson.) I want to match any of the following: 1.1 or a.a or . or .-- any number of digits (0-9) or alpha (a-z) on either side of the dot. if(eregi("^([0-9][a-z]\.[0-9][a-z]", $myArray[x])) Is this correct? I think I'm missing something. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP and Double?
how can i separate the digits in a Double number? for example: if i have 3.2 i would like to separate the digits into 3 and 2 and assign each to its own variable, like so numb1 = 3 numb2 = 2 thanks. jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] mySQL Question....
if i perform a SELECT query (say) like the following: SELECT email_addr FROM myTable WHERE x = 1 in this query i want to pull-out (or list) all email addresses where x equals 1, however, suppose i don't want any duplicate email addresses... would i use ORDER BY and COUNT(*) to get listing of non-duplicate email addresses, and just ignore the COUNT() ? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] mySQL Question....
Opps. I meant GROUP BY... and it looks like I don't need to include the COUNT(). SELECT email_addr, x GROUP BY email_addr HAVING x = 1; Is this the only way to display a listing without duplicates, or is there a more efficient (faster) way? I don't want to DELETE the duplicates, just don't want dups to show up in my SELECT queries. Thanks. Jason ""Jason Caldwell"" [EMAIL PROTECTED] wrote in message 9bj9ld$pad$[EMAIL PROTECTED]">news:9bj9ld$pad$[EMAIL PROTECTED]... if i perform a SELECT query (say) like the following: SELECT email_addr FROM myTable WHERE x = 1 in this query i want to pull-out (or list) all email addresses where x equals 1, however, suppose i don't want any duplicate email addresses... would i use ORDER BY and COUNT(*) to get listing of non-duplicate email addresses, and just ignore the COUNT() ? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] General WebServer Question?
Can anyone recommend (or is there) a utility / app that I can use to hit my webserver (say from another computer outside my subnet) -- any number of times to get an idea of performance - based on my bandwidth and hardware? In other words -- I'd like to do some hard core testing of my website and see how much my pipe and servers (simultaneously) can handle... I would like to get page return times, etc... Also -- is there a good add on to IIS or Apache that I can use to monitor not only how much traffic is hitting my site, but which pages, and from where the users are coming (ie. which websites they came from)? Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] True Appreciation
Many THANKS! I find this newsgroup to be one of the *best* I've come across! Responses are quick, usually detailed and always right on target... You guys and gals rock! Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Netscape 4.77 and PHP
WOW ! Thanks everyone... great responses :-) I will look at my tables... no doubt I goofed somewhere. Jason ""Jason Caldwell"" [EMAIL PROTECTED] wrote in message 9bbd0v$686$[EMAIL PROTECTED]">news:9bbd0v$686$[EMAIL PROTECTED]... I've created a test.php file that dynamically loads HTML.. works totally fine in IE 5, but when I test it with Netscape 4.77 -- nothing comes up... just a totally blank page. Anyone know why this might be happening? Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP MySQL Search Results
Does anyone know (or have) of a good example of how to create search results like a Yahoo or MSN search? for example: Say I do a search for "cars" and there are 10,000 records in my table that match "car"... I would like to show the results in blocks of (say) 25 at a time, therefore I will need a "Next Results", "Previous Results", "Total Records found that match my query", and perhaps, between the "Previous Results" and "Next Results" a set of numbers like so; Previous [1] [2] [3] [...] Next The numbers being "jump to" links, etc. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP MySQL Search Results
Hi Jason, Say you have a search form that says search for "searchbox" and the search box has a variable name of "search": ? /* Include connection details, with a variable of $connection */ if (!$page) { $page = 1; } $limit = $page * 25; $limit = $limit - 25; $sql = "SELECT FROM table WHERE searchdata LIKE '$search' ORDER BY searchdata DESC LIMIT $limit,25"; $result = @mysql_query($sql, $connection) or die (mysql_error()); $num = mysql_num_rows($result); if ($num == 0) { ? NO Valid search results. ? } else { while($row = mysql_fetch_array($result)) { $url = $row['url']; $name = $row['name']; ? a href="? echo "$url"; ?"? echo "$name"; ?BR ? } if ($page 1) { echo "a href=\"search.php?search=".$search."page=".(page -1)."\"Previous/a"; } if (($num 25) (($limit + 25) $num)) { echo "a href=\"search.php?search=".$search."page=".($page + 1)."\"Next/a."; } /* End the initial "Else" */ } ? __ Here you will see that if no page is assigend as a variable, it is force assigned to 1. The limit is the number of results the search is limited to. If you do some mathematics (ouch) you will see that the limit works like this: if the page is equal to 1: limit is 1 * 25 = 25. limit = 25 - 25 = 0 The limit in the sql query limits 0,25 (first 25 matches). if the page is equal to 2: limit is 2 * 25 = 50 limit is 50 - 25 = 25 The limit in the sql query limits 25,25 (25 matches After the first 25 matches). if the page is equal to 3: limit is 3 * 25 = 75 limit = 75 - 50 The limit in the sql query is 50,25 (next 25 matches after the first 50). Now, towards the bottom of the code I have supplied, I have next and previous links: if page is greater than 1, you can show a link to a previous page: search.php?search=".$search."page=".($page - 1) This links back to the search page with the searchg criteria, and the page - 1. if there are more than 25 results ($num) and the (limit + 25) is less than the total number of pages, we can add a next link. If you wanted to add page numbers as links, you could do a while or for loop, but I'd have to use my brain a little more to try and explain that to you. I hope that makes a little sense, I'm not very good at explaining these things. There's a really good tutorial on this at devshed.com James. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTML and PHP?
Just make sure you don't indent the closing marker or the parser will miss it! YES!! -- I struggled with that one for a long time... (at least a couple of hours, before I said, hmmm... let me [for giggles] remove the TABS before the closing marker... -- bam... Parser Error went away...) FYI to other readers: you can indent (or Tab) the leading marker, but the trailing maker cannot have tabs infront of it. for example ? print SOMESTUFF // leading marker here is a line of text and HTML html head SOMESTUFF; // notice no tabs here on the end marker "SOMESTUFF" ? Jason "Brian Clark" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi Steve, @ 11:34:26 PM on 4/13/2001, Steve Werby wrote: ... ? echo STOP html Yes, echo can use here-docs! Is it really that *hard* to take 1 minute to test for yourself? ;-) And you can use whatever marker (the 'STOP' above and below) you choose. Just make sure you don't indent the closing marker or the parser will miss it! /html STOP; ? Why even bother? Why not just do this? ? html Boo /html ?php -Brian -- PGP is spoken here: 0xE4D0C7C8 Please do not carbon copy me on list replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] What's XML's Purpose??
amen brother! ""Plutarck"" [EMAIL PROTECTED] wrote in message 9baam8$6sh$[EMAIL PROTECTED]">news:9baam8$6sh$[EMAIL PROTECTED]... I use to be really enthusiastically pro-XML just as I was getting into PHP, but now I've basically taken a "XML shmexXML" approach. I get the initial attraction, but I would think the love would fade off a bit. The key that so many people seem to forget is the best way to do HTML is with, *gasp*, HTML! If you just want a webpage, XML is using a canon to kill a fly. It's like creating classes and objects in PHP for sending text emails. Sure you can do it...but why? XML is new. Common society doesn't do well with new. They always manage to screw it up somehow. XML started as an extensible markup language...that's it. That's all it was supposed to do! Now people are using it to query databases, and concoct entire search engines, and they are trying to use it to control access to restricted data, etc etc. It's the same thing that happened with Java. People just aren't good with "new". XML is nice, and for some things it's even great. But it's not the death of plain old HTML, just like ISDN didn't kill POTS (remember when ISDN was "the future of telecom"?). I fear that there are too many cooks in the kitchen on XML, all with a seasoning all their own that they are dead set on adding to the broth. But for me, I say let people play with their Java and XML and new fangled widgets. I'll take my PHP and plain-old HTML, and I'll create twice as much material with just as high a quality, and I won't need to spend an extra minute learning a bleeding-edge technology. Life's too short to spend it learning how to live it. Translation: Better to program than to learn yet _another_ language. -- Plutarck Should be working on something... ...but forgot what it was. ""Chris Anderson"" [EMAIL PROTECTED] wrote in message 002001c0c506$c70d7f00$0d1012d1@null">news:002001c0c506$c70d7f00$0d1012d1@null... thanks that helped I stll think it sounds like its more geared for the MS crowd - Original Message - From: "Brian Clark" [EMAIL PROTECTED] To: "PHP is not a drug." [EMAIL PROTECTED] Sent: Saturday, April 14, 2001 3:29 PM Subject: Re: [PHP] What's XML's Purpose?? Hi Chris, @ 12:01:45 AM on 4/14/2001, Chris Anderson wrote: Am I missing something here? This has been discussed many times. There was an extremely long thread last year about XML, but I can't find it in the archives. Here's a good start: http://marc.theaimsgroup.com/?l=php-generalm=97969195010857w=2 Use the 'next in thread' link to follow the thread. -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Netscape 4.77 and PHP
I've created a test.php file that dynamically loads HTML.. works totally fine in IE 5, but when I test it with Netscape 4.77 -- nothing comes up... just a totally blank page. Anyone know why this might be happening? Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] HTML and PHP?
Is there a utility that I can use that will take a bunch of HTML and encapsulate it in the PRINT command? i.e. PRINT("{html stuff}\n"); ?? I have a ton of HTML pages that I want to make dynamic, but dread having to type the PRINT command in front of every line of html, and let alone having at manually add the slashes... urg. Thanks. Jason [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTML and PHP?
oh... that rocks! would i have to still add the slashes? /n, /" -- etc? "Les Neste" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Cool. Does that work with echo too, do you know? At 06:19 PM 4/13/2001 -0700, DanO wrote: try this: ? print EOP html jldsfajlf;dsajfl;dkfl;dsa /html EOP; ? AFAIK it is the easiest way to do multi-line printing! DanO ""Jason Caldwell"" [EMAIL PROTECTED] wrote in message 9b868e$2ca$[EMAIL PROTECTED]">news:9b868e$2ca$[EMAIL PROTECTED]... Is there a utility that I can use that will take a bunch of HTML and encapsulate it in the PRINT command? i.e. PRINT("{html stuff}\n"); ?? I have a ton of HTML pages that I want to make dynamic, but dread having to type the PRINT command in front of every line of html, and let alone having at manually add the slashes... urg. Thanks. Jason [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Les Neste 678-778-0382 http://www.lesneste.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTML and PHP?
actually just test this... don't need slashes... it works GREAT! thanks. ""Jason Caldwell"" [EMAIL PROTECTED] wrote in message 9b8it7$npq$[EMAIL PROTECTED]">news:9b8it7$npq$[EMAIL PROTECTED]... oh... that rocks! would i have to still add the slashes? /n, /" -- etc? "Les Neste" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Cool. Does that work with echo too, do you know? At 06:19 PM 4/13/2001 -0700, DanO wrote: try this: ? print EOP html jldsfajlf;dsajfl;dkfl;dsa /html EOP; ? AFAIK it is the easiest way to do multi-line printing! DanO ""Jason Caldwell"" [EMAIL PROTECTED] wrote in message 9b868e$2ca$[EMAIL PROTECTED]">news:9b868e$2ca$[EMAIL PROTECTED]... Is there a utility that I can use that will take a bunch of HTML and encapsulate it in the PRINT command? i.e. PRINT("{html stuff}\n"); ?? I have a ton of HTML pages that I want to make dynamic, but dread having to type the PRINT command in front of every line of html, and let alone having at manually add the slashes... urg. Thanks. Jason [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Les Neste 678-778-0382 http://www.lesneste.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]