Re: [PHP] New php functions?
It was probably the last thing you looked for there. I know I constantly go back to look up Date() placeholders. I know the feeling! In the end I printed the Date page out, folded it up and stapled it into my PHP pocket ref book -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 PGP Key available, send email with subject: Send PGP Key :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re:[PHP]imap and POP3
What I want to do is, check my POP3 server for messages, download those messages into my MySQL DB. I want to retrieve the FROM, SUBJECT, HEADER and BODY from the messages and place them in the corresponding mysql fields. This script I wrote last summer may help you some what.. it handles attachments too. #!/usr/local/bin/php -q ? // Written By Jon Farmer [EMAIL PROTECTED] // A script which dowmloads the support email and processes it $dbhost = localhost; $dbuser = user; $dbpassword = password; $dbname = support; $time = time(); mysql_pconnect($dbhost, $dbuser, $dbpassword); mysql_select_db($dbname); //Open the mailbox and check if mail waiting $mailstream = imap_open({localhost:143}INBOX,username,password); if (!$mailstream) { mysql_close(); exit; } $email = imap_headers($mailstream); if (count($email) == 0) { //echo Nothing to process ... \n; imap_expunge($mailstream); imap_close($mailstream); mysql_close(); exit; } //echo count($email) . \n; for ($i=1; $i=count($email); $i++) { ; $thisheader = imap_header($mailstream, $i); $subject = $thisheader-subject; $from = $thisheader-from; $name = $from[0]-personal; $fromaddr = sprintf(%s@%s,$from[0]-mailbox,$from[0]-host); //echo $subject . . $fromaddr . . $name . \n; $struc = imap_fetchstructure($mailstream, $i, FT_UID); //echo type: . $struc-bytes . \n; if (empty($struc-bytes)) { //echo Type: . $struc-type . \n; //echo Sub-type: . $struc-subtype . \n; $mailtext = trim(imap_fetchbody($mailstream, $i, 1)); //echo Parts Count: . Count($struc-parts) . \n; for ($z = 1; $z Count($struc-parts) + 1; $z++) { //echo Part No. . $z . : . $struc-parts[$z]-type . \n; if ($struc-parts[$z]-ifparameters) { $parameters = $struc-parts[$z]-parameters; $resarray = get_object_vars($parameters[0]); $filename[] = $resarray[value]; $filesrc[] = addslashes(imap_fetchbody($mailstream, $i, $z + 1)); switch ($struc-parts[$z]-type) { case 0: $type = text; case 1: $type = multipart; case 2: $type = message; case 3: $type = application; case 4: $type = audio; case 5: $type = image; case 6: $type = video; case 7: $type = other; default: $type = text; } $encode = $struc-parts[$z]-encoding . ; settype($encode, integer); switch ($encode) { case 0: $encoding = 7Bit; break; case 1: $encoding = 8Bit; break; case 2: $encoding = Binary; break; case 3: $encoding = Base64; break; case 4: $encoding = Quoted-Printable; break; case 5: $encoding = Other; break; } //echo $encoding . \n; $filetype[] = addslashes($type . / . strtolower($struc-parts[$z]-subtype)); $fileencoding[] = $encoding; if ($type . / . strtolower($struc-parts[$z]-subtype) == text/html) { if (eregi(\.htm, $resarray[value]) || eregi(\.html, $resarray[value])) { } else { $HTML = TRUE; } } $attachments = TRUE; } } } else { $mailtext = trim(imap_body($mailstream, $i)); $attachments = FALSE; } //echo $mailtext\n; if ($HTML) { //echo html\n; imap_delete($mailstream, $i); $bodytext = Dear Customer\n\n; $bodytext .= Thank you for contacting Customer Support.\n\n; $bodytext .= Unfortunately our automatic ticketing system for support requests\n; $bodytext .= is not compatible with HTML email. Please resend your support request\n; $bodytext .= in plaintext format.\n\n; $bodytext .= Alternatively call 09066 xx (call charged at 50p/min at all times); //$fromaddr mail ($from, RE: . $subject, $bodytext, From: Customer Support support@localdomain); continue; } if (eregi(SUP[0-9][0-9][0-9][0-9][0-9][0-9], $subject)) { //Existing support call; //Get ticket details from db $location = strpos($subject, SUP); $ticket = trim(substr($subject, $location, 10)); $sSQL = select * from supportrequests where ticketnumber = '$ticket'; $result = mysql_db_query($dbname, $sSQL); if (mysql_num_rows($result) == 0) { //echo Couldn't find ticket number $ticket . \n; continue; } $row = mysql_fetch_array($result); $supportrequestid = $row[0]; $emailtext = trim(imap_fetchbody($mailstream, $i, 1)); $sSQL = insert into supportdetail (supportrequestid, fromname, email, text, datereceived) values ( . $supportrequestid . , ' . $name . ', ' . $fromaddr . ', ' . $mailtext . ', . $time . ); $result = mysql_db_query($dbname, $sSQL); if ($attachments) { $sSQL = select supportdetailid from supportdetail where datereceived = . $time . and supportrequestid = . $supportrequestid; //echo $sSQL . \n; $result = mysql_db_query($dbname, $sSQL); $row = mysql_fetch_array($result); $supportdetailid = $row[supportdetailid]; $numatt = count($filesrc); for ($h =0; $h$numatt; $h++) { $sSQL = insert into attachments (supportdetailid, filename, attachment, filetype, encoding) values ($supportdetailid, '$filename[$h]', ' . $filesrc[$h] . ', '$filetype[$h]', '$fileencoding[$h]'); $result = mysql_db_query($dbname, $sSQL); } } $sSQL = update supportrequests set datelastactioned = $time where supportrequestid = $supportrequestid; $result = mysql_db_query($dbname, $sSQL); } else { //echo New Support Call\n; //get next support number $sSQL
Re: [PHP] How to remove ^M characters from a directory?
I have moved my php files to linux system. Now it z showing (control+M)(^M) characters in the file. How can I remove those characters? /usr/bin/perl -i.bak -npe 's/\r\n/\n/g' filename where filename is the file with he ^M line endings. Regards jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MS Access data = mySQL database
Can anyone tell me how to convert/send data stored in an MS Access database to a mySQL table through PHP?? 3 Ways of doing this come to mind. Only one uses PHP though. 1. From PHP use ODBC to extract from access and send to MySQL through PHP functions. 2. Export to csv from Access and use mysqlimport to import into MySQL. 3. Use the MySQL ODBC driver to link the MySQL tables into Access and run a query to copy the records over. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Echo Informative Text will Script Runs - how ?
How can I echo some text such as Processing, please wait... whilst the PHP script runs. Rather than displaying a blank screen with the results being echoed once the script has fully completed. echo (\Processing, please wait...\); flush(); //processing code here... -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to find out what country the visitor comes from
One you have the IP you need to do a whois on the RIPE database to work out who the IP is assigned to and which country they are in. -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 PGP Key available, send email with subject: Send PGP Key - Original Message - From: SED [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 07, 2002 12:11 PM Subject: [PHP] How to find out what country the visitor comes from Hi, I'm trying to find out what country the visitor comes from to offer them suitable language (like google.com does) but I haven't found a method that works 100%. What I have come up with so far is to use $HTTP_X_FORWARDED_FOR or gethostbyaddr($REMOTE_ADDR) Sometime I get domain which does the job (and that works) but often I get just IP number which leaves me out in the cold. Is there any other way to capture the visitors country? Thanks, SED -- 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] Check if var is a domain name
Hi, I would use a regular expression to check it. This is a pretty general one, but I think it should do the trick. It searches for 1 or more upper or lowercase letters, followed by a literal dot, followed by 2 or 3 lowercase letters. Of course there are valid domains that would not match this (foobar.co.uk) for example, but it should work with the values you specified. 1. Doesn't check every TLD as you acknowledge. 2. Doesnt't check validity as in the domain exists! If I wanted to check the domain was valid and existed I would do a Whois and NSLookup. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Check if var is a domain name
note that www.mynewdomain.com CAN be a valid domain also. Err... sub-domain. -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SAX + attributes
can anyone tell me how I can retrieve attributes of a node using SAX parser in PHP?? Yes use a Start Element Handler. The attribues are passed to it as a associative array. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mpeg
I've asked this question before, but no answer... so here it is again: does anyone now how I can get the dimensions (width, height) of an mpeg file? maybe via a unix command... (because in the PHP manual, I can't find anything about it, and I'm not that much of a unix-guru...)... ImageMagick will do this AFAIK. However you have to compile with the Mpeg libraries to achieve it. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php vs asp
sorry i should have explained myself abit better.i am a huge fan of php hence why i subscribe to this mailing list. its just that i need to settle an argument. my understanding is that php works better with mysql however a friend of mine is adament that asp will work just as well. i am not sure Hmm I have to say it would depend on the quality of the ODBC driver you would be using. For instance: would you be able to get the insert id with ASP as easily as PHP? Look at all the MySQL functions in PHP and ask your friend hwo they would accomplish this in ASP. I would be interested to hear what your friend has to say to this, I would appreciate if you would drop me his/her reaction.. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php vs asp
With ASP the only cost is the OS. Clint ASP = Cost of hardware + Cost of OS + Cost of 3rdParty components. PHP = Cost of hardware. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 PGP Key available, send email with subject: Send PGP -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Display a mesagge and redirect (newbie)
c) and d) are clientside functions if you have already outputted data to the browser so use Javascript to do them -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key - Original Message - From: Simos Varelakis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 17, 2002 12:36 PM Subject: [PHP] Display a mesagge and redirect (newbie) Hi to everyone I want to do the following and i dont know if its possible with php code a) run a mysql query b) display a simpe message c) delay few seconds d)auto redirect to a page can I do this with php i know how to do a) and b) and I can't do c) and d) note that if i try d) with function header (location URL') got an error for headers already send :-( Thanks in advance for your help and time Best regards simos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Connecting from PHP to MySQL on another Server
1. What is the difference between working with PHP and MySQL on a local server and working with PHP and MySQL when MySQL is on a remote server None in terms of functionality. 2. What is the protocol used to connect to MySQL on a local server and what is the protocol used to connect to a remote MySQL server? On the local machine a client (PHP is a client) can connect through unix sockets or TCP (3306). On a remote machine its TCP only. Unix sockets access is faster than TCP. 3. Is there a difference in performance between connecting from PHP to MySQL on a remote server or PHP to MSSQL Server? See above answer. Also you have any TCP/IP overhead to add on. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Mulitple Attachments using php
But looking through the archives there have been a lot of advice, URLs, classes given out, yet I haven't really found anything that can easily be implemented so that I can send muliple attachments in an single email. I have managed it with one code but it always introduced an ATT01583.ATT file, which I do not understand. Any guidence would be very useful, Forget classes and PHP code.. install mutt (assuming you are on a *nix) and call exec() to send via mutt.. You can do it all in one line of code, it works great and not a class or include insight! -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: SMS
You may want to look into this. http://phpclasses.upperdesign.com/browse.html/package/396 Except web - SMS gateways are increasing becoming a unreliabe way to send SMS. I know in the UK some of the mobile networks are blocking certain gateways as they are increasingly being used for spam and also to overload the network. -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] SMS
Hi everyone! I'd be grateful if someone could please tell me a link where I can find a good tutorial on how to develop a SMS tool with PHP, or if somebody has already developed something like it, or if there are any experts around, please give me some information about it. Can you be more specific. Do you mean you want to send SMS, receive SMS or do both? Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parser
My problem: The parser takes in input from an external xml file but the output from the servlet needs to be dynamically fed into the parser something like this: Err no you can feed a XML string to the parser. So capture the XML output from the servlet into a string, clean it up if it has any headers attached etc and then stuff it into the parser. -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Search Engine
Hi all! I want to develop a search engine in PHP for a portal that I'm working on at the moment, and I'd be glad if someone could please show me how to do it, or if anyone knows of a link where i can find a tutorial for that. Use htdig -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Setting up an XML platform/website
Is anyone interested in setting up an XML platform for PHP, where the use of XML is explained, with sample PHP/XML applications and in-depth real live tutorials? Since lot's of people underestimate the power of XML. Maybe, it's nice to be ready when Microsoft's dotNet crashes in and launches an new XML era. Anyone wants to help building such an platform/website? I used the XML parser in a credit card authorisation front end i wrote. Both the info to and from the credit card server was in XML and i used PHP to both build and parse the XML. I dont mind writing a tutorial on what I did, it works well but not sure how proficient it was in using XML. -- -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] weird fopen problem
I am getting a the follwing error: Warning: fopen(/home/jon/pgpfiles/sgsdgsdg,w) - Permission denied in /home/ethiorg/public_html/test.php on line 2 Warning: Supplied argument is not a valid File-Handle resource in /home/ethiorg/public_html/test.php on line 3 Warning: Supplied argument is not a valid File-Handle resource in /home/ethiorg/public_html/test.php on line 4 from the following script: ? $file = fopen(/home/jon/pgpfiles/sgsdgsdg,w); fputs($file, this is a test\n); fclose($file); ? the directory /home/jon/pgpfiles has mode 777 and is owned by nobody and group is nobody. Apache runs under user nobody. Any ideas? -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] weird fopen problem
Hi Jon, Warning: fopen(/home/jon/pgpfiles/sgsdgsdg,w) - Permission denied in /home/ethiorg/public_html/test.php on line 2 the directory /home/jon/pgpfiles has mode 777 and is owned by nobody and group is nobody. Apache runs under user nobody. looks like you try to open a file outside the allowed direcory tree. check your open_basedir setting in php.ini config file. Nope it was the /home/jon did not have execute permission for the httpd user. Fixed now. Thanks to all that responded. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] IP address from which country
No such table, the best you can do is look at their hostname and parse the last part ie .co.uk or .com... And then u can try and figure where they are from that Err... Wrong. You could host a .co.uk in the US or any other country for that matter! What you need to do is find the IP do a RIPE lookup at www.ripe.net and that will tell you who the IP is assigned to and where in the world they are. Of course if its a ISP in Maryland, USA they could have a dialup user from Australia connected so it only gives limited information. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Http request
just use post to send your username/password to the servlet Hi, Can anyone tellme how I can do a http request to a servlet from a PHP?? I mean, I have a username and password which I want to send in a string(variable) to a Servlet which authentifies it and responses back in XML format... any suggestions?? Well that would suffice if he just wanted to display the raw XML in the broswer. However if he wanted to parse the XML he needs to open a socket on port 80 or use a http class. Regards jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to backup records in mySQL DB?
We're beggining again but i'm not scared about the Data. The data is posted online by users. I need to have a way to backup my mySQL data. If possible, on some other site location or in Hard Copy (As in a file) or something. I don't know how to do any of this. I have no idea what to do about it. Can anyone make any suggestions help? This is a MySQL question and not a PHP question. That being said if you have telnet/SSH access to your server create a script to use mysqldump then tar/gzip the result and mail or ftp the resulting file to the backup location. Then cron it to run as often as you want backups. To keep on topic you can use PHP as the scripting language to do this. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP / SSL
I urge you strongly to advise against that. Although it might be possible to downgrade your encryption to 40bit I'd like to make you aware of the fact that DES which is 56 bit encryption if I'm not mistaken was cracked several times by brute force in UNDER 22 hours by the distributed.net people (www.distributed.net). Therefore I would NOT consider 40 bits encryption safe and I feel obligated to make you aware of that. You are warned now :-) so do as you please. Erm, yeah true but by their own admission they used the equivalant of 16 PII 266Mhz machines to accomplish this. If you think someone is going to want your data and has those kinda resources available then yeah go for higher. However if thats your worry where are you going to stop in the length of your key? If your that paranoid then it shouldn't be using public networks in the first place!! -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Signing Files with PGP
The -z option allows you to pass the passphrase on the command line -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key - Original Message - From: Brian Clark [EMAIL PROTECTED] To: PHP is not a drug. [EMAIL PROTECTED] Sent: Thursday, December 20, 2001 2:37 PM Subject: Re: [PHP] Signing Files with PGP * J.Mueller, pro.vider.de GmbH ([EMAIL PROTECTED]) [Dec 20. 2001 04:17]: Hello List, Howdy.. I try to setup a script which automatically signs a file with PGP. [...] When I use something like $command=/usr/local/bin/pgps -u Juergen -ato test1.sig ~/test1.txt; exec($command,$answer); obviously nothing is happening cause the pass phrase was not given. One way is to use popen() to execute the command and fputs() to write out the passphrase. http://download.php.net/manual/en/function.popen.php -- Brian Clark | Avoiding the general public since 1805! Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8 Variables won't constants aren't. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] QUESTION: how to validate credit card number before sent to Versign?
I presume you are sending the details to verisign by posting the info from the form directly to versign. If this is the case the post to a local php script, do the validation and then use the http_post class from http://phpclasses.upperdesign.com/ to send it to verisign Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 19, 2001 5:16 PM Subject: [PHP] QUESTION: how to validate credit card number before sent to Versign? We collect credit card info. on our site and send it to Verisign for processing. We collect the credit card info. on the last page of our registration form. We have about 50% of the credit card numbers declined because people use dashes in their cc number (even though our directions ask them not to). Is there anyway to incorporate the following function so that the dashes would be stripped out before going directly to Verisign for processing? or do I need to create a middle page that would validate the credit card info. before going to Verisign? If the latter is true, then is there a way I can run this validation invisibly - maybe using header(Location:)? ? function clean_no($cc_no){// Remove non-numeric characters from $cc_no return ereg_replace ('[^0-9]+', '', $cc_no); }? Thanks for your help, Shawna -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Emailing attachments upload to a form
Yeah.. code to divide the message into multiple parts, base64_encode the file, and attach it that way. I suggest looking for some kind of Email class that can do that for you. Try http://phpclasses.upperdesign.net/ Mike if you are on *nix used mutt from the commandline. -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Get Hours/Mins/Secs between two timestamps?
Is there a function in PHP that will output the difference between two timestamps (hours/mins/secs), similar in the way that getdate() extracts the date of a timestamp? Thank you. How about subtracting the one timestamp from the other and then devide by 3600, with the remainder divided by 60 and the remainder is your seconds. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key - Original Message - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Get Hours/Mins/Secs between two timestamps?
Since you asked, i guess you're not familiary with the % operator (modulus). Read the operator section of the manual, and you'll see how modulus is your friend... Wrong I use the % operator all the time But a better way, is to subtract one from the other and then use gmdate() on the difference, that way you don't have to worry about differences in excess of 60 secs... and what if the difference between timestamp1 and timestamp2 is 86400 ? -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key - Original Message - From: Andreas Landmark [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 12, 2001 11:34 AM Subject: Re: [PHP] Get Hours/Mins/Secs between two timestamps? On Wed, Dec 12, 2001 at 11:31:25AM -, Jon Farmer wrote: Is there a function in PHP that will output the difference between two timestamps (hours/mins/secs), similar in the way that getdate() extracts the date of a timestamp? Thank you. How about subtracting the one timestamp from the other and then devide by 3600, with the remainder divided by 60 and the remainder is your seconds. -- Andreas D Landmark / noXtension Time flies like an arrow, but fruit flies like a banana. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP+MYSQL: unable to select database
I get: unable to select database when I visit my guestbook.php The user trying it is set in the mysql.user (without any perms) and in the mysql.db (with all perms). Do I have to set all perms to this user in the mysql.user table? Did you 'flush privileges' ? -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Frames creating problems...
Well I have a website with frames. The problem here is that I have a serach box in the top frame and I want the results to be displayed in the other frame. Javascript! Use the OnCLick event of a button to take the value of the textbox and update the href of the other frame passing the contents of the textbox in the querystring. -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Email-based PHP-Script
does anybody know of any documentation how to write scripts that do interact with emails (Majordomo-like), i.e. when an email comes to [EMAIL PROTECTED] that a script is starting which reads the email and completes tasks which are defined within the email? Compile PHP as a binary and pipe the email directly from sendmail into PHP on STDIN Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parse error when requiring
Parse error: parse error in /home/sites/site139/web/EIA/sessionstart.php on line 10 It's strange that line number 10 doesn't exist! Do you have an include statement in sessionstart.php? -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Maximum execution time of 30 seconds exceeded
I wrote a script just to do some local replacement stuff here on my own machine. Is there any way to change the maximum execution time of PHP which seems to be restricted to 30 seconds Would be great if you could give me a hint on how to change this... http://www.php.net/manual/en/function.set-time-limit.php -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Maximum execution time of 30 seconds exceeded
The timeout is set in php.ini Only change it in php.ini if you want it to be serverwide. For a specific script use set_time_linit(). Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Access denied for user
I get the following message when trying to view a php page Warning: Access denied for user: 'jupshoes@localhost' (Using password: YES) in /home/jupshoes/public_html/guest/index.php on line 27 Unable to connect to SQL server The username or password is incorrect. Or the username does not have permission to log on from localhost -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] question on incrementing
I'm trying to increment a variable but either clicking on link or button but I don't want to reload the page. Is there any possible way to pull this off? It would have to be a session or cookie variable for a start. Also you would have to refresh A page inorder to do this so the way i would go is use a hidden frame and onClick of the button refresh the page in the hidden frame. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MsSQL question
Hello world! I'm using php 4.0.6 to work with MsSQL (FreeBSD 4.4, Apache 1.3.20). How should i compile php to enable mssql functions? Exactly as described here: http://www.php.net/manual/en/ref.mssql.php RTFM -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] database question
yeah good call on a type it should of been \s not \S -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key - Original Message - From: Jim Musil [EMAIL PROTECTED] To: py [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, November 29, 2001 10:56 PM Subject: Re: [PHP] database question \S refers to a non whitespace character. In the following: select whatever from articles where textlines regexp ^\Sbingo\S$ what does \S means? py - Original Message - From: Jon Farmer [EMAIL PROTECTED] To: Warren Vail [EMAIL PROTECTED]; Michael Hall [EMAIL PROTECTED]; PHP List [EMAIL PROTECTED] Sent: Thursday, November 29, 2001 9:54 AM Subject: Re: [PHP] database question Actually the sql statement you want is select whatever from articles where textlines regexp ^\Sbingo\S$ regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key - Original Message - From: Warren Vail [EMAIL PROTECTED] To: Michael Hall [EMAIL PROTECTED]; PHP List [EMAIL PROTECTED] Sent: Thursday, November 29, 2001 2:57 PM Subject: RE: [PHP] database question Try; SELECT whatever FROM articles WHERE textlines LIKE %searchword% Two warnings; 1) This will force a table scan (the contents of each row in the entire table because there can be no index to support faster searching of contents that float in the column) which will be very slow on a large database (even a medium size one). 2) This will also find words that exist inside other words. (ie the word ward exists inside toward) If you try to solve this by imbedding blanks between the wildcard (%) and the text, you will probably not be able to find the word at the end of a line, or just prior to a comma or period. I also believe there may be a way to make the search case insensitive, look for something like a WHERE tolower(textlines) LIKE ... to force the column values to be all lower case and make sure your search values are all lower case as well. Good luck, Warren Vail -Original Message- From: Michael Hall [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 29, 2001 2:21 PM To: PHP List Subject: [PHP] database question How can I search a MySQL database field that contains sentences (VARCHAR datatype) or entire texts (TEXT datatype) for single words? Let's say I want to search 100 articles stored in a database field as TEXT for the word bingo, is there any SQL or PHP way of doing that? Mick -- Michael Hall [EMAIL PROTECTED] [EMAIL PROTECTED] http://openlearningcommunity.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: Re: [PHP] URGENT-HELP !!!!!!
Problem with that solution is some SMTP hosts will reject messages from domains that do not resolve to the sending SMTP host. I would recommend setting up a alias on sendmail and pipe all email to that address to /dev/null You would need to stress to your recipients that all replies to that email are ignored. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key - Original Message - From: Chamarty Prasanna Kumar [EMAIL PROTECTED] To: Johan Holst Nielsen [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, November 30, 2001 10:54 AM Subject: Re: Re: [PHP] URGENT-HELP !! Thanks very much !! Smart solution !! yes, I don't want to get reply from that mail. Just looking for any solution..if u finds one please let me know. Regards, Kumar. On Fri, 30 Nov 2001 Johan Holst Nielsen wrote : Want to send mail through PHP script such that the receiver of that mail should not contain FROM header. I used mail() function with empty FROM header and even without FROM header, but the receiver is still getting FROM address as [EMAIL PROTECTED] You can't. The mail specification have to get a FROM header, but to make a solution you can make a FROM header like this: FROM: Do Not Reply [EMAIL PROTECTED] regards, Johan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] p.net For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] database question
Actually the sql statement you want is select whatever from articles where textlines regexp ^\Sbingo\S$ regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key - Original Message - From: Warren Vail [EMAIL PROTECTED] To: Michael Hall [EMAIL PROTECTED]; PHP List [EMAIL PROTECTED] Sent: Thursday, November 29, 2001 2:57 PM Subject: RE: [PHP] database question Try; SELECT whatever FROM articles WHERE textlines LIKE %searchword% Two warnings; 1) This will force a table scan (the contents of each row in the entire table because there can be no index to support faster searching of contents that float in the column) which will be very slow on a large database (even a medium size one). 2) This will also find words that exist inside other words. (ie the word ward exists inside toward) If you try to solve this by imbedding blanks between the wildcard (%) and the text, you will probably not be able to find the word at the end of a line, or just prior to a comma or period. I also believe there may be a way to make the search case insensitive, look for something like a WHERE tolower(textlines) LIKE ... to force the column values to be all lower case and make sure your search values are all lower case as well. Good luck, Warren Vail -Original Message- From: Michael Hall [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 29, 2001 2:21 PM To: PHP List Subject: [PHP] database question How can I search a MySQL database field that contains sentences (VARCHAR datatype) or entire texts (TEXT datatype) for single words? Let's say I want to search 100 articles stored in a database field as TEXT for the word bingo, is there any SQL or PHP way of doing that? Mick -- Michael Hall [EMAIL PROTECTED] [EMAIL PROTECTED] http://openlearningcommunity.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] script timeouts
OK I have a problem with a script that is occasionally timing out. Of course I could just increase the timeout but that is not the answer completly. The script connects to a server through sockets. The server then connects to another server to do a credit card authorisation. The server then returns to the script some information after the authorisation. The script then logs the result in a db and formats the result on a web page to the user. What I have noticed is that the script is timing out after it is logging in the database for no apparent reason. So what I would like to do is instead of the script dieing on timeout for it to go and do something else. Ideally it will redirect to another php script which will check for the entry in the database. Can this be done? Any pointers? Regards jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Yet Another Mysql Problem
Well telling us what the errors are would be a start :-) Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key - Original Message - From: Stephen Phillips [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 5:16 PM Subject: [PHP] Yet Another Mysql Problem Hi again, I've run into a nice bug using phpmyadmin to import data into a mysql database, and was hoping someone had some experience with doing this. I was wondering if there is any common errors which could be occurring due to characters with in the data? I'm fairly certain that this is the case as I can import about 5 lines of the database in mysql through phpmyadmin, and these don't have many odd characters in them, but anymore and it turns around and gives me an error, any ideas? Steve. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] exporting
hey guys.. does anyone have any ideas on how to export information from a mysql database to microsoft word, excel, access, note pad or any other such application? There is a class on http://phpclasses.upperdesign.com/ That allows you to create a excel file from php. Should be fairly straightforward to pull the info using php and right to Excel file using the class Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RE :[PHP] Multiple Entry SELECT and JavaScript interaction
In order to allow multiple entry on a SELECT form object, the name of the form has to end with the brackets [], but then when I do that I can't refer to it from within JavaScript because as a variable name it becomes illegal. I have to be able to refer to the SELECT object to change its contents based on another form object. Instead of referring in javascript to the select by name refer by reference ie: document.form[0].elements[1].selected Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Week of month
Is there any way to find out the week of the month. Today is in the first week of month. That is, a function like weekofmonth() which displays 1 today 2 next week. No builtin function in PHP. You will need to search to see if some kind and generous soul has published their code for this purpose or write your own. Remember the actual first day of a week can be country specific. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Week of month
Well seeing as Monday of this week was the 29th of October is this week the first of November or the last of October? I think the United Nations set out a specification for determining the week number of the year but not sure if they have a spec for the week of the month. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] - Original Message - From: Andrew Braund [EMAIL PROTECTED] To: PHP Masters [EMAIL PROTECTED] Sent: Thursday, November 01, 2001 9:57 AM Subject: RE: [PHP] Week of month How about; echo It is week .((int)(date(j)/7)+1). of the month.br; -Original Message- From: Jon Farmer [mailto:[EMAIL PROTECTED]] Sent: Thursday, 1 November 2001 20:14 To: PHP Masters; Sheni R. Meledath Subject: Re: [PHP] Week of month Is there any way to find out the week of the month. Today is in the first week of month. That is, a function like weekofmonth() which displays 1 today 2 next week. No builtin function in PHP. You will need to search to see if some kind and generous soul has published their code for this purpose or write your own. Remember the actual first day of a week can be country specific. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Loading message
the page won't ever showup unless the webserver finishes processing the PHP file, therefore the Loading ... will appear while the page is waiting for its component to finish loading (images, javascripts, flash files, ) Totally incorrect. I have a page on our intranet that checks whois information against about 10 whois servers. Right at the top of the page it says Checking. As soon as a response comes back from a whois server it shows in the browser ie :- domain.com available domain.net unavailable The list grows as the results come back.. As soon as all the results have been returned the message Checking... changes to Finished even if all the images etc have not loaded yet... All done with PHP and a one line javascript call. Regards jon ] -- -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Loading message
Yeah just call flush() when you want whats been parsed so far to go to the client.. -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] - Original Message - From: Daniel Alsén [EMAIL PROTECTED] To: php [EMAIL PROTECTED]; Jon Farmer [EMAIL PROTECTED] Sent: Thursday, October 25, 2001 3:53 PM Subject: RE: [PHP] Re: Loading message Could i have a hint of what you have done Jon? - Daniel Totally incorrect. I have a page on our intranet that checks whois information against about 10 whois servers. Right at the top of the page it says Checking. As soon as a response comes back from a whois server it shows in the browser ie :- domain.com available domain.net unavailable The list grows as the results come back.. As soon as all the results have been returned the message Checking... changes to Finished even if all the images etc have not loaded yet... All done with PHP and a one line javascript call. Regards jon ] -- -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP for shell scripting: weird error.
I'm running PHP v4.0.7RC3 (from package php4-cgi) on Linux 2.4.10-ac11. Distribution debian unstable. I would recommend 4.0.6 compiled from source. Thats what I use and its very stable. Regards jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Spam messages (Was: FREE S E X O
And then the spammers can use NNTP again. I think it goes both ways. NNTP LIST A good spam filter (blacklist) would be a good option. Yeah thats what i said -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php in css not working with IF's
Budweiser if ( A != 10 or A != 9 ) -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Window open.
I have yet another PHP question! =) How do i open a window in PHP and how do i insert information in it? Actually you have a javascript question! check out window.open() in the javascript docs Regards jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Carriage return.
My php script is generating a file that is saved in Unix format. I automatically get the ^M in the end of everyline. Is there a way of saving this without getting the ^M in the end of each line? /usr/bin/perl -npe 's/\r\n/\n/g' filename will remove the Ctrl-M characters for you. You could call it straight after the line that generates the file. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: mysql query . need help!!!!!
You cant use a select statement withoug using a table name. check out this $query = insert into classification(customername) (select customername from username where username='$username'); Incorrect in mySQL you can do mysql select 3+5; returns 8 plus a whole lot of other functions that can be selected without a table name. Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] EDI with PHP?
Hi, The company I work for is starting to lose contracts because they are not capable of EDI. As I seem to be the only person in the company who has heard of EDI and knows what it stands for I am assumed to be an expert :-) Anyway, I would like to suggest that instead of EDI we use XML and use PHP both as a parser and a creater of the EDI like transactions. I would propose they are sent over the net and probably PGP encrypted or signed. I have done some minor work with PHP and XML, mainly credit card authorisation, but wondered how suited it would be to this kind of app? Any ideas/pointers? Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: EDI with PHP?
No, we would have to spend around £24,000 sterling to get the modules. We already have modules that allow importing of order, etc from txt files. I could write a PHP XML parser to interface into this. What I am not sure is how acceptable it will be to our customers -- -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] http://www.computerworld.com/cwi/story/0,1199,NAV47-68-85-1552_STO55904,00.h tml http://www.xml.com/search/index.ncsp?sp-q=EDI PHP should be quite capable of handling this, but you will end up creating a lot of the business logic from scratch. If your company already uses integrated management software like SAP, it may -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Cookies
You can't set a cookie for a different domain or subdomain. If you set a cookie for a domain and then goto to SSL then the cookie will still be presented. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] - Original Message - From: Jason Radley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 31, 2001 4:11 PM Subject: [PHP] Cookies Does anyone know how to share cookies between servers. What I want to do is set a cookies on non secure server for a secure server. Here is setcookie(SessionID,$sessid,time() + 7200,https://domainname.com;); Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Cookies
Ignore my previous post it is incorrect Sorry Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] - Original Message - From: Jon Farmer [EMAIL PROTECTED] To: Jason Radley [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, August 31, 2001 4:31 PM Subject: Re: [PHP] Cookies You can't set a cookie for a different domain or subdomain. If you set a cookie for a domain and then goto to SSL then the cookie will still be presented. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] - Original Message - From: Jason Radley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 31, 2001 4:11 PM Subject: [PHP] Cookies Does anyone know how to share cookies between servers. What I want to do is set a cookies on non secure server for a secure server. Here is setcookie(SessionID,$sessid,time() + 7200,https://domainname.com;); Thanks -- -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] POST to port 443 (SSL)
Ermm you are missing SSL encryption. You can't just try and talk to port 443! You have to use something that talks SSL to talk to port 443. fsockopen() does not talk SSL. Regards -- Jon Farmer տլ Systems Programmer, Entanet www.enta.net Tel +44 (0)1952 428969 Mob +44 (0)7968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] -Original Message- From: Patrick Calkins [mailto:[EMAIL PROTECTED]] Hello, I am trying to use the UPS Online Tools, the XML version. This requires you POSTing an XML document to their Tools server, which is SSL enabled. I am having a problem getting this to connect in PHP (4.0.6) on my server (Apache 1.3.20). In my scripts, I use $Socket = fsockopen (www.ups.com, 443, $errno, $errstr); if (!$Socket) die (Error bla bla bla); fputs ($Socket, GET /ups.app/xml/Rate HTTP/1.0\r\n\r\n); ... ... If you point your browser to https://www.ups.com/ups.app/xml/Rate you will see a response. But this code seems to just time-out. If I change the port 443 to port 80, I will get a response. What am I missing for it to talk to an SSL port?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] How do I read the first n lines from a file?
If you are on a unix box you might want to use the tail command... if you use exec() the output will be in an array... -- Jon Farmer ?? Systems Programmer, Entanet www.enta.net Tel +44 (0)1952 428969 Mob +44 (0)7968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] -Original Message- From: Tauntz [mailto:[EMAIL PROTECTED]] Sent: 28 August 2001 12:13 To: [EMAIL PROTECTED] Subject: [PHP] How do I read the first n lines from a file? hi ! I have a simmple question :).. Lets say that I have a file called: list.txt and I want to take the first 10 lines from it echo it to the browser ? thank you [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP/Sendmail interaction : how to get rid of wrong emails
Well on submission of the email you could try contacting their mail server and pretend to a have a mail for them using SMTP. If you get a recipient ok or similar message.. ,thre is a code for it, then at least the server accepts mail for that address. You might be better off croning this rather than have the user wait on a http request. Alternatively there is a perl mod that does this as well. Secondly you could write a script that downloads the mail from root and deletes out the database anything that bounces. You could even delete these messages from the root account once done HTH Regards Jon -- Jon Farmer տլ Systems Programmer, Entanet www.enta.net Tel +44 (0)1952 428969 Mob +44 (0)7968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] -Original Message- From: Sebastian Stadtlich [mailto:[EMAIL PROTECTED]] Sent: 28 August 2001 15:08 To: 'Php-General (E-Mail) Subject: [PHP] PHP/Sendmail interaction : how to get rid of wrong emails Hi all I'm facing the Problem that lots of my users are too stupid to write their email correct. When i mail them with php a return email is send to me by their mailserver, which results in LOTS of mail for the root account. Can i get sendmail to put the returned emails in a file? so that i can check that file with php and delete those mails from my DB ? or is there a way to check the email when they enter it in a form (online versus their mailserver)? i already check for wrong email syntax, but that does not solve the problem... Sebastian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Refresh Main frame
Yes but you would have to dynamically build the javascript statement up using php with the query string you wanted and use window.parent.name-of-frame.location.href=index.php??echo $querystring? -- Jon Farmer Õ¿Õ¬ Systems Programmer, Entanet www.enta.net Tel +44 (0)1952 428969 Mob +44 (0)7968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] -Original Message- From: Rosen [mailto:[EMAIL PROTECTED]] Sent: 28 August 2001 15:04 To: [EMAIL PROTECTED] Subject: Re: [PHP] Refresh Main frame Can I send params to main frame ? Thanks, Rosen * RZe: [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Original message From: Rosen [EMAIL PROTECTED] Date: Tue, Aug 28, 2001 at 04:29:05PM +0300 Message-ID: [EMAIL PROTECTED] Subject: [PHP] Refresh Main frame Hi, how can I tell to refresh the main frame ( index.php ) from some subframe I use frames ) ? Thanks, Rosen /Original message Reply SCRIPT type=text/javascript window.parent.name-of-mainframe.reload(true); /SCRIPT That should be what you're looking for... /Reply -- * RzE: -- -- Renze Munnik -- DataLink BV -- -- E: [EMAIL PROTECTED] -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP/Sendmail interaction : how to get rid of wrong emails
For perl look at http://www.cpan.org/modules/by-category/19_Mail_and_Usenet_News/Mail/Mail-Ch eckUser-1.02.readme As for php you would need to open a socket connection.. My advice would be to use the perl module and call a perl script from php. Regards Jon -- Jon Farmer Õ¿Õ¬ Systems Programmer, Entanet www.enta.net Tel +44 (0)1952 428969 Mob +44 (0)7968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] -Original Message- From: Sebastian Stadtlich [mailto:[EMAIL PROTECTED]] Sent: 28 August 2001 15:26 To: 'Php-General (E-Mail) Subject: AW: [PHP] PHP/Sendmail interaction : how to get rid of wrong emails any hint where to find the perl mod or some php-code that contacts mailservers like you described? -Ursprüngliche Nachricht- Von: Jon Farmer [mailto:[EMAIL PROTECTED]] Gesendet: Dienstag, 28. August 2001 16:14 An: Sebastian Stadtlich; 'Php-General (E-Mail) Betreff: RE: [PHP] PHP/Sendmail interaction : how to get rid of wrong emails Well on submission of the email you could try contacting their mail server and pretend to a have a mail for them using SMTP. If you get a recipient ok or similar message.. ,thre is a code for it, then at least the server accepts mail for that address. You might be better off croning this rather than have the user wait on a http request. Alternatively there is a perl mod that does this as well. Secondly you could write a script that downloads the mail from root and deletes out the database anything that bounces. You could even delete these messages from the root account once done HTH Regards Jon -- Jon Farmer Õ¿Õ¬ Systems Programmer, Entanet www.enta.net Tel +44 (0)1952 428969 Mob +44 (0)7968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] -Original Message- From: Sebastian Stadtlich [mailto:[EMAIL PROTECTED]] Sent: 28 August 2001 15:08 To: 'Php-General (E-Mail) Subject: [PHP] PHP/Sendmail interaction : how to get rid of wrong emails Hi all I'm facing the Problem that lots of my users are too stupid to write their email correct. When i mail them with php a return email is send to me by their mailserver, which results in LOTS of mail for the root account. Can i get sendmail to put the returned emails in a file? so that i can check that file with php and delete those mails from my DB ? or is there a way to check the email when they enter it in a form (online versus their mailserver)? i already check for wrong email syntax, but that does not solve the problem... Sebastian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Shell or http?
Shell PHP scripts will start with the line #!/path/to/php -q Regards Jon -- Jon Farmer O?O¬ Systems Programmer, Entanet www.enta.net Tel +44 (0)1952 428969 Mob +44 (0)7968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] -Original Message- From: George E. Papadakis [mailto:[EMAIL PROTECTED]] Sent: 26 August 2001 18:36 To: PHP List Subject: [PHP] Shell or http? Hi, Is there any way to identify if a php script is running through a shell or web? Thanks in advance. -- GeorgeP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP and RSA/Java (Repost with correct e-mail!)
PGP would be an ideal solution for this. The webserver would have the public key and the people operating the PDQ machine the private key. A few things to remember are. 1. Call PGP using exec() 2. Make sure you read the PGP docs to see how to use a particular keyring. 3. Make sure the keyrings and randseed files are readable by the apache user. 4. Have fun I have successfully got this working and if you need any help let me know Regards jon -- Jon Farmer տլ Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] -Original Message- From: Martin Gunther [mailto:[EMAIL PROTECTED]] Sent: 24 August 2001 15:41 To: [EMAIL PROTECTED] Subject: [PHP] PHP and RSA/Java (Repost with correct e-mail!) Hi all, I need to use a public/private key encryption system for dredit card details on a site I am developing. We are not taking Credit Card payments with an online marchanmt such as NetBanx Sec Pay, etc, etc, but we need to send the CC details to the Shop Management for putting through a PDQ machine. How can I use a Public Private key system to do this from PHP. I know Java can support RSA (although never investigated it), and that PHP can use standard Java classes (is this true?). Please any help would be great Martin Gunther -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] redirect
header(location: redirect.php); -- Jon Farmer տլ Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] -Original Message- From: Wilbert Enserink [mailto:[EMAIL PROTECTED]] Sent: 24 August 2001 15:45 To: [EMAIL PROTECTED] Subject: [PHP] redirect Hi all, I have the simplest question maybe, but I can't seem to find the answer. It's friday. Anybody knows how I can redirect to another url? greetings Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP and RSA/Java (Repost with correct e-mail!)
I dont think you read the original post correctly. Obviously you would use SSL to get the info form the browser to server. What the poster was asking was how does he securely get the information from the server to the people using the PDQ machine. Regards -- Jon Farmer O?O? Systems Programmer, Entanet www.enta.net Tel +44 (0)1952 428969 Mob +44 (0)7968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Gregor Maier Sent: 24 August 2001 16:45 To: [EMAIL PROTECTED] Subject: RE: [PHP] PHP and RSA/Java (Repost with correct e-mail!) This would work but I don't think that this was the idea. You could send encrypted email from to server to another place with this method but you can't encrypt the date transmitted with an html form. (since php runs on the server and not on the client machine) To secure the communication between the web-server and the client's browser you can't use php. You'll either need SSL for your server or you use a java to encrypte the data on the client side and then send it to the server. On 24-Aug-2001 Jon Farmer wrote: PGP would be an ideal solution for this. The webserver would have the public key and the people operating the PDQ machine the private key. A few things to remember are. 1. Call PGP using exec() 2. Make sure you read the PGP docs to see how to use a particular keyring. 3. Make sure the keyrings and randseed files are readable by the apache user. 4. Have fun I have successfully got this working and if you need any help let me know Regards jon Hi all, I need to use a public/private key encryption system for dredit card details on a site I am developing. We are not taking Credit Card payments with an online marchanmt such as NetBanx Sec Pay, etc, etc, but we need to send the CC details to the Shop Management for putting through a PDQ machine. How can I use a Public Private key system to do this from PHP. I know Java can support RSA (although never investigated it), and that PHP can use standard Java classes (is this true?). Please any help would be great Martin Gunther -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- E-Mail: Gregor Maier [EMAIL PROTECTED] Date: 24-Aug-2001 Time: 17:37:41 -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: PHP based authentification -----------
Thus, the way to logout is to maintain a dynamic unique dataset of Realms and require authentication in a new Realm for any user that is logged out Yes, Richard recently advised me simialry. I set a cookie on a successful login and then delete it on a logout. If the cookie is not present when they go back to the page that needs login then it presents a login box to a realm that contains the current date and time in it. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] HTTP Authentication
Hi, I am using PHP to send a header to the browser requestiing authentication. On a successful login i am tracking inactivity by the client and want to expire the login once a timeout period is reached. Problem is if the session expires and the user just refreshes then the orignal login details are passed to the script. How do I get the client to forget the previous login details? Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Creating a javascript array from database data
-- while you are looping through the date jump in and out of php like this to populate the javascript array script language=Javascript function DataArray() { a = new Array() ? while ($i $number) { $text = mysql_result($result, $i, name); ? a[?=$i?] = ?=$text? ? $i++; } ? } HTH Jon Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] -Original Message- From: Neil Freeman [mailto:[EMAIL PROTECTED]] Sent: 15 August 2001 17:16 To: PHP General Subject: [PHP] Creating a javascript array from database data Hi there, Well after a few hours roaming around various websites I am at a loss. Here is what I am trying to do: 1) Access a MySQL database which contains 1 table 2) Read the records from this table 3) Store the values returned from this table into javascript array elements, ie, if I get the values dog, cat and cow back I want these stored in an array as such: myArray[0] = valueReturned1 myArray[1] = valueReturned2 myArray[2] = valueReturned3 You get the idea. Problem being that I cannot work out how to implement the javascript section of this. At the moment my php script writes the values returned from the database to screen but I require these to be stored in a javascript array. Please can someone help me before I go mad :) Here is my current .php script: -- html head titleMenus test/title /head body bgcolor=white ?php $dbhost = 'localhost'; $dbuser = 'guest'; $dbpass = 'guest'; $dbname = 'IFE'; $dbtable = 'menus'; //-- DATABASE CONNECTION // mysql_connect($dbhost,$dbuser,$dbpass) or die (Unable to connect to database); mysql_select_db($dbname) or die (Unable to select database); $sql= SELECT * FROM $dbtable; $result = mysql_query($sql); $number = mysql_numrows($result); $i = 0; if ($number == 0) print Error - No records found; elseif ($number 0) { while ($i $number) { $text = mysql_result($result, $i, name); print $text; $i++; } } mysql_free_result($result); mysql_close(); ? /body /html -- Thanks, Neil Email: [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Select
thats because mysql_fetch_row only returns one row. to get all the rows do while ($row = mysql_fetch_array($result) { //processing code here } This will run through all the rows putting the colums into the array $row[] Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] -Original Message- From: Jeremy Morano [mailto:[EMAIL PROTECTED]] Sent: 14 August 2001 15:53 To: [EMAIL PROTECTED] Subject: [PHP] Select Hi, I'm having a problem with my Select statement. This is what i'm doing: $connection = @mysql_connect(l, c, c) or die(Couldn't connect.); $db = @mysql_select_db($db_name, $connection) or die(Couldn't select database.); $sql = SELECT * FROM table_1 ; $result = @mysql_query($sql,$connection) or die(Couldn't execute query.); $data=mysql_fetch_row($result); $count=$data[0]; echo $count; Yet the only result I get is the first value of the first column. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Select
oops slight mistake i noticed there.. should be thats because mysql_fetch_row only returns one row. to get all the rows do while ($row = mysql_fetch_array($result)) { $firstcloumn = $row[0]; } This will run through all the rows putting the colunms into the array $row[] Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07968 524175 PGP Key available, send blank email to [EMAIL PROTECTED] -Original Message- From: Jeremy Morano [mailto:[EMAIL PROTECTED]] Sent: 14 August 2001 15:53 To: [EMAIL PROTECTED] Subject: [PHP] Select Hi, I'm having a problem with my Select statement. This is what i'm doing: $connection = @mysql_connect(l, c, c) or die(Couldn't connect.); $db = @mysql_select_db($db_name, $connection) or die(Couldn't select database.); $sql = SELECT * FROM table_1 ; $result = @mysql_query($sql,$connection) or die(Couldn't execute query.); $data=mysql_fetch_row($result); $count=$data[0]; echo $count; Yet the only result I get is the first value of the first column. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: Socket problem
Hmm well I has this problem on a FreeBSD box and as soon as I moved it to a RedHat7 box it worked. Jon Farmer Systems Programmer Entanet International Ltd www.enta.net Tel 01952 428969 Mob 07968 524175 -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED]] Sent: 12 August 2001 22:41 To: [EMAIL PROTECTED] Subject: [PHP] Re: Socket problem Anybody else using 1 on that machine yet? netstat -a -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Jon Farmer [EMAIL PROTECTED] Newsgroups: php.general To: PHP General Mailing List [EMAIL PROTECTED] Sent: Friday, August 10, 2001 10:58 AM Subject: Socket problem Hi, I playing with the socket examples off php.net When I try the talkback example I get the following error bind() failed: reason: Can't assign requested address I am setting $address to the ip of the machine and using port 1 Any ideas? Regards Jon Jon Farmer Systems Programmer Entanet International Ltd www.enta.net Tel 01952 428969 Mob 07968 524175 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] MySQL
if you mean how do you get mysqld to startup automatically then you need to call mysql.server start at bootup Regards Jon Jon Farmer Systems Programmer Entanet International Ltd www.enta.net Tel 01952 428969 Mob 07968 524175 -Original Message- From: Roman [mailto:[EMAIL PROTECTED]] Sent: 13 August 2001 11:55 To: Php-General Subject: [PHP] MySQL Please help me. How can I run mysql daemon on RedHat Linux. I install db with script mysql_install_db. roman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Copy function usage ?
You need to make sure that what ever user the webserver/php runs under has permissions to read from the source folder/file and write permission for the destination folder/file. Common users for apache/php are nobody or apache regards Jon Jon Farmer Systems Programmer Entanet International Ltd www.enta.net Tel 01952 428969 Mob 07968 524175 -Original Message- From: Tamas Bucsu [mailto:[EMAIL PROTECTED]] Sent: 09 August 2001 16:36 To: [EMAIL PROTECTED] Subject: [PHP] Copy function usage ? Hi guys, I have a problem that's killin' me. As I'm not very good at Linux I don't know how to set the properties of the folder pics to be able to use the copy function. (If I'm right and the problem is not some else) Please help. Here's the code: if (file_exists($userfile)) { copy($userfile,pics/.$userfile); } else { echo Nem sikerül a következõ file-t feltölteni:.$userfile; } thx Tamas Bucsu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] selecting words
There was a post earlier very similar to this. If you have a database, you could use SELECT LEFT(mycolumn, 100) FROM mytable WHERE ... Without a db, you can use the PHP substring function: substr() Except that would return the first 100 characters and not the first 100 words as requested. To do this you would need to find the 100th space in the string and use everything before that. I would probably explode the string and loop through the first one hundred elements to reconstruct the string with the first one hundred words. Regards Jon Jon Farmer Systems Programmer Entanet International Ltd www.enta.net Tel 01952 428969 Mob 07968 524175 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Problem with inserts to mysql
Hi, This is a real strange one. I am writing a shell script in PHP which I am cronning to run every 5 mins. Basically it downloads email via imap. Splits it up into it relevant sections and adds it to a database. It does multiple inserts, and update and multiple selects. The problem I have is that some of the inserts dont work. There is no error returned ny mysql_error() and if echo the SQL out and run in the MySQL client then it inserts ok. The thing is that it is not the same query every time either. Sometimes its the first insert and naother time its the second insert. I have attached the script in case you want to check it out.. Any ideas anyone? Thanks Jon #!/usr/local/bin/php -q ? // A script which dowmloads the support email and processes it $dbhost = localhost; $dbuser = user; $dbpassword = password; $dbname = support; $time = time(); mysql_pconnect($dbhost, $dbuser, $dbpassword); mysql_select_db($dbname); //Open the mailbox and check if mail waiting $mailstream = imap_open({imap.server.com:143}INBOX,user,password); $email = imap_headers($mailstream); if (count($email) == 0) { //echo Nothing to process ... \n; imap_expunge($mailstream); imap_close($mailstream); mysql_close(); exit; } //echo count($email) . \n; for ($i=1; $i=count($email); $i++) { ; $thisheader = imap_header($mailstream, $i); $subject = $thisheader-subject; $from = $thisheader-from; $name = $from[0]-personal; $fromaddr = sprintf(%s@%s,$from[0]-mailbox,$from[0]-host); //echo $subject . . $fromaddr . . $name . \n; $struc = imap_fetchstructure($mailstream, $i, FT_UID); //echo type: . $struc-bytes . \n; if (empty($struc-bytes)) { //echo Type: . $struc-type . \n; //echo Sub-type: . $struc-subtype . \n; $mailtext = trim(imap_fetchbody($mailstream, $i, 1)); //echo Parts Count: . Count($struc-parts) . \n; for ($z = 1; $z Count($struc-parts) + 1; $z++) { //echo Part No. . $z . : . $struc-parts[$z]-type . \n; if ($struc-parts[$z]-ifparameters) { $parameters = $struc-parts[$z]-parameters; $resarray = get_object_vars($parameters[0]); $filename[] = $resarray[value]; $filesrc[] = addslashes(imap_fetchbody($mailstream, $i, $z + 1)); switch ($struc-parts[$z]-type) { case 0: $type = text; case 1: $type = multipart; case 2: $type = message; case 3: $type = application; case 4: $type = audio; case 5: $type = image; case 6: $type = video; case 7: $type = other; default: $type = text; } $filetype[] = addslashes($type . / . strtolower($struc-parts[$z]-subtype)); if ($type . / . strtolower($struc-parts[$z]-subtype) == text/html) { if (eregi(\.htm, $resarray[value]) || eregi(\.html, $resarray[value])) { } else { $HTML = TRUE; } } $attachments = TRUE; } } } else { $mailtext = trim(imap_body($mailstream, $i)); $attachments = FALSE; } //echo $mailtext\n; if ($HTML) { //echo html\n; imap_delete($mailstream, $i); $bodytext = Sorry that's HTML mail and we dont accept it\n; mail ($fromaddr, RE: . $subject, $bodytext, From: Customer Support [EMAIL PROTECTED]); continue; } if (eregi(SUP[0-9][0-9][0-9][0-9][0-9][0-9], $subject)) { //echo Existing support call\n; } else { //echo New Support Call\n; //get next support number $sSQL = select * from ticketnumbers; $result = mysql_db_query($dbname, $sSQL);
RE: [PHP] Best way to take a copy of a Database from Server to server
How can i take a dump of first database (which is about 1MB) and restore that dump on the second one? If you have Telnet access use the mysqldump and mysql clients to export then import. Regards Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Upper or Lower Case
What happens if they type NeO, or NEO, or nEo, or neO (etc)? ;) Also, if you're using this in a large application (or intend to in the future), are you going to type out all of the names as you have done with the neo example? Bjorn's method is much better, and you're better off getting into good practice early. Who mentioned anything about typing? In the example given it was a hardcoded string. Jon Farmer Systems Programmer Entanet International Ltd www.enta.net Tel 01952 428969 Mob 07968 524175 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Automated Scripts
You could either Compile PHP as a command line executable or Use Lynx to call a php page through HTTP. either wat cron is the way to go Regards -- Jon Farmer www.workcam.co.uk +44 (0)7968 524175 2001 should be pronounced twenty o one not two thousand and one "Jason Murray" [EMAIL PROTECTED] wrote in message 1595534C9032D411AECE00508BC766FB01052937@MERCURY">news:1595534C9032D411AECE00508BC766FB01052937@MERCURY... I need to run a script that renames a file and deletes an old one then ships it to another server every Monday at a certain time I know this is possible, but what is the technology called? Does PERL or PHP have the ability to do this? Can I get CRON objects to run PHP source code? Is this an example of such a script, emailling the same mail to the mailing list every monday at a specific time? I already replied to you off-list. Jason -- Jason Murray [EMAIL PROTECTED] Web Design Team, Melbourne IT Fetch the comfy chair! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]