Re: [PHP] OpenID
There is a openID mailing list set up if anyone has any technical questions, gene...@openid.net -Nate On Fri, Feb 5, 2010 at 4:57 PM, haliphax halip...@gmail.com wrote: On Mon, Feb 1, 2010 at 9:54 PM, Michael A. Peters mpet...@mac.com wrote: Daevid Vincent wrote: -Original Message- From: Al [mailto:n...@ridersite.org] Sent: Monday, February 01, 2010 12:09 PM To: php-general@lists.php.net Subject: [PHP] OpenID This is a bit off subject, but What is your opinion on OpenID? Failed gimick. Tried to resurface again about a year ago. Still seems like failure. ++ Session ID hijacking is bad enough, it gives the malicious user access to one resource. OpenID hijacking gives the malicious user access to a ton of resources. And what does a user do when their OpenID provider disappears? I think Michael hit the nail on the head as far as my concerns are.. well.. concerned. :) Google's OpenID provider seems like it would be around forever and whatnot, but if you're going to rely on one of the big OpenID providers, then it would appear that OpenID itself is useless. Facebook's OpenID, etc., are on shaky ground at best. I use a few sites that leverage OpenID as their login process, and I've got to say--it's very convenient. However, I only use my Google account for OpenID logins, so to me, it's really just a Google connector. I commend everyone involved for their effort, but I think the underlying principles need to be re-examined. It feels like they rushed the whole concept into production before too many of the fundamental issues had been discussed and dealt with. My 2c. // Todd
Re: [PHP] Warning: OutsourcingRoom.com
Hey guys, Did some digging... looks like the host for http://outsourcingroom.com is http://hosting.ua/. Also, outsourcingroom looks to be owned by http://www.cbsystematics.com. The host for this company website is http://parking.ru. Hopefully this information can be of use to someone a little more legal-eagle than myself. Nate n...@grapepudding.com On Thu, Aug 6, 2009 at 8:05 AM, Andrew Ballard aball...@gmail.com wrote: On Thu, Aug 6, 2009 at 8:20 AM, abdulazeez alugodefati...@hotmail.com wrote: Well, I try not to give out my details to too many people each month, and this month they were beat to it by a nice fellow in Nigeria who I'm helping out by letting him put some money into my account. Hello Ash, Could that be termed as aiding and abetting that 'nice fellow from Nigeria'?. Let me know your term for it and while you're at it, could you not spend the money? Cheers. Alugo Abdulazeez Greetings from Nigeria. I believe the term you are looking for is fraud victim. I also believe Ash was being quite facetious. :-) Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Programming With Revision History
Hey guys, Does anyone know of any good literature on programming revision history into an application? I'm looking for something covering theory around revision history. For a little background info, I'm dealing with lesson plans that will need to be edited by many different sources. I like the way wikimedia handles revision history, but I'm just curious what my options are. Thanks, Nate
Re: [PHP] simplexml
You have to handle the html special chars. == amp; On Thu, Jul 10, 2008 at 10:59 AM, Joakim Ling [EMAIL PROTECTED] wrote: Hi I'm using simplexml to create some xml files. Here's a stripped example, how can I get this to work? Tried millions different ways still no joy. ?php header(Content-type: text/xml); $xml = simplexml_load_string('root/root'); $root = $xml-addChild('tests'); $root-addChild('test', 'test test'); echo $xml-asXML(); ? // cheers jo
Re: [PHP] simplexml
You have to handle the html special chars. == amp; On Thu, Jul 10, 2008 at 10:59 AM, Joakim Ling [EMAIL PROTECTED] wrote: Hi I'm using simplexml to create some xml files. Here's a stripped example, how can I get this to work? Tried millions different ways still no joy. ?php header(Content-type: text/xml); $xml = simplexml_load_string('root/root'); $root = $xml-addChild('tests'); $root-addChild('test', 'test test'); echo $xml-asXML(); ? // cheers jo
Re: [PHP] Splitting up long URLs
If you want to do it on the php side, I would do something like this: a href=$fullURLsubstr($fullURL, 0, 9)/a It would provide a valid link using the full url, but chop off everything after the 10th character and replace with a Nate On Tue, Jul 1, 2008 at 3:45 PM, Boyd, Todd M. [EMAIL PROTECTED] wrote: -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 01, 2008 3:27 PM To: php-general@lists.php.net Subject: [PHP] Splitting up long URLs I have a web page that lists most recent comments in a left margin. Sometimes people post long URLs, or even just really really long words, that force that margin to display way too wide, screwing up the page layout. Is there a way to make sure URLs or other text in a string gets split up so this doesn't happen? If there's a CSS solution that's better than a PHP solution I'll take that too. :-) STFW: http://www.w3.org/TR/css3-text/#white-space ...doesn't say much in the article about whether or not it will break up words rather than lines, but it's worth a shot. Todd Boyd Web Programmer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
On Tue, Jun 17, 2008 at 3:22 PM, Jon Drukman [EMAIL PROTECTED] wrote: Nate Tallman wrote: Why is an ErrorDocument insufficient or not the elegant way? It accomplishes the goal in a clean way, no? It's *WRONG*. ErrorDocument still preserves the 404 error code, it just gives it a prettier face. If the page really is there, returning a 404 for it is not correct. Search engines will not index it. You probably don't want that. Not to beat a dead horse, but why would you *not* want to preserve the 404? If it's a bad url anyways, you probably *want* to return a 404 (albeit prettier) and you probably *don't* want search engines indexing it.
Re: [PHP] Re: Search like php.net's URL thingy
Why not just set: ErrorDocument 404 /path/to/some/script.php Then check $SERVER['REDIRECT_URL'] for the failed request. On Thu, Jun 5, 2008 at 2:41 PM, Shawn McKenzie [EMAIL PROTECTED] wrote: Ryan S wrote: Hey, one of the things that make the php.net site so cool is how easy it is to find info for a function or a list of topics.. eg: http://php.net/arrays http://php.net/count I'm sure nearly all of you reading this have done it more times than you would care to count, i'm trying to get something like this on my own site but even after going to php.net and clicking on the view source buttons am a bit confused. basically this is what i am trying, people who type in http://www.mysite.com/asdf should not be shown a 404 not found page but instead asdf should be passed onto my script where i can do a search on the term and either give them back the results of that search or direct them to a custom 404 page. since i couldnt find the answer via php.net's source i started messing around with how i *think* its done... tell me if i am on the correct track: when someone requests a page that does not exist, a .htaccess file them up and also takes the page name they were searching for and redirects them to a script... So far i have only been able to get the .htaccess file point to my custom 404 page... but how do i get it to pass the parameter of the not-found-page to my script? Would appreciate any code, tips, urls you can give me. Thanks! Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) If you use .htaccess and have mod_rewrite then it is simpler. Something like this (untested): IfModule mod_rewrite.c RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?term=$1 [L] /IfModule Then in index.php you can use the contents of $_GET['term'], which in your example would be asdf. [QSA,L] will give you the query string if the user typed in something like http://www.mysite.com/asdf?your=mom. Then $_GET['your'] = 'mom'. -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
ErrorDocument 404 /path/to/some/script.php * $_SERVER['REDIRECT_URL'] (somehow misplaced underscore) On Thu, Jun 5, 2008 at 2:50 PM, Nate Tallman [EMAIL PROTECTED] wrote: Why not just set: ErrorDocument 404 /path/to/some/script.php Then check $SERVER['REDIRECT_URL'] for the failed request. On Thu, Jun 5, 2008 at 2:41 PM, Shawn McKenzie [EMAIL PROTECTED] wrote: Ryan S wrote: Hey, one of the things that make the php.net site so cool is how easy it is to find info for a function or a list of topics.. eg: http://php.net/arrays http://php.net/count I'm sure nearly all of you reading this have done it more times than you would care to count, i'm trying to get something like this on my own site but even after going to php.net and clicking on the view source buttons am a bit confused. basically this is what i am trying, people who type in http://www.mysite.com/asdf should not be shown a 404 not found page but instead asdf should be passed onto my script where i can do a search on the term and either give them back the results of that search or direct them to a custom 404 page. since i couldnt find the answer via php.net's source i started messing around with how i *think* its done... tell me if i am on the correct track: when someone requests a page that does not exist, a .htaccess file them up and also takes the page name they were searching for and redirects them to a script... So far i have only been able to get the .htaccess file point to my custom 404 page... but how do i get it to pass the parameter of the not-found-page to my script? Would appreciate any code, tips, urls you can give me. Thanks! Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) If you use .htaccess and have mod_rewrite then it is simpler. Something like this (untested): IfModule mod_rewrite.c RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?term=$1 [L] /IfModule Then in index.php you can use the contents of $_GET['term'], which in your example would be asdf. [QSA,L] will give you the query string if the user typed in something like http://www.mysite.com/asdf?your=mom. Then $_GET['your'] = 'mom'. -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
Not true, Apache does return a 404, but IE will use the custom 404 page if it is available. Nate On Thu, Jun 5, 2008 at 2:57 PM, Shawn McKenzie [EMAIL PROTECTED] wrote: As far as I remember, errordocument still send the code, in this case 404 to the client. In the case of IE, this will display IEs built-in error doc if the server supplied one is 512 Bytes. Maybe other implications for spiders also. I might be wrong, but this is from some old memory. -Shawn Nate Tallman wrote: ErrorDocument 404 /path/to/some/script.php * $_SERVER['REDIRECT_URL'] (somehow misplaced underscore) On Thu, Jun 5, 2008 at 2:50 PM, Nate Tallman [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Why not just set: ErrorDocument 404 /path/to/some/script.php Then check $SERVER['REDIRECT_URL'] for the failed request. On Thu, Jun 5, 2008 at 2:41 PM, Shawn McKenzie [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Ryan S wrote: Hey, one of the things that make the php.net http://php.net site so cool is how easy it is to find info for a function or a list of topics.. eg: http://php.net/arrays http://php.net/count I'm sure nearly all of you reading this have done it more times than you would care to count, i'm trying to get something like this on my own site but even after going to php.net http://php.net and clicking on the view source buttons am a bit confused. basically this is what i am trying, people who type in http://www.mysite.com/asdf should not be shown a 404 not found page but instead asdf should be passed onto my script where i can do a search on the term and either give them back the results of that search or direct them to a custom 404 page. since i couldnt find the answer via php.net http://php.net's source i started messing around with how i *think* its done... tell me if i am on the correct track: when someone requests a page that does not exist, a .htaccess file them up and also takes the page name they were searching for and redirects them to a script... So far i have only been able to get the .htaccess file point to my custom 404 page... but how do i get it to pass the parameter of the not-found-page to my script? Would appreciate any code, tips, urls you can give me. Thanks! Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) If you use .htaccess and have mod_rewrite then it is simpler. Something like this (untested): IfModule mod_rewrite.c RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?term=$1 [L] /IfModule Then in index.php you can use the contents of $_GET['term'], which in your example would be asdf. [QSA,L] will give you the query string if the user typed in something like http://www.mysite.com/asdf?your=mom. Then $_GET['your'] = 'mom'. -Shawn --PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
Correction for my statement: As long as the content length is greater than 512 bytes, IE will display the content from the 404. Less than that and it will display it's own pretty message. http://www.404-error-page.com/404-error-page-too-short-problem-microsoft-ie.shtml http://www.mattcutts.com/blog/404-pages-in-google-toolbar/ On Thu, Jun 5, 2008 at 3:06 PM, Shawn McKenzie [EMAIL PROTECTED] wrote: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807 Also, why would you want Google let's say, to receive a 404 Not Found header for http://php.net/arrays??? -Shawn Nate Tallman wrote: Not true, Apache does return a 404, but IE will use the custom 404 page if it is available. Nate On Thu, Jun 5, 2008 at 2:57 PM, Shawn McKenzie [EMAIL PROTECTED]mailto: [EMAIL PROTECTED] wrote: As far as I remember, errordocument still send the code, in this case 404 to the client. In the case of IE, this will display IEs built-in error doc if the server supplied one is 512 Bytes. Maybe other implications for spiders also. I might be wrong, but this is from some old memory. -Shawn Nate Tallman wrote: ErrorDocument 404 /path/to/some/script.php * $_SERVER['REDIRECT_URL'] (somehow misplaced underscore) On Thu, Jun 5, 2008 at 2:50 PM, Nate Tallman [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Why not just set: ErrorDocument 404 /path/to/some/script.php Then check $SERVER['REDIRECT_URL'] for the failed request. On Thu, Jun 5, 2008 at 2:41 PM, Shawn McKenzie [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Ryan S wrote: Hey, one of the things that make the php.net http://php.net http://php.net site so cool is how easy it is to find info for a function or a list of topics.. eg: http://php.net/arrays http://php.net/count I'm sure nearly all of you reading this have done it more times than you would care to count, i'm trying to get something like this on my own site but even after going to php.net http://php.net http://php.net and clicking on the view source buttons am a bit confused. basically this is what i am trying, people who type in http://www.mysite.com/asdf should not be shown a 404 not found page but instead asdf should be passed onto my script where i can do a search on the term and either give them back the results of that search or direct them to a custom 404 page. since i couldnt find the answer via php.net http://php.net http://php.net's source i started messing around with how i *think* its done... tell me if i am on the correct track: when someone requests a page that does not exist, a .htaccess file them up and also takes the page name they were searching for and redirects them to a script... So far i have only been able to get the .htaccess file point to my custom 404 page... but how do i get it to pass the parameter of the not-found-page to my script? Would appreciate any code, tips, urls you can give me. Thanks! Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) If you use .htaccess and have mod_rewrite then it is simpler. Something like this (untested): IfModule mod_rewrite.c RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?term=$1 [L] /IfModule Then in index.php you can use the contents of $_GET['term'], which in your example would be asdf. [QSA,L] will give you the query string if the user typed in something like http://www.mysite.com/asdf?your=mom. Then $_GET['your'] = 'mom'. -Shawn --PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Search like php.net's URL thingy
Why is an ErrorDocument insufficient or not the elegant way? It accomplishes the goal in a clean way, no? Nate On Thu, Jun 5, 2008 at 3:25 PM, Yeti [EMAIL PROTECTED] wrote: still telling Ryan to produce errors is insufficient or at least not the elegant way On 6/5/08, Nate Tallman [EMAIL PROTECTED] wrote: Correction for my statement: As long as the content length is greater than 512 bytes, IE will display the content from the 404. Less than that and it will display it's own pretty message. http://www.404-error-page.com/404-error-page-too-short-problem-microsoft-ie.shtml http://www.mattcutts.com/blog/404-pages-in-google-toolbar/ On Thu, Jun 5, 2008 at 3:06 PM, Shawn McKenzie [EMAIL PROTECTED] wrote: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807 Also, why would you want Google let's say, to receive a 404 Not Found header for http://php.net/arrays??? -Shawn Nate Tallman wrote: Not true, Apache does return a 404, but IE will use the custom 404 page if it is available. Nate On Thu, Jun 5, 2008 at 2:57 PM, Shawn McKenzie [EMAIL PROTECTED] mailto: [EMAIL PROTECTED] wrote: As far as I remember, errordocument still send the code, in this case 404 to the client. In the case of IE, this will display IEs built-in error doc if the server supplied one is 512 Bytes. Maybe other implications for spiders also. I might be wrong, but this is from some old memory. -Shawn Nate Tallman wrote: ErrorDocument 404 /path/to/some/script.php * $_SERVER['REDIRECT_URL'] (somehow misplaced underscore) On Thu, Jun 5, 2008 at 2:50 PM, Nate Tallman [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Why not just set: ErrorDocument 404 /path/to/some/script.php Then check $SERVER['REDIRECT_URL'] for the failed request. On Thu, Jun 5, 2008 at 2:41 PM, Shawn McKenzie [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Ryan S wrote: Hey, one of the things that make the php.net http://php.net http://php.net site so cool is how easy it is to find info for a function or a list of topics.. eg: http://php.net/arrays http://php.net/count I'm sure nearly all of you reading this have done it more times than you would care to count, i'm trying to get something like this on my own site but even after going to php.net http://php.net http://php.net and clicking on the view source buttons am a bit confused. basically this is what i am trying, people who type in http://www.mysite.com/asdf should not be shown a 404 not found page but instead asdf should be passed onto my script where i can do a search on the term and either give them back the results of that search or direct them to a custom 404 page. since i couldnt find the answer via php.net http://php.net http://php.net's source i started messing around with how i *think* its done... tell me if i am on the correct track: when someone requests a page that does not exist, a .htaccess file them up and also takes the page name they were searching for and redirects them to a script... So far i have only been able to get the .htaccess file point to my custom 404 page... but how do i get it to pass the parameter of the not-found-page to my script? Would appreciate any code, tips, urls you can give me. Thanks! Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) If you use .htaccess and have mod_rewrite then it is simpler. Something like this (untested): IfModule mod_rewrite.c RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?term=$1 [L] /IfModule Then in index.php
Re: [PHP] Template system in PHP
Ditto on Eval() PHP is already a templating system. Why go the long way around? On Feb 12, 2008 10:13 AM, Greg Donald [EMAIL PROTECTED] wrote: On 2/12/08, Xavier de Lapeyre [EMAIL PROTECTED] wrote: Do any of you guys gurls know of a way to implement that template system. eval() is my favorite templating engine. http://php.net/eval -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP shell commands
To fix this scenerio, chroot would require different apache processes running under different users. On Jan 11, 2008 3:46 PM, Lucas Prado Melo [EMAIL PROTECTED] wrote: On Jan 11, 2008 2:16 PM, Daniel Brown [EMAIL PROTECTED] wrote: Make sure you change the permissions on the directory in which uploads are saved to be non-readable by anyone (including yourself, in case the scripts are suexec'd). For example, if the directory in which you save uploaded files is uploads/ then just do this (on a *nix box): chmod 300 uploads That way, files can still be saved to the directory (which requires write and execute privileges), but the files cannot be read or executed via the web, and directory listing is implicitly denied for all protocols (and local access) to anyone except root. The uploaded scripts must be executed via the web because it's a host... Maybe we could prevent scripts from certain folders to see other folders... (chroot?) Do you know how to do it in apache? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Internet Explorer Caching
that's from php.net... PHP scripts often generate dynamic content that must not be cached by the client browser or any proxy caches between the server and the client browser. Many proxies and clients can be forced to disable caching with: ?php header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past ? Note: You may find that your pages aren't cached even if you don't output all of the headers above. There are a number of options that users may be able to set for their browser that change its default caching behavior. By sending the headers above, you should override any settings that may otherwise cause the output of your script to be cached. Additionally, session_cache_limiter() and the session.cache_limiter configuration setting can be used to automatically generate the correct caching-related headers when sessions are being used. On 8/29/07, Satyam [EMAIL PROTECTED] wrote: I'm sending these headers: header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1 header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past I don't remember where I took them from, but they are working fine for me. Satyam - Original Message - From: Richard Heyes [EMAIL PROTECTED] To: Charlene [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Wednesday, August 29, 2007 5:50 PM Subject: Re: [PHP] Internet Explorer Caching Charlene wrote: I've been having problems with Internet Explorer caching php programs. I'm using the following code: header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Pragma, no-cache); header(Expires, -1); And it used to work, but now, according to Windows Explorer its giving it 3 hours to expire. Are you sure? By default PHP pages/scripts don't send any caching headers and hence don't get cached. You can check this using: http://www.fiddlertool.com -- Richard Heyes +44 (0)844 801 1072 http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.484 / Virus Database: 269.12.10/977 - Release Date: 28/08/2007 16:29 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- -Nate http://swapinvites.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] getting from one table listing from another
I know this is kinda crazy but I need it :P I have one table that lists name's and I have another table that has the name's and points I want to know how to list the name's of the first table by the points of the second table -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php + cURL issue
I'm adding additional bounty to my problem for anyone who can help me fix it. I'll send you a Rio Cali Sport 256 MB MP3 player - new in box. Comes with the sport ear buds, arm strap, few other accessories. You can google it for the details of it. Great for a stocking stuffer or as an extra gadget for kicks (as if we all dont have enough). =D To restate the problem for those that have forgotten, one server is working (win 2k, other is not win 2k3) - same code, same versions of everything. I've created a page for you to view the code / the verbose data / the phpInfo() for the two servers. Its a script to auto-login to a site - not particularly yahoo, the problem occurs with all cookie based logins, so using this yahoo script as an example. Again, the win2k server ==IS== working with that code - so its dosent appear to be a code issue. You can view the debug information here : http://70.84.198.254/index.html thanks again, Nate Nielsen [EMAIL PROTECTED] - Original Message - From: Curt Zirzow [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Friday, November 18, 2005 11:04 PM Subject: Re: [PHP] php + cURL issue On Fri, Nov 18, 2005 at 06:08:16PM -0600, Nate Nielsen wrote: Okay, I've added the verbose output to copare exactly what is happening between the two versions - thanks to Curt, the verbose info shows there IS something different happening. To recap, the code is exactly the same, the php version is the same (same files even), the php.ini is the same (except drive letters), the curl version is exactly the same (libcurl/7.14.0 OpenSSL/0.9.8 zlib/1.2.3). The only difference is that one server is Win2k and the other is Win2003 (and of course one is working and other is not). yeah, it does seem to be *not* a bug in curl versions. Now it is very clear that something different is happening on the two different servers. I've created a page to list the phpInfo() data, the code that is being run, and the VERBOSE information outputted by cURL. You can view the information here : http://70.84.198.254/index.html ok.. the key thing i noticed in that nice little side by side display you put together is this: When you are sending the first post data look at the end of it curl is complaining about something: Ok side: name=login_form.src=auc.tries=1.done=TML 4.01//EN.md5=.hash=.js=.partner=.slogin=adsherrouse.intl=us.fUpdate=.prelog=.bid=.aucid=.challenge=.01//EN.yplus=.chldID=pkg=hasMsgr=0passwd=doglogansubmit=Sign In HTTP/1.1 302 Found Bad Side: name=login_form.src=auc.tries=1.done=TML 4.01//EN.md5=.hash=.js=.partner=.slogin=adsherrouse.intl=us.fUpdate=.prelog=.bid=.aucid=.challenge=.01//EN.yplus=.chldID=pkg=hasMsgr=0passwd=doglogansubmit=Sign In* Curl_xxx_rcvs returned -1, block = TRUE You will notice that the ok side is sends back a 302 while the bad side is returning an error from curl. I'm not sure what that Curl_xxx_rcvs.. line means but it seems is the source of the problem. A other thing you would want to compare is the actual results that come back from the request. On the otherhand, what you seem to be doing is very likely to break sooner than later, i'm not sure why you want to proxy a complex web authentication system such as yahoo's Curt. -- -- 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] php + cURL issue
Okay, I've added the verbose output to copare exactly what is happening between the two versions - thanks to Curt, the verbose info shows there IS something different happening. To recap, the code is exactly the same, the php version is the same (same files even), the php.ini is the same (except drive letters), the curl version is exactly the same (libcurl/7.14.0 OpenSSL/0.9.8 zlib/1.2.3). The only difference is that one server is Win2k and the other is Win2003 (and of course one is working and other is not). Now it is very clear that something different is happening on the two different servers. I've created a page to list the phpInfo() data, the code that is being run, and the VERBOSE information outputted by cURL. You can view the information here : http://70.84.198.254/index.html You can see from looking at the verbose information that something is definitely happening differently on the dev/working server. Again, I'm putting a bounty on this issue. If you can help me fix this, 6 months of free hosting on one of my dedicated (you choose US or Germany) based server (with your own IP). If you dont need/want hosting, I'll give you some cash. Up to you. Any help is greatly GREATLY appreciated!! Thanks again, Nate Nielsen [EMAIL PROTECTED] - Original Message - From: Curt Zirzow [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Thursday, November 17, 2005 9:28 PM Subject: Re: [PHP] php + cURL issue On Thu, Nov 17, 2005 at 04:00:21PM -0600, Nate Nielsen wrote: I'm having an issue with cURL. I have installed it on two different boxes, one is working properly, and another isn't. The script auto login's a user to a site. One server it works as expected and logs the user in, the other it does not. It appears the cookie data that is being saved is different on the two machines from the login. what are the differences in the cookies? have you tried curl_setopt() with: curl_setopt($ch, CURLOPT_VERBOSE); curl_setopt($ch, CURLOPT_STDERR, $filehandle); // where to log have you looked at the output on the login request to ensure that the content is being returned as expected. What does the code look like? Curt. -- -- 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-DB] Drag and Drop with PHP and MySQL
You wont be able to do the drag and drop, but you can gracefully do multiple file uploads with flash (via flash 8). It also lets you know the progress of the file upload itself. I've done a snazzy picture upload tool for a Flex (generates flash applications on the fly with ActionScript and XML files only - no actual flash IDE) - it allows you to select a file, hit upload, shows a progress bar of the transfer (you can cancel at any time) - and when done, the image is made into a thumbnail and shown on the screen. -obviously, no page reloads and totally cross compatible. I wouldnt know where to start with regular flash as I'm a programmer, so only Flex appeals to me - but I know it can be done, and isnt extremely complicated. My guess is that you could have a flash guru whip something out pretty fast. =) -Nate Nielsen [EMAIL PROTECTED] - Original Message - From: Jasper Bryant-Greene [EMAIL PROTECTED] To: Joe Harman [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Friday, November 18, 2005 8:52 PM Subject: Re: [PHP] Re: [PHP-DB] Drag and Drop with PHP and MySQL Joe Harman wrote: Hi Chris, I would think that there has to be something out there like a Javascript that would accomplish that... that would be my first guess anyhow... there possibly could be something done in flash that would act as a drop area for the file... let us know what you find Joe There's no way the browser is going to let JS have access to the user's filesystem. I would expect ditto for Flash, although I don't use it. Jasper On 11/18/05, Micah Stevens [EMAIL PROTECTED] wrote: No. That would be nice though eh? What I have done in the past is when a user needs to upload a file, I give them a linked button that links to a ftp:// style address. This ftp account points to a directory that PHP can have access to. The user then drags and drops (IE only) the files on this new window, which uploads the files to this directory. Once they're done, they close the window, and hit a second button 'Click here when finished uploading' which tells php to grab all the files in the upload directory and put them where they need to go. This is far from ideal, causes miserable problems when more than one person is using the technique at once, and offers a host of security and usability issues. Oh, and it's IE only, Firefox can't do this, and I don't think opera/safari can either. However, it's much better than uploading a ton of files individually using a form. I only use this for applications where I can be sure that only one user will use it at once, and they're trusted. In a pinch it works though. I don't care so much about drag and drop, I was just trying to solve the multi-file upload issue. I wish there was a better way. If I'm stupid and there is, I'd love to hear about it. -Micah On Friday 18 November 2005 5:42 pm, Chris Payne wrote: HI there everyone, I have a file upload system where you select via requester the file to upload, it then uploads it with PHP and stores the info in a MySQL database. Is there an interface / programming method I can use which I can DRAG a file from the desktop into an area in a form just as if I had used a file requester to select a file? Learning a new programming technique is no problem as long as it can be used with PHP and MYSQL. Any helps / pointers would be REALLY welcome. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Joe Harman - Do not go where the path may lead, go instead where there is no path and leave a trail. - Ralph Waldo Emerson -- 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 + cURL issue
I'm having an issue with cURL. I have installed it on two different boxes, one is working properly, and another isn't. The script auto login's a user to a site. One server it works as expected and logs the user in, the other it does not. It appears the cookie data that is being saved is different on the two machines from the login. The code itself is identical. The result on the two servers is different. I've fiddled with this thing for a couple weeks, and now its too late to mess with it anymore as I have a launch target I need to hit. What I'd like is a php / IIS guru to help me fix this. I will give you remote desktop access to the server and you can take it away from there. I just need you to get the script running on the server the same as the other. The script is already there, its very simplistic, only about 50 lines or so, no database interaction, nothing fancy at all. I'm not a strong PHP guy, so its very simplistic. (again though, it works on other server, so its not a code issue) In return, I'll give you free hosting on one of my dedicated servers for 6 months. This is not your average shared hosting, I dont host sites for a living, I only host clients I code for - so there is only a handful of people on each server. In fact, the server you will be on, you will be the only person on it at this time. You'll have access to PHP (obviously), ColdFusion MX 7 (the latest, greatest version), MSSQL 2k and/or mySQL (different server), and if you need additional services, we can work that out. Please email me if you are interested in helping or if you have any ideas please!! Thanks in advance! - Nate Nielsen [EMAIL PROTECTED]
Re: [PHP] php + cURL issue
also, as another note - the php version and cURL version is identical on the two machines - the main difference between them being that one is windows 2k server and the other one is windows 2k3 server (std ed) any ideas ? thanks - Original Message - From: Nate Nielsen [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Thursday, November 17, 2005 4:00 PM Subject: [PHP] php + cURL issue I'm having an issue with cURL. I have installed it on two different boxes, one is working properly, and another isn't. The script auto login's a user to a site. One server it works as expected and logs the user in, the other it does not. It appears the cookie data that is being saved is different on the two machines from the login. The code itself is identical. The result on the two servers is different. I've fiddled with this thing for a couple weeks, and now its too late to mess with it anymore as I have a launch target I need to hit. What I'd like is a php / IIS guru to help me fix this. I will give you remote desktop access to the server and you can take it away from there. I just need you to get the script running on the server the same as the other. The script is already there, its very simplistic, only about 50 lines or so, no database interaction, nothing fancy at all. I'm not a strong PHP guy, so its very simplistic. (again though, it works on other server, so its not a code issue) In return, I'll give you free hosting on one of my dedicated servers for 6 months. This is not your average shared hosting, I dont host sites for a living, I only host clients I code for - so there is only a handful of people on each server. In fact, the server you will be on, you will be the only person on it at this time. You'll have access to PHP (obviously), ColdFusion MX 7 (the latest, greatest version), MSSQL 2k and/or mySQL (different server), and if you need additional services, we can work that out. Please email me if you are interested in helping or if you have any ideas please!! Thanks in advance! - Nate Nielsen [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] auto reply framework
I'm working on the design of a program for sending automatic messages to users, based on certain conditions. It seems like there should be some sort of framework for this sort of thing, but I'm not sure what it would be called, besides auto-reply framework. I didn't find anything when searching for that. Here's an example of what I'm talking about: Message M0 should be sent to - all current users of service S - where membership expiration is in 30 days from today Message M1 should be sent to - all current users of service S - where membership level == premium - where signup date was 45 days ago Message M2 should be sent to - former users of service S - where membership expiration was at least 30 days ago Message M3 should be sent to - former users of service S - where membership expiration was at least 60 days ago - where user already got message M2 at least 30 days ago Etc. Etc. So the point is that I need to be able to set up rules for what each message contains, and when each message should be sent, based on selected conditions. Is there anything out there (PHP/Mysql solution preferably) that might give some help with something like this? Thanks, Nate
[PHP] regex issue
All I want to do is capture the keyword (array, break, echo, etc) and color it. --- $txt = this is an array('test'); $pattern = /(array|break|echo|continue)([\(.|\s.|\;.])/; echo preg_replace($pattern, 'font color=red$0/font', $txt); This captures array( though and I just want array. Thanks for pointing out my stupidity, Nate Sanden [EMAIL PROTECTED] http://www.savingadvice.com
RE: [PHP] regex issue
I don't want to match something like linear though. I only want to match line or line( or line; and only replace the line portion of it. Thanks, Nate -Original Message- From: Greg Donald [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 30, 2004 5:36 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] regex issue On Tue, 30 Nov 2004 17:18:33 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: All I want to do is capture the keyword (array, break, echo, etc) and color it. I'd do it like this: $source = 'this is a line of text'; $term = 'line'; $text = eregi_replace(($term), font color=red\\1/font, $source); -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.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
[PHP] paypal ipn - subscriptions
I'm creating a subscription service where customers will signup and pay $X per month to have access to this service. I've done the easy part, which is communicating back and forth with paypal. Anytime a transaction is made, it's sent to my ipn.php script. The part I'm having difficulty with is figuring out how to manage who does and doesn't have access to the service based on what paypal sends me. It looks like there are 6 different transaction types possible for subscriptions. subscr_signup subscr_cancel subscr_modify subscr_failed subscr_payment subscr_eot For example, what if someone cancels their subscription? I don't think I can turn off their service immediately because their month might not be over yet. Another thought. Would I just mark their account active if they are subscr_signup or subscr_payment and leave it at that unless paypal tells me otherwise (from subscr_failed, or subscr_cancel, or subscr_eot). OR should I record the date of the subscr_signup or subscr_payment and only allow them access for one month after that date? Anyone have experience creating something like this? Would really appreciate hearing how you did it. Or if you haven't, but have ideas, let me know! Thanks! Nate
RE: [PHP] Sessions: I don't get it!!
Looks like you're making it way more complicated than it needs to be. PHP will automatically tack on the Session ID tag to your local url's, but only if it needs to. There is no need to append the SID to url's manually. Nate -Original Message- From: Don [mailto:[EMAIL PROTECTED] Sent: Sunday, November 14, 2004 9:54 PM To: [EMAIL PROTECTED] Subject: [PHP] Sessions: I don't get it!! I'd like to do something with sessions that should be easy. But I'm new to this, and obviously I'm missing something somewhere... I want to use cookies if the visitor allows, but tack the session info (SID) get style on the URL of a linked page *only if* the visitor blocks cookies. I've tried a lot of variations, but nothing really works. I either get the entire SID value in the URL (even if cookies are accepted), or the SID doesn't show up in the URL, which means it works only with visitors who accept cookies. Below is my most recent attempt. simple.php detects whether the visitor accepts cookies by forcing a page reload (my thanks to Chris Shiflett), then attempts a redirection, based on whether cookies are accepted. Doesn't work. Anyone got any ideas? TIA. - ? # simple.php ini_set('session.use_trans_sid', 0); ini_set('session.use_cookies', 1); ini_set('register_globals', 0); session_start(); if (! isset($_GET['cac'])) { header('Set-Cookie: accept_cookies=yes'); header('Location: ' . $_SERVER['PHP_SELF'] . '?cac=1'); } $_SESSION['accepts_cookies'] = isset($_COOKIE['accept_cookies']); $_SESSION['session_num'] = session_id(); if ($_SESSION['accepts_cookies']) { header('location: simple2.php'); } else { header('location: simple2.php?'. strip_tags(SID)); } die; ? -- ? # simple2.php //ini_set('session.use_trans_sid', 0); //ini_set('session.use_cookies', 1); //ini_set('session.use_only_cookies', 1); //ini_set('register_globals', 0); session_start(); ? html head titleProcessing Error/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body ? echo Old Session ID: . $_SESSION['session_num'] . br; echo This Session ID: . session_id() . br; echo SID: . SID . br; ? blockquote ? echo ? /blockquote /body /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] Display an image
You'll need to create a separate php page called image.php or something and retrieve the $mydata2-photo and output it to the browser. img src='image.php?id=1' image.php --- $sql = select where id = '$id'; echo $mydata2-photo; Nate -Original Message- From: John Taylor-Johnston [mailto:[EMAIL PROTECTED] Sent: Friday, November 12, 2004 9:29 PM To: [EMAIL PROTECTED] Cc: John Taylor-Johnston Subject: [PHP] Display an image I have a longblob with a jpeg loaded in it. But how do I display it? `photo` longblob NOT NULL, This doesn't work :) I need header information, etc. So what does? echo img src=.$mydata2-photo.\n; I don't have an example to work with. John --snip- $sql2 = select * from .$db...$table; $news2 = mysql_query($sql2); echo img src=.$mydata2-photo.\n; echo h3$mydata2-Rank $mydata2-Name/h3\n; echo smalli$mydata2-biography/i/small\n; } -- 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] Detecting image types for uploaded images
What about mime_content_type()... see what that returns. Nate -Original Message- From: Karthik [mailto:[EMAIL PROTECTED] Sent: Monday, November 08, 2004 12:35 AM To: [EMAIL PROTECTED] Subject: [PHP] Detecting image types for uploaded images Hi, How do I differentiate between progressive and standard jpegs for files already on the server ? getimagesize does return a mime type, but doesn't seem to differentiate between image/jpeg and image/pjpeg and returns image/jpeg for all jpeg images. Any ideas? Thanks -K -- 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] recursive function not returning anything..
function recursePathLookup($CatID, $Path = array()) { //Get the catid for this subcat $sql = SELECT SubCategoryID, Name FROM categories WHERE CategoryID = '.$CatID.'; $query = mysql_query($sql); if(mysql_num_rows($query) == 1) { $data = mysql_fetch_array($query); $Path[] = $data[Name]; recursePathLookup($data[SubCategoryID], $Path); } else { //print_r($Path); return $Path; } } print_r(recursePathLookup(2)); Any ideas why when I uncomment the //print_r($Path) inside the function it prints the value fine, but when I try to return the value and print it outside the function I get nothing? Thanks, Nate
RE: [PHP] Re: recursive function not returning anything..
Of course! Thank you. Nate -Original Message- From: M. Sokolewicz [mailto:[EMAIL PROTECTED] Sent: Sunday, November 07, 2004 11:03 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: recursive function not returning anything.. [EMAIL PROTECTED] wrote: function recursePathLookup($CatID, $Path = array()) { //Get the catid for this subcat $sql = SELECT SubCategoryID, Name FROM categories WHERE CategoryID = '.$CatID.'; $query = mysql_query($sql); if(mysql_num_rows($query) == 1) { $data = mysql_fetch_array($query); $Path[] = $data[Name]; recursePathLookup($data[SubCategoryID], $Path); change to: return recursePathLookup($data[SubCategoryID], $Path); } else { //print_r($Path); return $Path; } } print_r(recursePathLookup(2)); Any ideas why when I uncomment the //print_r($Path) inside the function it prints the value fine, but when I try to return the value and print it outside the function I get nothing? Thanks, Nate -- 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] Pb'lm of Regular Expression
These MIGHT work... I don't know though (not too good with regex). img.+src=\(.+)\.+ a.+href=\(.+)\.+ Nate -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Sunday, November 07, 2004 10:29 PM To: [EMAIL PROTECTED] Subject: [PHP] Pb'lm of Regular Expression Hi to all My problem is that i want to create one regular expression which can fatch this image tag from my site img src=\https://abc.com/first.php? site_id=abcaid=keyinlid=keyinref=q=\ width=\1\ height=\1\; ?php $value = print_links(http://www.mysite.com;); function print_links($url) { $page_contents = file_get_contents($url); preg_match_all(/*/,$page_contents,$match_array); print pre; print_r($match_array); print /pre; foreach ($match_array as $entry) { print(The image Tag is :); } } ? Now what regular expression i write so i can fetch the image tag from my site of above syntex.And if possible send me the regular expression of fetching A href=/A Thnx in Advance. Ankur Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: NMax
Yeah definitely use COUNT(*) or mysql_num_rows() function. Nate -Original Message- From: David Schlotfeldt [mailto:[EMAIL PROTECTED] Sent: Saturday, November 06, 2004 9:19 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: NMax You could do it in a SQL statement SELECT COUNT(*) FROM table_name; This is less system intensive. David John Taylor-Johnston wrote: I might add, I do this, think there must be a better way? $mycounter = 0; while ($mydata = mysql_fetch_object($news)) { $mycounter++; } John Taylor-Johnston wrote: How can I calculate how many records I have in a table? John -- 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] best way to store images
I'm trying to plan out the best way to develop an image hosting script for my client. I'd like to use the least CPU intensive way assuming 10's of thousands of images in this system. Disk space is less important, as that seems to be a cheaper upgrade than memory/CPU would be. There are basically 2 scenarios I've come up with but I'm open to other ideas: 1) Store images on the file system - and the image information (file name, timestamp, size, dimensions, type, etc) in MySQL. 2) Store images in MySQL table 1 and their corresponding information in table 2. Also for each image request I'd like to record bandwidth usage and probably other statistics in MySQL so assume at least this one query on MySQL for each image request (if not 2 queries if I store the image itself in MySQL). Lastly, I will use mod_rewrite so clients can access images by their name rather than a php page. So I guess my questions are which scenario do you think is best and would because mod_rewrite uses a little more overhead would that be a major issue assuming a busy site? Thanks for your help! Nate
RE: [PHP] Big table dump stopping in between
Why on earth would you want to echo 80k rows?? :) Anyways... 1) If you have safe mode on, set_time_limit doesn't work. 2) You might check your max_execution_time value defined in the php.ini Nate -Original Message- From: Ritesh Nadhani [mailto:[EMAIL PROTECTED] Sent: Friday, November 05, 2004 9:43 PM To: [EMAIL PROTECTED] Subject: [PHP] Big table dump stopping in between Hello, I have a PHP page. In the script I connect to one our tables having more then 80K rows and dump the data using echo command. When I run this page from my browser, the process always stops half way thru and only half the data is dumped. I can reproduce this problem everytime. I am on a 512Kbps DSL line. By stopping i mean from IE, about 50K rows are dumped and then the process stops. I have even tried: set_time_limit (0) so that we have unlimited timeout but its still giving the same error. Do I need to configure something in the server so that complete data is dumped? Ritesh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: check is pop address
Well one thing that springs to mind is you could try to connect to their mail server on port 110 995 and see if you get a response. Thats not foolproof but that might be a good place to start... -nate Philip S wrote: Hi there, I was wondering whether someone could tell me whether it is possible to use PHP to check whether a user supplied email address is a pop address as opposed to a web based address like hotmail. Have done some searching but cant seem to turn any answers up. Thanx in advance for any replys, Phil S -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: What does this do?
Hey Stephen, Check this out: ?php $bob = dog; $joe = bob; print ${bob}; print BR; print ${$joe}; ? -Nate Stephen Goddard wrote: Hi, Can anyone tell me what this does ${varname} I cant find any information as to what the braces do. Cheers Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] regex
hi, i need to search $final_footer for a string such as %INCLUDE_FILE[/path/to/file]% (where /path/to/file could be anything) and delete it from the string. it being %INCLUDE_FILE[/path/to/file]% (not just /path/to/file) im new to regexps but im guessing I should use preg_match for this? Can someone give me a code example? thanks much Nate -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: how to pass variable for $_GET
stripslashes(\'2003-1-3 00:00:01\' AND \'2003-3-10 23:59:59\'); Domintcom [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] ok - found urldecode which is now giving me the following; \'2003-1-3 00:00:01\' AND \'2003-3-10 23:59:59\' original string; '2003-1-3 00:00:01' AND '2003-3-10 23:59:59' Domintcom [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] ok - I know how to pass these variables by appending variables to the link. however, I'm trying to pass the following string; '2003-1-1 00:00:01' AND '2003-3-20 23:59:59' now - when I pass it what I get is the following; date='2003-2-1%2000:00:01'%20AND%20'2003-3-1%2023:59:59' it seems what I'm going to have to do is replace %20 with a space, but I'm unclear of how to do that with php. thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] regex
Thanks! That worked almost. It removed everything except for the 2 % signs. How might I remove those as well? Leif K-Brooks [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... Try this (entirely untested!): $final_footer = preg_replace('%INCLUDE_FILE\\[[^\\]]*\\]%','',$final_footer); Nate wrote: hi, i need to search $final_footer for a string such as %INCLUDE_FILE[/path/to/file]% (where /path/to/file could be anything) and delete it from the string. it being %INCLUDE_FILE[/path/to/file]% (not just /path/to/file) im new to regexps but im guessing I should use preg_match for this? Can someone give me a code example? thanks much Nate -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] regex
Thanks! That worked almost. It removed everything except for the 2 % signs. How might I remove those as well? Leif K-Brooks [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Try this (entirely untested!): $final_footer = preg_replace('%INCLUDE_FILE\\[[^\\]]*\\]%','',$final_footer); Nate wrote: hi, i need to search $final_footer for a string such as %INCLUDE_FILE[/path/to/file]% (where /path/to/file could be anything) and delete it from the string. it being %INCLUDE_FILE[/path/to/file]% (not just /path/to/file) im new to regexps but im guessing I should use preg_match for this? Can someone give me a code example? thanks much Nate -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] regex
Worked great. Thanks so much. Leif K-Brooks [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Whoops! Try this: preg_replace('|%INCLUDE_FILE\\[[^\\]]*\\]%|','',$final_footer); Nate Sanden wrote: Thanks! That worked almost. It removed everything except for the 2 % signs. How might I remove those as well? Leif K-Brooks [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Try this (entirely untested!): $final_footer = preg_replace('%INCLUDE_FILE\\[[^\\]]*\\]%','',$final_footer); Nate wrote: hi, i need to search $final_footer for a string such as %INCLUDE_FILE[/path/to/file]% (where /path/to/file could be anything) and delete it from the string. it being %INCLUDE_FILE[/path/to/file]% (not just /path/to/file) im new to regexps but im guessing I should use preg_match for this? Can someone give me a code example? thanks much Nate -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Function or GD problem?
Function or GD problem... I have a strange problem here, hoping someone can help. The following code works great but when I make it into a function it doesn't error but it gives a RED X image. PHP: ?php include(functions.inc.php); $size = getimagesize(uploads/$src); if ($size[2]==2) { $sourceimg = imagecreatefromjpeg($full_img_url/$src) OR DIE(DIED); if($size[0]$size[1]) { if($size[1]$height) { $height1=$size[1]; } else { $height1=$height; } $width1=($size[0]*$height1)/$size[1]; } else { if($size[0]$width) { $width1=$size[0]; } else { $width1=$width; } $height1=($size[1]*$width1)/$size[0]; } Header(Content-type: image/jpeg); $destimg = imagecreatetruecolor($width1,$height1) OR DIE(DIED); //Try to resample (needs GD 2) if(imagecopyresampled($destimg, $sourceimg, 0,0,0,0, $width1, $height1, $size[0], $size[1])) { } elseif(imagecopyresized($destimg, $sourceimg, 0,0,0,0, $width1, $height1, $size[0], $size[1])) { } else { //HTML RESIZE } imagejpeg($destimg,'',76) OR DIE(DIED); imagedestroy($destimg) OR DIE(DIED); } } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Function or GD problem?
Hi, thanks for your help but im not sure what you mean. My image php page is http://www.maxamplify.com/maxgallery/admin/test.php?src=img.jpg This contains the exact same code I posted below. However if i make that into a function it gives me a red X as you can see here: http://www.maxamplify.com/maxgallery/admin/test1.php?src=img.jpg Just to clarify, im doing a function like -- function ResizeJPG($src) { global $full_img_url; //code below } ResizeJPG($src); -- Thanks for your help! Nate Hugh Danaher [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] In the receiving page, change your link from an img src= tag to an a href= then see what the error message says. Hugh - Original Message - From: Nate [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 16, 2003 2:55 PM Subject: [PHP] Function or GD problem? Function or GD problem... I have a strange problem here, hoping someone can help. The following code works great but when I make it into a function it doesn't error but it gives a RED X image. PHP: ?php include(functions.inc.php); $size = getimagesize(uploads/$src); if ($size[2]==2) { $sourceimg = imagecreatefromjpeg($full_img_url/$src) OR DIE(DIED); if($size[0]$size[1]) { if($size[1]$height) { $height1=$size[1]; } else { $height1=$height; } $width1=($size[0]*$height1)/$size[1]; } else { if($size[0]$width) { $width1=$size[0]; } else { $width1=$width; } $height1=($size[1]*$width1)/$size[0]; } Header(Content-type: image/jpeg); $destimg = imagecreatetruecolor($width1,$height1) OR DIE(DIED); //Try to resample (needs GD 2) if(imagecopyresampled($destimg, $sourceimg, 0,0,0,0, $width1, $height1, $size[0], $size[1])) { } elseif(imagecopyresized($destimg, $sourceimg, 0,0,0,0, $width1, $height1, $size[0], $size[1])) { } else { //HTML RESIZE } imagejpeg($destimg,'',76) OR DIE(DIED); imagedestroy($destimg) OR DIE(DIED); } } ? -- 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] file-upload.errors
Hi guys, I'm curious about a couple things regarding: $_FILES['userfile']['error'] (On page: http://www.php.net/manual/tw/features.file-upload.errors.php ) and also input type=hidden name=MAX_FILE_SIZE value=500 The manual says Since PHP 4.2.0, PHP returns an appropriate error code along with the file array. The error code can be found in the ['error'] segment of the file array that is created during the file upload by PHP. In otherwords, the error might be found in $_FILES['userfile']['error']. So if I get error: Value: 2; The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form. Does this mean the file was examined by the browser and it determined it was too large OR does it have to upload the file temporarily and then check to see if its too large? It sounds like browser would first examine the file before it gets uploaded, however, if I try to upload a 1mb file it takes noticably longer to produce an error than say a 501 byte file. Please anyone that can help me with this I would really appreciate it. Thanks, Nate -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file-upload.errors
So something like my below function isn't going to work because the file HAS to be uploaded temporarily for it to fopen? The ONLY possible way to check it is with javascript then? Anyone know where I could find some code to do that? $maxbytes=500; function ImageSizeCheck($img,$maxbytes,$arewegood,$size) { $fp = fopen($img, r); $first_file_size_read = fread($fp, $maxbytes + 1); fclose($fp); if(strlen($first_file_size_read) $maxbytes) { $arewegood=0; $size=strlen($first_file_size_read)-1; } else { $arewegood=1; $size=strlen($first_file_size_read)-1; } } Marco Tabini [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Mon, 2003-02-17 at 21:44, Nate wrote: Does this mean the file was examined by the browser and it determined it was too large OR does it have to upload the file temporarily and then check to see if its too large? It sounds like browser would first examine the file before it gets uploaded, however, if I try to upload a 1mb file it takes noticably longer to produce an error than say a 501 byte file. Please anyone that can help me with this I would really appreciate it. The browser *should* check but it doesn't. In fact, the limit that's being exceeded is probably the one set in your php.ini configuration file. In any case, it's generally a bad idea to trust the client with performing any checks for anything other than the convenience of the user, because it's very easy for a malicious user to send out a request that contains completely arbitrary data ignoring completely all the controls that are built into your HTML file. Cheers, Marco -- php|architect - The Monthly Magazine for PHP Professionals Come check us out on the web at http://www.phparch.com! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Protecting files
Just something that crossed my mind a few times. What if another website includes this file in their own php page. That site can't access those variables can they? (I'm sure PHP wouldn't allow that but I need to put this curiousity to rest) Nate Bryan Lipscy [EMAIL PROTECTED] wrote in message 005301c2d6dd$47a11250$6301a8c0@ukiuki">news:005301c2d6dd$47a11250$6301a8c0@ukiuki... How can I protect my php files among other files like templates (.inc) and mysql config (config.inc) files being copied/read/imported (front page)/used by other applications other than my site... can this be done by htaccess? is so , could anyone point me into right direction? I have renamed my sensitive (those containing l/p for mail and mysql) files to .php and constructed them to render a blank page if ever directly called. Something like this: ? All the sensitive code $db_login = user; $db_pwd = password; $mail_login = mail; $mail_pwd = pass; ? htmlhead/headbody/body/html I do not think that -r to everyone would work in that Apache still needs to read the file when included by another script. Still looking for a better way. What concerns me the most is if a code disclosure bug is later discovered in 4.3.0 or another version. Bryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Protecting files
I wonder though, if they're on a the same server but different sites. Like a shared host environment. Aw the things the bewilder the mind. Nate Bryan Lipscy [EMAIL PROTECTED] wrote in message 01c2d710$81a68e20$6301a8c0@ukiuki">news:01c2d710$81a68e20$6301a8c0@ukiuki... That is called Cross-Site Scripting (XSS). I have not been able to get access to the variables via an XSS exploit. It appears that Apache renders the php code before sending off the requesting include function. I also like the .htaccess way of preventing user access to the scripts. This is also worthy of further investigation. Bryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fw: help plz server
- Original Message - From: Maxim Maletsky [EMAIL PROTECTED] To: Nate [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, February 10, 2003 5:42 AM Subject: Re: help plz server please forward this email to `[EMAIL PROTECTED]' -- Maxim Maletsky [EMAIL PROTECTED] Nate [EMAIL PROTECTED] wrote... : ok i have a problem my computer/server got messed up a week ago i just got my server back up and i installed php well my requires and includes don't work my path is this: include_path = ..;c:\inetpub\wwwroot i dunno what's up with it it should work but it keeps coming up with this: Warning: main(/includes/functions.inc) [function.main]: failed to create stream: No such file or directory in c:\inetpub\wwwroot\stats\include.php on line 1 Fatal error: main() [function.main]: Failed opening required '/includes/functions.inc' (include_path='..;c:\inetpub\wwwroot\') in c:\inetpub\wwwroot\stats\include.php on line 1 the page resides in c:\inetpub\wwwroot\stats\ this is the code for the page: ? require('/includes/functions.inc'); ? HTML HEAD meta name=Description content=BFD's Stat Page ?PHP require (/includes/Sec.inc); if (isset($_REQUEST['inc'])) require ($_REQUEST['inc']); else require (index.php); require (/includes/parts/bottom.inc); ? can ya help me at all? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: session
Try establishing the variables first then register them as session variables. I guess you can't access the session variable directly so that may also mean you cannot set the session variable if you have nothing to actually put in it... : ) R. Lindeman [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... okay i've posted something before here are my scripts either you tell me what i do wrong or i'll go beserk you can check the outcome of the code on the following adress http://www.filenexus.com/piet.php here's the code for piet.php : ?php // open session and begin registering values session_start(); session_register(fubar1); session_register(fubar2); session_register(fubar3); $fubar1=Remko; $fubar2=Lindeman; $fubar3=I3M1I; header(Location: retief.php?.SID); ? here's the code for retief.php : ?php // begin the retrieval of propagated values $remko = $HTTP_SESSION_VARS[fubar1]; $lindeman = $HTTP_SESSION_VARS[fubar2]; $klas = $HTTP_SESSION_VARS[fubar3]; echo $remko; echo $lindeman; echo $klas; ? the problem is that the values don't get registered -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: session
Opps ... sorry I jumped too soon at answering that.. But from what I can tell the header function is screwing you up probly because it is like a redirect. If you register session data I would think it would have to be sent in the header to the client.. Maybe a workaround would be to echo vb or java script to redirect instead of redirecting from the server.. That way the header info would be written... so try this... in place of the header function... echo script language='vbscript'\n; echo location.href=\retief.php?.SID.\\n; echo /script\n; Nate [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Try establishing the variables first then register them as session variables. I guess you can't access the session variable directly so that may also mean you cannot set the session variable if you have nothing to actually put in it... : ) R. Lindeman [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... okay i've posted something before here are my scripts either you tell me what i do wrong or i'll go beserk you can check the outcome of the code on the following adress http://www.filenexus.com/piet.php here's the code for piet.php : ?php // open session and begin registering values session_start(); session_register(fubar1); session_register(fubar2); session_register(fubar3); $fubar1=Remko; $fubar2=Lindeman; $fubar3=I3M1I; header(Location: retief.php?.SID); ? here's the code for retief.php : ?php // begin the retrieval of propagated values $remko = $HTTP_SESSION_VARS[fubar1]; $lindeman = $HTTP_SESSION_VARS[fubar2]; $klas = $HTTP_SESSION_VARS[fubar3]; echo $remko; echo $lindeman; echo $klas; ? the problem is that the values don't get registered -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] class instance name
How do you determine the class instance name from within the class? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] class instance name
How do you determine the class instance name from within the class? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] class instance name
No because it isn't the name of the class I want it is the name of the instance of the class... Martin Towell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... or are you referring to this? http://www.php.net/manual/en/function.get-class.php (a function that I keep forgetting about) Martin -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 02, 2002 9:53 AM To: Nate Cc: [EMAIL PROTECTED] Subject: Re: [PHP] class instance name On Monday, April 1, 2002, at 06:24 PM, Nate wrote: How do you determine the class instance name from within the class? Isn't it $this ? Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- 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 user_auth script. The Script
You have the ending } for the if statement? Nate - Original Message - From: Matthew Darcy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 12, 2002 12:57 AM Subject: RE: [PHP] a user_auth script. The Script was hoping someone else would see the errors I can't. I'll re-post the script. Matt. -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: 12 February 2002 07:04 To: [EMAIL PROTECTED] Subject: Re: [PHP] a user_auth script. The Script On Tuesday 12 February 2002 07:11, Matthew Darcy wrote: spotted 1 error already missing the starting after the printf statment. Any more ? -Original Message- From: Matthew Darcy [mailto:[EMAIL PROTECTED]] Sent: 11 February 2002 23:09 To: Roy Cabaniss; php Subject: RE: [PHP] a user_auth script. The Script ?php include(../dbconnect.php); if ($submit == sign!) { $admin_string_auth=(select account_name, account_password, account_admin_level from account_details where account_name='$login_name') or die (Cant run auth string); [snip] In cases like these, it is always a good idea to point out which is the line in question. Earlier posts mentioned line 55, but without manually counting, how are we going to know which is line 55? Plus, after going through the mail system, what was originally line 55, may not be line 55 anymore. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* George Orwell 1984. Northwestern 0. -- Chicago Reader 10/15/82 */ -- 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] Cache Being Bad
I have a text box on my page and a submit button. The text box value is whatever it grabs from the database. If the user deletes what is in the text box and puts in his own text, then hits submit, the script updates that field with whatever the user inputs. Problem is, after the user hits submit, it APPEARS as though the new text was not submitted because the old text is still in the box. Yet when he refreshes the page it shows the new text. Does that make sense? How do I make it so the new text shows up without him having to refresh. Also I don't want to do a redirect because I want to print a message Info submitted when the user hits submit. I have tried: function cache_control($maxage=0) { $Modified = Last-modified: .gmdate(D, d M Y H:i:s, time()). GMT; $Expires = Expires: .gmdate(D, d M Y H:i:s, time() + $maxage). GMT; $CacheControl = Cache-Control: must-revalidate, max-age=.$maxage., ; $CacheControl.= s-max-age=.$maxage; Header($CacheControl); Header($Modified); Header($Expires); } cache_control(0); Thanks so much for reading, Nate
Re: [PHP] Cache Being Bad
Nevermind everyone. I was just being an idiot and fetching from the database BEFORE updating it. Well maybe this will at least help some people not make the same stupid mistake. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 11, 2002 8:19 PM Subject: [PHP] Cache Being Bad I have a text box on my page and a submit button. The text box value is whatever it grabs from the database. If the user deletes what is in the text box and puts in his own text, then hits submit, the script updates that field with whatever the user inputs. Problem is, after the user hits submit, it APPEARS as though the new text was not submitted because the old text is still in the box. Yet when he refreshes the page it shows the new text. Does that make sense? How do I make it so the new text shows up without him having to refresh. Also I don't want to do a redirect because I want to print a message Info submitted when the user hits submit. I have tried: function cache_control($maxage=0) $Modified = Last-modified: .gmdate(D, d M Y H:i:s, time()). GMT; $Expires = Expires: .gmdate(D, d M Y H:i:s, time() + $maxage). GMT; $CacheControl = Cache-Control: must-revalidate, max-age=.$maxage., ; $CacheControl.= s-max-age=.$maxage; Header($CacheControl); Header($Modified); Header($Expires); } cache_control(0); Thanks so much for reading, Nate -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Example code for multiple uploads? (Using PHP 4.0.6)
I'm trying to create a form that supports multiple uploads (of up to 4 files), but does not require each of them. I've tried all the code examples in the PHP documentation, and they don't appear to work with PHP 4.0.6. Basically, I get the file names returned in the arrays, but the array that should contain the name of the temporary file just says 'none'. Things work fine for a single upload. Does anyone have example code for this? Thanks! :) -- Nate Carlson [EMAIL PROTECTED] | Phone : (952)943-8700 http://www.real-time.com| Fax : (952)943-8500 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Example code for multiple uploads? (Using PHP 4.0.6)
On Fri, 16 Nov 2001, George Whiffen wrote: Multi loads are fine for me in 4.0.3 at least, but I don't use arrays, each upload has a different name (I gave up on form arrays at IE 3!). Have you tried giving them unique names? I was hoping to avoid that. :) I'll give it a shot, though. Thanks! -- Nate Carlson [EMAIL PROTECTED] | Phone : (952)943-8700 http://www.real-time.com| Fax : (952)943-8500 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] php javascript
Hey all! I'm including some javascript that enables a button in a form input type=button name=CheckAll value=Check All onClick=checkAll(document.myform.email)to check all the check boxes at once. (I have an array of check boxes from a mysql db) I use: SCRIPT LANGUAGE=JavaScript !-- Begin function checkAll(field) { for (i = 0; i field.length; i++) field[i].checked = true ; } function uncheckAll(field) { for (i = 0; i field.length; i++) field[i].checked = false ; } // End -- /script So... In order to use this script my button has to have onClick=checkAll(document.myform.email) and my check boxes have to have name=email but i need to name them name=email[] in order to pass the variables as an array in php. ive tried using onClick=checkAll(document.myform.email[]) but that just gives me an error for obvious reasons im sure. I don't know jack about javascript, so if you know of a better way to make a button that selects all check boxes or another way to code how the check boxes values are passed to the next page, I would be so greatful. Thanks! Nate
Re: [PHP] php javascript
First off thanks for the reply. When I click the test button I get Error: 'length' is null or not an object. I used script language=javascript function func( field ) { for ( i = 0; i field.length; i++ ) field[i].checked = true ; } /script input type=checkbox name=email[] value=5 input type=checkbox name=email[] value=2 input type=checkbox name=email[] value=1 input type=button value=test onclick=func( document.forms[ 0 ].elements[ 'email[]' ] ) - Original Message - From: Krzysztof Kocjan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 03, 2001 2:47 AM Subject: Re: [PHP] php javascript Try document.myform.elements['email[]'] like below script language=javascript function func( field ) { for ( i = 0; i field.length; i++ ) field[i].checked = true ; } /script form name=myform input type=checkbox name=email[] value=email_1 input type=checkbox name=email[] value=email_2 input type=checkbox name=email[] value=email_3 input type=checkbox name=email[] value=email_4 input type=checkbox name=email[] value=email_5 br input type=button value=test onclick=func( document.forms[ 0 ].elements[ 'email[]' ] ) /form Krzysztof [EMAIL PROTECTED] wrote: Hey all! I'm including some javascript that enables a button in a form input type=button name=CheckAll value=Check All onClick=checkAll(document.myform.email)to check all the check boxes at once. (I have an array of check boxes from a mysql db) I use: SCRIPT LANGUAGE=JavaScript !-- Begin function checkAll(field) { for (i = 0; i field.length; i++) field[i].checked = true ; } function uncheckAll(field) { for (i = 0; i field.length; i++) field[i].checked = false ; } // End -- /script So... In order to use this script my button has to have onClick=checkAll(document.myform.email) and my check boxes have to have name=email but i need to name them name=email[] in order to pass the variables as an array in php. ive tried using onClick=checkAll(document.myform.email[]) but that just gives me an error for obvious reasons im sure. I don't know jack about javascript, so if you know of a better way to make a button that selects all check boxes or another way to code how the check boxes values are passed to the next page, I would be so greatful. Thanks! Nate 99% trafien. 1% rezerwy, zeby innym nie bylo przykro. Nowe Centrum Wyszukiwania http://szukaj.interia.pl/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php javascript
Thanks... Leave the input name as email. If you really want to call it email[], you should be able to reference this in JavaScript as the object document.myform[email[]] document.myform[email[]] seems to give me a syntax error. If you leave it as email, you can then convert the email variable into an array using explode() or split() as so: On the recieving page I have echo($array = implode (,, $email)); which echos the array of text box values just fine. but only if the input name=email[] not name=email, and email[] doesnt work since my javascript uses email, not email[] - Original Message - From: Matthew Armsby [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 03, 2001 2:54 AM Subject: Re: [PHP] php javascript Leave the input name as email. If you really want to call it email[], you should be able to reference this in JavaScript as the object document.myform[email[]] If you leave it as email, you can then convert the email variable into an array using explode() or split() as so: ?php // on the recieving page, of course $emailArray = explode (,, $email); // Alternatively, a bit of RE exploding... $emailArray = split (,, $email); ? Matt Hey all! I'm including some javascript that enables a button in a form input type=button name=CheckAll value=Check All onClick=checkAll(document.myform.email)to check all the check boxes at once. (I have an array of check boxes from a mysql db) I use: SCRIPT LANGUAGE=JavaScript !-- Begin function checkAll(field) { for (i = 0; i field.length; i++) field[i].checked = true ; } function uncheckAll(field) { for (i = 0; i field.length; i++) field[i].checked = false ; } // End -- /script So... In order to use this script my button has to have onClick=checkAll(document.myform.email) and my check boxes have to have name=email but i need to name them name=email[] in order to pass the variables as an array in php. ive tried using onClick=checkAll(document.myform.email[]) but that just gives me an error for obvious reasons im sure. I don't know jack about javascript, so if you know of a better way to make a button that selects all check boxes or another way to code how the check boxes values are passed to the next page, I would be so greatful. Thanks! Nate -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] 2 decimal places
number_format($variable, 2, '.', '') something like that i believe - Original Message - From: Kurth Bemis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 19, 2001 7:22 PM Subject: [PHP] 2 decimal places i'm looking for a php function to add 2 decimal place sto a number. if the number already have one decimal place then one more zero should be added to make it two decimal placesanyone know of a quick way to do this? ~kurth -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Stupid Cookie Question
Sorry for having to ask this because i'm sure its a really simple answer... I set a cookie with the following... ?php header(Location: index.php); SetCookie(password,$password); SetCookie(cwname,$cwname); ? User see's a form with username and password fields. It sets whatever he inputs to cookies. Now i'm trying to figure out how to delete them! I know you can delete it if you set a negative time but I never set a time to it in the first place. Thanks, Nate
Re: [PHP] another easy cookie question
Do you have any white spaces or carriage returns before your headers? If so get rid of them. - Original Message - From: George Pitcher [EMAIL PROTECTED] To: Kelly Barrett [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, September 14, 2001 3:21 AM Subject: Re: [PHP] another easy cookie question Kelly, Thanks for the tip but having re-arranged my code I still get the same message. New coding = ?php header(Location:index.php); setcookie(Cookievalue, abcdefghijklmnopqrstuvwxyz0123456789, time()+3600); ? html head titleUntitled Document/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head Any suggestions? George - Original Message - From: Kelly Barrett [EMAIL PROTECTED] To: George Pitcher [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, September 14, 2001 11:31 AM Subject: Re: [PHP] another easy cookie question Hi George, You must output all headers (including cookies) before you output any content. So, you just need to move your header and setcookie calls so they are above the html and head tags. e.g. ?php header(Location:index.php); setcookie(Cookievalue, abcdefghijklmnopqrstuvwxyz0123456789) time()+3600); ? html head Cheers, Kelly. Hi all, This is what I have at the top of my php page (php-4.0.6-winNT). html head ?php header(Location:index.php); setcookie(Cookievalue, abcdefghijklmnopqrstuvwxyz0123456789) time()+3600); ? titleUntitled Document/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head I get the following error. CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: ... and nothing else! Where am I going wrong? I bet it's a simple answer. George P in Edinburgh _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] another easy cookie question
If nothing but the header Location ran then it would send him to his page, but its not even doing that. It's giving him an error before it does that. He already mentioned he didn't have any html or anything before the headers. - Original Message - From: Niklas Lampén [EMAIL PROTECTED] To: Php-General [EMAIL PROTECTED] Sent: Friday, September 14, 2001 3:51 AM Subject: RE: [PHP] another easy cookie question First of all, before header() or setcookie() can't be any outputing code (like html). And here if you do: ?php header(Location: index.php); setcookie(blah); Nothing else but header() will be run, since it will move you to the index.php file. P.S. Notice the space: header(Location: index.php); Niklas -Original Message- From: George Pitcher [mailto:[EMAIL PROTECTED]] Sent: 14. syyskuuta 2001 12:47 To: [EMAIL PROTECTED] Subject: [PHP] another easy cookie question Hi all, This is what I have at the top of my php page (php-4.0.6-winNT). html head ?php header(Location:index.php); setcookie(Cookievalue, abcdefghijklmnopqrstuvwxyz0123456789) time()+3600); ? titleUntitled Document/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head I get the following error. CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: ... and nothing else! Where am I going wrong? I bet it's a simple answer. George P in Edinburgh _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Anti Leech Script ??????? please
Probably http://php.resourceindex.com/ ? - Original Message - From: Coenraad Steenkamp [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 14, 2001 3:45 AM Subject: [PHP] Anti Leech Script ??? please Does anyone know of a anti leech script and where i could get it! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] cookies
Don't they taste great? Okay okay..
[PHP] cookies
Oops sorry sent that last one on accident.. real problem: i'm using the below code ?php header(Location: index.php); SetCookie(password,$password,time()+3600); SetCookie(name,$name,time()+3600); ? Before they go to this page they enter the password and name in a form and hit submit and it submits to this page.. Now is there something wrong with that code? cause it doesnt seem to create the cookie. Thanks a bunch, Nate
Re: [PHP] Re: WELCOME to php-general@lists.php.net
I'm not entirely positive but not sure if you can use the domain name in the include.. in other words try: ?php include(home.htm); ? And you obviously cant include pages from other servers.. - Original Message - From: Andreas Sartori [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 13, 2001 11:08 PM Subject: [PHP] Re: WELCOME to [EMAIL PROTECTED] i have a small problem. ?php include(http://www.sbg.ac.at/home.htm;); ? Warning: php_network_getaddresses: getaddrinfo failed: Name does not resolv to supplied parameters; neither nodename nor servname were passed. in /usr/INFO/web-docs/test.php on line 3 Warning: Failed opening 'http://www.sbg.ac.at/home.htm' for inclusion (include_path='.:/php/includes:/usr/INFO/web-docs/unineu/search:/usr/INFO/we b-docs/unineu/classes') in /usr/INFO/web-docs/test.php on line 3 when using: ?php fopen(http://www.sbg.ac.at/home.htm;, r); ? Warning: php_network_getaddresses: getaddrinfo failed: Name does not resolv to supplied parameters; neither nodename nor servname were passed. in /usr/INFO/web-docs/test.php on line 3 Warning: fopen(http://www.sbg.ac.at/home.htm,r;) - Bad file number in /usr/INFO/web-docs/test.php on line 3 please help me :) -- -- andreas sartori hellbrunnerstrasse 34 Datenbankadministration unix support 5020 salzburg, austria zid - universitaet salzburgtel: +43 (662) 8044-6731 http://www.sbg.ac.at/zid/people/sartori/sartori.htmfax: +43 (662) 629842 -- -- -- -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: WELCOME to php-general@lists.php.net
Ah, well shows what I know :) - Original Message - From: Sterling Hughes [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, September 13, 2001 11:14 PM Subject: Re: [PHP] Re: WELCOME to [EMAIL PROTECTED] On Thu, 13 Sep 2001 [EMAIL PROTECTED] wrote: I'm not entirely positive but not sure if you can use the domain name in the include.. in other words try: ?php include(home.htm); ? And you obviously cant include pages from other servers.. 1) yes, you can include pages from other servers 2) the error means that the domain name you are including from doesn't resolve to an ip address (more accurately an addrinfo structure). -Sterling - Original Message - From: Andreas Sartori [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 13, 2001 11:08 PM Subject: [PHP] Re: WELCOME to [EMAIL PROTECTED] i have a small problem. ?php include(http://www.sbg.ac.at/home.htm;); ? Warning: php_network_getaddresses: getaddrinfo failed: Name does not resolv to supplied parameters; neither nodename nor servname were passed. in /usr/INFO/web-docs/test.php on line 3 Warning: Failed opening 'http://www.sbg.ac.at/home.htm' for inclusion (include_path='.:/php/includes:/usr/INFO/web-docs/unineu/search:/usr/INFO/we b-docs/unineu/classes') in /usr/INFO/web-docs/test.php on line 3 when using: ?php fopen(http://www.sbg.ac.at/home.htm;, r); ? Warning: php_network_getaddresses: getaddrinfo failed: Name does not resolv to supplied parameters; neither nodename nor servname were passed. in /usr/INFO/web-docs/test.php on line 3 Warning: fopen(http://www.sbg.ac.at/home.htm,r;) - Bad file number in /usr/INFO/web-docs/test.php on line 3 please help me :) -- -- andreas sartori hellbrunnerstrasse 34 Datenbankadministration unix support 5020 salzburg, austria zid - universitaet salzburgtel: +43 (662) 8044-6731 http://www.sbg.ac.at/zid/people/sartori/sartori.htmfax: +43 (662) 629842 -- -- -- -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] news display
Hey all! I have a slight problem I was hoping you could help me with. I'm writing a little news script for my site, and well here is the scenario: I have 2 tables in a mysql database, one holds author information (name, email, password, etc.) The other table holds the news that they submit (news, date, time, headline, etc.) Now I am trying to display the news on a page, ordered of course by date (or id in this case) and well i'm using the code below. ?php $db = mysql_pconnect(localhost); mysql_select_db(news,$db); $result1 = mysql_query(SELECT * FROM news,authors ORDER BY `id` DESC,$db); while($myrow=mysql_fetch_array($result1)) { echo table cellpadding=0 cellspacing=0trtdimg src=images/r13.gif/tdtd background=images/r14.gif width=100%pfont size=2 face=verdana color=whitestrong . $myrow[headline] . /strong/FONT font size=1 face=verdana color=whitebrPosted by A HREF=mailto:; . $myrow[email] . . $myrow[author] . /A at . $myrow[time] . $myrow[$tod] . /FONT/tdtdimg src=images/r15.gif/td/tr/tablebrFONT COLOR=white SIZE=2 FACE=verdana . $myrow[news] . brbr; } ? So the results would look something like: $Headline Posted by $author at $time $news and it would of course just repeat, for however many entries there is. Now the problem: If I enter 4 news posts a day, I want to show 1 date above all the news posts. (Instead of 1 date next to each news post) Any idea how I can do this (In easy to understand lingo/code please)? Thanks! Nate
[PHP] displaing news
Hey all! I have a slight problem I was hoping you could help me with. I wrote earlier but no response (so one last try). I'm writing a little news script for my site, and well here is the scenario: The SHORT: I have news,headline,author,date,time,etc. all in a table in a mysql db, that I use mysql_fetch_array to pull out of the db and display on a page. It shows everything fine, but I was wondering, if there is more than one news entry per day, how can I display 1 date above the news entries for that day. (Instead of a seperate date for each news entry). The LONG: I have 2 tables in a mysql database, one holds author information (name, email, password, etc.) The other table holds the news that they submit (news, date, time, headline, etc.) Now I am trying to display the news on a page, ordered of course by date (or id in this case) and well i'm using the code below. ?php $db = mysql_pconnect(localhost); mysql_select_db(news,$db); $result1 = mysql_query(SELECT * FROM news,authors ORDER BY `id` DESC,$db); while($myrow=mysql_fetch_array($result1)) { echo table cellpadding=0 cellspacing=0trtdimg src=images/r13.gif/tdtd background=images/r14.gif width=100%pfont size=2 face=verdana color=whitestrong . $myrow[headline] . /strong/FONT font size=1 face=verdana color=whitebrPosted by A HREF=mailto:; . $myrow[email] . . $myrow[author] . /A at . $myrow[time] . $myrow[$tod] . /FONT/tdtdimg src=images/r15.gif/td/tr/tablebrFONT COLOR=white SIZE=2 FACE=verdana . $myrow[news] . brbr; } ? So the results would look something like: $Headline Posted by $author at $time $news and it would of course just repeat, for however many entries there is. Now the problem: If I enter 4 news posts a day, I want to show 1 date above all the news posts. (Instead of 1 date next to each news post) Any idea how I can do this (In easy to understand lingo/code please)? Thanks! Nate
Re: [PHP] displaing news
Thanks Tom, I'm still a newbie at this stuff though, so can you (or anyone) look this over and tell me what I did wrong... ?php //Connect to db $db = mysql_pconnect(localhost); mysql_select_db(news,$db); $result1 = mysql_query(SELECT * FROM news,authors ORDER BY `id` DESC,$db); $is_first=true; while($myrow=mysql_fetch_array($result1)) { if($is_first) { $lastdate=$myrow[date]; $thisdate=$myrow[date]; $is_first=false; } if($thisdate==$lastdate) { echo text here . $myrow[headline] . Posted by A HREF=mailto:; . $myrow[email] . . $myrow[author] . /a at . $myrow[time] . $myrow[$tod] . brbr . $myrow[news] . brbr; } else { echo h2 . $myrow[date] . text here . $myrow[headline] . Posted by A HREF=mailto:; . $myrow[email] . . $myrow[author] . /a at . $myrow[time] . $myrow[$tod] . brbr . $myrow[news] . brbr; } $lastdate=$thisdate; } ? I wasn't sure how to assign the $lastdate and $thisdate variables. - Original Message - From: Tom Carter [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 9:37 AM Subject: Re: [PHP] displaing news rough outline of what you would need to do. this is pseudocode.. I'm too tired to write correct php :) $is_first=true; whlie(get next result entry) { if($is_first) { $last-date=date of this entry; $this-date=date of this entry; $is_first=false; } if($this-date==$last-date) { just put the article after the current one } else { start a new section, displaying date etc } $last-date=$this-date; } - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 5:24 PM Subject: [PHP] displaing news Hey all! I have a slight problem I was hoping you could help me with. I wrote earlier but no response (so one last try). I'm writing a little news script for my site, and well here is the scenario: The SHORT: I have news,headline,author,date,time,etc. all in a table in a mysql db, that I use mysql_fetch_array to pull out of the db and display on a page. It shows everything fine, but I was wondering, if there is more than one news entry per day, how can I display 1 date above the news entries for that day. (Instead of a seperate date for each news entry). The LONG: I have 2 tables in a mysql database, one holds author information (name, email, password, etc.) The other table holds the news that they submit (news, date, time, headline, etc.) Now I am trying to display the news on a page, ordered of course by date (or id in this case) and well i'm using the code below. ?php $db = mysql_pconnect(localhost); mysql_select_db(news,$db); $result1 = mysql_query(SELECT * FROM news,authors ORDER BY `id` DESC,$db); while($myrow=mysql_fetch_array($result1)) { echo table cellpadding=0 cellspacing=0trtdimg src=images/r13.gif/tdtd background=images/r14.gif width=100%pfont size=2 face=verdana color=whitestrong . $myrow[headline] . /strong/FONT font size=1 face=verdana color=whitebrPosted by A HREF=mailto:; . $myrow[email] . . $myrow[author] . /A at . $myrow[time] . $myrow[$tod] . /FONT/tdtdimg src=images/r15.gif/td/tr/tablebrFONT COLOR=white SIZE=2 FACE=verdana . $myrow[news] . brbr; } ? So the results would look something like: $Headline Posted by $author at $time $news and it would of course just repeat, for however many entries there is. Now the problem: If I enter 4 news posts a day, I want to show 1 date above all the news posts. (Instead of 1 date next to each news post) Any idea how I can do this (In easy to understand lingo/code please)? Thanks! Nate -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Newbie Question.. (MySQL/PHP)
Hey guys, I have a mysql database of articles, and what i'd like to do is make 1 page that shows a brief sneak peak of each article, so what I would do is, show the first 50 or so words of each article and then add an elipses at the end. I'm sure it can be done but I wouldn't have a clue where to start. Any suggestions, or anyone ever done this? Thanks, Nate
[PHP] ordering a query
Me again :) I have a query that orders by id#, the problem is I have 17 items and I get an output like so: 1,10,11,12,13,14,15,16,17,2,3,4,5,6,7,8,9 So it thinks 1 and 10 are the same, and it thinks 11 is less than 2 and so on and so forth. Remedy please? (I'd rather not rename the items 01, 02, 03, 04, etc.) Thanks again. Nate
[PHP] auto increment
you know how, if you make a field a primary key and have it auto increment... then if you delete an entry and add a new one it makes the field 2 instead of 1... i know thats explained bad but do you know what i mean? is there a way to make it go back to 1 as if there were never any fields entered? Thanks, Nate
[PHP] Ordering a query
I use the following code to order the results of the query by the variable $order. $result = mysql_query(SELECT articles.title,vote.votes,vote.total,articles.date,staff.firstname,articles.content,articles.id FROM staff,articles,vote WHERE articles.authorid = staff.id AND articles.id = vote.item ORDER BY `$order` DESC,$db); I assign the variable a value according to my url, http://www.mysite.com/file.php?order=something My question is. Is there a way of assigning the $order variable a default value? Like if they hit http://www.mysite.com/file.php without the order=something can I tell the script to assign $order a default value? Thanks, Nate
[PHP] mysql_fetch_array
Can someone tell me what i'm doing wrong here? ?php //Connect to db $db = mysql_pconnect(localhost,login,pass); mysql_select_db(database,$db); //Check for the IP $result2 = mysql_query(SELECT ip FROM ip where ip = '$REMOTE_ADDR',$db); while($myrowmysql_fetch_array($result2)) { echo Print some text here!; } ? Basically I just want to print text if the IP address was not found in the database, and if it was found then I want to print Print some text here! Please help! Thanks, Nate
[PHP] replacing a carriage return with an html break
Hi all, I am filling out a form text area, and submitting it to the next page which just prints what I submitted, but it doesnt print any returns, i used when i filled out the previous text area I found on php.net there is a ereg_replace funtion and a trim function but I am unsure if either one will work and im not sure how to use them. Thanks, nate
[PHP] --with-imap-ssl
Does anyone know how to use imap with ssl if this configure option is given (4.0.3 and later)? I can't find anything in the docs. --Nate -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Fopen
Hi there, I am trying to open remotely the file http://www.parentprofiles.com/clicker.php and am useing the code: ? $fp = fopen("http://www.parentprofiles.com/clicker.php?profile_id=" . $this-profile_id . "code=1","r"); echo $fp; ? to do it. however when I do all I get is a response that says: Resource id #1 instead of giving me the page. Any ideas? Alan __ Is your life touched by adoption . . . or do you wish it were? Visit www.Adoption.com. Get FREE Adoption.com e-mail at www.AdoptionMail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]