Re: [PHP] execute php script with crontab
Could I add a question regarding the cron command? If you automatically run a php script through the cron command is timeout taken under account or does it run through the "command line" which is faster (and timeout is not taken under account?) Thanks all Mario - Original Message - From: "rudi" <[EMAIL PROTECTED]> To: "Jason Wong" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, January 19, 2004 7:29 AM Subject: Re: [PHP] execute php script with crontab > Ok, thanks i will check it first. soon i will send mail about it. > > Jason Wong <[EMAIL PROTECTED]> wrote:On Monday 19 January 2004 12:01, rudi wrote: > > > 01 * * * * root run-parts /usr/bin/php /var/www/html/cron/testcron.php > > I believe 'run-parts' takes a directory as argument. Try: > > 1 * * * * root /usr/bin/php /var/www/html/cron/testcron.php > > > Also if you have: > > #!/usr/bin/php > > as the first line in testcron.php (and make it executable) then you can use > simply: > > 1 * * * * /var/www/html/cron/testcron.php > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > -- > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-general > -- > /* > However the modem comes set from the factory, it will be the WRONG way to work > on your machine > -- Murphy's Laws of BBS'ing n3 > */ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > - > Do you Yahoo!? > Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Unix Authentication
For one of my php applications I want to check user's UNIX[Linux] account. If his / her username password pair matches with that of /etc/passwd or samba or NIS then only the user will be allowed to access the contents. How to achieve this ? TIA Shekhar ___ V I I T, http://www.viitindia.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] INSERT problem with MySQL/PHP
Try the following, INSERT INTO questions(user_id,objective,question,question_type) VALUES('$uawr_idx', '$objective', '$question', '$question_type') Define the rows you want to insert into. Hope this helps! Regards, Ray - Original Message - From: "Todd A. Jacobs" <[EMAIL PROTECTED]> To: "PHP General" <[EMAIL PROTECTED]> Sent: Monday, June 18, 2001 4:11 PM Subject: [PHP] INSERT problem with MySQL/PHP > PHP: 4.0.4pl1 > MySQL: 3.23.36-1 > > I have the following code fragment, which uses the same connection > parameters elsewhere to *successfully* to retrieve data from a database, > so this doesn't appear to be a permissions problem with MySQL. > > However, nothing happens with inserts; no rows are added at all. All I get > is a message form mysql_error() saying "Query was empty." > > Can anyone tell me what might be wrong? > > $user_idx = 1; > $objective = 1; > $question = 'Foo'; > $question_type = 'singular'; > > $connection_id = mysql_connect ('192.168.1.1', 'php', 'password') > or die ("No connection.\n"); > > $sql = "INSERT INTO question VALUES (NULL, $user_idx, $objective, > '$question', '$question_type', NULL, NULL)"; > > $result = mysql_db_query('item_db', $sql_query, $connection_id); > > echo ""; > echo "\nDebugging output:\n"; > echo "\tSQL: $sql\n"; > echo "\tError: ", mysql_error(), "\n"; > echo "\tLast insert ID: ", mysql_insert_id(), "\n"; > echo "\tResult: $result\n"; > echo "\n"; > > -- > Todd A. Jacobs > CodeGnome Consulting, LTD
Re: [PHP] automatic page view
I would set your database up like so. tablecompany idcompany otherstuff tableusernamepass compidusernamepassword Make the ID in the tablecompany auto_increment then test the tableusernamepass compid against it when the user properly logs in. Exampe of the entries in the database: tablecompany 1Company 1All the other stuff 2Company 2A Different company tableusernamepass 1Username Password 2UsernamePassword// A user for company 2 2AnotherUserPassword// A user for company 2 2AnotherUserPassword// A user for company 2 That should give you an idea. Hope this helps. Regards, Ray
[PHP] Imp
hello all, As we know, there are a lot of php design patterns(more than 20). I want to know that which patterns are important and necessary for ZCE exam. PHP5 Study Guide only covers Singleton,Factory,Registry,MVC and ActiveRecord. But i still feel that more patterns are necessary for the exam. Cheers, Daniel - Expecting? Get great news right away with email Auto-Check. Try the Yahoo! Mail Beta.
[PHP] Important Design Patterns
hello all, As we know, there are a lot of php design patterns(more than 20). I want to know that which patterns are important and necessary for ZCE exam. PHP5 Study Guide only covers Singleton,Factory,Registry,MVC and ActiveRecord. But i still feel that more patterns are necessary for the exam. Cheers, Daniel - Food fight? Enjoy some healthy debate in the Yahoo! Answers Food & Drink Q&A.
[PHP] Important Design Patterns
hello all, As we know, there are a lot of php design patterns(more than 20). I want to know that which patterns are important and necessary for ZCE exam. PHP5 Study Guide only covers Singleton,Factory,Registry,MVC and ActiveRecord. But i still feel that more patterns are necessary for the exam. Cheers, Daniel - Finding fabulous fares is fun. Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains.
[PHP] Change displayed file name to download
Hi, I'm using the following code: $fp = fopen($filename, 'r+'); $content = fread($fp, filesize($filename)); fclose($fp); header("Content-type: application/msword"); header("Content-Disposition: attachment; filename=$filename"); echo $content; exit; ___ Now when downloading a file the default name that appears for the user is the realname of the file i the server with the real path the only difference is that the slashes are modified by underscore. My question is: is there any way how to control the name that will be displayed for the customer? Or at least skip the path and display just the file's name? Thank you __ Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the All-new Yahoo! Mail. Click on Options in Mail and switch to New Mail today or register for free at http://mail.yahoo.ca
[PHP] array or list of objects of different types
Hi all, I want to be able to have an array of elements of different types. As an example: the first element is a boolean, the second is an integer, and the thirs is a string. In php there is no typing, i'm just wondering if there is a way to have that, it would be a lot better than having an array of strings and have to convert each element. Thank you __ The new Internet Explorer® 8 - Faster, safer, easier. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/
[PHP] Excel Report Formatting
Hi, Do you know if there is a way to generate a formated Excel report. I want some rows to be of different colors than the others. Thank you __ Get the name you've always wanted @ymail.com or @rocketmail.com! Go to http://ca.promos.yahoo.com/jacko/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Excel Report Formatting
Hi Tommy, The code in the link is traightforward. The problem is you need to install ADOdb. I'm wondering if there is a way to do it from scratch. Thanks - Original Message From: Tommy Pham To: Php Developer ; php-general@lists.php.net Sent: Tue, April 20, 2010 11:37:21 AM Subject: RE: [PHP] Excel Report Formatting > -Original Message- > From: Php Developer [mailto:pdevelo...@rocketmail.com] > Sent: Tuesday, April 20, 2010 8:30 AM > To: php-general@lists.php.net > Subject: [PHP] Excel Report Formatting > > Hi, > > Do you know if there is a way to generate a formated Excel report. > I want some rows to be of different colors than the others. > > Thank you > > > > > __ > Get the name you've always wanted @ymail.com or @rocketmail.com! Go to > http://ca.promos.yahoo.com/jacko/ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php http://www.phpeveryday.com/articles/Write-report-in-Excel-Format-Part-1--P155.html __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Excel Report Formatting
Hi, somebody knows if it is possible to open excel content in a new window? what i want is basically initialize the headers and instead of echo $content i want it to open in a new window. is that possible? - Original Message From: Tommy Pham To: Php Developer ; php-general@lists.php.net Sent: Tue, April 20, 2010 1:47:40 PM Subject: RE: [PHP] Excel Report Formatting > -Original Message- > From: Php Developer [mailto:pdevelo...@rocketmail.com] > Sent: Tuesday, April 20, 2010 9:52 AM > To: Tommy Pham; php-general@lists.php.net > Subject: Re: [PHP] Excel Report Formatting > > Hi Tommy, > > The code in the link is traightforward. The problem is you need to > install ADOdb. > > I'm wondering if there is a way to do it from scratch. > > Thanks > > > ----- Original Message > From: Tommy Pham > To: Php Developer ; php- > gene...@lists.php.net > Sent: Tue, April 20, 2010 11:37:21 AM > Subject: RE: [PHP] Excel Report Formatting > > > -Original Message- > > From: Php Developer [mailto:pdevelo...@rocketmail.com] > > Sent: Tuesday, April 20, 2010 8:30 AM > > To: php-general@lists.php.net > > Subject: [PHP] Excel Report Formatting > > > > Hi, > > > > Do you know if there is a way to generate a formated Excel report. > > I want some rows to be of different colors than the others. > > > > Thank you > > > > > > > > > > __ > > Get the name you've always wanted @ymail.com or @rocketmail.com! Go > to > > http://ca.promos.yahoo.com/jacko/ > > > > http://www.phpeveryday.com/articles/Write-report-in-Excel-Format-Part- > 1--P155.html > I think the article/sample uses PEAR's Excel Writer. http://pear.php.net/package/Spreadsheet_Excel_Writer/ http://pear.php.net/manual/en/package.fileformats.spreadsheet-excel-writer.spreadsheet-excel-writer-format.setfgcolor.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Email with attachment
Hi, I found a good function at php.net that sends email with atachment, but unfortunately i still cannot figure out how to send a body of the email too. Here is the code: function sendEmailWithAttachement($to, $subject, $message, $file) { if (strtoupper(substr(PHP_OS,0,3)=='WIN')) { $eol="\r\n"; } elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')) { $eol="\r"; } else { $eol="\n"; } $filename = basename($file); displaymessage($filename); $file_size = filesize($file); $file_type = filetype($file); displaymessage($file_size); $handle = fopen($file, "rb"); $content = fread($handle, $file_size); $content = chunk_split(base64_encode($content)); fclose($handle); # Common Headers $headers = 'From: cont...@example.com'.$eol; $headers .= 'Reply-To: cont...@example.com'.$eol; $headers .= 'Return-Path: cont...@example.com'.$eol; // these two to set reply address $headers .= "Message-ID: <".time()." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol; $headers .= "X-Mailer: PHP v".phpversion().$eol; // These two to help avoid spam-filters # Boundry for marking the split & Multitype Headers $mime_boundary=md5(time()); $headers .= 'MIME-Version: 1.0'.$eol; $headers .= "Content-Type: multipart/related; boundary=\"".$mime_boundary."\"".$eol; $msg = ""; # Attachment $msg .= "--".$mime_boundary.$eol; $msg .= "Content-Type: ".$file_type."; name=\"".$filename."\"".$eol; // sometimes i have to send MS Word, use 'msword' instead of 'pdf' $msg .= "Content-Transfer-Encoding: base64".$eol; $msg .= $message; $msg .= "Content-Disposition: attachment; filename=\"".$filename."\"".$eol.$eol; // !! This line needs TWO end of lines !! IMPORTANT !! $msg .= $content.$eol.$eol; # Setup for text OR html $msg .= "Content-Type: multipart/alternative".$eol; # Text Version $msg .= "--".$mime_boundary.$eol; $msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol; $msg .= "Content-Transfer-Encoding: 8bit".$eol; $msg .= "This is a multi-part message in MIME format.".$eol; $msg .= "If you are reading this, please update your email-reading-software.".$eol; $msg .= "+ + Text Only + +".$eol.$eol; # Finished $msg .= "--".$mime_boundary."--".$eol.$eol; // finish with two eol's for better security. see Injection. mail($to, $subject, $msg, $headers); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] People's misbehavior on the list
some people don't remove the "Re:" prefix when answering to the questions It opens a new topic on the list and that's not appropriate . Thank ya - Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.
[PHP] Are IP addresses reliable?
I wanna know that is there a way to forge someone's IP address? for example, I have a client with an static ip address, and she is a superuser. Can i rely on her IP address? or somebody else can forge her IP? I don't want her to enter a username and a password.. Cheers, Daniel - Park yourself in front of a world of choices in alternative vehicles. Visit the Yahoo! Auto Green Center.