[PHP] webpage has expired remedies
Hello, Could someone suggest the steps needed to troubleshoot the webpage has expired issue in IE. I have a self-posting php form which queries and writes to a pgsql database. Occasionally, when an input is entered, the form never loads and I get this error instead. I do want to make clear that this has nothing to do with using the back button on the browser, as most instances of this error do. I also cannot reliably reproduce this error on IE. Sometimes it occurs several times on a specific input, but the next minute the same exact input is processed without any issues. It does seem to be associated with especially onerous queries that take the (gis) database a while to process, but sometimes even quick queries cause it. Also, as I mentioned, this only occurs on IE, not on firefox or safari. Feels almost as some kind of a timeout that IE responds to, but I don't know much about these things and would appreciate any guidance. Best regards, --Ed Bukhman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] webpage has expired remedies
Thank you, but this would involve the target (get) page having a bunch of stuff in the URL, no? I would like to avoid this if possible, not least because it would allow people to go directly to the get page the next time, and this would be problematic for my application. Is there a different way (that avoids the GET method)? --Ed Bukhman Eric Butera eric.but...@gmail.com wrote in message news:6a8639eb0906041557n71e8b671ycafc72fd9c9ba...@mail.gmail.com... On Thu, Jun 4, 2009 at 2:14 PM, Ed Bukhman eb...@yahoo.com wrote: Hello, Could someone suggest the steps needed to troubleshoot the webpage has expired issue in IE. I have a self-posting php form which queries and writes to a pgsql database. Occasionally, when an input is entered, the form never loads and I get this error instead. I do want to make clear that this has nothing to do with using the back button on the browser, as most instances of this error do. I also cannot reliably reproduce this error on IE. Sometimes it occurs several times on a specific input, but the next minute the same exact input is processed without any issues. It does seem to be associated with especially onerous queries that take the (gis) database a while to process, but sometimes even quick queries cause it. Also, as I mentioned, this only occurs on IE, not on firefox or safari. Feels almost as some kind of a timeout that IE responds to, but I don't know much about these things and would appreciate any guidance. Best regards, --Ed Bukhman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php post redirect get, PRG -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSS tables
PJ wrote: I know of no better place to ask. This may not be strictly a PHP issue, but... I am busting my hump trying to format rather large input pages with CSS and trying to avoid tables; but it looks to me like I am wasting my time as positioning with CSS seems an impossibly tortuous exercise. I've managed to do some pages with CSS, but I feel like I am shooting myself in the foot or somewhere... Perhaps I am too demanding. I know that with tables, the formatting is ridiculously fast. Any thoughts, observations or recommendations? Whatever works best for you IMHO. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: New Horizon! scam
Alan Bell wrote: that would appear to be a scam of some sort, not sent by Alan Lord at all, he can spell electronic and generally speaks English. Alan. Alan Lord wrote: New Horizon! i would like to introduce a good company who trades mainly in electornic products. Now the company is under sales promotion,all the products are sold nearly at its cost. They provide the best service to customers,they provide you with original products of good quality,and what is more,the price is a surprising happiness to you! It is realy a good chance for shopping.just grasp the opportunity,Now or never! The web address: Windows Live Messenger just got better. Damn! I though it was a good deal, what is more, I already vistied their site and checked over all electornic product. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Which file Included me?
Is there a function or variable that will tell me if a file has asked another file to include something much the same as $_SERVER['HTTP_REFERER'] works. I have a script that is included on every page of a site but also needs to include some javascript only if it's called from a certain URL. thanks, Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Chrome 1.0 released
Bill Guion wrote: At 9:30 AM -0500 12/14/08, tedd wrote: At 3:08 PM -0800 12/13/08, Yeti wrote: I have to defend poor little IE a little now. It supports XHTML and CSS2 pretty well so far. And those standards came out a couple of months ago. Even a blind pig finds an acorn every once in a while. Cheers, tedd Tedd, You should apologize to all pigs for that comparison. -= Bill =- Yeah, but javascript is still a PITA. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] alphabetical filenames with readdir
Is there a way to make readdir output filenames alphabetically? Thanks, Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] alphabetical filenames with readdir
Ed Curtis wrote: Is there a way to make readdir output filenames alphabetically? Thanks, Ed Never mind. I figured out how to do it using an array and sort. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Code works alone but not with other code.
I've got this chunk of code (included) that used to work fine in a script up until a couple of weeks ago. Nothing has changed in the php page at all, it just quit working. If I take this chunk of code and place it alone in a php script it works just fine, but only by itself. I don't understand what's going on and don't see anything that would make the script seem like it's just skipping this chunk of code, without errors, when I run it. I'm using PHP 4.4.4-8 mand MySQL 5.0.32 on Debian Etch. The code does use nested MySQL queries, it worked before but I thought maybe something changed in PHP or MySQL recently in updates that might have broken it, but there is another chunk of code in the script that uses nested queries as well that works fine just as it had been. I also have another script that has recently broke and seems to skip a section of code as well without errors. There are no real similarities between the two that I can see. Thanks, Ed //DO COUNTY BY COUNTY SORTED REPORTS (SORTED BY CITY,PRICE) echo Starting Standard County By County Reportsbr; mysql_connect ($local_host, $local_user, $local_pass); $result = mysql_query (SELECT countyname FROM ehs.tempinventorycounties ORDER BY countyname ASC); if ($row = mysql_fetch_array($result)) { do { $currentcounty = $row['countyname']; echo Generating Report for $currentcounty Countybr; $ap = fopen($report_path/$currentcounty$issue.txt, w); $result2 = mysql_query (SELECT * FROM ehs.tempinventory WHERE county = '$currentcounty' AND property_type NOT LIKE 'Commercial' AND property_type NOT LIKE 'Land Lots' ORDER BY city,price DESC); if ($row2 = mysql_fetch_array($result2)) { do { fputs($ap, $row2['mls']); fputs($ap, $nl); fputs($ap, $row2['city']); fputs($ap, $sp); fputs($ap, $dol); fputs($ap, number_format($row2['price'])); fputs($ap, $nl); fputs($ap, $row2['beds']); fputs($ap, $sp); fputs($ap, Bedroom); fputs($ap, $sp); fputs($ap, $row2['baths']); fputs($ap, $sp); fputs($ap, Bath); fputs($ap, $nl); if ($row2['garage'] != None) { $garage_type = explode( , $row2['garage']); $garage_show = $garage_type[1] . . $garage_type[2]; fputs($ap, $garage_show); } else { fputs($ap, $row2['garage']); } fputs($ap, $sp); fputs($ap, $row2['squarefeet']); fputs($ap, $sp); fputs($ap, SF); fputs($ap, $nl); fputs($ap, MLS#); fputs($ap, $row2['mls']); fputs($ap, $nl); fputs($ap, $row2['phone']); fputs($ap, $nl); fputs($ap, Email: ); fputs($ap, $row2['email']); fputs($ap, $nl); fputs($ap, $row2['company']); fputs($ap, $sp); fputs($ap, $row2['agent']); fputs($ap, $nl); fputs($ap, $nl); //COPY LISTING IMAGE TO INVENTORY IMAGES $path = $row2['path']; $image = $row2['image']; exec (cp -p $path/listings/$image $image_path/$image); //COPY AGENT IMAGE TO INVENTORY AGENT IMAGES $agent_image = $row2['agent']; $agent_image = str_replace( , _, $agent_image); $agent_image = $agent_image . .jpg; exec (cp -p $path/agents/$agent_image $agent_path/$agent_image); } while ($row2 = mysql_fetch_array($result2)); } fclose($ap); } while ($row = mysql_fetch_array($result)); } mysql_close(); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strlower problem
I'm converting upper case characters in a string to lower case and am coming up with an empty string. As I've done a million times before with other non-numerical strings. $thisStr = CL22; $strLow = strtolower($thisStr); echo $thisStr; Why does $strLow come up empty? Thanks, Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strlower problem
Richard Heyes wrote: Ed Curtis wrote: I'm converting upper case characters in a string to lower case and am coming up with an empty string. As I've done a million times before with other non-numerical strings. $thisStr = CL22; $strLow = strtolower($thisStr); echo $thisStr; Why does $strLow come up empty? Because you're echoing out the original (uppercase) string. Try: echo $strLow; My mistake. I meant to type echo $strLow; not echo $thisStr; in my post. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strlower problem
Michael Kubler wrote: Does : /echo strtolower(CL22);/ work? You could also try : /var_dump($strLow); / Ed Curtis wrote: Richard Heyes wrote: Ed Curtis wrote: I'm converting upper case characters in a string to lower case and am coming up with an empty string. As I've done a million times before with other non-numerical strings. $thisStr = CL22; $strLow = strtolower($thisStr); echo $thisStr; Why does $strLow come up empty? My mistake. I meant to type echo $strLow; not echo $thisStr; in my post. I found the problem myself. The actual code follows the same principal but the value of $thisStr is a $_GET value from a link. The name of that value in the link was 'style'. Oops, you should never use a HTML reserved attribute as a varible identifier in a link. I just wasn't thinking at the time I wrote it. (a href=order2.php?style=CL22) Sorry I took up your time, Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Memory usage very high under AMD64?
Aschwin Wesselius wrote: Ed W wrote: RSS is staying approximately constant, ie the memory in use has not changed much VSZ, ie virtual memory has increased by more than 2x2=4. If someone has some hard experience of both platforms then please add some experience to this - however, I'm looking for some hard debugging knowhow on this, not just some handwaving estimates please Ed W Maybe still some handwaving, but my colleague forwarded me this link: http://www.bit-tech.net/bits/2007/10/16/64-bit_more_than_just_the_ram/1 I hope that's still in your interest. Interesting, but I think I have come to the wrong forum? Where do the programmers who implement PHP hang out? I really need to get under the bonnet on this and find out what's happening - I'm not after speculation (thanks to everyone who responded though) Anyone got some hard details on how to debug this further - I'm looking for under the hood kind of thoughts please Ed W
Re: [PHP] Memory usage very high under AMD64?
Aschwin Wesselius wrote: Ed W wrote: 45MB x2 is a lot less than 215MB... Also, I would expect the actual consumption to be less than 2x since not all the data will be doubled in size..? Any other suggestions on how to debug this 5x jump in memory usage? Thanks Ed W Robert Cummings wrote: 64 bit integers are twice as big as 32 bit integers. Hi all, I'm not an expert and have no real experience with programming in a 64-bit environment. That said, I think a system will allocate not only space for 64-bit values (in simple theory twice as much as 32-bit). 64-bit is simple a factor, so calculations increase with this factor. I think the memory goes into a square ratio (NxN) instead of just saying double (Nx2). Again, I'm not a wizzkid with enough math experience. This is just my simple and humble reasoning. -- RSS is staying approximately constant, ie the memory in use has not changed much VSZ, ie virtual memory has increased by more than 2x2=4. If someone has some hard experience of both platforms then please add some experience to this - however, I'm looking for some hard debugging knowhow on this, not just some handwaving estimates please Ed W
[PHP] Memory usage very high under AMD64?
Hi I am trying to figure out expected memory usage of PHP Under my 32bit install Apache 2 processes are drawing around 45MB virtual and 25MB RSS. (XCache enabled) However, under 64bit, same PHP and Apache versions, FastCGI is consuming around 110MB virt and 25MB RSS. However, Apache2 processes are consuming around 215MB virt and 20MB RSS Can anyone please help debug why the virtual consumption is so high? Actually the RSS numbers look fine - it's the vsz numbers that I am trying to understand why so high? Thanks Ed W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Memory usage very high under AMD64?
45MB x2 is a lot less than 215MB... Also, I would expect the actual consumption to be less than 2x since not all the data will be doubled in size..? Any other suggestions on how to debug this 5x jump in memory usage? Thanks Ed W Robert Cummings wrote: 64 bit integers are twice as big as 32 bit integers. Cheers, Rob. On Wed, 2008-04-02 at 20:16 +0100, Ed W wrote: Hi I am trying to figure out expected memory usage of PHP Under my 32bit install Apache 2 processes are drawing around 45MB virtual and 25MB RSS. (XCache enabled) However, under 64bit, same PHP and Apache versions, FastCGI is consuming around 110MB virt and 25MB RSS. However, Apache2 processes are consuming around 215MB virt and 20MB RSS Can anyone please help debug why the virtual consumption is so high? Actually the RSS numbers look fine - it's the vsz numbers that I am trying to understand why so high? Thanks Ed W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upgrade
I'm currently running Debian Woody with PHP 4.1.2 installed by default. It's really stable and I like it alot. Would I run into any problems upgrading it to say 4.3.0. There are some functions I need in it that 4.1.2 doesn't have. I'm not ready to make the jump to PHP5 yet. I've tried it on a test server and have run into a couple of problems with the upgrade. Thanks, Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upgrade
Ben wrote: It really depends on your situation. We are an ISP hosting lots of website. Upgrading from 4 to 5 means a lot of sites will have trouble. Personally I have some problem of upgrading from 4 to 5. The below codes work on 4: include(DB/DataObjects.php); $pro = DB_DataObject::factory('Product'); $pro-find(); while($pro-fetch()) $allPro[] = $pro; But on 5, it has to be modified to include(DB/DataObjects.php); $pro = DB_DataObject::factory('Product'); $pro-find(); while($pro-fetch()) $allPro[] = clone $pro; The above is only an example. So upgrading to 5 is not an option for us. -- Ben Web Design Shropshire, Software programing http://www.sparkcomputing.co.uk Thanks, I did find a way to do what I needed to do and not have to upgrade. There are more system calls but it won't be used often enough to worry about. Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] using preg_match
I'm trying to use preg_match to find a string in a system path. What I need to do is see if the string '/realtors' exists in a variable named '$path'. I know '/' is used as a container within the command itself. How do I escape it to find the string '/realtors'? Thanks, Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] using preg_match
Christian Haensel wrote: Hi Ed, did you try the backslash as escape character? ? $path = testing/realtors/userdata/; if(preg_match(/\/realtors/, $path)) { echo 'Success'; } ? That's what did it. I was thinking the \ was the escape for the command but wanted to make sure. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Opening file
Hi list, I have been trying to make printer friendly version feature for a web site and have encountered a problem. Each page of the web site is composed of a header.php, footer.php and the content of the page which uses include_once to include the above mentioned pages. I have tried all known methods of reading the file I want to have printer friendly version for, but all of them return a complete page (page with code of footer.php and header.php included, and not the original). So, here is what I get: *** html titleaaa/title body some content here /body /html *** And what I need is: *** ? include_once header.php ? some content here ? include_once footer.php ? *** After I get the original code I can exclude the include php tags and print only the main content. So, the question is: is there any way (except for FTP functions) to solve this? Thank you. Best regards, Ed -- http://www.freenet.am/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help needed to write an installation script for my php application
On Mon, April 23, 2007 5:36 am, [EMAIL PROTECTED] wrote: Hi There, Could you please help me to write an installation script to install a php based application in Windows. NSIS, nullsoft installer is a nice installer to use for Windows applications. http://nsis.sourceforge.net/Main_Page -- Edoceo, Inc. http://www.edoceo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] db query not working
I have this code: mysql_connect ($local_host, $local_user, $local_pass); mysql_select_db ($local_db); mysql_query (DELETE FROM tmphitsmag); $result = mysql_query (SELECT DISTINCT company FROM view_log WHERE company != ''); if ($row = mysql_fetch_array($result)) { do { $magazine_path = $row['company']; $magazine_path = explode(/, $magazine_path); echo str_replace(_, , $magazine_path[2]) . br; mysql_query (INSERT INTO tmphitsmag (magazine) VALUES('$magazine_path[2]'); } while($row = mysql_fetch_array($result)); } mysql_close(); It dumps the table fine, works the explode, outputs the string in the echo command the way I expect, but doesn't place the value in tmphitsmag table. Anyone have a clue? Thanks, Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] db query not working as expected
I have this code: mysql_connect ($local_host, $local_user, $local_pass); mysql_select_db ($local_db); mysql_query (DELETE FROM tmphitsmag); $result = mysql_query (SELECT DISTINCT company FROM view_log WHERE company != ''); if ($row = mysql_fetch_array($result)) { do { $magazine_path = $row['company']; $magazine_path = explode(/, $magazine_path); echo str_replace(_, , $magazine_path[2]) . br; mysql_query (INSERT INTO tmphitsmag (magazine) VALUES ('$magazine_path[2]')); } while($row = mysql_fetch_array($result)); } mysql_close(); The code dumps the first table fine, selects, manipulates, and echoes the string the way I expect, but fails to input the string into the tmphitsmag table. Any ideas? Thanks, Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php and javascript error
I've just run into this problem this morning a href=# onclick=javascript:window.open('web_forward.php?address=? echo $web_url; ?agent=? echo $agent; ?real_company_name=? echo $real_company_name; ?', 'Web Site'); This produces an Error on Page in IE 7, but works perfectly in Firefox and Netscape. I have several other javascript calls on the page where this call resides and all of them work perfectly except for this one. Does this error occur because I'm sending the variables to another script that does some logging then forwards the user to the URL or is it just a IE quirk? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] db query not working
Satyam wrote: I saw two people pointing two errors on the SQL insert statement which you would have found yourself had you put the 'or die()' at the end of the query, as someone else suggested. Do never leave any query without the 'or die()' after it (or any other means to check if mysql_query returns anything not false). This would have saved lots of your time, our time, everybody's bandwidth and would avoid your asking everybody again for the next error you make. We all make errors, none of us is above that, that's why, at least in my case, I never fail to add the or die() at the end. That's why the developers of function libraries have put some means of reporting errors back. It takes time for providing good error reporting. You are wasting that effort as well. Do you deserve all this speech? No more than the dozens who write what I call 'ballistic' code: code you have no control over once it launches. Guided missiles are far better. Anyway, you got it because I had time to rant about this. Satyam I wasted no more bandwidth than you did with your rant. My code post was edited from the original code and that's where the mistake was made, not in the code itself. And I do, by the way, end all my queries with or die(). I just left it out of the edit. Besides, the problem is fixed now. Thanks to all that helped. Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php and javascript error
Németh Zoltán wrote: 2007. 03. 7, szerda keltezéssel 10.59-kor Ed Curtis ezt írta: I've just run into this problem this morning a href=# onclick=javascript:window.open('web_forward.php?address=? echo $web_url; ?agent=? echo $agent; ?real_company_name=? echo $real_company_name; ?', 'Web Site'); This produces an Error on Page in IE 7, but works perfectly in Firefox and Netscape. I have several other javascript calls on the page where this call resides and all of them work perfectly except for this one. Does this error occur because I'm sending the variables to another script that does some logging then forwards the user to the URL or is it just a IE quirk? I'm almost sure it has nothing to do with php rather javascript, and maybe microsoft's special javascript interpretations... I know it's not the PHP but rather the JS that's causing it. What I fail to understand is that there are 2 JS calls before, and 2 JS calls after this one in my page and the other 4 work perfectly. They are basically the same call too, just to different scripts. I just wondered if anyone knew why this particular call doesn't work or had come across anything like this. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php and javascript error
a href=# onclick=javascript:window.open('web_forward.php?address=? echo $web_url; ?agent=? echo $agent; ?real_company_name=? echo $real_company_name; ?', 'Web Site'); This produces an Error on Page in IE 7, but works perfectly in Firefox and Netscape. I have several other javascript calls on the page where this call resides and all of them work perfectly except for this one. Does this error occur because I'm sending the variables to another script that does some logging then forwards the user to the URL or is it just a IE quirk? This is a JavaScript issue, but may have something to do with the data you are echoing out in PHP. Look at the source in the browser. My guess it that you've got a stay quote mark in one of your PHP vars. Not it, I looked and there's nothing there. PS: If you want your code to validate, change the to amp; Add the closing /a tag too. Thanks, the 's are now all amp;. The closing /a is in the script, just wasn't posted in the message. PPS: It's advisable not to use the short tags, use ?php instead of ? Can you tell me why? Is it just a personal preference? Another JS call directly in front of this one works perfectly. a href=# onclick=javascript:window.open('email.php?mls=? echo $mls; ?amp;toagent=? echo $agent; ?amp;toagentemail=? echo $agent_email; ?amp;tocompanyname=? echo $real_company_name; ?', 'Email', 'width=400,height=400,scrollbars=no,resizable=yes'); Send Me Email /a The only difference is this call has the window options included the one that doesn't work doesn't have them. I've added them just to check and it didn't change anything. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php and javascript error
Edward Kay wrote: you've got a stay quote mark in one of your PHP vars. Not it, I looked and there's nothing there. I'm sure it's because you've got some stray characters in your output that mess it up. It would help if you actually posted the source rather than just saying it's OK, when it clearly isn't. The problem wasn't a stray apostrophe. Brad Fuller was dead on. It was the space in the window name option of the javascript. It works as expected once the space is removed. PPS: It's advisable not to use the short tags, use ?php instead of ? Can you tell me why? Is it just a personal preference? If you move to another server where the short tags option is off, your code will break. From the manual: Using short tags should be avoided when developing applications or libraries that are meant for redistribution, or deployment on PHP servers which are not under your control My scripts aren't meant for distribution also they will only ever be delpoyed on a server that I control. Thanks for the tip though and thanks to everyone that helped. Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] db query not working
It is an old guy thing, at least in my case (trivia: I was born the day after the ENIAC was turned off) Aha! October 3, 1955 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] counting hyperlink clicks in php
Hello Brad, Saturday, February 17, 2007, 4:22:22 PM, you wrote: Denis L. Menezes wrote: Dear friends. I have a site where I have news headers. I wish to count the clicks on the news headers so that I can see how many times each of the the news has been viewed. This way I can show the most viewed news. Can one of you please advise hwo this can be done? Thanks Denis I think the best way to do this would be to set an onClick (Javascript) event handler for each of the links, and then use AJAX style stuff to send the information to PHP on the server side, then PHP can log the link that was clicked, and keep track of the most clicked links. -B Another way to do this is to take the user to a page that would identify the clicked link (by ID, for example), store the visits data to a database or a text file and then redirect to the corresponding news. So, such link might look like this: a href=http://www.news.com/redirect.php?news_id=150;read news/a Hope this helps. Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] How can I know if a browser is cookies enables?
Hello tedd, Monday, February 5, 2007, 7:04:34 PM, you wrote: At 11:36 PM -0500 2/4/07, Mauricio Muriel wrote: Hello. How can I know if a web browser is cookies enables? Regards Mauricio M. Give it a glass of milk and watch what happens. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com It can also be done with JavaScript. Found an example at: http://techpatterns.com/downloads/javascript_check_cookies.php Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I know if a browser is cookies enables?
Also try: http://www.aspfaqs.com/webtech/082400-1.shtml What would we do without search engines? :)) Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] connect.c+php
Can anyone give me an example on using connect.c with php? Thank you. Ed -- http://www.freenet.am/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CSS / PHP / Javascript
I'm reading a book on CSS and how you can define different style sheets for different visitors. I'm wondering how you guys do it. The book recommends using Javascript functions for identifying the user's browser and matching them with the corresponding style sheets. Anyone using PHP for this instead - specifically with defining style sheets for different target browsers and platforms? -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] dns_get_record()
Hi, Is there a corresponding php method that would accomplish the same thing as: dig @ns_srvr_name thisdomain.com So far, dns_get_record() uses the default nameserver values from the /etc/resolve.conf (afaik, at least); how do I get it to lookup the domain name using ns_srvr_name as the name server? Any help appreciated. Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Protecting Streaming Audio
use readfile to read the file and output it to the browser. I don't know the specific ones, but you'll need to also send headers that declare the file as streaming media. On Nov 4, 2006, at 10:08 PM, Adam Gittins wrote: Thanks. :) That's an idea... Few questions. Grab the file and sendt it to someone, that would work with a download but would it work with a streaming audio file, because that has to be opened in realOne player or windows media player? I was searching PHP.net documentation for a way of grabbing a file - what function would be used?? Sorry about the silly questions.. Sincerely, Adam On 11/4/06, Ed Lazor [EMAIL PROTECTED] wrote: You put the data in a directory outside of the webspace and use PHP to grab the file and send it to someone. That way you're able to control access to the file. By webspace, I'm referring to the directories outside of the ones used to store and serve your webpages. This directory structure would serve as an example for where you store your webpages and where you store your data separately from the webpages: /www/www.somesite.com/htdocs /www/www.somesite.com/data On Nov 3, 2006, at 9:29 PM, Adam Gittins wrote: Dear List, I have had a question that has been bugging me for a while now. Say that I need to have a members website. Which I want to protect streaming audio (Real, or Windows Media), now all the pages I can protect with a MYSQL DB and PHP. But when it comes to protecting a url of a file or audio feed it becomes tricky. What is the procedure? Would I have to use the htaccess file? But then when I open a realaudio file it will ask for a username and passworld again.. How does one protect an url - or do I have to copy the file to a temp dir and then after a set time delete it? Help, there must be a way.. Thanks for any ideas.. Sincerely, Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Frameworks
I think you pegged it... the benefit is that you save time, the drawback is that you're limited in what you can do. I think you have to review each framework and chose one based on your personal preferences, the project at hand, etc. On Nov 2, 2006, at 7:37 AM, [EMAIL PROTECTED] wrote: I know this subject has been covered in the past, but my question is why use them? I'm hoping to not create a religious war... I see that frameworks would probably help you develop some things faster, but most of the time they don't do the things the way I would want them to work. If I did use one, it almost seems like I would use it to get through something until I had time to do things the way I wanted/needed to do them. There's a lot of talk about frameworks lately, and especially the Zend Framework, so I'd like to look into what it's all about. I think I might be missing out the framework issue, so I'd like to hear other people's opinions. I do like the mail, pdf, and a few other parts of the Zend Framework. I also like that it's more like a set of tools than a monolithic beast that would take a lot of memory just to load up into your application. Your thoughts? Thanks, Ray -- 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] Protecting Streaming Audio
You put the data in a directory outside of the webspace and use PHP to grab the file and send it to someone. That way you're able to control access to the file. By webspace, I'm referring to the directories outside of the ones used to store and serve your webpages. This directory structure would serve as an example for where you store your webpages and where you store your data separately from the webpages: /www/www.somesite.com/htdocs /www/www.somesite.com/data On Nov 3, 2006, at 9:29 PM, Adam Gittins wrote: Dear List, I have had a question that has been bugging me for a while now. Say that I need to have a members website. Which I want to protect streaming audio (Real, or Windows Media), now all the pages I can protect with a MYSQL DB and PHP. But when it comes to protecting a url of a file or audio feed it becomes tricky. What is the procedure? Would I have to use the htaccess file? But then when I open a realaudio file it will ask for a username and passworld again.. How does one protect an url - or do I have to copy the file to a temp dir and then after a set time delete it? Help, there must be a way.. Thanks for any ideas.. Sincerely, Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ChangeLog PHP 5.2.0 - Fileupload
Very cool example. Probably best explained with an example: http://progphp.com/upload.php Try uploading a 200-300k file. The source code is at: http://progphp.com/upload.phps -Rasmus -- 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] Mac PHP MySQL
Thanks Johan, I appreciate the info. I ended up going with MAMP as a quick solution. On Nov 2, 2006, at 11:29 PM, Johan Martin wrote: On 02 Nov 2006, at 5:11 PM, Ed Lazor wrote: I'm trying to configure and compile PHP 5. The configure is failing to find the MySQL UNIX socket. Any ideas? ./configure \ --with-apxs2=/usr/local/apache2/bin/apxs \ --with-zlib \ --with-mysql=/usr/local/mysql \ --with-mysql-socket=/tmp I had a similar problem and downloaded the tar version of the Mac OS X Mysql Server. Pointed --with-mysql= to the libraries and that folder and it worked. Decided to compile my own because the packages always seem to lag behind the released versions of the software. Also need both postgresql and mysql support. Johan Martin Catenare LLC 534 Pacific Ave San Francisco, CA. 94133 Phone: (415) 834-9802 Fax: (415) 294-4495 http://www.catenare.com AOL: catenarellc Yahoo: martin_johan GTalk: [EMAIL PROTECTED] FreeWorldDialup :716798 - http://www.freeworlddialup.com/ Gizmo Project: 747-627-9132 - http://www.gizmoproject.com/ http://www.linkedin.com/in/catenare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP 5.1.6 on Mac OSX 10.4.8 w/MySQL 5.0.27 support
Thanks Colin. I'd seen that site and noticed in their forums that people were reporting problems with PHP 5.1.6. I also noted that they use Apache 1.3 and I'm trying to use 2.2. On Nov 2, 2006, at 6:02 AM, Colin Guthrie wrote: Ed Lazor wrote: Any ideas on how to get this PHP configure / compile to work? My colleague recommends this site which he was able to consult to get a similar setup working. Hope it helps. http://www.entropy.ch/software/macosx/php/ Col. -- 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] Mac PHP MySQL
I'm trying to configure and compile PHP 5. The configure is failing to find the MySQL UNIX socket. Any ideas? ./configure \ --with-apxs2=/usr/local/apache2/bin/apxs \ --with-zlib \ --with-mysql=/usr/local/mysql \ --with-mysql-socket=/tmp The mysql.sock file is physically located in /private/tmp. The /tmp is a link to /private/tmp. I also tried specifying the --with-mysql- socket=/private/tmp with no luck. PHP 5.1.6 Apache 2.2.3 MySQL 5.0.27 Mac OS X 10.4.8 Thanks, Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Closing a connection to browser without exiting the script
Here's another idea: display your message in the original browser window, launch a new browser window for the processing script, have the window set behind the first with javascript. When your script is finished, have it output javascript that closes the processing window. On Nov 2, 2006, at 12:37 PM, [EMAIL PROTECTED] wrote: Original Message Subject: [PHP] Closing a connection to browser without exiting the script From: David Négrier [EMAIL PROTECTED] Date: Wed, November 01, 2006 2:24 pm To: php-general@lists.php.net Hello there, I'm having a somewhat unusual question here, and I cannot find any way to solve it. I have a PHP page that displays a message, and then, performs a very long operation. Note that it displays the message first. I do not intend to give some feedback to the user when the operation is done. I've seen I can use ignore_user_abort() to prevent the user from stopping the ongoing operation, but that solves only part of my problem. Because as long as the page is not fully loaded, the mouse cursor in the user's browser is showing a watch. So ideally, what I would like is to be able to close the connection from the server-side, but without using the exit() function, so my script keeps running afterwards. I know I could use a system() call to launch another process to do the processing, but I would like to avoid doing that, because there are many variables in the context that I cannot easily pass in parameter. I also tried to use the register_shutdown_function() to perform my operation after the page is displayed but since PHP 4.1.0, the connection is closed after the function is called Would any of you have an idea on how I could close that connection? Thanks a lot, David www.thecodingmachine.com It's a bit different of an idea, but you could put your reqest to perform the operation in a text file in some directory. Then you have a seperate PHP script that checks that directory for any files that would tell it to operate. Then you tell Cron to run that script every minute, 10 minutes, whatever works best for you. With this idea you can write out the file and then tell the person that you have submitted a request. Then the cron job checks for the request and performs it. You could use a database instead of a file as well with the idea of a queue. That would probably work better, because then if you needed to you can keep track of which user's process was run, and then update the user table. Say the user table has a column processing with three possible values. 0 (not processed), 1 (in processing), 2 (finished processing). You could probably expand upon that idea quite a bit more if you need to. It's no single magic bullet function call, but that's how I'd probably do it. Ray -- 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] Mac PHP MySQL
Very very nice. I'm impressed with how easy everything was to setup. I keep wondering why nobody at PHP/MySQL/Apache ever sets up stuff like this. On Nov 2, 2006, at 8:40 PM, Wee Keat Chin wrote: Ed, Ed Lazor wrote: I'm trying to configure and compile PHP 5. The configure is failing to find the MySQL UNIX socket. Any ideas? I can't tell you why because I have not a clue, but why don't you try using MAMP (http://www.living-e.de/en/products/The-MAMP/ download.php) and you can then switch between PHP4 AND 5? -- Wee Keat Chin -- 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] Changing the Action attribute of Form
Javascript: Have the submit button call a JS function which would check the state of the select and set the action appropriately before submitting the form. PHP: submit the result to a dispatcher script that'll redirect to one of the targets based on what has arrived in the data (you'll lose the ability to POST though). I'd chose the javascript route personally. You could use PHP's curl functions to rePOST the data, but that seems like more work than is necessary. My .02 cents. :) -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.ini ini_set
I think that's what he's trying, but he's missing the fact that he needs to include the actual From: that you've specified. In other words, I think he's doing: mail([EMAIL PROTECTED], Subject, Body, [EMAIL PROTECTED]); instead of: mail([EMAIL PROTECTED], Subject, Body, From:[EMAIL PROTECTED]); On Oct 31, 2006, at 10:55 PM, M.Sokolewicz wrote: Why can't you just add a From: Registrar [EMAIL PROTECTED] header? =/ - tul Chris wrote: Beauford wrote: That doesn't work. Here is what I have. mail($email,$subject,$body,$from); Which is (senders address, the subject, the body of the message, and the from address) The from address is taken from this, and I added the -f in front of it. define(regaddress, [EMAIL PROTECTED]); It still says it comes from: Nobody [EMAIL PROTECTED]; on behalf of; Registrar [EMAIL PROTECTED] That's something different entirely to what your original email said. Your mail server is adding that, it's not a php setting you can change. If you look at the mail source, it will have an extra header in there (can't remember what it is but check against this email - something like Sender or Sender-Address). -- 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] 301 redirect returning 302 instead
Have the lighttpd guys come up with any ideas? On Nov 1, 2006, at 10:24 AM, [EMAIL PROTECTED] wrote: Just a shot in the dark, but it's possible that providing a Location header resets the status response. Try swapping your two header calls. Stut: Flipping the headers doesn't work, unfortunately, running wget still shows a 302 being returned. Kris: You need both headers. Just giving the Location would give a 302, when a 301 is the goal. Just to add more info: We're running php as fastcgi under lighttpd. Doing a little searching I see that there is some weirdness with http headers when PHP is run as a CGI, but I can't seem to see any solutions out there. Obviously I can't be the ONLY person running this way, so there has to be a solution out there. -- Ian Evans Chairman Executive Producer DigitalHit.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Microsoft Partners With Zend
It's great to see Microsoft be so supportive of PHP. Go Andi! :) Personally I'm unsure. I would like to think that Zend is smart enough to realize M$ tactics of embrace/extend and will not allow that to happen. But everyone has a price, and you through enough money at something and you can make things happen (as M$ knows all to well). I also would NEVER (by choice) use M$ for a web server, not due to any anti-M$ sentiment (I use XP as my desktop), but just b/c I feel LAMP is just so integrated and works so well for this task, why fix what isn't broken. So personally I could give a shit if PHP works well on IIS. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Microsoft Partners With Zend
ps... I wonder if .NET will ever support PHP *GRIN* On Nov 1, 2006, at 11:59 AM, Ed Lazor wrote: It's great to see Microsoft be so supportive of PHP. Go Andi! :) Personally I'm unsure. I would like to think that Zend is smart enough to realize M$ tactics of embrace/extend and will not allow that to happen. But everyone has a price, and you through enough money at something and you can make things happen (as M$ knows all to well). I also would NEVER (by choice) use M$ for a web server, not due to any anti-M$ sentiment (I use XP as my desktop), but just b/c I feel LAMP is just so integrated and works so well for this task, why fix what isn't broken. So personally I could give a shit if PHP works well on IIS. -- 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] Directory name
I don't think web browsers are going to send you the name of the directory the file comes from. On Nov 1, 2006, at 10:50 AM, Sugrue, Sean wrote: I'm trying retrieve a directory name and a filename with a form. I want to use input type file so the user can browse for the file but keep the whole directory name. Any help Sean -- 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] OO website/program doubt
No variable is part of session data, unless you specifically add it yourself. Sorry, can't answer to AJAX, haven't had time to play with it. On Nov 1, 2006, at 12:50 PM, Meghdad Azriel wrote: Hello, The objects in an OO website/program is always alive in the session, or they die at the end of the execution of each page? and what about making something like this: front-building-engine in javascript AJAX tells to PHP the events AJAX request and load data from PHP PHP sends front-layout-specification -- View this message in context: http://www.nabble.com/OO-website- program-doubt-tf2555845.html#a7122248 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Microsoft Partners With Zend
And writing windows native applications with php under Visual Studio may be interesting... I use RealBasic a lot for cross-platform development... it would be cool if PHP were the base language, instead of Basic *grin* -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I get ini_set('output_handler', '') to work?!
Unless you want to pre-parse set_ini() for constants differently than set_ini() for variables. [shudder] It sounds like we just need support for pre-parser commands. You end up with one set of variables, but now you have the opportunity to change attributes of the environment before script processing begins. Then again, there's probably problems related to doing something like this. Any idea of what they would be? -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Closing a connection to browser without exiting the script
dejavu! This thread was just on the mailing list recently... check the mailing list archives. -Ed On Nov 1, 2006, at 1:24 PM, David Négrier wrote: Hello there, I'm having a somewhat unusual question here, and I cannot find any way to solve it. I have a PHP page that displays a message, and then, performs a very long operation. Note that it displays the message first. I do not intend to give some feedback to the user when the operation is done. I've seen I can use ignore_user_abort() to prevent the user from stopping the ongoing operation, but that solves only part of my problem. Because as long as the page is not fully loaded, the mouse cursor in the user's browser is showing a watch. So ideally, what I would like is to be able to close the connection from the server-side, but without using the exit() function, so my script keeps running afterwards. I know I could use a system() call to launch another process to do the processing, but I would like to avoid doing that, because there are many variables in the context that I cannot easily pass in parameter. I also tried to use the register_shutdown_function() to perform my operation after the page is displayed but since PHP 4.1.0, the connection is closed after the function is called Would any of you have an idea on how I could close that connection? Thanks a lot, David www.thecodingmachine.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OO website/program doubt
Yes. Check the mailing list archive. We just had a discussion about 2 weeks ago that talked about this and gave a few examples. On Nov 1, 2006, at 1:30 PM, bruce wrote: yo rich (or others)... does php provide the ability to store objects in a session var -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 01, 2006 1:16 PM To: Meghdad Azriel Cc: php-general@lists.php.net Subject: Re: [PHP] OO website/program doubt On Wed, November 1, 2006 2:50 pm, Meghdad Azriel wrote: The objects in an OO website/program is always alive in the session, or they die at the end of the execution of each page? They die and are resurrected like zombies on the next page. The Resurrection is slightly more complicated than that described in the Bible, however, requiring some serious gnarly timing issues in your loading of the class definitions before you attempt to use the objects... Probably best to load all your class definitions before you do session_start() from that perspective, though I don't know as I never use OOP much in PHP. You *could* write a daemon in PHP to have long-lived objects, however, if you want to keep them around for a long shelf life. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 5.1.6 on Mac OSX 10.4.8 w/MySQL 5.0.27 support
Any ideas on how to get this PHP configure / compile to work? Apache 2.2.3 is installed and working from source. MySQL 5.0.27 is installed and working from the Mac OSX package available on the MySQL site. PHP 5.1.6 will configure and make if I don't worry about MySQL support. The configure fails if I try to add MySQL support. Here's the first configure attempt: ./configure \ --with-axps2=/usr/local/apache2/bin/axps \ --with-mysql=/usr/local/mysql This will error out saying the zlib library is missing, so I add the zlib parameter: ./configure \ --with-axps2=/usr/local/apache2/bin/axps \ --with-mysql=/usr/local/mysql \ --with-zlib=/usr This configure fails with the config.log output at the end of this email. I have the Mac fully updated and the Developer package is installed. I Googled for answers, found a few examples of others who've had success and tried to use the same configure as them, but I end up with the same error. Well, I found some stuff on entropy.ch that I didn't try, mainly because they were using Apache 1.3 and I'm using Apache 2.2.3. Thanks in advance for any ideas you have. -Ed configure:58552: gcc -o conftest -I/usr/include -g -O2 -no-cpp- precomp -L/usr/local/mysql/lib -L/usr/local/mysql/lib -liconv -L/usr/ lib conftest.c -lmysqlclient -liconv -lz -lm -lxml2 -lz -liconv - lm -lxml2 -lz -liconv -lm 15 ld: Undefined symbols: _fprintf$LDBLStub _sprintf$LDBLStub _printf$LDBLStub configure: failed program was: #line 58541 configure #include confdefs.h /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char mysql_close(); int main() { mysql_close() ; return 0; } configure:58773: checking for mysql_error in -lmysqlclient configure:58792: gcc -o conftest -I/usr/include -g -O2 -no-cpp- precomp -L/usr/local/mysql/lib -L/usr/local/mysql/lib -liconv -L/usr/ lib -L/usr -L/usr conftest.c -lmysqlclient -lz -liconv -lz -lm - lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm 15 ld: Undefined symbols: _fprintf$LDBLStub _sprintf$LDBLStub _printf$LDBLStub configure: failed program was: #line 58781 configure #include confdefs.h /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char mysql_error(); int main() { mysql_error() ; return 0; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid question of the day (Editing text file in $HOME via web)
On Oct 30, 2006, at 11:34 PM, Google Kreme wrote: So, do I whack up something where I just load the file into a HTML Textarea and then write it back (simple enough, though possibly rather dangerous), or is there something straightforward I should go ahead and use that might find use elsewhere on the server? Playing Devils Advocate here, but why not store the text in a database? The text file should be somewhat secure if you're manually reading and writing to it in PHP, making sure that you're the one controlling the file name, the file extension (file type), the file permissions, and the file size. -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Run script every 30 seconds
On Oct 31, 2006, at 2:48 AM, Ahmad Al-Twaijiry wrote: yes, I think you can call it ,semi-real-time monitoring because we want the script when it run it should read some records in database and update other records That's kind of vague. I'm not able to give better advice without more information, but it does sound like you'll eventually run into some bottlenecks as system usage increases ( and fairly quickly if you're collecting data every 30 seconds). -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Decide witch table within a union
On Oct 30, 2006, at 9:20 PM, Børge Holen wrote: On Tuesday 31 October 2006 02:27, Ed Lazor wrote: Someone asked what it was to be used for. It's for combining 4 forums into one witch shows the latest movement among them. More like an introduction sort of... Sounds cool. Are you using a pre-made forum package? No Maby it'd been easier, I did that at first... But not much to learn using other ppls tools. True, a good challenge is always fun :) -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] channels attribute value returns wrong
Just getting, but is there a 0, 1, 2, and 3 channel? On Oct 31, 2006, at 3:10 AM, dhatri gmail wrote: Hello, using function getimagesize(); I am trying to get channels attribute value of image, it returns 3 for cmyk image actually it should return 4, can you tell me why it happens so? regds. dmt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is there such a thing?
On Oct 31, 2006, at 8:25 AM, Rory Browne wrote: It would be helpful if people would read the link the OP provided, as opposed to just the URL to that link. The page isn't about compiling PHP source into a binary. It's about creating a method of using web applications ( php ) without the help of a seperate web-server. I could be wrong, because I haven't used them, but I do think that some of the links I sent do what you're looking for. For example, one of the links had information about storing the executables on CD for distributing presentations. Good news tho, if those don't work for you, odds are good that you're not going to find what you're looking for... mainly because PHP is designed to be an interpretive web language and there are other tools more suited for what you're trying to accomplish. -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] only one at atime
On Oct 31, 2006, at 2:29 AM, Ahmad Al-Twaijiry wrote: We have a virtual stock exchange site (for learning purpose) we put all the bids and offers in a table and every minute we run the php script to make the exchange but my customer want to make it less than 1 minute I can tell there's something I'm missing here. I suspect it has to do with the operation of how the bid/offer exchange process actually works. I'm assuming that the bid is the asking price for the stock, one bid will receive multiple offers, and your script sells the stock to the highest bidder within a given time frame. Is that right? -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Imagecopyresampled creates black pictures
On Oct 30, 2006, at 12:52 AM, Martin Hochreiter wrote: Hi! I'm using imagecopyresampled to create thumbnails of various pictures. That works well except some pictures that imagecopyresampled converts to small black thumbnails (although it converts it correctly to a bigger size) What is wrong here? No idea off-hand, but it would probably help if you you included more information like source code and details about the images that are not working. -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Search Engine - Synonyms
Another idea from what I just sent: try googling synonym database. It looks like there are a few leads in there as well. On Oct 30, 2006, at 6:26 AM, Kevin wrote: Hi, Is it possible to automatically search for synonyms related to a word in a search engine for example if I create a search engine and search for the word 'Horse', it would automatically search for other words such as 'Pony' etc? Has anyone had any experience on how this would be implemented? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Encoding PC-850
Would this help? http://us3.php.net/manual/en/function.mb-convert-encoding.php On Oct 30, 2006, at 7:21 AM, [EMAIL PROTECTED] wrote: Hi! I need to be able to encode text to PC-850 but I have big trouble finding out info about this encoding. Does it even exist? I get a few google hits, but nothing useful. Any idea of how I can convert for example an UTF-8 string or an ISO-8859-1 to this PC-850 format? Thanks for any input. Regards Emil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_replace on words with an array
It looks like you guys are coming up with some cool solutions, but I have a question. Wasn't the original purpose of this thread to prevent sql injection attacks in input from user forms? If so, wouldn't mysql_real_escape_string be an easier solution? On Oct 30, 2006, at 8:17 AM, Jochem Maas wrote: Dotan Cohen wrote: I need to remove the noise words from a search string. I can't seem to get str_replace to go through the array and remove the words, and I'd rather avoid a redundant foreach it I can. According to TFM str_replace should automatically go through the whole array, no? Does anybody see anything wrong with this code: $noiseArray = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 0, \, ', :, ;, |, \\, , , ,, ., ?, $, !, @, #, $, %, ^, , *, (, ), -, _, +, =, [, ], {, }, about, after, all, also, an, and, another, any, are, as, at, be, because, been, before, being, between, both, but, by, came, can, come, could, did, do, does, each, else, for, from, get, got, has, had, he, have, her, here, him, himself, his, how, if, in, into, is, it, its, just, like, make, many, me, might, more, most, much, must, my, never, now, of, on, only, or, other, our, out, over, re, said, same, see, should, since, so, some, still, such, take, than, that, the, their, them, then, there, these, they, this, those, through, to, too, under, up, use, very, want, was, way, we, well, were, what, when, where, which, while, who, will, with, would, you, your, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z); $searchQuery=str_replace( ^.$noiseArray.$, , $searchQuery); // another idea based on further reading of the thread: function pregify($val) { foreach ((array)$val $k as $v) $val[$k] = '\b'.preg_quote($v).'\b'; return $val; } $searchQuery = preg_replace(pregify($noiseArray), , $searchQuery); Thanks in advance. Dotan Cohen http://essentialinux.com http://what-is-what.com/what_is/sitepoint.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is there such a thing?
On Oct 29, 2006, at 9:22 PM, Richard Lynch wrote: On Fri, October 27, 2006 5:46 pm, Integz wrote: http://www.evilbitz.com/2006/10/27/local-php-standalone-binaries-2/ I responded in that forum. Short Version: No. Check out: http://gtk.php.net/ Do these qualify? http://www.roadsend.com/home/index.php?SMC=1pageID=compiler http://www.priadoblender.com -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Search Engine - Synonyms
On Oct 30, 2006, at 6:26 AM, Kevin wrote: Hi, Is it possible to automatically search for synonyms related to a word in a search engine for example if I create a search engine and search for the word 'Horse', it would automatically search for other words such as 'Pony' etc? It is possible: http://www.google.com/help/refinesearch.html Has anyone had any experience on how this would be implemented? I haven't done it, but it seems straight forward. Start with one word, query a database for it's synonyms, and then use the resulting words (including the original word) in the final search query. It just seems like it would take a lot of work to create a database of words and their synonyms. You'll also need to add weight and sort the results so that your initial keyword scores higher. Honestly, if I were you, I'd run this question by the MySQL mailing list. PHP just works with the results of the search, so you still end up having to figure out how to do this in MySQL (or whatever database you're using). Another thing that might help is to Google keywords like synonym search programming technique. I had to sort through the results, but it did look like there were a few interesting articles. Here's one of them: http://developer.apple.com/documentation/ UserExperience/Conceptual/SearchKitConcepts/searchKit_basics/ chapter_2_section_2.html -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_replace on words with an array
On Oct 30, 2006, at 9:19 AM, Stut wrote: Ed Lazor wrote: It looks like you guys are coming up with some cool solutions, but I have a question. Wasn't the original purpose of this thread to prevent sql injection attacks in input from user forms? If so, wouldn't mysql_real_escape_string be an easier solution? Me thinkie nottie. From the OP... I need to remove the noise words from a search string. You sure? This is what they said originally: Nothing else is relevant, but $searchQuery will get passed to the database, so it should be protected from SQL injection. That's why I want to remove characters such as quotes, dashes, and the equals sign. Maybe that doesn't account for all of the extra words they're trying to remove... dunno, thus my question. However, until the OPer accepts that people are right when they say you can't append strings to an array it's never going to work. Every bit of sample code posted retains the following line of code rather than fixing it according to several other previous posts... ^.$noiseArray.$ Happy happy joy joy, oh look, the spring's broken. Doing!! Persistence is a virtue? hehe -Stut (slightly drunk, but feeling generally good about the world) Hy. That's not fair. No bragging unless you plan on sharing :) -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Decide witch table within a union
Someone asked what it was to be used for. It's for combining 4 forums into one witch shows the latest movement among them. More like an introduction sort of... Sounds cool. Are you using a pre-made forum package? -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] only one at atime
On Oct 30, 2006, at 10:14 AM, Ahmad Al-Twaijiry wrote: Hi everyone, I create a php script that will run every minute (by cronjob) and update some database tables (php 5, database mysql 5, tables type innodb) the problem is that I want this script to run only one at atime (only one process from this script can run ) for example, if the cronjob start the script and the script takes more than one minute, then after this one minute the cronjob start another process from this script, it should exit once it find there is an old process of it running) what I do now is that when the script start it will check for a tmp file (/tmp/script.pid) and if it fine it it will exit. if the file (/tmp/script.pid) is not exists, it will create it and start doing the database update and when the script finish it will remove the file any better idea ? It sounds like how I'd approach it, but it depends somewhat on the type of updates your script is performing and how busy your website is. Plus, I'm curious, what kind of updates are needing to occur every 30 seconds? And, if your scripts are at risk of running for more than 30 seconds, does this mean that the volume of data you're working with end up building upon itself? Just wondering, because it sounds like you could end up hammering your database server. -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Run script every 30 seconds
On Oct 30, 2006, at 10:26 AM, Ahmad Al-Twaijiry wrote: is it possible to link the script to my php interface (the one that the users is using it) and if the php interface page will run the script (IN background) if it didn't run for the last 30 seconds ? I see this is very hard and almost impossible , what do you think ? PS: also I need to make sure no more than 1 process of the script is running :) Hi Ahmad. Could you describe what your script is doing? What type of information are you wanting users to see? Is this some sort of status page? Is it some sort of semi-real-time monitoring? -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_replace on words with an array
On Oct 30, 2006, at 1:10 PM, Dotan Cohen wrote: On 30/10/06, Stut [EMAIL PROTECTED] wrote: Ed Lazor wrote: It looks like you guys are coming up with some cool solutions, but I have a question. Wasn't the original purpose of this thread to prevent sql injection attacks in input from user forms? If so, wouldn't mysql_real_escape_string be an easier solution? Me thinkie nottie. From the OP... I need to remove the noise words from a search string. Yes, that is also part of the aim. How come? Not trying to be facetious here. I'm just wondering if you see a benefit that I don't. For example, say the hacker injects some sql and you use mysql_real_escape_string. You end up with something like this... actually, I'll do one step further and just use the quote_smart function described in the mysql_real_escape_string page of the php manual: $query = sprintf(SELECT * FROM users WHERE user=%s AND password=%s, quote_smart($_POST['username']), quote_smart($_POST['password']) ); Say the user tried to inject sql in $_POST['username'] and it looked something like: root';drop all; Having used quote_smart, the value of $query ends up SELECT * FROM users WHERE user='root\'\;drop all\;' AND password='something' The sql injection fails. The data is seen as a literal. The database is going to think there's no user with that name. That means that even if the user did include extra words, they're just part of the value that is checked against user names - rather than being see as potential commands. I'm not sure if I'm describing this well, so let me know what you think and I'll go from there. -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I get ini_set('output_handler', '') to work?!
I suppose I could re-compile my command line version with a different php.ini file, but that's kind of lame that I have to have two php.ini files for what ini_set() SHOULD handle. Would modifications via .htaccess work for you? -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Query question
You'd still benefit from converting your data into an actual date format in order to take full advantage of available features. hehe You guys are going to start thinking of me as a performance freak, but I think MySQL's date functions might provide better performance than string manipulation. On Oct 29, 2006, at 6:08 AM, Beauford wrote: I don't see this as a particular problem as the data will always be the same. Now under other circumstances in another database, I can see what you are saying. -Original Message- From: Satyam [mailto:[EMAIL PROTECTED] Sent: October 29, 2006 4:30 AM To: Beauford; 'PHP' Subject: Re: [PHP] Query question I said that you have a problem,not that you caused it, and my observation might (hopefully) help newbies in the list. Satyam - Original Message - From: Beauford [EMAIL PROTECTED] To: 'PHP' php-general@lists.php.net Sent: Sunday, October 29, 2006 9:06 AM Subject: RE: [PHP] Query question This is how I get the data and I have no control over the actual layout of the database. So I have to work with what I have. Robert: LOL, I don't know either. The format is - 01/01/2006. When I first did it I used 7, which should be right, but I ended up getting /2002 /2003, etc. So I went to 8 and all was well. Beats me. B -Original Message- From: Satyam [mailto:[EMAIL PROTECTED] Sent: October 29, 2006 2:14 AM To: Beauford; 'PHP' Subject: Re: [PHP] Query question If that works then you have a problem: you are storing dates as a plain string ( varchar or whatever) instead of a native date/time datatype, which precludes the use of a large number of native SQL date/time functions, such as year() which should suit you nicely in this case. Eventually, you will bump into something more elaborate which you won't be able to do on the SQL side just with string functions and that will force you to bring whole tables into PHP to do more extensive processing. Satyam - Original Message - From: Beauford [EMAIL PROTECTED] To: 'PHP' php-general@lists.php.net Sent: Sunday, October 29, 2006 7:05 AM Subject: RE: [PHP] Query question This is what I finally figured out, which works just perfectly. select count(date) as count, substring(date,8) as year from stats group by year; Thanks to all for the input. -Original Message- From: Joe Wollard [mailto:[EMAIL PROTECTED] Sent: October 29, 2006 12:15 AM To: Beauford Cc: PHP Subject: Re: [PHP] Query question Look into the MySQL YEAR() function to extract the year from a specific date. Start here: http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html On 10/28/06, Beauford [EMAIL PROTECTED] wrote: I posted this here as I figured I would need to manipulate this using PHP. The code below doesn't quite work because the date is in the format of 05/05/2006. So I am getting totals for each date, not each year. I need the totals for each year, regardless of the day or month. This is why I figured I'd need to use PHP to maybe put it in an array first or something. Thanks -Original Message- From: Joe Wollard [mailto:[EMAIL PROTECTED] Sent: October 28, 2006 10:30 PM To: Ed Lazor Cc: Beauford; PHP Subject: Re: [PHP] Query question Agreed, this should go to a MySQL list. But in the spirit of helping I think the following should give you a good starting point. SELECT `year`, COUNT(`year`) AS `count` FROM `tbl` GROUP BY `year` ASC On 10/28/06, Ed Lazor [EMAIL PROTECTED] wrote: Use the mysql list :) On Oct 28, 2006, at 3:01 PM, Beauford wrote: Hi, I have a MySQL database with a date field and a bunch of other fields. The date field is in the format - 01/01/2006. What I want to do is query the database and create a table that shows just the year and how many instances of the year there is. I have been taxing my brain for a simple solution, but just not getting it. Any suggestions? Thanks Example output. Year Count 2002 5 2003 8 2004 9 2005 15 2006 22 ps - I get this information sent to me and I can't change any of the data. I just enter it in the db and then hopefully do the query on it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- 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
Re: [PHP] strange problem with count()
Side note, it sounds like $this-result is an object holding an array, not the array itself and print_r is automatically traversing the object. On Oct 29, 2006, at 4:27 AM, Gunnar Beushausen wrote: Hi! I've a strange problem with count. I wrote a routine to jump to the last position of an array. The code ist this: if(!$this-done) { array_push($this-result, $this-stmt-fetchall_assoc()); } $this-done = true; $this-currIndex = $this-rowIndex = count($this-result)-1; return $this; If i do a print_r($this-result); i'm getting like thousand entries, so the array is actually filled with all values needed. But somehow a count($this-result) gives me a value of 1. I wonder why count says there is only 1 entry in that array, when print_r gives out more than thousand entries. Does anybody have a clue? I'm using php 5.1.6 Thanks in advance, Gunnar -- 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] forms usage in web pages
Is anyone else getting multiple copies of posts? On Oct 29, 2006, at 9:52 AM, Larry Garfield wrote: There's nothing wrong with multiple forms on a single page, as long as all id attributes in all elements are unique on the entire page, not just within the form. Just make sure that each form is self-contained with its own submit button and such. Only the form whose submit button is clicked will get submitted by the browser. Whether or not you want to use multiple forms for a given set of tasks or multiple submit buttons in a single form (which you can then test to see which was clicked) will depend on what it is you're doing. Both are perfectly legitimate ways of doing things, depending on what things you're doing. On Sunday 29 October 2006 01:45, Karthi S wrote: hi, i am newbie to web programming. i have a basic doubt in using forms. Is it advisable to use multiple forms performing various functions in a single web page. what are the pros and cons of using that. Please forgive me if this is not the right mailing list to post this question. But help me out in clarifying this basic doubt. thanks in advance Karthi -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it. -- Thomas Jefferson -- 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] Decide witch table within a union
PHP can't tell what table the data came from. On Oct 29, 2006, at 1:34 PM, Børge Holen wrote: Hi. I got this working (almost) How do I decide (inside?) the whileloop the table_nr, 1 to 4 witch the link is echo'ed from. I could add another field in each table telling witch table it is. Easy solution, but feels like polluting the db. Also I could do another loop to check another of the printed fields up agains witch table is used, but that adding to the slowness of this union stuff, it would take forever, if the union in itself is slow or the fact that I'm cutting the message field after 100 characters I dunno. This is anyway the main code wherein the problem lies: $sql= (select * from table_1 WHERE pid='0' order by id desc limit 10) union (select * from table_2 WHERE pid='0' order by id desc limit 10) union (select * from table_3 WHERE pid='0' order by id desc limit 10) union (select * from table_4 WHERE pid='0' order by id desc limit 10) order by date desc limit 10 ; $result = mysql_query($sql) or die('Error, query failed'); while($myrow = mysql_fetch_array($result)){ $id = $myrow[id]; $pid = $myrow[pid]; echo a href=\index.php?table=$table_nrpage/a; } -- --- Børge Kennel Arivene http://www.arivene.net --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_replace on words with an array
checkout the function mysql_real_escape_string() On Oct 29, 2006, at 3:13 PM, Dotan Cohen wrote: On 30/10/06, Paul Novitski [EMAIL PROTECTED] wrote: Hi Dotan, To get help with your problem, share more of your PHP code with the list so we can look at what you're doing. Also, give us a link to the PHP script on your server so we can see the output. Regards, Paul Nothing else is relevant, but $searchQuery will get passed to the database, so it should be protected from SQL injection. That's why I want to remove characters such as quotes, dashes, and the equals sign. I set up a test page: http://what-is-what.com/test.php with this code: htmlbody ?php // FOIL SQL INJECTION AND REMOVE NOISE $noiseArray = array([:alnum:], [:punct:], |, \\, , , #, @, \$, %, ^, , *, (, ), -, _, +, =, [, ], {, }, about, after, all, also, an, and, another, any, are, as, at, be, because, been, before, being, between, both, but, by, came, can, come, could, did, do, does, each, else, for, from, get, got, has, had, he, have, her, here, him, himself, his, how, if, in, into, is, it, its, just, like, make, many, me, might, more, most, much, must, my, never, now, of, on, only, or, other, our, out, over, re, said, same, see, should, since, so, some, still, such, take, than, that, the, their, them, then, there, these, they, this, those, through, to, too, under, up, use, very, want, was, way, we, well, were, what, when, where, which, while, who, will, with, would, you, your); $searchQuery=preg_replace( /^.$noiseArray.$/, , $_POST [query]); $searchQuery=trim($searchQuery); print p$searchQuery/p; ? form action=/test.php method=post input type=text name=query / input type=submit / /form /body/html Dotan Cohen http://song-lirics.com http://what-is-what.com/what_is/distribution.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Decide witch table within a union
Definitely not. Review your design. If you need to know which table data comes from, then perform table specific queries. If you need to combine data from more than one table, code your application to respond accordingly. You may also need to review your database schema design in order that it best meet your needs. On Oct 29, 2006, at 2:00 PM, Børge Holen wrote: Would you suggest to use a extra field to hold the table name as default? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] socket_recv
Depends on the volume and type of data that you're working with. It also depends on the type of connection between the server and client. Slower connections, unreliable connections, or general data, use smaller packets. Reliable connection or higher volumes of data, use larger packets. Think of it this way, the entire packet of data gets resent if there's an error and this could be costly time-wise if your packets are huge. On Oct 29, 2006, at 4:41 PM, Eric wrote: Is there a reccomended size of data to pull in with socket_recv (Such as 1024) or can I pull in 981132487 and it wont make a difference? Thanks in advance. -- 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] Decide witch table within a union
That seems unreasonably harsh. I can see what you mean, but don't take it that way. I was trying to help. What in your view is wrong with a union query that preserves an indicator of which component table a particular record comes from? Read earlier in the thread. He's talking about adding a field to the table and that the value of this field in every single record will be the name of the table the record belongs to. I said I would definitely not recommend doing that. I can easily imagine a circumstance in which this could be valuable, say the union of several mailing lists that are in separate tables simply because they originate from different sources. We union them to print a single alphabetical list, for example, but we want an indicator as to the source of each record. I can imagine modifying the OP's query to read: $sql= (select '1' as tableId, * from table_1 WHERE pid='0' order by id desc limit 10) union (select '2' as tableId, * from table_2 WHERE pid='0' order by id desc limit 10) union (select '3' as tableId, * from table_3 WHERE pid='0' order by id desc limit 10) union (select '4' as tableId, * from table_4 WHERE pid='0' order by id desc limit 10) order by date desc limit 10 ; Would this be so egregious? and if so why? I think this is a great solution, wish I'd thought of it. =) You say, If you need to combine data from more than one table, code your application to respond accordingly. What does this mean, exactly? I'm just talking about intelligent programming. Surely you're not suggesting that we code an application to somehow divine the source of a record in a union query when the query itself could simply supply that datum easily. Of course not. Honestly, I think you're just being critical of what I said, because you thought I was being harsh and unfair when I wasn't actually trying to be. -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Decide witch table within a union
Sorry, Ed, I had intended my reply to be friendly as well. I'm allergic to smiley-face icons, but I should have tried harder to convey my tone. Dang this poker-faced email! No worries. It's all good :) -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Shopping Cart
Be specific in stating what prior research has been done so that we may help, if possible. Point noted. Helping out further, you'll find that this rule applies to almost all mailing lists. 2) We don't owe you anything. If you decide to go elsewhere for help don't expect us to feel guilty or upset or anything but mildly amused. I would point out that you're unlikely to find a better source of help than the 'official' PHP lists, but I really don't care enough about where you go for help. My statement was meant as some behavioral/emotional modification, or an attempt at soliciting pity. So my lack of compassion is mutually returned. Helping out even further with another general rule of etiquette on mailing lists, keep it cool and filter the crap. For example, Chris' initial reply came across as offensive and you could have surprised him by filtering his attitude, focusing on the real issue, and responding with information about what you have researched up to this point. Speaking of which, I think that's where this thread is. Have you researched any of the options that come up from Googling php shopping cart? Which options have you dismissed and why? -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Uploading files.
Side note on the PHP FTP... I'm sure there are PHP FTP classes out there for you to use... google php ftp class and you'll see a few options to explore. On Oct 28, 2006, at 10:47 AM, João Cândido de Souza Neto wrote: Hi everyone. I´m in a big doubt about uploading files ins a safe way. I wont give permission for the web server user to write in some folder of my system and then use move_uploaded_file function in order to keep it secure. I was using ftp functions to do it but a get a new trouble, in some servers my ftp user has no permission to read in the upload temp folder of php. I am determined to access by ftp funcions, give permission to web server user, put the file by move_uploaded_file and take the permission previously gave. I do not test but i think it will works. Someone has another tip to do it without loss security? Thanks in advance. -- 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: PHP Sessions || Problems with AOL, Safari, etc.
Check php.ini session settings. There are some options in there for you to use in your scripts. Set up scripts to test whether session cookies are being saved and then route accordingly. On Oct 28, 2006, at 12:41 PM, sit1way wrote: Hey all. I run a members-only hockey report that relies on Session variable (s) to grant/deny access to members-only site content. Generally members have no trouble accessing members-only content once logged-in to the site; however, since we have a few thousand members, I frequently receive tech support requests along the lines of My login doesn't work, I keep getting returned to the login screen. Invariably it's McAffee anti-virus, or other anti-virus program running on the user's computer that disables session cookies, or the user disabled session cookies in attempts to make their browser more secure. Is there a way to get around this problem? Not being able to set Session variable(s) is a major annoyance; one that I'd like to resolve if possible. Suggestions welcome... Thanks, --Noah -- 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: A general UL script
Are you just trying to tell whether the form has been submitted? Or are you just trying to validate form data? -- verify form submitted - if (isset($_POST)) { // form submitted, process data } else { // display form } -- http://us2.php.net/manual/en/features.file-upload.php Example 38-2. Validating file uploads On Oct 28, 2006, at 2:46 PM, Børge Holen wrote: Ok. got that thanks. But that leaves me a bit off to how to tell the script to leave it alone. Is it possible to check it or maby even better. Posible to not add an empty field in the submit. The multifile submit I actually intended this script for, always send the first field empty so later on I slice the array to cut out the first'n empty field. Witch ALSO would be very helpful, since I right this minute seems to believe/found out that Safari actually seems to send the field in the opposite order of Firefox??? Maby there is something else, but the script stops when I check the array for actual images. On Saturday 28 October 2006 23:33, M.Sokolewicz wrote: Børge Holen wrote: When I use a normal single file upload form; both of these statements will continue wether my form is empty or not, why? if(!empty($_FILES)){ do som checking if its a jpg. if not exit; if(isset($_FILES)){ because it IS set and NOT empty. $_FILES['file_upload_field'] is set, it's got no data, but it IS set. $_FILES is set because $_FILES['file_upload_field'] exists. Submitting a blank form sends all variables though without actual (non-default) content. - tul -- --- Børge Kennel Arivene http://www.arivene.net --- -- 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] A general UL script
You posted this earlier and people, myself included, responded. I don't know why you're reposting your original message rather than reply to what we went. If you're not happy with the answers we provided, please rephrase your question in order that have more luck in answering it. On Oct 28, 2006, at 1:16 PM, Børge Holen wrote: When I use a normal single file upload form; both of these statements will continue wether my form is empty or not, why? if(!empty($_FILES)){ do som checking if its a jpg. if not exit; if(isset($_FILES)){ -- --- Børge Kennel Arivene http://www.arivene.net --- -- 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] Query question
Use the mysql list :) On Oct 28, 2006, at 3:01 PM, Beauford wrote: Hi, I have a MySQL database with a date field and a bunch of other fields. The date field is in the format - 01/01/2006. What I want to do is query the database and create a table that shows just the year and how many instances of the year there is. I have been taxing my brain for a simple solution, but just not getting it. Any suggestions? Thanks Example output. YearCount 20025 20038 20049 200515 200622 ps - I get this information sent to me and I can't change any of the data. I just enter it in the db and then hopefully do the query on it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 5 Hosting
Hi, I wanted to give some feedback on PHP 5 hosting in case it helps someone. I signed up with DreamHost last Thursday. I also signed up with OCS Solutions to compare the two services. I also maintain a server with CalPop. When I signed up with Dreamhost, I discovered that you have to fill out a form and fax it to them, along with a rubbing of your credit card. Personally, I found that part rather annoying. They say it's for added security, but I've never had to do that with any other online transactions that I've done. OCS Solutions had me pay for a year up front, which always makes me nervous when checking out a new provider, but they do offer a money back guarantee. Actually, both providers offered a money back guarantee. DreamHost's is 97 days. That's pretty good. Cost-wise, both companies were fairly inexpensive. I ran a Google search for DreamHost Coupon and found a coupon that eliminated a majority of the up front cost. Actually, I was pretty surprised. They give you a free domain registration that includes private whois for free. After the coupon, I paid $9.90 and covered the start-up fee (normally $45), the first month of service, and the domain registration. It feels like I paid for a domain registration and got free hosting for a month. My account with DreamHost was created on Monday. Technically, it took 5 days to get my account set up. That's the longest set up delay I've ever experienced with any host provider. OCS Solutions called me an hour after signing up and had my account setup shortly thereafter. I also registered a domain when signing up with OCS Solutions. The whois was wrong. Somehow it ended up showing as registered to one of their employees, but I called and they quickly fixed it. The account was set up under the wrong username, but they fixed that quickly, along with problems with cpanel when it doesn't handle the name change correctly. Mistakes were made, but I was really pleased with how easy it was to get help and I was really happy with how much people obviously cared about helping out. After signing up with DreamHost, the domain that I'd registered with them wasn't working. I was exploring their control panel to figure out the problem when I came upon a DNS management page. The page automatically identified and fixed the problem. That was impressive. Also, I started exploring the DreamHost forums after signing up, something I almost wish I'd done beforehand. I found a lot of posts from very disgruntled customers. It sounds as if they've been running into problems lately on their servers. People complain A LOT about the lack of phone support from DreamHost... you have to submit a trouble ticket for everything. If your account subscription is high enough, they offer a limited number of call backs. The worst part was reading debates between the really happy and the really unhappy DreamHost clients. A lot of the discussions boiled down to verbal attacks between customers. I'm honestly surprised DreamHost didn't intervene. One last thing with OCS, the plan I started on turned out to be insufficient for my needs. I talked with them and they came up with a new plan that does everything I want and just charged me a little more to cover the difference. End result so far... CalPop: I've always had problems with the initial set up of servers at CalPop. Talking with their tech support on the phone is a nightmare; there's something wrong with their phone lines (seems like a really bad voice over IP solution). It usually takes way too many emails to resolve problems. I've also experienced a lot of hardware failures, which makes me wonder about the quality of parts they purchase. Once the server works though, everything seems to settle down until the next problem shows up. DreamHost: Best prices, low service. It seems like DreamHost is run by and tailored toward experienced techies. That's fine, I can work with that. I'm willing to try working with limited phone support. I'm really only concerned with delays I might experience when a problem shows up in something that's mission critical. Beyond that, there are a lot of features available here that aren't elsewhere. I'm getting great value for my money. OCS Solutions: Good prices, but you have to pay up front. Best customer service I've experienced from an ISP so far. I feel a lot more comfortable using them for anything mission critical. On Oct 11, 2006, at 10:12 PM, Kyle wrote: Hello, I would suggest dreamhost at www.dreamhost.com. Their prices look a bit hefty at first but there are referral codes all over the internet and you can end up saving $97. Their plans have tons of bandwidth and space and I haven't had any trouble with it. But I would suggest them highly, their service is quite impressive. And if you don't like the PHP features
Re: [PHP] [OFF] A note on replying to this list
You're asking everyone else to change their email client when the quickest solution would be for you to change yours. On Oct 22, 2006, at 10:59 PM, theIggs wrote: Hello all! Sorry for the offtopic. Please, when you reply to PHP mailing lists, put the Re: element right in front of the subject: Re: [PHP] Screen shots not [PHP] Re: Screen shots When there are two different styles used simultaneously it's merely impossible to sort messages in chains. At least my email client (The Bat!) can't sort messages in chains with [PHP] Re-like subject. So I believe for most of us two different styles at a time are not convenient. Thanks. Please correct me if I'm wrong. --- Regards, theIggs. -- 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] [ANNOUNCEMENT] Sparse 1.1b released - create Ajax forms!
Has anyone checked this for security? On Oct 23, 2006, at 11:26 AM, Daniel Orner wrote: A big new update for Sparse, the HTML-based framework for writing MySQL-backed CGI applications easily and quickly. Now, the generated forms output in fully degradable Ajax, meaning that if a user doesn't have Javascript available or if an error occurs, the regular functionality will still work. Documentation has also had a significant overhaul. If you haven't tried Sparse yet, now's the time! --Daniel -- Sparse - a new way to write MySQL-based programs with little to no actual programming. Save yourself time and effort! http://sparse-php.sourceforge.net/ -- 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] FTP - folders
On Oct 23, 2006, at 2:27 PM, Richard Lynch wrote: On the Mac, I always dug Fetch personally. Nice... I've been looking for something like Fetch. PC, you got your CuteFTP and all that ilk. SecureFTP by VanDyke rocks. Now, on *nix, SCP is nice for that, if you have SSH shell access. If not, I dunno... Never have stumbled across a good utility for that. Never looked super hard either, as glob usually works in FTP shell, and when it doesn't, well, I can ususally find some way around that too. ncftp for general stuff on Unix has always been my favorite. I default to things like scp when I need secure transfers of data. -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mapped Drive issue
Depends on your operating system. On Oct 23, 2006, at 6:31 PM, Rob Kritzer wrote: Yes, the directory on mapped drive Y does exist. I do think that it might have something with how PHP and Apache is running. How do I chanage how PHP is running under an account? Where do I tell PHP or Apache to run under a different accunt? On 10/23/06, Richard Lynch [EMAIL PROTECTED] wrote: Y: doesn't exist. It may not exist because you haven't opened it lately and authenticated it as valid. Or it might not exist because PHP is not running as you, and PHP has no access to it. Or it might not exist because it's Windows, and you need to re-boot. On Wed, October 18, 2006 2:14 pm, Rob Kritzer wrote: I have a script the use to work: $date = date(mdy); mkdir(Y:/Daily_DisplayAds/todays_ads-$date); But now I get this error: Warning: mkdir() [function.mkdir]: No such file or directory in C:\wamp\www\scripts\ad_finder\display_class.php on line 10 If I change Y to C it works, can anyone please help me thanks. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mapped Drive issue
If you're running Apache as an XP service, go to the services control panel, open the apache config, and you can change the user there. Otherwise, you'll have to edit the apache config and change the user there. On Oct 23, 2006, at 7:21 PM, Rob Kritzer wrote: For now I am on a PC XP Pro, wish they would give me back my Mac. On 10/23/06, Ed Lazor [EMAIL PROTECTED] wrote: Depends on your operating system. On Oct 23, 2006, at 6:31 PM, Rob Kritzer wrote: Yes, the directory on mapped drive Y does exist. I do think that it might have something with how PHP and Apache is running. How do I chanage how PHP is running under an account? Where do I tell PHP or Apache to run under a different accunt? On 10/23/06, Richard Lynch [EMAIL PROTECTED] wrote: Y: doesn't exist. It may not exist because you haven't opened it lately and authenticated it as valid. Or it might not exist because PHP is not running as you, and PHP has no access to it. Or it might not exist because it's Windows, and you need to re- boot. On Wed, October 18, 2006 2:14 pm, Rob Kritzer wrote: I have a script the use to work: $date = date(mdy); mkdir(Y:/Daily_DisplayAds/todays_ads-$date); But now I get this error: Warning: mkdir() [function.mkdir]: No such file or directory in C:\wamp\www\scripts\ad_finder\display_class.php on line 10 If I change Y to C it works, can anyone please help me thanks. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Screen Shots
On Oct 22, 2006, at 5:29 PM, Sancar Saran wrote: On Sunday 22 October 2006 15:19, Mark McWhirter wrote: Is there any way that I can get a script to take a screen shot every minute of all the users using my php website? Convert to pdf. Are you logging the stats? That would allow you to graph the usage whenever you want. -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] worst sites / standard format
Sorry, how does this relate to PHP? It seems like you're just trying to get us to visit your sites to bump up traffic. On Oct 19, 2006, at 8:44 AM, Chuck Stearns wrote: hey, check out the bar on the side of the ones with main.html. http://www.997thelake.com/main.html http://www.cool929fm.com/main.html http://www.star933.com/ http://www.wzzo.com/main.html http://www.929nin.com/main.html guess we have our work cut out for us, eh? we need to find a distinct, unarguable value for this product, and i believe that it's the fact that the link redistributes to amazon, whereas there is a greater value if they can sell the songs themselves. problem is, what agreement dot hey have with amazon? anyway, that's what i found. later /cs -- 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] Creating new table from distinct entries
This is definitely something you'll want to run by the MySQL mailing list. On Oct 19, 2006, at 10:02 AM, Alan Milnes wrote: PHP 4.4.4 MySQL 4.1.21-community-nt I have a table in my database that has a Primary key on 2 fields (MyID and MyChange) and a field that indicates if there is a problem with the record (MyError)- I want to create a new table that only has unique MyIDs and where there is more than 1 I only want the record with the highest MyChange number. The table has about 50 fields so I have the following code:- $myquery=CREATE TABLE mystats SELECT *, DISTINCT MyID FROM oldstats WHERE MyError IS NULL ORDER BY MyChange DESC ;; $myresult = mysql_query($myquery); but I am getting an MySQL error #1064. Any ideas or suggestions as to where I am going wrong? Alan -- 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] ENV vars
How are you running PHP? What are you trying to accomplish with setting the env var? On Oct 19, 2006, at 8:16 PM, jekillen wrote: Hello again; I'm wondering if it is possible to create an $_ENV var with a php script running under a web server. I'm not sure where to look in the manual or other documentations for this. Isn't there a set_env() function or something like it? (would apply to php 4 0r 5x) Thanks in advance. JK -- 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