[PHP] Re: Need direction on PHP-CLI MUD Server
Don Myers wrote: ... B. Since the PHP-CLI script never ends how can I send the first echo You have...? Maybe flush() helps. http://www.php.net/manual/en/function.flush.php -- Pavel a.k.a. Papi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mail() function problem
is that mean that I don't really have to install any mail server or sendmail prgram on my testing server?? Jasper Howard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] i use apache on my windows xp machine and have never gotten around to settings up any kind of sendmail program, I'm pretty sure you have to download one or atleast its some extra configuration. -- -- Jasper Howard :: Database Administration Velocity7 1.530.470.9292 http://www.Velocity7.com/ -- Dre [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm using an Apache server .. doesn't it come with a sendmail program ?? I really don't know Jasper Howard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] do you have a sendmail program on your testing server? -- -- Jasper Howard :: Database Administration Velocity7 1.530.470.9292 http://www.Velocity7.com/ -- Dre [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi I was trying to use the mail() function, but it did not work, maybe because of some settings problem or something that I can't figure out I went online and tried to execute the following //=== ?php $from = $_POST['from']; $subject = $_POST['subject']; $content = $_POST['content']; $to = [EMAIL PROTECTED]; $headers = From:.$from; if(mail($to, $subject, $content, From: $from)) { echosent; } else{ echo not sent; } ? //=== the variable values sent from a Form in another and they are sent correctly but I keep having this error //=== Warning: mail(): Failed to connect to mailserver at localhost port 25, verify your SMTP and smtp_port setting in php.ini or use ini_set() in C:\Program Files\Apache Group\Apache2\htdocs\mysite/myfile.php on line 194 //=== my php.ini settings for the mail function are //= [mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 sendmail_from = [EMAIL PROTECTED] //= thanks in advance Dre, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() function problem
I'm developing uner Windows at home .. but I'm pretty sure that my host is running Unix or Unix like systems on their machines Pahlevanzadeh Mohsen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Please install a mailserver until your SMTP server will be up. When your SMTP server is down,mail func doesn't work. My suggesstion: Please work under UNIX systems. Yours,Mohsen --- Dre [EMAIL PROTECTED] wrote: Hi I was trying to use the mail() function, but it did not work, maybe because of some settings problem or something that I can't figure out I went online and tried to execute the following //=== ?php $from = $_POST['from']; $subject = $_POST['subject']; $content = $_POST['content']; $to = [EMAIL PROTECTED]; $headers = From:.$from; if(mail($to, $subject, $content, From: $from)) { echosent; } else{ echo not sent; } ? //=== the variable values sent from a Form in another and they are sent correctly but I keep having this error //=== Warning: mail(): Failed to connect to mailserver at localhost port 25, verify your SMTP and smtp_port setting in php.ini or use ini_set() in C:\Program Files\Apache Group\Apache2\htdocs\mysite/myfile.php on line 194 //=== my php.ini settings for the mail function are //= [mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 sendmail_from = [EMAIL PROTECTED] //= thanks in advance Dre, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = -DIGITAL SIGNATURE--- ///Mohsen Pahlevanzadeh Network administrator programmer My home phone is: +98213810146 My email address is m_pahlevanzadeh at yahoo dot com My website is: http://webnegar.net __ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mail() function problem
Thank you Lone , I will try it out Lone Wolf [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What you need to do is set your SMTP server inside the php.ini file... [mail function] SMTP = smtp.server.com ; for win32 only sendmail_from = [EMAIL PROTECTED] ; for win32 only ;sendmail_path = ;for unix only, may supply arguments as well ; (default is sendmail -t) The test string I used to make sure my example worked: ?php print mail ('[EMAIL PROTECTED]', 'No need for reply -- PHP test!', /* subject */ hi JohnnLine 2n);/* body*/ ? Robert -Original Message- From: Dre [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 01, 2004 6:48 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: mail() function problem Sorry .. but I'm really so new at this I'm using Apache Server on a MS Windows XP Pro. OS, and I'm trying to send a mail through a form .. what do I need to install or configure to be able to do this. thanks in advance Dre [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm using an Apache server .. doesn't it come with a sendmail program ?? I really don't know Jasper Howard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] do you have a sendmail program on your testing server? -- -- Jasper Howard :: Database Administration Velocity7 1.530.470.9292 http://www.Velocity7.com/ -- Dre [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi I was trying to use the mail() function, but it did not work, maybe because of some settings problem or something that I can't figure out I went online and tried to execute the following //=== ?php $from = $_POST['from']; $subject = $_POST['subject']; $content = $_POST['content']; $to = [EMAIL PROTECTED]; $headers = From:.$from; if(mail($to, $subject, $content, From: $from)) { echosent; } else{ echo not sent; } ? //=== the variable values sent from a Form in another and they are sent correctly but I keep having this error //=== Warning: mail(): Failed to connect to mailserver at localhost port 25, verify your SMTP and smtp_port setting in php.ini or use ini_set() in C:\Program Files\Apache Group\Apache2\htdocs\mysite/myfile.php on line 194 //=== my php.ini settings for the mail function are //= [mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 sendmail_from = [EMAIL PROTECTED] //= thanks in advance Dre, -- 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] Newbie: Validate Required Form Fields
Hello All, I have a newbie question related to validating required Form fields. Suppose we have a two-step user registration process with scripts register1.php and register2.php, each page containing a set of required and non-required fields. In register1.php, when user submits the form, it calls register2.php as the action. In register2.php, I want to validate the Form values submitted by the user in register1.php and if any of the required fields is missing a value, I want to re-dispaly the register1.php page with the appropriate error message. What is the most appropriate way to handle this? Once the validation fails in register2.php, can I call register1.php with parameters? If so, how? Or do I use session variables to capture the error information? How do I redirect to register1.php from within the code execution of register2.php? Thanks in advance for your help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie: Validate Required Form Fields
Use javascript on register1 rather than actually submitting the form to the server. It's the best way to do this, plus it's a bit quicker. If you have javascript questions, those are for another forum. -Brent - Original Message - From: Francis Chang [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 02, 2004 3:37 AM Subject: [PHP] Newbie: Validate Required Form Fields Hello All, I have a newbie question related to validating required Form fields. Suppose we have a two-step user registration process with scripts register1.php and register2.php, each page containing a set of required and non-required fields. In register1.php, when user submits the form, it calls register2.php as the action. In register2.php, I want to validate the Form values submitted by the user in register1.php and if any of the required fields is missing a value, I want to re-dispaly the register1.php page with the appropriate error message. What is the most appropriate way to handle this? Once the validation fails in register2.php, can I call register1.php with parameters? If so, how? Or do I use session variables to capture the error information? How do I redirect to register1.php from within the code execution of register2.php? Thanks in advance for your help. -- 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] Regex for Validating URL
Hi all, yeah, i know, i did do quite a bit of searching but I just cant find it... Does anyone have the regex to make sure an http address is full and without error? like http://www.example.com Much thanks ;-) -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Need direction on PHP-CLI MUD Server
On Thu, 02 Sep 2004 10:16:26 +0300, Pavel Jartsev [EMAIL PROTECTED] wrote: Don Myers wrote: ... B. Since the PHP-CLI script never ends how can I send the first echo You have...? Maybe flush() helps. http://www.php.net/manual/en/function.flush.php I always add the following line to the top of all my CLI scripts to turn off output buffering... while (@ob_end_flush()); -- Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Checkbox Question
Hi all, Im using php's cURL module to submit a form on a remote site. All is *good* so far but i dont know what parameter to pass to ensure that this checkbox is 'checked': INPUT TYPE=checkbox NAME=a VALUE=on so, what is it? a=what? Thanks very much! -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Newbie: Validate Required Form Fields
Francis I have a new web app that does exactly that. Page one has some mandatory fields. Page 2 checks these fields and tells the user to go back if they aren't complete. If they are complete then they are presented with page 2 and the fields it holds. -- - Michael Mason Arras People www.arraspeople.co.uk - Francis Chang [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello All, I have a newbie question related to validating required Form fields. Suppose we have a two-step user registration process with scripts register1.php and register2.php, each page containing a set of required and non-required fields. In register1.php, when user submits the form, it calls register2.php as the action. In register2.php, I want to validate the Form values submitted by the user in register1.php and if any of the required fields is missing a value, I want to re-dispaly the register1.php page with the appropriate error message. What is the most appropriate way to handle this? Once the validation fails in register2.php, can I call register1.php with parameters? If so, how? Or do I use session variables to capture the error information? How do I redirect to register1.php from within the code execution of register2.php? Thanks in advance for your help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Load Data Local Infile
I am using the following command and it appears to execute but does not actually load any data: LOAD DATA LOCAL INFILE 'public_html/CSV/act-export.csv' INTO TABLE MembersData FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; Any ideas what I might be missing...? The file exists, and I must have the path right or would get an error but still no joy unfortunately... -- - Michael Mason Arras People www.arraspeople.co.uk - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Handling XML output in a slim way
Raditha Dissanayake wrote: If it's not broken don't fix it. If what you are doing right now works stick with it because it consumes very little memory or CPU compared to DOM functions. You are right, it works. But I'm not satisified and up until now I've been dealing with very simple XML documents, but they're getting more and more complexer and I'm spending more and more time getting complex XML output right with the string-concact method. - Markus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] importNode
I am trying to copy the body portion of a HTML file for use in the current page. I am using PHP 5.0.1. I think the following is close but not close enough; nothing gets imported by importNode. I assume this would be easy if I knew the DOM well enough; if someone else is then I hope this would be easy enough for them to either fix or provide something that works. ?php define(APPLICATION_ROOT, C:/Apache2/htdocs/); $Filename = Categories.html; if (!file_exists(APPLICATION_ROOT.$Filename)) { print File $Filename does not existbr\n; exit; } $Document = new DOMDocument(); $Document-loadHTMLFile(APPLICATION_ROOT.$Filename); if (!$Document) { echo Error loading $Filenamebr\n; exit; } $NewDocument = new DOMDocument(); $Body = $Document-getElementsByTagName(body)-item(0); foreach($Body-getElementsByTagName(*) as $Node) $NewDocument-importNode($Node, FALSE); print $NewDocument-saveHTML(); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
On Thu, 2 Sep 2004 10:59:20 +0200, Nick Wilson [EMAIL PROTECTED] wrote: yeah, i know, i did do quite a bit of searching but I just cant find it... Does anyone have the regex to make sure an http address is full and without error? like http://www.example.com A quick google (php regex validate url) found this... http://www.canowhoopass.com/guides/regex/ -- Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Exporting Dbase to CSV
Jay Blanchard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What, exactly, do you mean? A CSV file that resembles a spreadsheet? A doc with CSV? The term CSV is very common; it means Comma Separated Values. It is the format that originally was (and is) used by the Basic language. When someone says CSV format or CSV file I understand quite well what they mean or should mean. It is not a standard format, but it is nearly standard. I have no idea what a CSV file that resembles a spreadsheet is and I especially have no idea what a doc with CSV is. The definition of those however are probably not important here, except they are much less likely to be understood than the term CSV format. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Checkbox Question
Hi Nick, Nick Wilson wrote: Hi all, [...] INPUT TYPE=checkbox NAME=a VALUE=on so, what is it? a=what? [...] if a was checked a=on is posted (or 'get'ed) if not checked a isn't set. Thanks very much! You're welcome Stephan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
* and then Stut declared Does anyone have the regex to make sure an http address is full and without error? like http://www.example.com A quick google (php regex validate url) found this... http://www.canowhoopass.com/guides/regex/ Yes, i saw that page. As I said, I have searched *a lot* for this. That is a bit overkill for me, i just want to validate the syntax of a regular http address. I tried reading the code to extract the needed portion but couldnt work it out ;( Anyone help me out? Thanks.. -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: importNode
Sam Hobbs [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am trying to copy the body portion of a HTML file for use in the current page. I am using PHP 5.0.1. I think the following is close but not close enough; nothing gets imported by importNode. I assume this would be easy if I knew the DOM well enough; if someone else is then I hope this would be easy enough for them to either fix or provide something that works. ?php define(APPLICATION_ROOT, C:/Apache2/htdocs/); $Filename = Categories.html; if (!file_exists(APPLICATION_ROOT.$Filename)) { print File $Filename does not existbr\n; exit; } $Document = new DOMDocument(); $Document-loadHTMLFile(APPLICATION_ROOT.$Filename); if (!$Document) { echo Error loading $Filenamebr\n; exit; } $NewDocument = new DOMDocument(); $Body = $Document-getElementsByTagName(body)-item(0); foreach($Body-getElementsByTagName(*) as $Node) $NewDocument-importNode($Node, FALSE); print $NewDocument-saveHTML(); ? Ooops, sorry. I should have searched the archives before posting. I see I need to do an appendChild after importNode. That works if I set deep to TRUE, except I get elements repeated. I am confident I will solve that in a couple of minutes, so I think I am finally done with that portion. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dynamic HTML Creation
Ramil Sagum [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] given a template : - body User Information:p Name: {$name}br Address: {$address}br /body - and the php code: $smarty = new Smarty; $smarty-assign('name', 'george smith'); $smarty-assign('address', '45th Harris'); $smarty-display('index.tpl'); I can do something very similar using DOM directly. Now that I have learned how to use DOM in PHP 5, it will (I hope) require just a few minutes to write some generalized functions to make things work in an equivalent manner. Doing things that way, the editor used to edit the UI can be virtually any HTML editor. My knowledge of the DOM and my code will be more portable to other languages. I am sure that Smarty can do many other useful things, but probably they are not needed for what I am doing. I think it is important to first learn the DOM and how to use it; it is a standard that can be used in an abundance of ways and in many other languages. Without becoming familiar with DOM it is difficult to understand the advantages of Smarty. You sent me a message offline from the newsgroup; I prefer to keep things in the list. You implied I am being ignorant. I try to avoid making emotional statements such as that. I tried to explain that I spend too much time learning things I can't use. It is not a matter of not wanting to learn; it is a matter of not wasting time. It is too easy for me to spend time learning something that I can't use. It is more a matter of having too great of a desire to learn. Since you are familiar with Smarty, it sure would help if you could explain it's advantage compared to using the DOM for what I am doing. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Checkbox Question
Stephan Fiedler wrote: Hi Nick, Nick Wilson wrote: Hi all, [...] INPUT TYPE=checkbox NAME=a VALUE=on so, what is it? a=what? [...] if a was checked a=on is posted (or 'get'ed) if not checked a isn't set. Thanks very much! You're welcome Stephan that actually depends on the browser. Mayne browsers send a= when it's not checked (meaning an EMPTY value) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Load Data Local Infile
[snip] I am using the following command and it appears to execute but does not actually load any data: LOAD DATA LOCAL INFILE 'public_html/CSV/act-export.csv' INTO TABLE MembersData FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; Any ideas what I might be missing...? The file exists, and I must have the path right or would get an error but still no joy unfortunately... [/snip] Do you have the proper permissions to read the file? BTW, OT. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Exporting Dbase to CSV
[snip] Jay Blanchard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What, exactly, do you mean? A CSV file that resembles a spreadsheet? A doc with CSV? The term CSV is very common; it means Comma Separated Values. It is the format that originally was (and is) used by the Basic language. When someone says CSV format or CSV file I understand quite well what they mean or should mean. It is not a standard format, but it is nearly standard. I have no idea what a CSV file that resembles a spreadsheet is and I especially have no idea what a doc with CSV is. The definition of those however are probably not important here, except they are much less likely to be understood than the term CSV format. [/snip] Sam, Thanks for bringing this back up. I know what a CSV file is, but the original poster asked a fairly ambiguous question, so I was attempting to get him to clarify what he was looking for. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MSSQL, PHP and Linux
[snip] On Thursday 02 September 2004 08:30, blackwater dev wrote: the date is a very good question? Here is the info from my system -rwxr-xr-x1 root root 1371932 Sep 1 19:50 /usr/bin/php Not sure why its showing that date - Apache has been restarted. But that's probably your php-cli version. Are you using the Apache module version of PHP? I didn't see it in the configure command you posted previously. [/snip] Make sure that you do a 'make clean'. I have found that phpinfo() does not get updated properly but the functions may still work. Doing a 'make clean' will insure that the info is updated properly. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Load Data Local Infile
On Thursday 02 September 2004 17:18, Harlequin wrote: I am using the following command and it appears to execute but does not actually load any data: LOAD DATA LOCAL INFILE 'public_html/CSV/act-export.csv' INTO TABLE MembersData FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; Is this new PHP 5 syntax? Any ideas what I might be missing...? Probably the MySQL list. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Do you think there's a God? Well, SOMEbody's out to get me! -- Calvin and Hobbs */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Assign null value using php
Hello, Can any one tell me how to assign a null value to a php string?. I tried assigning empty single quote,backslash with zero,double quotes also. but nothing works.. Regards, Uma -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
On Thursday 02 September 2004 18:42, Nick Wilson wrote: * and then Stut declared Does anyone have the regex to make sure an http address is full and without error? like http://www.example.com Define FULL and WITHOUT ERROR. Without knowing what *you* mean by full without error, I don't think anybody can sensibly help you. For instance for the above example you don't even need a regex: if ($url === 'http://www.example.com') { echo 'Yay!, full and without error!'; } I've a feeling that's not what you want, so tell us what you want. A quick google (php regex validate url) found this... http://www.canowhoopass.com/guides/regex/ Yes, i saw that page. As I said, I have searched *a lot* for this. That is a bit overkill for me, It would be nice when asking a question to summarise what research you have done. Instead of just saying I've looked and found nothing (or words to that effect). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Heisengberg might have been here. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] importing DBF data into mysql
Ave, This is undoubtedly exactly what I was looking for. What I don't understand is why its' not converting my DBF file. It gives a Could not read File error. It reads the dbf file that came with the script. I'm still trying to figure it out but it won't work... Thanks though. On 9/1/04 6:52 PM, Thornton [EMAIL PROTECTED] wrote: This is probably what your looking for http://www.coolnet.cz/miro/dbf2mysql/dbf2mysql.tar.bz2 It should handle your needs On Wed, 2004-09-01 at 14:08, PHP Junkie wrote: Ave, Is there a PHP script that is able to import or convert DBF data into mySQL tables? I need to get my DBF data into mySQL and PHPMyAdmin couldn't handle it. Another problem I have is I'm running a MAC OS X... There is a very simple and efficient DBF2MYSQL program for windows but not for MAC. I did see somewhere a PHP script that could do it, but I don't know where. Thanks. -- - Thornton [EMAIL PROTECTED] - - Cierra Grouphttp://www.cierragroup.com - -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Assign null value using php
T Umashankari wrote: Hello, Can any one tell me how to assign a null value to a php string?. I tried assigning empty single quote,backslash with zero,double quotes also. but nothing works.. Regards, Uma $var = null; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Assign null value using php
T Umashankari wrote: Hello, Can any one tell me how to assign a null value to a php string?. I tried assigning empty single quote,backslash with zero,double quotes also. but nothing works.. Regards, Uma $str = NULL; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Assign null value using php
On Thursday 02 September 2004 20:23, T UmaShankari wrote: Can any one tell me how to assign a null value to a php string?. I tried assigning empty single quote,backslash with zero,double quotes also. but nothing works.. manual Types NULL -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* If only one solution can be found for a field problem, then it is usually a stupid solution -- Murphy's Military Laws n37 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
From: Nick Wilson [EMAIL PROTECTED] Does anyone have the regex to make sure an http address is full and without error? like http://www.example.com (?:http://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\. )*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+) ){3}))(?::(?:\d+))?)(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F \d]{2}))|[;:@=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{ 2}))|[;:@=])*))*)(?:\?(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{ 2}))|[;:@=])*))?)?)|(?:ftp://(?:(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(? :%[a-fA-F\d]{2}))|[;?=])*)(?::(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a- fA-F\d]{2}))|[;?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\d+)(?:\.(?:\d+))*))(?:(?:%0[Aa])?(?:%20)*)=(?:(?:%0[Aa]) ?(?:%20)*))?(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))*)))*)(?:( ?:(?:(?:%0[Aa])?(?:%20)*)(?:[;,])(?:(?:%0[Aa])?(?:%20)*))(?:(?:(?:(?:( ?:(?:[a-zA-Z\d]|%(?:3\d|[46][a-fA-F\d]|[57][Aa\d]))|(?:%20))+|(?:OID|o id)\.(?:(?:\d+)(?:\.(?:\d+))*))(?:(?:%0[Aa])?(?:%20)*)=(?:(?:%0[Aa])?( ?:%20)*))?(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))*))(?:(?:(?: %0[Aa])?(?:%20)*)\+(?:(?:%0[Aa])?(?:%20)*)(?:(?:(?:(?:(?:[a-zA-Z\d]|%( ?:3\d|[46][a-fA-F\d]|[57][Aa\d]))|(?:%20))+|(?:OID|oid)\.(?:(?:\d+)(?: \.(?:\d+))*))(?:(?:%0[Aa])?(?:%20)*)=(?:(?:%0[Aa])?(?:%20)*))?(?:(?:[a -zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))*)))*))*(?:(?:(?:%0[Aa])?(?:%2 0)*)(?:[;,])(?:(?:%0[Aa])?(?:%20)*))?)(?:\?(?:(?:(?:(?:[a-zA-Z\d$\-_.+ !*'(),]|(?:%[a-fA-F\d]{2}))+)(?:,(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-f A-F\d]{2}))+))*)?)(?:\?(?:base|one|sub)(?:\?(?:((?:[a-zA-Z\d$\-_.+!*'( ),;/?:@=]|(?:%[a-fA-F\d]{2}))+)))?)?)?)|(?:(?:z39\.50[rs])://(?:(?:(? :(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?
Re: [PHP] Assign null value using php
T UmaShankari wrote: Hello, Can any one tell me how to assign a null value to a php string?. I tried assigning empty single quote,backslash with zero,double quotes also. but nothing works.. Regards, Uma Use the manual, Luke. http://us4.php.net/manual/en/language.types.null.php -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie: Validate Required Form Fields
On Thursday 02 September 2004 16:37, Francis Chang wrote: I have a newbie question related to validating required Form fields. Suppose we have a two-step user registration process with scripts register1.php and register2.php, each page containing a set of required and non-required fields. In register1.php, when user submits the form, it calls register2.php as the action. In register2.php, I want to validate the Form values submitted by the user in register1.php and if any of the required fields is missing a value, I want to re-dispaly the register1.php page with the appropriate error message. What is the most appropriate way to handle this? Once the validation fails in register2.php, can I call register1.php with parameters? No. I'm assuming that the form in register1.php is created using pph, so when you construct that form, plugin the values that were submitted. At the same time you can highlight the items that were invalid. Or do I use session variables to capture the error information? That would be best although you would have to make sure the client accepts (session) cookies and/or enable transparent sessions support in PHP. How do I redirect to register1.php from within the code execution of register2.php? header(Location: http://www...;); There are many ready made code which does all this and more for you. Check out www.phpclasses.org -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* He laughs at every joke three times... once when it's told, once when it's explained, and once when he understands it. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie: Validate Required Form Fields
On Thursday 02 September 2004 16:46, Brent Clements wrote: Use javascript on register1 rather than actually submitting the form to the server. It's the best way to do this, plus it's a bit quicker. If you have javascript questions, those are for another forum. Yuo would use Javascript in addition to, and not instead of, server-side checks. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Corruption is not the #1 priority of the Police Commissioner. His job is to enforce the law and fight crime. -- P.B.A. President E. J. Kiernan */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] importing DBF data into mysql
[snip] This is undoubtedly exactly what I was looking for. What I don't understand is why its' not converting my DBF file. It gives a Could not read File error. It reads the dbf file that came with the script. I'm still trying to figure it out but it won't work... http://www.coolnet.cz/miro/dbf2mysql/dbf2mysql.tar.bz2 [/snip] Check the permissions -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
John Holmes wrote: From: Nick Wilson [EMAIL PROTECTED] Does anyone have the regex to make sure an http address is full and without error? like http://www.example.com (?:http://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\. )*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+) ){3}))(?::(?:\d+))?)(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F \d]{2}))|[;:@=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{ 2}))|[;:@=])*))*)(?:\?(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{ 2}))|[;:@=])*))?)?)|(?:ftp://(?:(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(? :%[a-fA-F\d]{2}))|[;?=])*)(?::(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a- fA-F\d]{2}))|[;?=])*))?@)?(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|- )*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(? :\d+)(?:\.(?:\d+)){3}))(?::(?:\d+))?))(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+! *'(),]|(?:%[a-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Z\d]|%(?:3\d|[46][a-fA-F\d]|[57][Aa\d]))|(?:%20))+|(?:OID|o id)\.(?:(?:\d+)(?:\.(?:\d+))*))(?:(?:%0[Aa])?(?:%20)*)=(?:(?:%0[Aa])?( ?:%20)*))?(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))*))(?:(?:(?: %0[Aa])?(?:%20)*)\+(?:(?:%0[Aa])?(?:%20)*)(?:(?:(?:(?:(?:[a-zA-Z\d]|%( ?:3\d|[46][a-fA-F\d]|[57][Aa\d]))|(?:%20))+|(?:OID|oid)\.(?:(?:\d+)(?: \.(?:\d+))*))(?:(?:%0[Aa])?(?:%20)*)=(?:(?:%0[Aa])?(?:%20)*))?(?:(?:[a -zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))*)))*))*(?:(?:(?:%0[Aa])?(?:%2 0)*)(?:[;,])(?:(?:%0[Aa])?(?:%20)*))?)(?:\?(?:(?:(?:(?:[a-zA-Z\d$\-_.+ !*'(),]|(?:%[a-fA-F\d]{2}))+)(?:,(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-f A-F\d]{2}))+))*)?)(?:\?(?:base|one|sub)(?:\?(?:((?:[a-zA-Z\d$\-_.+!*'( ),;/?:@=]|(?:%[a-fA-F\d]{2}))+)))?)?)?)|(?:(?:z39\.50[rs])://(?:(?:(? :(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?
Re: [PHP] importing DBF data into mysql
Let's try this: ?php $db=dbase_open ( path/to/file.dbf,0 ); $nr = dbase_numrecords($db); echo File opened with $nr recordsbr\n; $temp = dbase_get_record($db,$i); print_r($temp); ? this simple program should show you the fields of the record 1 of the file. if it works, let us know Pablo. On Thu, 02 Sep 2004 08:40:51 -0400, PHP Junkie [EMAIL PROTECTED] wrote: Ave, This is undoubtedly exactly what I was looking for. What I don't understand is why its' not converting my DBF file. It gives a Could not read File error. It reads the dbf file that came with the script. I'm still trying to figure it out but it won't work... Thanks though. On 9/1/04 6:52 PM, Thornton [EMAIL PROTECTED] wrote: This is probably what your looking for http://www.coolnet.cz/miro/dbf2mysql/dbf2mysql.tar.bz2 It should handle your needs On Wed, 2004-09-01 at 14:08, PHP Junkie wrote: Ave, Is there a PHP script that is able to import or convert DBF data into mySQL tables? I need to get my DBF data into mySQL and PHPMyAdmin couldn't handle it. Another problem I have is I'm running a MAC OS X... There is a very simple and efficient DBF2MYSQL program for windows but not for MAC. I did see somewhere a PHP script that could do it, but I don't know where. Thanks. -- - Thornton [EMAIL PROTECTED] - - Cierra Grouphttp://www.cierragroup.com - -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Pablo M. Rivas. http://pmrivas.ipupdater.com --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
On Thursday 02 September 2004 20:52, John Holmes wrote: From: Nick Wilson [EMAIL PROTECTED] Does anyone have the regex to make sure an http address is full and without error? like http://www.example.com (?:http://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\. )*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+) [snip] Did you just pulled it out of your ***[1] or did you copy-n-paste it from somewhere? [1] hat -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Life would be tolerable but for its amusements. -- G.B. Shaw */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
* and then Jason Wong declared It would be nice when asking a question to summarise what research you have done. Instead of just saying I've looked and found nothing (or words to that effect). bugger off jason, if you dont understand the question dont bore me with your silliness. -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Does this beginner's book exist?
Chris Lott wrote in message: I am looking for a new text for my beginning PHP...[snipped] ... Besides Larry's book - which is excellent - try David Sklar's book called Learning PHP 5 (O'Reilly). Not too much on mySQL with PHP except for chapter 7 _however_ the whole book is grounded in the understanding of PHP syntax and constructs - if/else, loops, arrays, functions - then moves on to databases, cookies/sessions, forms and files. Clear, concise and with humor and if you like Chinese food great entrees for the array examples. Both books are very good. TR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
* and then John Holmes declared From: Nick Wilson [EMAIL PROTECTED] Does anyone have the regex to make sure an http address is full and without error? like http://www.example.com (?:http://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\. Pretty funny John. apart from a good laugh, what does that do? ;-) All i want is to check that the url is valid. IE that it does not read like this for example htt://www.example.com or http://[EMAIL PROTECTED] -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Does this beginner's book exist?
Chris Lott [EMAIL PROTECTED] wrote in message: I am looking for a new text for my beginning PHP and MySQL programming class. This class is for COMPLETE beginners who have never programmed before. I have used, in the past, PHP4: A Beginner's Guide and PHP for the World Wide Web (Visual Quicktart). (I will be using PHP4, at least until the Redhat Enterprise Server upgrades :) However, both of these books, while being well pitched towards beginners, also assume that register_globals is enabled, and while the former is more like a textbook (it has exercises and mini-quizzes) it doesn't do as good a job with the examples as the latter (which has no exercises). My students are distance education students, so little things like variable scopes can be very time consuming to help them with-- it would be nice if the text got it right :) Does a book for complete beginners exist that also demonstrates basic good programming practices, has decent examples, and perhaps exercises/quizzes (not as important as the first two)? c -- Chris Lott ... Besides Larry's book - which is excellent - try David Sklar's book called Learning PHP 5 (O'Reilly). Not too much on mySQL with PHP except for chapter 7 _however_ the whole book is grounded in the understanding of PHP syntax and constructs - if/else, loops, arrays, functions - then moves on to databases, cookies/sessions, forms and files. Plus, there are questions at the end of each chapter. Clear, concise and with humor and - if you like Chinese food - mouth watering entrees for the array examples. Both books are very good. TR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
On Thursday 02 September 2004 21:08, John Nichel wrote: What about NFS mounts? ;) What about them? Look carefully. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* You will not be elected to public office this year. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
* and then John Nichel declared John Holmes wrote: From: Nick Wilson [EMAIL PROTECTED] Does anyone have the regex to make sure an http address is full and without error? like http://www.example.com (?:http://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\. )*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+) ){3}))(?::(?:\d+))?)(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F \d]{2}))|[;:@=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{ 2}))|[;:@=])*))*)(?:\?(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{ 2}))|[;:@=])*))?)?)|(?:ftp://(?:(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(? :%[a-fA-F\d]{2}))|[;?=])*)(?::(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a- fA-F\d]{2}))|[;?=])*))?@)?(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|- )*[a-zA-Z\d])?)\.)*(?:[a-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-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))*)))*)(?:( ?:(?:(?:%0[Aa])?(?:%20)*)(?:[;,])(?:(?:%0[Aa])?(?:%20)*))(?:(?:(?:(?:( ?:(?:[a-zA-Z\d]|%(?:3\d|[46][a-fA-F\d]|[57][Aa\d]))|(?:%20))+|(?:OID|o id)\.(?:(?:\d+)(?:\.(?:\d+))*))(?:(?:%0[Aa])?(?:%20)*)=(?:(?:%0[Aa])?( ?:%20)*))?(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))*))(?:(?:(?: %0[Aa])?(?:%20)*)\+(?:(?:%0[Aa])?(?:%20)*)(?:(?:(?:(?:(?:[a-zA-Z\d]|%( ?:3\d|[46][a-fA-F\d]|[57][Aa\d]))|(?:%20))+|(?:OID|oid)\.(?:(?:\d+)(?: \.(?:\d+))*))(?:(?:%0[Aa])?(?:%20)*)=(?:(?:%0[Aa])?(?:%20)*))?(?:(?:[a -zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))*)))*))*(?:(?:(?:%0[Aa])?(?:%2 0)*)(?:[;,])(?:(?:%0[Aa])?(?:%20)*))?)(?:\?(?:(?:(?:(?:[a-zA-Z\d$\-_.+ !*'(),]|(?:%[a-fA-F\d]{2}))+)(?:,(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-f A-F\d]{2}))+))*)?)(?:\?(?:base|one|sub)(?:\?(?:((?:[a-zA-Z\d$\-_.+!*'(
Re: [PHP] My problem
On Thursday 02 September 2004 07:58, Pahlevanzadeh Mohsen wrote: $parameterforauth=array(dsn=mysql://$username:[EMAIL PROTECTED]/mem, table=usernames, usernamecol=user, passwordcol=pass); If you're 100% positive that the above is correct and both $username and $password are what you expect them to be then because the following ... $ptr_auth_C=new Auth(DB,$parameterforauth,'Login'); $ptr_auth_C-start(); if ($ptr_auth_C-getAuth()) echo Successfuly loggined!!!; ... is not a standard PHP class you would have to ask the author of the class for help. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Q: What is the difference between a duck? A: One leg is both the same. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Load Data Local Infile
Jason Wong wrote: On Thursday 02 September 2004 17:18, Harlequin wrote: I am using the following command and it appears to execute but does not actually load any data: LOAD DATA LOCAL INFILE 'public_html/CSV/act-export.csv' INTO TABLE MembersData FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; Is this new PHP 5 syntax? Any ideas what I might be missing...? Probably the MySQL list. You are behind the times jason, this list has been taken over by the dark forces of mysql -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Regex for Validating URL
[snip] * and then Jason Wong declared It would be nice when asking a question to summarise what research you have done. Instead of just saying I've looked and found nothing (or words to that effect). bugger off jason, if you dont understand the question dont bore me with your silliness. [/snip] Easy gentlemen...easy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
From: Jason Wong [EMAIL PROTECTED] Does anyone have the regex to make sure an http address is full and without error? like http://www.example.com (?:http://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\. )*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+) [snip] Did you just pulled it out of your ***[1] or did you copy-n-paste it from somewhere? Some best of the internet site... I had to pull it from the Google cache since work wouldn't let me get to the site. I don't even know if it really works or not... :) ---John Holmes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
From: Nick Wilson [EMAIL PROTECTED] * and then Jason Wong declared It would be nice when asking a question to summarise what research you have done. Instead of just saying I've looked and found nothing (or words to that effect). bugger off jason, if you dont understand the question dont bore me with your silliness. I couldn't agree more. You're here to answer questions, Jason. You do the research and put the time into finding answer for me because I'm too fucking lazy to do it. You can't expect me to provide useful information in my questions. That's for me to know and for you to pry out of me over the course of 20 emails only to determine that wait, you have to install PHP?... Got it? Seriously, I hope you were being sarcastic or something, Nick. Otherwise the smart people on the list know how to use filters to tune out idiots. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
* and then Jay Blanchard declared Easy gentlemen...easy Fair play Jay. This is not my first encounter with mr.social.skills though ;-) -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
* and then John Holmes declared Seriously, I hope you were being sarcastic or something, Nick. Otherwise the smart people on the list know how to use filters to tune out idiots. I think it's a clear question. I dread coming to this list in case Jason decides to 'tell me off' for somthing. I really wish he'd put me on his 'ignore list'. -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
* and then John Holmes declared From: Nick Wilson [EMAIL PROTECTED] * and then Jason Wong declared besides, i will not be treated that way by anyone without saying somthing. IMO some on this list need to get out a bit more, meet some people, aquire some manners and social skills. I asked the same quesiton elsewhere and got 2 answers with exactly what i needed. Nobody asked anybody to any research/homework for them, i just hoped someone might have it handy and be happy to post it. thanks.. -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session understanding
Hello, Morning .. at least it is where I am :) I have a small issue with sessions, at the moment I am using sessions on our web site and storing the session information in a db_table. It is working great. Right now I am only storing the users ID, name and role in the session data, but I would like to store other information as well. The problem is ... that if that person opens another browser window and connects to the site another session is not created. So if I try and store a variable that would be unique to each window it would get over written. Is this a configuration problem ? Thanks. -- Michael Gale Network Administrator Utilitran Corporation -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
Nick Wilson wrote: * and then Jason Wong declared It would be nice when asking a question to summarise what research you have done. Instead of just saying I've looked and found nothing (or words to that effect). bugger off jason, if you dont understand the question dont bore me with your silliness. Nice. Maybe if you took the time out of your busy day to actually look for a solution, Jason would have to 'bore' you. Here... http://www.google.com/search?hl=enie=UTF-8q=validate+url+php+regular+expressionbtnG=Google+Search Is that enough, or do you want one of us to write the code for you too? -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] trying to do too much with functions?
I have a few functions with way too many parameters in them, or functions which have a non-obvious order of parameters which I constantly have to refer to as I'm working. Since I'm using PHP as my templating language (none smarty here!) as well as the programming language. So I've been looking for some alternatives... My main objectives: 1. have all parameters optional 2. have a mixed order for the paramaters Other languages seem to do this well (Ruby, or perhaps RubyOnRails seems good at it), but in PHP I can only see a few options... I'm hoping someone might offer a few more ideas. ? $params = array('a'='123','b'='456'); echo doStuff($params); ? ?=doStuff(array('a'='123','b'='456'))? ?=doStuff('a=123','b=456')? ?=doStuff('a','123','b','456'); ? ?=doStuff(a='123' b='456')? So, is that it? Have I thought of all possible options? --- Justin French http://indent.com.au -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
Jason Wong wrote: On Thursday 02 September 2004 21:08, John Nichel wrote: What about NFS mounts? ;) What about them? Look carefully. I don't know if I have that much time. :) -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
On 02/09/2004, at 11:27 PM, Nick Wilson wrote: * and then Jason Wong declared It would be nice when asking a question to summarise what research you have done. Instead of just saying I've looked and found nothing (or words to that effect). bugger off jason, if you dont understand the question dont bore me with your silliness. No, Jason was right (in his usual, abrupt, rude kinda way). Good questions get good answers. --- Justin French http://indent.com.au -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
Jay Blanchard wrote: Easy gentlemen...easy Who you callin' a gentleman?!?! -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
* and then Justin French declared On 02/09/2004, at 11:27 PM, Nick Wilson wrote: * and then Jason Wong declared It would be nice when asking a question to summarise what research you have done. Instead of just saying I've looked and found nothing (or words to that effect). bugger off jason, if you dont understand the question dont bore me with your silliness. No, Jason was right (in his usual, abrupt, rude kinda way). Good questions get good answers. It seems I owe Jason an apology. Jason, i apologize. No buts, no becauses, I went a little too far. I'm sorry. I would take it as a kindness though if you would avoid my posts where possible. thankyou. -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
I have taken a look and I have seen a {3} and I think this was for specifying the number of letters of the top domain name. Well, I think it should be {4} for making it work for .info domains also... T Teddy - Original Message - From: John Holmes [EMAIL PROTECTED] To: Jason Wong [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 02, 2004 4:56 PM Subject: Re: [PHP] Regex for Validating URL From: Jason Wong [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need direction on PHP-CLI MUD Server
Hello, I have been banging my head trying to figure out how to design a MUD Server using PHP-CLI as the server and PHP-CLI as the command language. (telnet front end at this point) but The real problem is full interaction with the user in those external commands (php-cli scripts) to send and read data. A. How do I create a input method to connect the external PHP script to the Server's Socket? B. Since the PHP-CLI script never ends how can I send the first echo You have...? D Myers I hope I'm understanding what you're asking. If you need to interact with the user via stdin you can use this function to capture user input: function read() { $fp=fopen(/dev/stdin, r); $input=fgets($fp, 255); fclose($fp); return $input; } Your code flow could look something like: ?php do { print what's your name?\n; $name = read(); } while (empty($name)); print Hello $name!\n; sleep(1); do { print What is your jedi name?\n; $jediName = read(); } while (empty($jediName)); print Hello $name AKA $jediName\n\n; function read() { $fp=fopen(/dev/stdin, r); $input=fgets($fp, 255); fclose($fp); return trim($input); } ? I hope that gets you started in the right direction. Sounds like a fun project. Jim Grill Web-1 Hosting, LP http://www.web-1hosting.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: MSSQL, PHP and Linux
I didn't see it mentioned but if you don't do a 'make clean' command php will not update the info used by php_info(), so you see the old information. I've recently set up access to mssql databases and as repeated by many you need to do the following: install freetds libraries (in my case to /usr/local/freetds) compile php with the --with-mssql=/usr/local/freetds flag setup the mssql DSN entry in the freetds conf file (under /usr/local/freetds/etc) Jon Bertsch -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ftp functions not working
I am writing some backup scripts that will ftp my *.gz files to my ftp server. Unfortunately I didn't originally install php with ftp support (oversight on my part). I reconfigured/installed PHP with --enable-ftp and restarted everything, but the functions still don't work. #!/usr/local/bin/php ? if (function_exists('ftp_connect')): print cool\n; else: print damn\n; endif; ? output when ran: 'Damn' During the make I didn't see any errors. When I ran phpinfo() [http://www.randomthoughtprocess.com/info.php] it shows that I have FTP support. Is there something that I am missing? -- Cory Wiles Systems Engineer ePerformax - Memphis, TN 901.751.4902 http://www.eperformax.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Does this beginner's book exist?
I have one on the shelf that I have never read titled: PHP/MySQL Programming for the Absolute Beginner, no Experience Required which might be worth a look. Looks like they have one for php5 now also http://premierpressbooks.com/ptr_detail.cfm?group=Programmingsubcat=SQLisbn=1%2D59200%2D494%2D6 On Thu, 2 Sep 2004 09:22:39 -0400, Anthony Ritter [EMAIL PROTECTED] wrote: Chris Lott wrote in message: I am looking for a new text for my beginning PHP...[snipped] ... Besides Larry's book - which is excellent - try David Sklar's book called Learning PHP 5 (O'Reilly). Not too much on mySQL with PHP except for chapter 7 _however_ the whole book is grounded in the understanding of PHP syntax and constructs - if/else, loops, arrays, functions - then moves on to databases, cookies/sessions, forms and files. Clear, concise and with humor and if you like Chinese food great entrees for the array examples. Both books are very good. TR -- 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] Regex for Validating URL
On Thursday 02 September 2004 22:10, Nick Wilson wrote: * and then John Holmes declared Seriously, I hope you were being sarcastic or something, Nick. Otherwise the smart people on the list know how to use filters to tune out idiots. I think it's a clear question. I dread coming to this list in case Jason decides to 'tell me off' for somthing. I really wish he'd put me on his 'ignore list'. OK Prince Charming, this will probably be my last response to you. - You preface your question by saying that you already did some research. - Stut suggests a site to you - You say you already looked at that site, you just wasted Stut's good intentions and precious time - John gives you a very comprehensive regex, but apparently its too comprehensive for you -- John doesn't mind wasting time ;) - now re-read what I said. I rest my case. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Justice always prevails ... three times out of seven! -- Michael J. Wagner */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session understanding
From: Michael Gale [EMAIL PROTECTED] I have a small issue with sessions, at the moment I am using sessions on our web site and storing the session information in a db_table. It is working great. Right now I am only storing the users ID, name and role in the session data, but I would like to store other information as well. The problem is ... that if that person opens another browser window and connects to the site another session is not created. So if I try and store a variable that would be unique to each window it would get over written. Is this a configuration problem ? Session are identified by a cookie (by default). No matter what window or how many windows the user has, the same session ID is going to be sent in a cookie when a request is made to your site. So there's no way to tell the requests from different windows apart. Why do you really need to know if a new window is opened or not? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Statistics
I'm trying to develop a set of functions that can handle the statistics of a website. I want them to be as flexible as possible, and i want to be able to have several different views (day, week, month, year). For example if i wanted to know how many visitors, visits and page hits there was each month last year, i could call the function like this: $months = Statistics::getStats(STAT_VIEW_YEAR, 2004); foreach ($months as $month) { echo $month['visitors']; // ... } I'm thinking of doing it like this: ?php class Statistics { public static function logPageView () { global $db; // $db is just a MySQL object interface $ip = $_SERVER['REMOTE_ADDR']; $ex = STATS_SESSION_EXPIRE; $result = $db-query(UPDATE `statistics` SET `visit_end` = NOW() AND `hits` = `hits`+1 WHERE `ip` = '$ip' AND NOW()-`visit_end` $ex ORDER BY `visit_start` DESC LIMIT 1); if ($db-affectedRows() !== 1) { $db-query(INSERT INTO `statistics` (ip, visit_start, visit_end) VALUES ('$ip', NOW(), NOW())); } } public static function getStats ($view = STATS_VIEW_DAY, $date) { global $db; switch ($view) { case STATS_VIEW_YEAR: $sql = YEAR(visit_start) = $date GROUP BY MONTH(visit_start) ORDER BY MONTH(visit_start); break; // More cases default: return FALSE; } return $db-query(SELECT COUNT(DISTINCT ip) AS visitors, COUNT(*) AS visits, SUM(hits) AS hits FROM `statistics` WHERE . $sql)-fetchArray(); } } ? Is there a simpler way of approaching this? -- Daniel Schierbeck -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session understanding
Hello, The site is for a ticket tracking system, if a CSR has a window open and is working on company A - I would like to save some information about company A in a session variable. Since the session is stored in the DB I figured it was save. Then if the CSR need to look up another company and opens another window I want to make sure that the session variable I just set containing company A is not over written. ... Is there a better way to do this ... I was hoping to not have to pass variables between each page by including them in the URL. Michael. On Thu, 2 Sep 2004 11:11:37 -0400 John Holmes [EMAIL PROTECTED] wrote: From: Michael Gale [EMAIL PROTECTED] I have a small issue with sessions, at the moment I am using sessions on our web site and storing the session information in a db_table. It is working great. Right now I am only storing the users ID, name and role in the session data, but I would like to store other information as well. The problem is ... that if that person opens another browser window and connects to the site another session is not created. So if I try and store a variable that would be unique to each window it would get over written. Is this a configuration problem ? Session are identified by a cookie (by default). No matter what window or how many windows the user has, the same session ID is going to be sent in a cookie when a request is made to your site. So there's no way to tell the requests from different windows apart. Why do you really need to know if a new window is opened or not? ---John Holmes... -- Michael Gale Network Administrator Utilitran Corporation -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] trying to do too much with functions?
From: Justin French [EMAIL PROTECTED] I have a few functions with way too many parameters in them, or functions which have a non-obvious order of parameters which I constantly have to refer to as I'm working. Since I'm using PHP as my templating language (none smarty here!) as well as the programming language. So I've been looking for some alternatives... My main objectives: 1. have all parameters optional 2. have a mixed order for the paramaters Other languages seem to do this well (Ruby, or perhaps RubyOnRails seems good at it), but in PHP I can only see a few options... I'm hoping someone might offer a few more ideas. ? $params = array('a'='123','b'='456'); echo doStuff($params); ? ?=doStuff(array('a'='123','b'='456'))? ?=doStuff('a=123','b=456')? ?=doStuff('a','123','b','456'); ? ?=doStuff(a='123' b='456')? So, is that it? Have I thought of all possible options? Have you looked at the Function Handling Functions? http://www.php.net/manual/en/ref.funchand.php An array is probably your best bet, though, since you want to have mixed orders. The only way you'd be able to identify what parameter is which is by using the keys of the array, then. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Regex for Validating URL
I agree Nick for an open source community this list is not very open. Quite a few I am better than you type people on the list. How does that make the beginner feel? I better not ask a question, for I fear that I will get flamed. What a joke! There are many other places to go and get good answers without the bull shit that you get here. Regards, Justin -Original Message- From: Nick Wilson [mailto:[EMAIL PROTECTED] Sent: Thursday, September 02, 2004 7:15 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Regex for Validating URL * and then John Holmes declared From: Nick Wilson [EMAIL PROTECTED] * and then Jason Wong declared besides, i will not be treated that way by anyone without saying somthing. IMO some on this list need to get out a bit more, meet some people, aquire some manners and social skills. I asked the same quesiton elsewhere and got 2 answers with exactly what i needed. Nobody asked anybody to any research/homework for them, i just hoped someone might have it handy and be happy to post it. thanks.. -- Nick W -- 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] Session understanding
I have a small issue with sessions, at the moment I am using sessions on our web site and storing the session information in a db_table. It is working great. Right now I am only storing the users ID, name and role in the session data, but I would like to store other information as well. The problem is ... that if that person opens another browser window and connects to the site another session is not created. So if I try and store a variable that would be unique to each window it would get over written. Is this a configuration problem ? Are they closing all the browser windows before opening the new one? If not, the session will be held onto until it expires from inactivity. -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session understanding
From: Michael Gale [EMAIL PROTECTED] The site is for a ticket tracking system, if a CSR has a window open and is working on company A - I would like to save some information about company A in a session variable. Since the session is stored in the DB I figured it was save. Then if the CSR need to look up another company and opens another window I want to make sure that the session variable I just set containing company A is not over written. ... Is there a better way to do this ... I was hoping to not have to pass variables between each page by including them in the URL. Not sure if I understand completely, but how about using some arrays in your session? Have $_SESSION['companies']['companyA'] = array(...), $_SESSION['companies']['companyB'] = array(...), etc... I think you'll still have to pass some values in the URL to determine what company the different requests are for, but now you'll at least have each one available in the session (so you only have to populate it once, I assume). How you need to approach this from a programmers perspective is realizing that you cannot tell requests from different windows apart. The user could have 100 windows open and you can't really tell. All you do is recieve POST or GET requests and handle them accordingly. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Regex for Validating URL
Maybe what this community needs is an advanced mailing list. I think that these types of attitudes just make the new user to php stray away. If we had a section beginners list that if people asked dumb questions, or questions that are stated dumb, some people would take the time to help the newbie out and show him the right way and then answer his question for him. This way the Arrogants don't have to be in the newbie list and people that are more down to earth can help the php community grow. My 2 cents. Regards, Justin -Original Message- From: Justin French [mailto:[EMAIL PROTECTED] Sent: Thursday, September 02, 2004 7:16 AM To: Nick Wilson Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Regex for Validating URL On 02/09/2004, at 11:27 PM, Nick Wilson wrote: * and then Jason Wong declared It would be nice when asking a question to summarise what research you have done. Instead of just saying I've looked and found nothing (or words to that effect). bugger off jason, if you dont understand the question dont bore me with your silliness. No, Jason was right (in his usual, abrupt, rude kinda way). Good questions get good answers. --- Justin French http://indent.com.au -- 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] print at a specific time
thanks... On Wed, 1 Sep 2004 22:18:30 -0500, Brent Clements [EMAIL PROTECTED] wrote: Sorry forgot to enclose the variable values. doh! I needs more coffee! -Brent - Original Message - From: John Holmes [EMAIL PROTECTED] To: Brent Clements [EMAIL PROTECTED] Cc: devil_online [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, September 01, 2004 10:12 PM Subject: Re: [PHP] print at a specific time Brent Clements wrote: $minute = 01; Be careful with the leading zeros... that's interpreted as an Octal number by PHP, but Octal 1 == Decimal 1 in this case. :) -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] print at a specific time
thanks On Wed, 1 Sep 2004 22:18:30 -0500, Brent Clements [EMAIL PROTECTED] wrote: -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session understanding
Michael Gale wrote: Hello, Morning .. at least it is where I am :) good evening. Close to 10:00pm in tropical paradise (Sri Lanka in case you don't know where that is ) I have a small issue with sessions, at the moment I am using sessions on our web site and storing the session information in a db_table. It is working great. Right now I am only storing the users ID, name and role in the session data, but I would like to store other information as well. The problem is ... that if that person opens another browser window and connects to the site another session is not created. It would seem from your description that though you are storing session data in db, the sesssion identifier itself is passed back and forth via cookies. That means that would be shared between browser windows. The alternative to use trans-sid has it's pros and cons but it will certainly let you store two uniques for two browsers. So if I try and store a variable that would be unique to each window it would get over written. Is this a configuration problem ? Thanks. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: trying to do too much with functions?
Justin French [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have a few functions with way too many parameters in them, or functions which have a non-obvious order of parameters which I constantly have to refer to as I'm working. Since I'm using PHP as my templating language (none smarty here!) as well as the programming language. So I've been looking for some alternatives... My main objectives: 1. have all parameters optional 2. have a mixed order for the paramaters Other languages seem to do this well (Ruby, or perhaps RubyOnRails seems good at it), but in PHP I can only see a few options... I'm hoping someone might offer a few more ideas. ? $params = array('a'='123','b'='456'); echo doStuff($params); ? ?=doStuff(array('a'='123','b'='456'))? ?=doStuff('a=123','b=456')? ?=doStuff('a','123','b','456'); ? ?=doStuff(a='123' b='456')? So, is that it? Have I thought of all possible options? As you should have a fixed parameter order in your function you don't need to pass the variable names in. So this is OK for up to three or four params: doStuff('value1', 'value2', 'value3', 'value4'); If your function takes more than four parameters an associative array would be the way to go (your first example). You might consider splitting it up into several functions if it takes that many arguments. Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] trying to do too much with functions?
Justin French wrote: I have a few functions with way too many parameters in them, or functions which have a non-obvious order of parameters which I constantly have to refer to as I'm working. Since I'm using PHP as my templating language (none smarty here!) as well as the programming language. So I've been looking for some alternatives... hey you forgot C :-) now that java has also adapted a vargs look a like i guess it's high time for PHP to do the same. When faced with the find of situation that you are seem to face what I do is create a class and pass it along as a single parameter. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] importing DBF data into mysql
Ave, It was the permissions issue. Although even before I used the script, I knew permissions would play a role so I had set the permissions appropriately. Unfortunately I didn't set them for an enclosed folder where I was storing the DBF file. Anyhow, it's working now... Thanks a ton! On 9/2/04 8:55 AM, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] This is undoubtedly exactly what I was looking for. What I don't understand is why its' not converting my DBF file. It gives a Could not read File error. It reads the dbf file that came with the script. I'm still trying to figure it out but it won't work... http://www.coolnet.cz/miro/dbf2mysql/dbf2mysql.tar.bz2 [/snip] Check the permissions -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
* Thus wrote Nick Wilson: * and then John Holmes declared From: Nick Wilson [EMAIL PROTECTED] Does anyone have the regex to make sure an http address is full and without error? like http://www.example.com (?:http://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\. Pretty funny John. apart from a good laugh, what does that do? ;-) All i want is to check that the url is valid. IE that it does not read like this for example htt://www.example.com or http://[EMAIL PROTECTED] Both of those are perfectly valid. Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Session understanding
Michael Gale [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, Morning .. at least it is where I am :) I have a small issue with sessions, at the moment I am using sessions on our web site and storing the session information in a db_table. It is working great. Right now I am only storing the users ID, name and role in the session data, but I would like to store other information as well. The problem is ... that if that person opens another browser window and connects to the site another session is not created. So if I try and store a variable that would be unique to each window it would get over written. Is this a configuration problem ? Thanks. An alternative might be omitting cookies and passing the session id around via GET/POST. This would solve your problem but might require some work to adapt your application. Another advantage of this would be that you would not have to rely on your user's cookie setting being enabled. Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Checkbox Question
* Thus wrote Nick Wilson: Hi all, Im using php's cURL module to submit a form on a remote site. All is *good* so far but i dont know what parameter to pass to ensure that this checkbox is 'checked': INPUT TYPE=checkbox NAME=a VALUE=on TIAS. a=value|on) which ever the browser seems appropriate. Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] trying to do too much with functions?
On Thursday 02 September 2004 22:11, Justin French wrote: I have a few functions with way too many parameters in them, or functions which have a non-obvious order of parameters which I constantly have to refer to as I'm working. Since I'm using PHP as my templating language (none smarty here!) as well as the programming language. So I've been looking for some alternatives... My main objectives: 1. have all parameters optional 2. have a mixed order for the paramaters Other languages seem to do this well (Ruby, or perhaps RubyOnRails seems good at it), but in PHP I can only see a few options... I'm hoping someone might offer a few more ideas. ? $params = array('a'='123','b'='456'); echo doStuff($params); ? ?=doStuff(array('a'='123','b'='456'))? ?=doStuff('a=123','b=456')? ?=doStuff('a','123','b','456'); ? ?=doStuff(a='123' b='456')? So, is that it? Have I thought of all possible options? Some languages handle it gracefully by allowing you to specify the parameters name and value when calling the function. AFAIK using arrays is the only way of emulating such a behaviour in PHP. Doing so allows you to easily extend a function's functionality and also not having to worry about order of parameters etc. Just look at how many of PHP's own functions have been extended over the years. And at least one of them have had the parameters switched around. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Regarding astral projection, Woody Allen once wrote, This is not a bad way to travel, although there is usually a half-hour wait for luggage. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
On Thursday 02 September 2004 22:15, Justin French wrote: No, Jason was right (in his usual, abrupt, rude kinda way). abrupt -- maybe, rude -- no I usually reserve my more elegant prose for my sweetheart. Good questions get good answers. Good advice. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* If you can't get your work done in the first 24 hours, work nights. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php does not get variable values in POST method
I developed an html/php form in a Php version 4.0.6, working fine, but when a moved the files to another web server with Php 4.3.2 the file procesaadmision.php called in the Post method does not get any of the input html variables defined in the calling form. form ACTION=procesaadmision.php METHOD=POST Thanks for any help Leticia Campos IT Programming -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] trying to do too much with functions?
On Thu, 2004-09-02 at 07:11, Justin French wrote: I have a few functions with way too many parameters in them, or functions which have a non-obvious order of parameters which I constantly have to refer to as I'm working. Since I'm using PHP as my templating language (none smarty here!) as well as the programming language. So I've been looking for some alternatives... My main objectives: 1. have all parameters optional 2. have a mixed order for the paramaters Other languages seem to do this well (Ruby, or perhaps RubyOnRails seems good at it), but in PHP I can only see a few options... I'm hoping someone might offer a few more ideas. ? $params = array('a'='123','b'='456'); echo doStuff($params); ? ?=doStuff(array('a'='123','b'='456'))? ?=doStuff('a=123','b=456')? ?=doStuff('a','123','b','456'); ? ?=doStuff(a='123' b='456')? So, is that it? Have I thought of all possible options? /** * pass an array..so as long as you pass one thing... */ function doStuff($args) { // do something print_r($args); } /** * this arg is optional as it has a default value */ function doSomething($x=0) { return $x; } -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development / signature.asc Description: This is a digitally signed message part
Re: [PHP] Handling XML output in a slim way
Hello, On 09/02/2004 06:25 AM, Markus Fischer wrote: If it's not broken don't fix it. If what you are doing right now works stick with it because it consumes very little memory or CPU compared to DOM functions. You are right, it works. But I'm not satisified and up until now I've been dealing with very simple XML documents, but they're getting more and more complexer and I'm spending more and more time getting complex XML output right with the string-concact method. You may want to try this XML writer class. It lets you just add tags and data and then it outputs the data properly encoded and nicely indented according to your specifications. It does not requere any special extension. http://www.phpclasses.org/xmlwriter -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp functions not working
Cory D. Wiles wrote: I am writing some backup scripts that will ftp my *.gz files to my ftp server. Unfortunately I didn't originally install php with ftp support (oversight on my part). I reconfigured/installed PHP with --enable-ftp and restarted everything, but the functions still don't work. #!/usr/local/bin/php ? if (function_exists('ftp_connect')): print cool\n; else: print damn\n; endif; ? output when ran: 'Damn' During the make I didn't see any errors. When I ran phpinfo() [http://www.randomthoughtprocess.com/info.php] it shows that I have FTP support. Is there something that I am missing? Did you install php cli binary? Is it installed in /usr/local/bin? Check the build date (/usr/local/bin/php -i | grep Build Date). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie: Validate Required Form Fields
Hello, I have a newbie question related to validating required Form fields. Suppose we have a two-step user registration process with scripts register1.php and register2.php, each page containing a set of required and non-required fields. In register1.php, when user submits the form, it calls register2.php as the action. In register2.php, I want to validate the Form values submitted by the user in register1.php and if any of the required fields is missing a value, I want to re-dispaly the register1.php page with the appropriate error message. What is the most appropriate way to handle this? Once the validation fails in register2.php, can I call register1.php with parameters? If so, how? Or do I use session variables to capture the error information? How do I redirect to register1.php from within the code execution of register2.php? You may want to try this forms generation and validation class using hidden fields to pass validated data to next page. http://www.phpclasses.org/formsgeneration You may also use in conjunction this multi-page forms class that seems to do more like what you need: http://www.phpclasses.org/multipageforms -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for Validating URL
Hello, From: Nick Wilson [EMAIL PROTECTED] Does anyone have the regex to make sure an http address is full and without error? like http://www.example.com Usually I use this expression: '^(http|https)\://(([-!#\$%\'*+.0-9=?A-Z^_`a-z{|}~^?]+\.)+[A-Za-z]{2,6})(\:[0-9]+)?(/)?/' You may also want to try this forms generation and validation class that comes with special URL auto-completion field support so you can do for instance simply type www.php.net and it automatically expand to http://www.php.net/ and conform to a more strict validation expression like the above without making the user type it all. http://www.phpclasses.org/formsgeneration -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp functions not working
On Thursday 02 September 2004 22:43, Cory D. Wiles wrote: #!/usr/local/bin/php During the make I didn't see any errors. When I ran phpinfo() [http://www.randomthoughtprocess.com/info.php] it shows that I have FTP support. Is there something that I am missing? You're using php-cli. What does: /usr/local/bin/php -i | less show? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Vulcans worship peace above all. -- McCoy, Return to Tomorrow, stardate 4768.3 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Windows user authentication thru PHP and Apache
All, Wanting to build a login page which uses the same user information as the user's Windows account. Is there a way to validate a user's login information against the primary Windows domain controller using PHP and Apache? Searching the archives all I'm finding is how to do this with PHP IIS (which appears to be by using the functionality of IIS). Thanks, Dave Merritt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Locate compiled PHP (Zend) Scripts
Hi, does anyone know, how I can easily determine which websites are using compiled PHP-Scripts. I have to check our webserver, based on BSD and Apache, for these Scripts. Would appreciate any suggestions from you! Thank you Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] this is a test
this is a test -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php does not get variable values in POST method
On Thu, 02 Sep 2004 09:03:34 -0700, Leticia Campos wrote: I developed an html/php form in a Php version 4.0.6, working fine, but when a moved the files to another web server with Php 4.3.2 the file procesaadmision.php called in the Post method does not get any of the input html variables defined in the calling form. form ACTION=procesaadmision.php METHOD=POST you probably have register globals disabled there: http://de3.php.net/manual/en/ini.sect.data-handling.php#ini.register-globals thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Statistics
Daniel Schierbeck wrote: I'm trying to develop a set of functions that can handle the statistics of a website. I want them to be as flexible as possible, and i want to be able to have several different views (day, week, month, year). For example if i wanted to know how many visitors, visits and page hits there was each month last year, i could call the function like this: Is there a simpler way of approaching this? You can save yourself a lot of time and effort by installing something like analog or webalizer (both free), unless ofcourse your hosting company is ripping you off by not giving access to the raw log files. The other factor you would want to consider is that inserting into a mysql database is much slower than retrieving from it particularly when you have lots of indices - you will need plenty of them if you are going to build any kind of report. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session understanding
Michael Gale wrote: Hello, The site is for a ticket tracking system, if a CSR has a window open and is working on company A - I would like to save some information about company A in a session variable. Since the session is stored in the DB I figured it was save. Then if the CSR need to look up another company and opens another window I want to make sure that the session variable I just set containing company A is not over written. ... Is there a better way to do this ... I was hoping to not have to pass variables between each page by including them in the URL. Michael. It will be a tough ask to prevent one record from being overwritten by another - As I mentioned in a previous mail the only way to do this is probably to use trans-sid. An alternative approach (that does not involve trans-sid) would be to save multiple records along with another record which identifies which record is beign currently worked on. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp functions not working
#!/usr/local/bin/php ? if (function_exists('ftp_connect')): print cool\n; else: print damn\n; endif; ? output when ran: 'Damn' During the make I didn't see any errors. When I ran phpinfo() [http://www.randomthoughtprocess.com/info.php] it shows that I have FTP support. Is there something that I am missing? The version of PHP you're running on the command-line may or may not be the same installation as the one used by Apache. Use the following to see what your CLI installation does or does not have enabled: php -r phpinfo(); michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] this is a test
this is a test -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] this is a test
this is a test -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php