RE: [PHP] what do i need to disable
Check this out : http://www.weberdev.com/get_example-4473.html berber -Original Message- From: Don [mailto:[EMAIL PROTECTED] Sent: Friday, January 19, 2007 7:38 AM To: php-general@lists.php.net Subject: [PHP] what do i need to disable Ok, You have been very helpful with my questions so far and I thank you for that. My next task is disable harmful tags/scripts in a full text field. I want to store a bio type field and I am considering allowing html (to allow a myspace type of customization to the page), but I am really new to this so I really don't know what kind of trouble I am asking for. I'm sure that I need to block JavaScript, but are there other things (tags, scripting, etc.) that can be input into my DB that will cause problems either being stored as such or when accessed? Again, thanks for the advice in advance. Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] email validation string.
Try this : http://www.weberdev.com/get_example-3274.html berber -Original Message- From: Don [mailto:[EMAIL PROTECTED] Sent: Thursday, January 18, 2007 10:41 PM To: php-general@lists.php.net Subject: [PHP] email validation string. I'm trying to get this line to validate an email address from a form and it isn't working. if (ereg([EMAIL PROTECTED],$submittedEmail)) The book I'm referencing has this line if (ereg([EMAIL PROTECTED],$submittedEmail)) Anyway.. I welcome any advice as long as it doesn't morph into a political debate on ADA standards and poverty in Africa. :-) Thanks Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Script to generate a site thumbnails
If you can get the image to your server, try using one of these examples : http://www.weberdev.com/AdvancedSearch.php?searchtype=titlesearch=thumb berber -Original Message- From: Pablo L. de Miranda [mailto:[EMAIL PROTECTED] Sent: Thursday, January 18, 2007 12:56 AM To: php-general@lists.php.net Subject: [PHP] Script to generate a site thumbnails Hi People, I'm needing a script that generate a site thumbnail from a given URL. Anybody can help me? Thanks, -- Pablo Lacerda de Miranda Graduando Sistemas de Informação Universidade Estadual de Montes Claros [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] email validation string.
# [EMAIL PROTECTED] / 2007-01-19 10:55:21 +0200: From: Don [mailto:[EMAIL PROTECTED] I'm trying to get this line to validate an email address from a form and it isn't working. if (ereg([EMAIL PROTECTED],$submittedEmail)) The book I'm referencing has this line if (ereg([EMAIL PROTECTED],$submittedEmail)) 1. Why did you remove the backslash? (the original was correct) 2. What do you expect the regexp to match? 3. Define it isn't working. Try this : http://www.weberdev.com/get_example-3274.html This will reject addresses that use greylisting, and 600 lines in a single function is gross. I wouldn't touch that. -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] email validation string.
You can always go to http://www.weberdev.com/ and write email validation in the Top Ajax search box. There are many other email validators that should have less than 600 lines in one function :) berber -Original Message- From: Roman Neuhauser [mailto:[EMAIL PROTECTED] Sent: Friday, January 19, 2007 12:17 PM To: WeberSites LTD Cc: 'Don'; php-general@lists.php.net Subject: Re: [PHP] email validation string. # [EMAIL PROTECTED] / 2007-01-19 10:55:21 +0200: From: Don [mailto:[EMAIL PROTECTED] I'm trying to get this line to validate an email address from a form and it isn't working. if (ereg([EMAIL PROTECTED],$submittedEmail)) The book I'm referencing has this line if (ereg([EMAIL PROTECTED],$submittedEmail)) 1. Why did you remove the backslash? (the original was correct) 2. What do you expect the regexp to match? 3. Define it isn't working. Try this : http://www.weberdev.com/get_example-3274.html This will reject addresses that use greylisting, and 600 lines in a single function is gross. I wouldn't touch that. -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- 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] email validation string.
Don't top-post. Trim quoted material. Use a mail user agent that doesn't screw up quoting. There's a plugin for Outlook to fix it. Thanks. # [EMAIL PROTECTED] / 2007-01-19 12:15:15 +0200: From: Roman Neuhauser [mailto:[EMAIL PROTECTED] # [EMAIL PROTECTED] / 2007-01-19 10:55:21 +0200: Try this : http://www.weberdev.com/get_example-3274.html This will reject addresses that use greylisting, and 600 lines in a single function is gross. I wouldn't touch that. I should have also mentioned that the function is fundamentally flawed, and the whole section dealing with deliverability should be removed. The only way to reliably find out about an email address deliverability is to send it a secret and receive it back (filtering out bounces). This mathematician, Daniel Bernstein, has a proof-of-concept code in ezmlm. :) (Or just google for VERP.) You can always go to http://www.weberdev.com/ and write email validation in the Top Ajax search box. What's Top Ajax? There are many other email validators that should have less than 600 lines in one function :) I already have a regular expression that matches a reasonable subset of the grammar defined in RFC 822. Why should I use someone else's square wheel when I have mine own? :) Also, if there are many email validators with better code, please offer those better ones if you must. -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie - help with a foreach
On cs, 2007-01-18 at 20:46 +0100, Jochem Maas wrote: Németh Zoltán wrote: On cs, 2007-01-18 at 02:04 -0800, pub wrote: On Jan 18, 2007, at 2:00 AM, Németh Zoltán wrote: ... maybe you should use a parameter for it, place it into the link in the first query loop, get it here and query based on it like SELECT * FROM job WHERE id={$_GET['job_id']} or whatever SQL INJECTION WAITING TO HAPPEN. true, sorry so check the value first greets Zoltán Németh ... foreach($row as $url) { $row = mysql_fetch_array($result2,MYSQL_ASSOC); if (url={$row['url']}) what is this IF statement supposed to be doing??? because it will always evaluate to true -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problems with sessions variables and virtual domains in apache
The don't want to pass the session variable across domains. The problem is in the main domain, i don't know what happens, the session variable lost the value or is distroyed. Chris [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] esteban wrote: I have a windows 2000 server with apache 2.0 and php 5.1.2. I use session variables to validate users, each page have something like this: if($_SESSION[validated]==0){ header(Location: index.php); exit; } This worked fine when i had only one domain, but when i began to use virtual domains, sometimes, not always, the session variable lost the value or the session variable is distroyed, i don't know what really happens. I add this lines to httpd.conf for each domain and the main domain is first: VirtualHost *:80 ServerAdmin [EMAIL PROTECTED] DocumentRoot C:/Program Files/Apache Group/Apache2/htdocs/domain ServerName www.domain.com ErrorLog logs/domain.com-error_log CustomLog logs/domain.com-access_log common php_admin_value upload_tmp_dir C:/Program Files/Apache Group/Apache2/htdocs/domain/tmp php_admin_value session.save_path C:/Program Files/Apache Group/Apache2/htdocs/domain/session /VirtualHost At the beginning i didn't use the two last lines with php_admin_value, i add the lines for trying to solve the problem but it doesn't work. I have an application made with phpmaker and SquierreMail v.1.4.7 too, and i have the same problem in both. In both case sometimes, when i want to go to other page, the server ask me for the username and the password, it is not always. If you are going across domains (page 1 is on domain 'a' and page 2 is on domain 'b'), you need to explicitly pass the session across in the query string. Even them I'm not sure it will work for security reasons. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] preg_match problem
Hi all, I have a simple checking like if (preg_match(/[\w\x2F]{6,}/,$a)) as I would like to allow all word characters as mentioned at http://hu2.php.net/manual/hu/reference.pcre.pattern.syntax.php plus the '/' character, and at least 6 characters. But it throws Warning: preg_match(): Unknown modifier ']' and returns false for abc/de/ggg which string should be okay. If I omit the \x2F, everything works fine but / characters are not allowed. Anyone knows what I'm doing wrong? Maybe / characters can not be put in patterns like this? Thanks in advance, Zoltán Németh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_match problem
# [EMAIL PROTECTED] / 2007-01-19 15:25:38 +0100: Hi all, I have a simple checking like if (preg_match(/[\w\x2F]{6,}/,$a)) as I would like to allow all word characters as mentioned at http://hu2.php.net/manual/hu/reference.pcre.pattern.syntax.php plus the '/' character, and at least 6 characters. But it throws Warning: preg_match(): Unknown modifier ']' and returns false for abc/de/ggg which string should be okay. If I omit the \x2F, everything works fine but / characters are not allowed. Anyone knows what I'm doing wrong? Maybe / characters can not be put in patterns like this? 1. You're making your life harder with those double quotes. \x2F is interpolated by PHP, before the PCRE library has a chance to see the string. 2. Use a different delimiter and you'll be able to use slash characters in the pattern freely. preg_match('~[\w/]{6,}~', $a); -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] email validation string.
1. Why did you remove the backslash? (the original was correct) I have a regular expression tester plugin in firefox and it validates Ok with the expression he provided. If I add the second (original) backslash it won't validate emails anymore. Also, from my little knowledge of Red.Exp. the backslash will escape special chars. In this case the backslash will escape the dot to match only a dot and not all chars... This my way of seing it... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_match problem
On p, 2007-01-19 at 15:39 +, Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2007-01-19 15:25:38 +0100: Hi all, I have a simple checking like if (preg_match(/[\w\x2F]{6,}/,$a)) as I would like to allow all word characters as mentioned at http://hu2.php.net/manual/hu/reference.pcre.pattern.syntax.php plus the '/' character, and at least 6 characters. But it throws Warning: preg_match(): Unknown modifier ']' and returns false for abc/de/ggg which string should be okay. If I omit the \x2F, everything works fine but / characters are not allowed. Anyone knows what I'm doing wrong? Maybe / characters can not be put in patterns like this? 1. You're making your life harder with those double quotes. \x2F is interpolated by PHP, before the PCRE library has a chance to see the string. 2. Use a different delimiter and you'll be able to use slash characters in the pattern freely. preg_match('~[\w/]{6,}~', $a); Thank you very much, it's working fine now. Zoltán Németh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] preg_match problem
Not a big regex expert, but first off i would recommend not using / as a delimiter for your pattern if you are trying to catch forward slashes in your text. I would use a pattern like: #[a-zA-Z0-9/]{6,}# Regards, Tim -Message d'origine- De : Németh Zoltán [mailto:[EMAIL PROTECTED] Envoyé : vendredi 19 janvier 2007 15:26 À : php-general@lists.php.net Objet : [PHP] preg_match problem Hi all, I have a simple checking like if (preg_match(/[\w\x2F]{6,}/,$a)) as I would like to allow all word characters as mentioned at http://hu2.php.net/manual/hu/reference.pcre.pattern.syntax.php plus the '/' character, and at least 6 characters. But it throws Warning: preg_match(): Unknown modifier ']' and returns false for abc/de/ggg which string should be okay. If I omit the \x2F, everything works fine but / characters are not allowed. Anyone knows what I'm doing wrong? Maybe / characters can not be put in patterns like this? Thanks in advance, Zoltán Németh -- 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] email validation string.
# [EMAIL PROTECTED] / 2007-01-19 14:46:04 +: 1. Why did you remove the backslash? (the original was correct) I have a regular expression tester plugin in firefox and it validates Ok with the expression he provided. JavaScript is *not* PHP. -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] webservice libraries/frameworks
I've heard that there might be a php library or framework that allows you to expose your code as a webservice with little to no extra code. I heard the code could potentially also allow access via several different protocols. Has anyone come across anything similar, or do I need to pick a specific protocol for my services? Thanks!
Re: [PHP] What makes a PHP expert
I'd say a programming expert is one that can grasp the nuances and complexities of a problem and break it down coherently and correctly in a relatively short amount of time (compared to average). A php expert is one that can break it down and implement a solution that leverages the PHP way of doing things and works with the language for a truly elegant solution. (The PHP way of solving a problem is different than the Java way is different from the C++ way. Different languages have different strengths. A language expert knows how to play to the strengths of the language he's using.) On Thursday 18 January 2007 9:23 am, bruce wrote: hi... for my $0.02 worth... sometimes it's as simple as someone who can qucikly grasp the issue(s) and nuances/intracacies of the issues/problems, and who can then utilize php to solve the problem, as well as craft an elegant solution that will scale into the future. peace... -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Thursday, January 18, 2007 5:56 AM To: h; php-general@lists.php.net Subject: RE: [PHP] What makes a PHP expert [snip] I often see job ads asking for a PHP expert and was wandering what you all thought makes a PHP programmer into an expert. what would you mark out as the key skills that distinguishes an expert from the ordinary i.e. OOP mastery, regular expressions etc. [/snip] First I would consider number of years of programming experience including how many years a programmer had been using PHP. I would examine some code and look for organization, documentation, and consistency. Is the programmer published (articles, books, etc) which may not count against expertise? An expert encompasses so much more than skills. For instance, I could be an expert on football because I understand history of the game, have been published, understand game planning and execution, and have played at the wide receiver position. Only the last 2 items really require skills. -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it. -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] email validation string.
1. Why did you remove the backslash? (the original was correct) I have a regular expression tester plugin in firefox and it validates Ok with the expression he provided. JavaScript is *not* PHP. As far as I can read, I never talked about JavaScript... Maybe the fact that I talked about a browser made you think I was using Java. NO! I'm not. This is a php list and I gave my answer based on that. This plugin I was talking about uses PHP/5.2.0 In either case... Aren't both expressions supposed to validate an e-mail?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What makes a PHP expert
larry... sounds good... however, given that you often have a myriad of different ways to solve a problem, how does on determine which of the solutions, is the 'PHP way' unless there are seriously obvious flaws with an approach, you can often have different approaches of solving a problem that pretty much lead to the same result.. peace... -Original Message- From: Larry Garfield [mailto:[EMAIL PROTECTED] Sent: Friday, January 19, 2007 7:29 AM To: php-general@lists.php.net Subject: Re: [PHP] What makes a PHP expert I'd say a programming expert is one that can grasp the nuances and complexities of a problem and break it down coherently and correctly in a relatively short amount of time (compared to average). A php expert is one that can break it down and implement a solution that leverages the PHP way of doing things and works with the language for a truly elegant solution. (The PHP way of solving a problem is different than the Java way is different from the C++ way. Different languages have different strengths. A language expert knows how to play to the strengths of the language he's using.) On Thursday 18 January 2007 9:23 am, bruce wrote: hi... for my $0.02 worth... sometimes it's as simple as someone who can qucikly grasp the issue(s) and nuances/intracacies of the issues/problems, and who can then utilize php to solve the problem, as well as craft an elegant solution that will scale into the future. peace... -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Thursday, January 18, 2007 5:56 AM To: h; php-general@lists.php.net Subject: RE: [PHP] What makes a PHP expert [snip] I often see job ads asking for a PHP expert and was wandering what you all thought makes a PHP programmer into an expert. what would you mark out as the key skills that distinguishes an expert from the ordinary i.e. OOP mastery, regular expressions etc. [/snip] First I would consider number of years of programming experience including how many years a programmer had been using PHP. I would examine some code and look for organization, documentation, and consistency. Is the programmer published (articles, books, etc) which may not count against expertise? An expert encompasses so much more than skills. For instance, I could be an expert on football because I understand history of the game, have been published, understand game planning and execution, and have played at the wide receiver position. Only the last 2 items really require skills. -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it. -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] email validation string.
Top Ajax : I meant that at the top of WeberDev.com there is an Ajax search box that you can use to search for email validation and see many related code examples to choose from. berber -Original Message- From: 'Roman Neuhauser' [mailto:[EMAIL PROTECTED] Sent: Friday, January 19, 2007 1:47 PM To: WeberSites LTD Cc: 'Don'; php-general@lists.php.net Subject: Re: [PHP] email validation string. Don't top-post. Trim quoted material. Use a mail user agent that doesn't screw up quoting. There's a plugin for Outlook to fix it. Thanks. # [EMAIL PROTECTED] / 2007-01-19 12:15:15 +0200: From: Roman Neuhauser [mailto:[EMAIL PROTECTED] # [EMAIL PROTECTED] / 2007-01-19 10:55:21 +0200: Try this : http://www.weberdev.com/get_example-3274.html This will reject addresses that use greylisting, and 600 lines in a single function is gross. I wouldn't touch that. I should have also mentioned that the function is fundamentally flawed, and the whole section dealing with deliverability should be removed. The only way to reliably find out about an email address deliverability is to send it a secret and receive it back (filtering out bounces). This mathematician, Daniel Bernstein, has a proof-of-concept code in ezmlm. :) (Or just google for VERP.) You can always go to http://www.weberdev.com/ and write email validation in the Top Ajax search box. What's Top Ajax? There are many other email validators that should have less than 600 lines in one function :) I already have a regular expression that matches a reasonable subset of the grammar defined in RFC 822. Why should I use someone else's square wheel when I have mine own? :) Also, if there are many email validators with better code, please offer those better ones if you must. -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] email validation string.
hi... the real problem you have with email validation is that the vast majority of the email validation scripts that you see in various apps only handle a part of what the wc3/spec states to be valid email addresses. if your app had the ability to handle the time constraint, a reasonable approach would be to simply fire off a msg to the email address and check the return status code! if you're really going to try to get a function to validate email addresses, and you're concerned about the outlying address types, then you're going to wind up with an ugly/hairy/complex situation. awhile ago, in taking the path least traveled, i punted this issue, and used a 'perl' function that i call from php to handle it... does it take a little longer, sure... but i decided it was worth it peace.. -Original Message- From: Roman Neuhauser [mailto:[EMAIL PROTECTED] Sent: Friday, January 19, 2007 2:17 AM To: WeberSites LTD Cc: 'Don'; php-general@lists.php.net Subject: Re: [PHP] email validation string. # [EMAIL PROTECTED] / 2007-01-19 10:55:21 +0200: From: Don [mailto:[EMAIL PROTECTED] I'm trying to get this line to validate an email address from a form and it isn't working. if (ereg([EMAIL PROTECTED],$submittedEmail)) The book I'm referencing has this line if (ereg([EMAIL PROTECTED],$submittedEmail)) 1. Why did you remove the backslash? (the original was correct) 2. What do you expect the regexp to match? 3. Define it isn't working. Try this : http://www.weberdev.com/get_example-3274.html This will reject addresses that use greylisting, and 600 lines in a single function is gross. I wouldn't touch that. -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- 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] Security Question
I've got a website on a virtual-host, Apache/Linux system running php scripts. I particular, I've designed a CMS where designated individuals compose and edit text in an html textarea, and then save the raw text in files. Custom [i.e., proxie] tags are used for emphasizing and the formating text [e.g., redRed Text/red]. The raw text is converted to W3C compliant, html code for user rendering. When processing the text, I remove all php start codes [? ?php, etc.] from the text, though it's not obvious to me how the text can be executed when it's treated as pure text sent to the client. Now the question. Does anyone see an obvious security hole? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Month display calendar
Dear friends. Can anyone please show me calendar scripts to make a calendar with a monthly display as shown in http://www.easyphpcalendar.com/ ? Thanks Denis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] email validation string.
# [EMAIL PROTECTED] / 2007-01-19 15:43:32 +: 1. Why did you remove the backslash? (the original was correct) I have a regular expression tester plugin in firefox and it validates Ok with the expression he provided. JavaScript is *not* PHP. As far as I can read, I never talked about JavaScript... Maybe the fact that I talked about a browser made you think I was using Java. NO! I'm not. This is a php list and I gave my answer based on that. This plugin I was talking about uses PHP/5.2.0 JavaScript is *not* Java. ;) But ok, sorry about the assumption. Where can I check out the plugin? In either case... Aren't both expressions supposed to validate an e-mail?? PHP uses one of two sets of special characters depending on whether you use single or double quotes, and leaves a single backslash preceeding a non-special character intact. PCRE removes backslashes if they're followed by non-special characters (but see /X). IOW, as opposed to PHP, PCRE will reduce \x to x for any x that's not special. Use \\x if you want \x. PHP will, however, reduce \\x to \x, since \ is special. Relying on PHP's behavior with ordinary-x \x in a PCRE introduces another grammar to the mix. -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Month display calendar
[snip] Can anyone please show me calendar scripts to make a calendar with a monthly display as shown in http://www.easyphpcalendar.com/ ? [/snip] Have you STFW or RTFM? There is a truckload of PHP code on the web that you can review, dissect, and learn from. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Month display calendar
On Sat, Jan 20, 2007 at 12:37:08AM +0800, Denis L. Menezes wrote: Dear friends. Can anyone please show me calendar scripts to make a calendar with a monthly display as shown in http://www.easyphpcalendar.com/ ? Thanks Denis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- You can take a look at: http://projects.stinemates.org/ And click on the 'View Source' link. == Nick Stinemates ([EMAIL PROTECTED]) http://nick.stinemates.org AIM: Nick Stinemates MSN: [EMAIL PROTECTED] Yahoo: [EMAIL PROTECTED] == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP5 Cross Compilation
Hello, What are all the flags and variables to set to cross compile PHP for arm? I didn't get any info on the query I posted earlier. If anyone has tried php on arm linux, please let me know the steps. Thanks so much, Regards, Kiran On 1/18/07, Kiran Malla [EMAIL PROTECTED] wrote: Hello, I am trying to cross compile PHP-5.2.0 for arm linux. # export CC=/usr/local/arm/3.3.2/bin/arm-linux-gcc # export AR=/usr/local/arm/3.3.2/bin/arm-linux-ar # export LD=/usr/local/arm/3.3.2/bin/arm-linux-ld # export NM=/usr/local/arm/3.3.2/bin/arm-linux-nm # export RANLIB=/usr/local/arm/3.3.2/bin/arm-linux-ranlib # export STRIP=/usr/local/arm/3.3.2/bin/arm-linux-strip # ./configure --host=arm-linux --sysconfdir=/etc/appWeb --with-exec-dir=/etc/appWeb/exec Result of this configure is, Checking for iconv support... yes checking for iconv... no checking for libiconv... no checking for libiconv in -liconv... no checking for iconv in -liconv... no configure: error: Please reinstall the iconv library. I have installed libiconv-1.11 on my system. The command 'which iconv' shows '/usr/local/bin/iconv'. I have no clue why configure is failing due to missing iconv. Somebody please throw some light on this issue. Regards, Kiran
Re: [PHP] Security Question
Al wrote: I've got a website on a virtual-host, Apache/Linux system running php scripts. I particular, I've designed a CMS where designated individuals compose and edit text in an html textarea, and then save the raw text in files. Custom [i.e., proxie] tags are used for emphasizing and the formating text [e.g., redRed Text/red]. The raw text is converted to W3C compliant, html code for user rendering. When processing the text, I remove all php start codes [? ?php, etc.] from the text, though it's not obvious to me how the text can be executed when it's treated as pure text sent to the client. Now the question. Does anyone see an obvious security hole? if you don't strip out stuff like 'script evil haxor code here; /script' then that's one thing that can bite. it's hard to say what holes there may be without seeing the code that does the conversion from 'raw text' to 'html' . another security issue is whether anyone could overwrite existing 'content' text files on the server - only your CMS should have write access to these. any php code in the files can't be run at all *unless* your using include on the given text files or your running the content of the text files through eval() Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP5 Cross Compilation
Kiran Malla wrote: Hello, What are all the flags and variables to set to cross compile PHP for arm? I didn't get any info on the query I posted earlier. If anyone has tried php on arm linux, please let me know the steps. if google didn't give any answers then I might suggest the php internals mailing list as a place to post a question - chances are that there are not a lot of people here that know jack shit about cross compiling. Thanks so much, Regards, Kiran On 1/18/07, Kiran Malla [EMAIL PROTECTED] wrote: Hello, I am trying to cross compile PHP-5.2.0 for arm linux. # export CC=/usr/local/arm/3.3.2/bin/arm-linux-gcc # export AR=/usr/local/arm/3.3.2/bin/arm-linux-ar # export LD=/usr/local/arm/3.3.2/bin/arm-linux-ld # export NM=/usr/local/arm/3.3.2/bin/arm-linux-nm # export RANLIB=/usr/local/arm/3.3.2/bin/arm-linux-ranlib # export STRIP=/usr/local/arm/3.3.2/bin/arm-linux-strip # ./configure --host=arm-linux --sysconfdir=/etc/appWeb --with-exec-dir=/etc/appWeb/exec Result of this configure is, Checking for iconv support... yes checking for iconv... no checking for libiconv... no checking for libiconv in -liconv... no checking for iconv in -liconv... no configure: error: Please reinstall the iconv library. I have installed libiconv-1.11 on my system. The command 'which iconv' shows '/usr/local/bin/iconv'. I have no clue why configure is failing due to missing iconv. Somebody please throw some light on this issue. Regards, Kiran -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] email validation string.
Where can I check out the plugin? Maybe I shouldn't have mentioned plugin and firefox... It's not a plugin for firefox like other firefox's plugins... In fact, when I downloaded somewhere arround the web the name of the thing (won't call it plugin again) was Site Programmer Plugin Assistant (or something alike) and it's just a bunch of php scripts that run as a local site... That's why I said that the plugin was using PHP/5.2.0 because that's the php version I have installed. It needs Apache with PHP support to work and the php code it uses is a form that processes a text field and do a ereg($Pattern, $Text) on an if statment that outputs Match or No Match. Meaning pure PHP (in my case v5.2.0) For a real Firefox plugin that shows the matched part of the text in real time as you change the pattern, you can search for a plugin (a real one) named Regular Expressions Tester. I don't have it but you can search http://www.mozilla.com for it. Wait... https://addons.mozilla.org/firefox/2077/ this is the homepage for the plugin. However, I don't know if this uses Java(script) or what... About what I asked in my last post... In php, if you have a string like $Text=[a-zA-Z]+\\. php will save it like [a-zA-Z]+\. because the first backslash is escaping a special character which is the second backslash but if you have the string $Text=[a-zA-Z]+\. php will save it the exactly the same way because even that the backslash is used to escape special characters, there is no special char after it. It's just a dot. So the string gets stored the same way. Also it doesn't get different with quotes or double quotes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FTP Error
Description: Warning: ftp_put(): php_connect_nonb() failed: No route to host (65) I get this error with the reproduce code. it also says Warning: ftp_put(): Type set to I. It is not uploading the file correctly. i have php 4.4.1 on iPowerWeb's server, so no upgrade is possible. Thanks in Advance Reproduce code: --- $conn_id = ftp_connect(ftpServer); $login_result = ftp_login($conn_id, userName, passWord); ftp_pasv($conn_id, true); if ((!$conn_id) || (!$login_result)) { echo FTP connection has failed!; echo Attempted to connect to stp server for user username; exit; } else { echo Connected to ftp server, for user user; } $upload = ftp_put($conn_id, bgd.txt, bgdlocal.txt, FTP_BINARY); if (!$upload) { echo FTP upload has failed!; } else { echo Uploaded $source_file to $ftp_server as $destination_file; } // close the FTP stream ftp_close($conn_id); Expected result: Uploaded $source_file to $ftp_server as $destination_file Actual result: -- Warning: ftp_put(): php_connect_nonb() failed: No route to host (65) in /home/beachgla/public_html/catalog/update/index.php on line 475 Warning: ftp_put(): Type set to I. in /home/beachgla/public_html/catalog/update/index.php on line 475 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Security Question
Good point about the 'script evil haxor code here; /script'. That's bad for our users, not the site, per se. Raw text to html is primarily done with a series of preg_replace() operations. No include() or exec() allowed near the text. Sounds like I'm in pretty good shape. Thanks for the help.. Jochem Maas wrote: Al wrote: I've got a website on a virtual-host, Apache/Linux system running php scripts. I particular, I've designed a CMS where designated individuals compose and edit text in an html textarea, and then save the raw text in files. Custom [i.e., proxie] tags are used for emphasizing and the formating text [e.g., redRed Text/red]. The raw text is converted to W3C compliant, html code for user rendering. When processing the text, I remove all php start codes [? ?php, etc.] from the text, though it's not obvious to me how the text can be executed when it's treated as pure text sent to the client. Now the question. Does anyone see an obvious security hole? if you don't strip out stuff like 'script evil haxor code here; /script' then that's one thing that can bite. it's hard to say what holes there may be without seeing the code that does the conversion from 'raw text' to 'html' . another security issue is whether anyone could overwrite existing 'content' text files on the server - only your CMS should have write access to these. any php code in the files can't be run at all *unless* your using include on the given text files or your running the content of the text files through eval() Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying Results on different rows in tables
Ah, I see. In Brad's reply there was two $result = mssql_query($sql) or die(mssql_error()); in the code. Removed the one from outside of the loop and it works fine now. Thanks to both of you for your help! On 1/18/07, Chris [EMAIL PROTECTED] wrote: Dan Shirah wrote: The code above displays no information at all. What I want to do is: 1. Retrieve my information 2. Assign it to a variable 3. Output the data into a table with each unique record in a seperate row As Brad posted: echo table; while ($row = mssql_fetch_array($result)) { $id = $row['credit_card_id']; $dateTime = $row['date_request_received']; echo trtd$id/tdtd$dateTime/td/tr; } echo /table; If that doesn't work, try a print_r($row) inside the loop: while ($row = mssql_fetch_array($result)) { print_r($row); } and make sure you are using the right id's / elements from that array. -- Postgresql php tutorials http://www.designmagick.com/
[PHP] Beginner Question
Hi, I have learned as lot about PHP but I still dont know how do they build PHP based web sites. I need to build a complete PHP site with a lot of content and integrate CSS,javaScript and a lot of other stuff (for the school) (Complete site for example. www.domain1.com/index.php or www.domain2.co/about?set=p1) I want to know how are the sites built, do they build for each page a PHP script or do they build just a couple of scripts and a database full of content and just retrieve and delete,edit,show database information? I know that when I see in the sites url php? that means that site has a database, right...? Either way I would be very gratefull if you could you give me a detailed explanation of the process of building a PHP/MySQL site (I know to write scripts in PHP so im not a total beginner). Thank you very much in advance!! P.S Please, I understand this could be a stupid question but please bare with me... :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Beginner Question
On Fri, 2007-01-19 at 19:21 +0100, Delta Storm wrote: Hi, I have learned as lot about PHP but I still dont know how do they build PHP based web sites. Obviously you haven't learned enough ;) I need to build a complete PHP site with a lot of content and integrate CSS,javaScript and a lot of other stuff (for the school) Woohooo, a good way to learn, though hopefully you get the security right the first time :) (Complete site for example. www.domain1.com/index.php or www.domain2.co/about?set=p1) I want to know how are the sites built, do they build for each page a PHP script or do they build just a couple of scripts and a database full of content and just retrieve and delete,edit,show database information? Depends on who builds it, what they use, and personal preference. For instance most Drupal sites are mostly database driven. But other sites may be file based. Some use a front end controller pattern so you access a single page that determines what you see via the URL's parameters, others use real files. Others use URL rewriting tricks via the web server to make it the front end controller pattern look like real files. I know that when I see in the sites url php? that means that site has a database, right...? Nope, that generally means it's using PHP, but not always. Anyone can set their webserver to invoke whatever server side language they want to use regardless of file extension. Some common PHP extensions though are, .php, .php3, .phtml, .html Either way I would be very gratefull if you could you give me a detailed explanation of the process of building a PHP/MySQL site (I know to write scripts in PHP so im not a total beginner). You'll need a webserver, I recommend Apache: http://httpd.apache.org/ You will probably want to install PHP as amodule for use by the webserver. You should check out the PHP website, it explains how to set things up: http://www.php.net/manual/en/install.general.php I suggest installing on a *nix system versus crappy Windows. But feel free to use Windows if you're just a noobie. You don't need a database to learn the basics, mostly you just need to know how to set up the webserver, where to place your files, how to retrieve form posts and URL parametets, and how to output HTML. The PHP website is a goldmine of information. The comments can be quite helpful also. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What makes a PHP expert
True, there's rarely One True Answer. That's one reason why there is no clear-cut definition of Expert. However, there are frequently better or worse solutions to a problem. It's easier to pinpoint when someone is not going with the grain of the language than when they are. For instance, considering the global namespace to be a good interface between system components disqualifies someone from the expert title, IMO. :-) (Yes, I've had to clean up after that.) Using arrays but never actually using associative arrays is another against the grain issue in PHP (whereas in other languages associative arrays are not as dead-easy as in PHP, so they're a wrong answer more often). That doesn't automatically mean that using associative arrays and not using the global namespace make someone an expert, of course, it's just an indication that they don't not know what they're doing. On Friday 19 January 2007 9:43 am, bruce wrote: larry... sounds good... however, given that you often have a myriad of different ways to solve a problem, how does on determine which of the solutions, is the 'PHP way' unless there are seriously obvious flaws with an approach, you can often have different approaches of solving a problem that pretty much lead to the same result.. peace... -Original Message- From: Larry Garfield [mailto:[EMAIL PROTECTED] Sent: Friday, January 19, 2007 7:29 AM To: php-general@lists.php.net Subject: Re: [PHP] What makes a PHP expert I'd say a programming expert is one that can grasp the nuances and complexities of a problem and break it down coherently and correctly in a relatively short amount of time (compared to average). A php expert is one that can break it down and implement a solution that leverages the PHP way of doing things and works with the language for a truly elegant solution. (The PHP way of solving a problem is different than the Java way is different from the C++ way. Different languages have different strengths. A language expert knows how to play to the strengths of the language he's using.) On Thursday 18 January 2007 9:23 am, bruce wrote: hi... for my $0.02 worth... sometimes it's as simple as someone who can qucikly grasp the issue(s) and nuances/intracacies of the issues/problems, and who can then utilize php to solve the problem, as well as craft an elegant solution that will scale into the future. peace... -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Thursday, January 18, 2007 5:56 AM To: h; php-general@lists.php.net Subject: RE: [PHP] What makes a PHP expert [snip] I often see job ads asking for a PHP expert and was wandering what you all thought makes a PHP programmer into an expert. what would you mark out as the key skills that distinguishes an expert from the ordinary i.e. OOP mastery, regular expressions etc. [/snip] First I would consider number of years of programming experience including how many years a programmer had been using PHP. I would examine some code and look for organization, documentation, and consistency. Is the programmer published (articles, books, etc) which may not count against expertise? An expert encompasses so much more than skills. For instance, I could be an expert on football because I understand history of the game, have been published, understand game planning and execution, and have played at the wide receiver position. Only the last 2 items really require skills. -- Larry GarfieldAIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it. -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it. -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Conditional Select
I have a page that shows all outstanding tickets, what I'm trying to have it do is let users search by several categories. I want to be able to filter the results based on the user input. For instance, say I have an employee that wants to find ticket #2. He enters 2 in the Request ID field and also enters 01/01/06 in the Date Requested field. How would I return the ticket that matches both Request ID and Date Requested fields? I have been able to return a result with only 1 search criteria entered, but get no results with more than 1. Below is the code I am working on. else { /* if the submit variable exists, the form has been submitted - look for and process form data */ // display result $request_id = $_POST['request_id']; $date_entered = $_POST['date_entered']; $status = $_POST['status']; $request_type = $_POST['request_type']; ? form name=submitForm action=?php echo $_SERVER['PHP_SELF']; ? method=post table align=center width=780 cellpadding=2 cellspacing=2 border=0 tr td width=185 align=rightspan class=smallboldRequest Id:/span/td td width=128 class=tblcellinput type=Text value=?php echo $_POST['request_id']; ? name=request_id size=8 maxlength=/td td width=187 align=rightspan class=smallboldDate Entered:/span/td td width=254 class=tblcellinput type=Text value=?php echo $_POST['date_entered']; ? name=date_entered size=15 maxlength=/td /tr tr td width=185 height=27 align=rightspan class=smallboldStatus:/span/td td width=128 class=tblcellinput type=Text value=?php echo $_POST['status']; ? name=status size=8 maxlength=/td td width=187 align=rightspan class=smallboldRequest Type:/span/td td width=254 class=tblcellinput type=Text value=?php echo $_POST['request_type']; ? name=request_type size=15 maxlength=/td /tr /table FORM ACTION=a href=javascript:clearForm() METHOD=POST name=logoutform table align=center border=0 cellpadding=0 cellspacing=0 width=780 tr td colspan=2 input type=submit name=submit value=Searchnbsp; input type=submit name=reset value=Reset /td /tr /table table align=center border=0 cellpadding=0 cellspacing=0 width=780 trtdnbsp;/td/tr tr td height=13 align=center class=tblheaddiv align=centerstrongProcess Payments /strong/div/td /tr tr td colspan=6hr color=#006600 //td /tr /table table align=center border=0 cellpadding=0 cellspacing=0 width=780 tr td width=88 height=13 align=center class=tblheaddiv align=centerRequest ID /div/td td width=224 height=13 align=center class=tblheaddiv align=centerDate/Time Entered /div/td td width=156 height=13 align=center class=tblheaddiv align=centerStatus/div/td td width=156 height=13 align=center class=tblheaddiv align=centerRequest Type /div/td td width=156 height=13 align=center class=tblheaddiv align=centerLast Processed By/div/td /tr /table ?php $database = database; $host = host; $user = username; $pass = password; // Connect to the datbase $connection = mssql_connect($host, $user, $pass) or die ('server connection failed'); $database = mssql_select_db($database, $connection) or die ('DB selection failed'); // Query the table and load all of the records into an array. **Note my SQL statement below, can I break in and out of PHP like this to verify if multiple variables are set?* * $sql = SELECT child_support_payment_request.credit_card_id, credit_card_payment_request.credit_card_id, date_request_received FROM child_support_payment_request, credit_card_payment_request WHERE child_support_payment_request.credit_card_id = credit_card_payment_request.credit_card_id ? ?php if ($request_id !== '') { AND credit_card_payment_request.credit_card_id = $request_id } ? ?php if ($dateTime !== '') { AND date_request_received = $dateTime; } ? ?php $result = mssql_query($sql) or die(mssql_error()); echo table width='780' border='1' align='center' cellpadding='2' cellspacing='2' bordercolor='#00'; while ($row = mssql_fetch_array($result)) { $id = $row['credit_card_id']; $dateTime = $row['date_request_received']; echo tr; echo td width='88' height='13' align='center' class='tblcell'div align='center'$id/div/td; echo td width='224' height='13' align='center' class='tblcell'div align='center'$dateTime/div/td; echo td width='156' height='13' align='center' class='tblcell'div align='center'Open/div/td; echo td width='156' height='13' align='center' class='tblcell'div align='center'Payment Type/div/td; echo td width='156' height='13' align='center' class='tblcell'div align='center'Last Processed By/div/td; echo /tr; } echo /table; ? ?php } ?
RE: [PHP] Conditional Select
-Original Message- From: Dan Shirah [mailto:[EMAIL PROTECTED] Sent: Friday, January 19, 2007 3:10 PM To: php-general@lists.php.net Subject: [PHP] Conditional Select I have a page that shows all outstanding tickets, what I'm trying to have it do is let users search by several categories. I want to be able to filter the results based on the user input. For instance, say I have an employee that wants to find ticket #2. He enters 2 in the Request ID field and also enters 01/01/06 in the Date Requested field. How would I return the ticket that matches both Request ID and Date Requested fields? I have been able to return a result with only 1 search criteria entered, but get no results with more than 1. Below is the code I am working on. else { /* if the submit variable exists, the form has been submitted - look for and process form data */ // display result $request_id = $_POST['request_id']; $date_entered = $_POST['date_entered']; $status = $_POST['status']; $request_type = $_POST['request_type']; ? form name=submitForm action=?php echo $_SERVER['PHP_SELF']; ? method=post table align=center width=780 cellpadding=2 cellspacing=2 border=0 tr td width=185 align=rightspan class=smallboldRequest Id:/span/td td width=128 class=tblcellinput type=Text value=?php echo $_POST['request_id']; ? name=request_id size=8 maxlength=/td td width=187 align=rightspan class=smallboldDate Entered:/span/td td width=254 class=tblcellinput type=Text value=?php echo $_POST['date_entered']; ? name=date_entered size=15 maxlength=/td /tr tr td width=185 height=27 align=rightspan class=smallboldStatus:/span/td td width=128 class=tblcellinput type=Text value=?php echo $_POST['status']; ? name=status size=8 maxlength=/td td width=187 align=rightspan class=smallboldRequest Type:/span/td td width=254 class=tblcellinput type=Text value=?php echo $_POST['request_type']; ? name=request_type size=15 maxlength=/td /tr /table FORM ACTION=a href=javascript:clearForm() METHOD=POST name=logoutform table align=center border=0 cellpadding=0 cellspacing=0 width=780 tr td colspan=2 input type=submit name=submit value=Searchnbsp; input type=submit name=reset value=Reset /td /tr /table table align=center border=0 cellpadding=0 cellspacing=0 width=780 trtdnbsp;/td/tr tr td height=13 align=center class=tblheaddiv align=centerstrongProcess Payments /strong/div/td /tr tr td colspan=6hr color=#006600 //td /tr /table table align=center border=0 cellpadding=0 cellspacing=0 width=780 tr td width=88 height=13 align=center class=tblheaddiv align=centerRequest ID /div/td td width=224 height=13 align=center class=tblheaddiv align=centerDate/Time Entered /div/td td width=156 height=13 align=center class=tblheaddiv align=centerStatus/div/td td width=156 height=13 align=center class=tblheaddiv align=centerRequest Type /div/td td width=156 height=13 align=center class=tblheaddiv align=centerLast Processed By/div/td /tr /table ?php $database = database; $host = host; $user = username; $pass = password; // Connect to the datbase $connection = mssql_connect($host, $user, $pass) or die ('server connection failed'); $database = mssql_select_db($database, $connection) or die ('DB selection failed'); // Query the table and load all of the records into an array. **Note my SQL statement below, can I break in and out of PHP like this to verify if multiple variables are set?* * $sql = SELECT child_support_payment_request.credit_card_id, credit_card_payment_request.credit_card_id, date_request_received FROM child_support_payment_request, credit_card_payment_request WHERE child_support_payment_request.credit_card_id = credit_card_payment_request.credit_card_id ? ?php if ($request_id !== '') { AND credit_card_payment_request.credit_card_id = $request_id } ? ?php if ($dateTime !== '') { AND date_request_received = $dateTime; } ? ?php $result = mssql_query($sql) or die(mssql_error()); echo table width='780' border='1' align='center' cellpadding='2' cellspacing='2' bordercolor='#00'; while ($row = mssql_fetch_array($result)) { $id = $row['credit_card_id']; $dateTime = $row['date_request_received']; echo tr; echo td width='88' height='13' align='center' class='tblcell'div align='center'$id/div/td; echo td width='224' height='13' align='center' class='tblcell'div align='center'$dateTime/div/td; echo td width='156' height='13' align='center' class='tblcell'div align='center'Open/div/td; echo td width='156' height='13' align='center' class='tblcell'div align='center'Payment Type/div/td; echo td width='156' height='13' align='center' class='tblcell'div align='center'Last Processed By/div/td; echo /tr; } echo
Re: [PHP] Where can I get the Printer extension?
Chris wrote: Chuck Anderson wrote: Chris wrote: Chuck Anderson wrote: It thought it would be bundled with my Windows version pf Php 4.4.1, but it is not. I've searched for it and can't find it at php.net. You didn't search very hard. On this page: http://php.net/printer Read the bit under Installation. This PECL extension is not bundled with PHP. and You may obtain this unbundled PECL extension from the various PECL snaps pages (select the appropriate repository for your version of PHP): PECL for PHP 4.3.x, PECL for PHP 5.0.x or PECL Unstable. I did look there. I did read that. You didn't try those links, though, did you? (Not Found) (btw, I asked in another group and just found that it is located here: http://pecl4win.php.net/index.php) I don't see how to get there from the main PECL site, but there it is. Consider myself reprimanded :P not too much :-) ... http://snaps.php.net/win32/PECL_5_0/NOT FOUND http://snaps.php.net/win32/ DIR LISTING http://snaps.php.net/ WEB INTERFACE However you didn't mention that the links didn't work ;) Post a documentation bug at http://bugs.php.net :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] request for support: no session survives the next click
Could anyone help me on this one: I can create sessions, see the cookies appear like flies in d:\tmp at a rate of more than 2 per second, and anyhow the session never survives the next click. To test I use the example-file Uitboeksessies.php as enclosed, it works in the office, not here at home. Also I enclosed my php.ini file. Anyone - please? Niek - Alkmaar - Netherland _ Leef je uit: ontwerp je startpagina precies zoals jij het wil hebben op Live.nl. http://www.live.com/getstarted-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] multidimensional array problems
Ive followed your example on grouping. Im still trying to understand all of the code but ive made great progess on this with your example. Now I have one last issue and this will be solved. Ill remind here what Im trying to achieve I have a table for leagues, lookup table and team roster. There can be multiple game types for each game i.e. CoD2 - CTF, CoD2 - SD, CoD2 - TDM. If a member is playing CoD2 CTF and CoD2 TDM there should be a table for each game and type showing each member playing that game/type. If a member is signed up for multiple games/types he/she should have a name listed under each game/type. Right now my php script is only sorting by game which is putting the same person in for each instance of the game instead of sorting through each game and then type. So here is my code so far and any help is greatly appreciated. ?php include (db.php); $memroster = SELECT inf_league.game, inf_league.type, inf_member.user_name, inf_member.rank, . inf_member.country, inf_member.email . FROM inf_league . INNER JOIN inf_memberleague ON inf_league.gid = inf_memberleague.l_id . INNER JOIN inf_member ON inf_member.user_id = inf_memberleague.m_id; $roster = array(); $memrosterresults = mysql_query($memroster) or die(mysql_error()); while ($record = mysql_fetch_object($memrosterresults)) { $roster[$record-game][] = $record; } ksort($roster); foreach ($roster as $game = $records) { print table\n; print caption{$game}/caption\n; print thName/th thRank/th thCountry/th thEmail/th\n; foreach ($records as $record) { print tr\n; print td{$record-user_name}/td\n; print td{$record-rank}/td\n; print td{$record-country}/td\n; print td{$record-email}/td\n; print /tr\n; } print /table\n; } ? _ Valentines Day -- Shop for gifts that spell L-O-V-E at MSN Shopping http://shopping.msn.com/content/shp/?ctId=8323,ptnrid=37,ptnrdata=24095tcode=wlmtagline -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] multidimensional array problems
It's actually quite simple. You simply add another layer of grouping. General case: $result = mysql_query(SELECT a, b, c, d FROM foo ORDER BY a, b, c); while ($record = mysql_fetch_object($result)) { $roster[$record-a][$record-b][] = $record; } ksort($roster); foreach ($roster as $a = $bfield) { print $a; ksort($bfield); foreach ($bfield as $b = $record) { print $a: $b; print_r($record); } } Add real output syntax to taste. On Friday 19 January 2007 4:33 pm, nitrox . wrote: Ive followed your example on grouping. Im still trying to understand all of the code but ive made great progess on this with your example. Now I have one last issue and this will be solved. Ill remind here what Im trying to achieve I have a table for leagues, lookup table and team roster. There can be multiple game types for each game i.e. CoD2 - CTF, CoD2 - SD, CoD2 - TDM. If a member is playing CoD2 CTF and CoD2 TDM there should be a table for each game and type showing each member playing that game/type. If a member is signed up for multiple games/types he/she should have a name listed under each game/type. Right now my php script is only sorting by game which is putting the same person in for each instance of the game instead of sorting through each game and then type. So here is my code so far and any help is greatly appreciated. ?php include (db.php); $memroster = SELECT inf_league.game, inf_league.type, inf_member.user_name, inf_member.rank, . inf_member.country, inf_member.email . FROM inf_league . INNER JOIN inf_memberleague ON inf_league.gid = inf_memberleague.l_id . INNER JOIN inf_member ON inf_member.user_id = inf_memberleague.m_id; $roster = array(); $memrosterresults = mysql_query($memroster) or die(mysql_error()); while ($record = mysql_fetch_object($memrosterresults)) { $roster[$record-game][] = $record; } ksort($roster); foreach ($roster as $game = $records) { print table\n; print caption{$game}/caption\n; print thName/th thRank/th thCountry/th thEmail/th\n; foreach ($records as $record) { print tr\n; print td{$record-user_name}/td\n; print td{$record-rank}/td\n; print td{$record-country}/td\n; print td{$record-email}/td\n; print /tr\n; } print /table\n; } ? -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it. -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Memory Limit?
Hi everyone, Quick question I¹m trying to increase the memory limit so that I can upload larger files to an application I¹m running. I¹m using Apache¹s resource .htaccess file to change PHP on the fly. Below is my .htaccess file. php_value memory_limit 30M php_value post_max_size 25M php_value upload_max_filesize 25M php_value max_execution_time 300 However, when I try and upload a file I get the following error: Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 19590657 bytes) in /path/to/php/file on line 1000 I also have a small program that runs the memory_usage() to see what the memory limit is set to and I get the following: memory usage: 37512 I really don¹t know why I¹m getting the Fatal error. Do I need to do something else that I just don¹t know about? Thanks! Jay
[PHP] non-blocking request to a url (via curl or file_get_contents or whatever)...
hi, I have a tradedoubler webbug to implement in site - not a problem as such - but I have a slight issue when it comes to online payments. I have an order processing page that is requested *directly* by an online payment service in order to tell the site/system that a given order has successfully completely, this occurs prior to the online payment service redirecting the user back to my site... at the end of the order processing the order (basically the order is marked as completed) is removed from the session in such a way that there is no longer anyway to know details about the order, so by the time the user comes back to the site I don't have the required info to create the required webbug url... which led me to the idea/conclusion that I must (in the case of successful online payments) generate the webbug url in the order processing page while the relevant order details are still available and then make a request to the webbug url directly from the server... I could make this request by simply doing this: file_get_contents($webbugURL); but this would block until the data was returned, but I don't want to wait for a reply and I definitely give a hoot about the content returned ... all I want is for the request to go out on the wire and then have my script immediately continue with what it should be doing. I believe this would require creating a non-blocking connection in some way, but I'm stuck as to the correct way to tackle this. I've been reading about non-blocking sockets/streams etc but I'm just becoming more and more confused really, anyone care to put me out of my misery? rgds, Jochem -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Memory Limit?
[snip] I really don¹t know why I¹m getting the Fatal error. Do I need to do something else that I just don¹t know about? [/snip] Make sure your upload form and your php.ini reflect the new upper limit. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FTP Error
Warning: ftp_put(): php_connect_nonb() failed: No route to host (65) in /home/beachgla/public_html/catalog/update/index.php on line 475 This tells me that you are unable to find/connect to the ftpServer that you are giving ftp_connect() I am wondering if your conditional was not working like it should, try this instead if ( $conn_id $login_result ) { echo Connected to ftp server, for user user; } else { echo FTP connection has failed; echo Attempted to connect to ftp server for user username; exit; } Jim Lucas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Security Question
Al wrote: Good point about the 'script evil haxor code here; /script'. That's bad for our users, not the site, per se. what is bad for your users is bad for your site, on top of that the script is running in the context of your domain - all sorts of nasty possibilities that could affect your site. Raw text to html is primarily done with a series of preg_replace() operations. what/how [exactly] the transformation is done determines whether your safe. No include() or exec() allowed near the text. Sounds like I'm in pretty good shape. maybe, maybe not - see above. (do you practice any sports? ;-P) ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] non-blocking request to a url (via curl or file_get_contents or whatever)...
because I like talking to myself :-P Jochem Maas wrote: hi, ... I definitely give a hoot about the content returned ... all I want is for the request to go out on the wire and then have my script immediately continue with what it should be doing. I believe this would require creating a non-blocking connection in some way, but I'm stuck as to the correct way to tackle this. I've been reading about non-blocking sockets/streams etc but I'm just becoming more and more confused really, anyone care to put me out of my misery? did more reading, still unsure of the whole thing, this is what I have right now: $url = array('', 'tbs.tradedoubler.com', '/report?blablablabla'); $isSSL = true; $proto = $isSSL ? 'ssl://' : 'http://'; $port = $isSSL ? 443 : 80; $errno = $errstr = null; if ($sock = fsockopen($proto.$url[1], $port, $errno, $errstr, 10)) { stream_set_blocking($sock, 0); fwrite($sock, GET {$url[2]} HTTP/1.0\r\n); fwrite($sock, Host: {$url[1]}\r\n); //fwrite($sock, Content-length: 0\r\n); //fwrite($sock, Accept: */*\r\n); fwrite($sock, \r\n); fclose($sock); } does this make any sense, will this work at all? would the 10 second timeout [potentially] negate all the hard work? rgds, Jochem -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Need tool to graphically show all includes/requires
We have a fairly complex product that is all PHP based GUI. We're in need of some kind of graphical tool (web, stand alone, windows, linux, osx whatever) that will take a directory tree, recursively traverse all the files, look for 'includes' and 'requires' (and the _once versions too) and then map them out so we can see what files are calling what and where. Anyone suggest something? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Get the shortened browser / HTTP_USER_AGENT
Hi. I want to strip everything after a / in the HTTP_USER_AGENT for example: Opera 9.10/blah/blah would become only Opera 9.10 Lets say $user = $_SERVER[HTTP_USER_AGENT]; $browser = (/, $user); Is this correct? Isn't something needed in the browser variable? Thanks Wikus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php