RE: [PHP] Protect Access to a Directory
Try using htaccess authentication instead? -Ade www.phpscriptsearch.com -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: 05 February 2003 07:06 To: [EMAIL PROTECTED] Subject: Re: [PHP] Protect Access to a Directory On Wednesday 05 February 2003 04:06, Pushpinder Singh Garcha wrote: Hi, I am using PHP and MySQL in my application. I have created a Login System for using Sessions. The problem that I am facing is that I need to protect a large number of pages in my website. So I have tried to use this method and it works fine for me : ? session_start(); if (session_is_registered(valid_user)) include ('guest.html'); else include 'not_logged_in.php'; ? I get stumped here in order to be able to insert this code I have to write for each of the 400 html files, 400 php files with the same name. Most of the files are arranged in the form of directories. Is there a better way to be able to do this (Using PHP and MySQL). Thanks in advance ! I've answered a similar question yesterday. And many more people have done so in the past -- search the archives! -- 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 -- /* Every journalist has a novel in him, which is an excellent place for it. */ -- 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] Array find a element
You can use in_array (http://www.php.net/function.in_array) for this. -- Mattias --|-Original Message- --|From: Narciso Miguel Rodrigues --|[mailto:[EMAIL PROTECTED]] --|Sent: Wednesday, February 05, 2003 02:03 --|To: [EMAIL PROTECTED] --|Subject: [PHP] Array find a element --| --| --|Is possible to do something like --| --| if ($username in $users) ... or i need to do a foreach($user){...} --| --|Thks --| --|[MsR] --| --| --|-- --|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] Best way to include multi-lingual support in an application.
There is gettext support in php for this. Haven't used it myself, but check it out at http://www.php.net/ref.gettext -- Mattias --|-Original Message- --|From: JJ Harrison [mailto:[EMAIL PROTECTED]] --|Sent: Wednesday, February 05, 2003 06:56 --|To: [EMAIL PROTECTED] --|Subject: [PHP] Best way to include multi-lingual support in --|an application. --| --| --|I am currently planning an application. I would like to --|include multiple --|language support so that I can have a german or french --|version down the --|track if need be. --| --|What are your views on the best way to include the ability to add --|languages after it is complete? --| --| --|-- --|--- --|JJ Harrison --|[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Best way to include multi-lingual support in an application.
Jj Harrison [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am currently planning an application. I would like to include multiple language support so that I can have a german or french version down the track if need be. What are your views on the best way to include the ability to add languages after it is complete? With TemplateTamer, you mark every item that needs to be translated as {#WORDKEY}, and the framework will do a call back to your page class to get a correct translation for the WORDKEY, and substitue translation in the output. In your app you can then detect the current language setting, and return appropriate translation. rush -- http://www.templatetamer.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PhpMyADmin Help
Pushpinder Singh Garcha wrote: Hello , I am using PhpMyAdmin to control my MySQL Database. Untill now I had been using the Local Apache webserver to test my scripts, so I had installed PhpMyAdmin in the 'Sites' Folder of my Mac. Now I need to beta test the Application on the Live Server. Do I need to upload PhpMyAdmin on to the remote site? Or can I let it remain sitting on the local server. Also, I was wondering , what value should I assign to the $cfg['PmaAbsoluteUri'] variable in the config.inc.php file. Many Thanks, Pushpinder Pushpinder Singh Garcha _ Web Architect $cfg['PmaAbsoluteUri'] --- http://localhost/admin/ or /admin/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] restricting acces to files
Hi, i've written a secure PHP login script which will allow users to login to a directory such as this: smezone.com/members/index.php however, how do I restrict people from accessing HTML files in that directory (which they can easily do so by typing the URL into their browser), such as: smezone.com/members/document1.html ? Since its a regular HTML files (and we have lots), I can't check whether the user has a valid session as I would do in a PHP file. Thanks for any help! Shams -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP connecting to MS Access
If a MS Access database and a PHP server were on the same machine, could they connect without having to use something like MS SQL Server?
Re: [PHP] Is there a way to retrieve an entire source code from a phpfile?
There is a php file that retrieve the source code from the url www.url.com and this source is treated and you get content from this file and show it on the response page. Is this possible? Can anyone show me the right direction? yes, codeword is 'ripping', i found some hits on google with php ripping html -audio -track -mp3 . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions and Cookies
I'm trying to use cookies in PHP4 (.whatever the latest release is). I want to use them for validation (ensuring a user has logged in) but all I can find is setcookie, which seems only to create the cookie. In trying to use PHP sessions, I end up with odd errors. When I try to use sessions I get the error message the header has already been sent. I've pasted them below (I was getting different errors before I moved the code before the html tag). Warning: Cannot send session cookie - headers already sent by (output started at /home/allan/public_html/sestest2.php:10) in /home/allan/public_html/verifysession.php on line 6 Warning: Cannot send session cache limiter - headers already sent (output started at /home/allan/public_html/sestest2.php:10) in /home/allan/public_html/verifysession.php on line 6 session_start() must be before html. Solve those problems first because sessions are going to be a better solution than a cookie. My Questions: If I create a cookie with set_cookie how do I read it/check it? Whatever you name the cookie, say 'MyCookie', on the following pages from where you set it, you'll have a $_COOKIE['MyCookie'] variable with it's value. Use that variable just like you would any other. How do I use sessions if they can't be sent in the code? They must be started before output. You can use the values within your code and set/change values within your code. What use are sessions if I can only mess with them in one place? What if I need to do some processing first to decide what to do with them? No problem, see above. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problems with gzuncompress data from fsockopen (data error)
Hello! Using the following script I try to get a html-page gzip-compressed, and uncompress the body of the HTTP-message. ?php define(CRLF,\xD\xA); $host = selfforum.teamone.de; $path = /; $fp = fsockopen($host, 80); $header = GET .$path. HTTP/1.0.CRLF; $header .= Accept-Encoding: gzip.CRLF; $header .= Host: .$host.CRLF; $header .= CRLF; fputs($fp, $header); while(!feof($fp)) { $result .= fread($fp,1); } fclose($fp); $compressed_result = explode(CRLF.CRLF, $result, 2); echo length: strlen($compressed_result[1]).\n; // length of compressed message // without header, to compare // with content-length header echo gzuncompress($compressed_result[1]); ? I get the following error: Warning: gzuncompress: data error in /www/webseite/temp/sock2.php on line 32 Line 32: echo gzuncompress($compressed_result[1]); From server I get HTTP-response contend-encoding: gzip, HTTP-Statuscode 200, the content-length in HTTP header is the same as my own echo length: strlen($compressed_result[1]).; $compressed_result[1] contains binary data, no plain-text. gzcompress and gzuncompress usually work without problems in. Server-OS: Linux 2.4 Webserver: Apache 1.3.26 PHP 4.2.3.(CGI) Perhaps there are some charakters form binary gzip-code interpretet as functional character, could I escape something here? Or some problems with line-breaks, or blanks? I have no idea whats going wrong here. I hope someone here knows what to do or where to look for errors! Thank you, Andreas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Creating associative array
I am trying to create associative array in a while loop.. $image_array = array(); $image_array = array_push($file_name=$image_url); what i am doing wrong??
Re: [PHP] Creating associative array
Try: $image_array = array(); $image_array[$file_name] = $image_url; PHP wrote: I am trying to create associative array in a while loop.. $image_array = array(); $image_array = array_push($file_name=$image_url); what i am doing wrong?? -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Problem with include PHP 4.3.0
Goetz Lohmann wrote : doc_root = /usr/local/www/htdocs than maybe leave this blank ! No. In my case it's absolutely senseless to define doc_root in php.ini since there are many virtual servers in httpd.conf, each with its own root. It's also the reason why I don't want Apache to get a working dir from the environment. So '.' and '..' don't mean anything either (for opening files), but that seems OK to me. Maybe your server got a working dir from its parent shell, so '.', '..', getcwd() and `pwd` work for you. I didn't mention that I'm not the PHP programmer, but the Apache/PHP manager, and this is a problem encountered by the webmaster of one of the virtual servers when testing PHP 4.3.0. Their PHP application has several include directories and many include()s within included files. It's the reason why I'm looking for a way of getting their script working properly with as few modification as possible (I can modify php.ini or the server config). if a file is parsed, all include files a relativ to this parsed file. This seems true for 4.3.0, false for 4.2.1 (it's relative to the main script PHP_SELF). PHP_SELF /phpinfo.php I have printed PHP_SELF from within testinclude.php and inc1.php. In both cases, it's /tests/testinclude.php echo exec('ls'); should print out not a empty string but testinclude.php and echo exec('pwd'); should print /usr/local/www/htdocs/tests Only if the server gets a working dir, which is not my case (ls and pwd return nothing, which is normal IMHO). Webmasters can't set it with chdir() since setting environment variables other than PHP_* is forbidden in the recommended php.ini for security reason. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating associative array
At 13:28 5-2-03, you wrote: Try: $image_array = array(); $image_array[$file_name] = $image_url; PHP wrote: I am trying to create associative array in a while loop.. $image_array = array(); $image_array = array_push($file_name=$image_url); i agree with the suggestion, but maybe (this may be a stupid newbie comment) this will also work, if you insist on using array_push: $image_array = array_push(array($file_name=$image_url)); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating associative array
On Wednesday 05 February 2003 20:51, Chris Hayes wrote: At 13:28 5-2-03, you wrote: Try: $image_array = array(); $image_array[$file_name] = $image_url; PHP wrote: I am trying to create associative array in a while loop.. $image_array = array(); $image_array = array_push($file_name=$image_url); i agree with the suggestion, but maybe (this may be a stupid newbie comment) this will also work, if you insist on using array_push: $image_array = array_push(array($file_name=$image_url)); Please read the manual. array_push() does NOT work like that. -- 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 -- /* And in the heartbreak years that lie ahead, Be true to yourself and the Grateful Dead. -- Joan Baez */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Security question with PHP on Unix / Linux.
Ananth Kesari [EMAIL PROTECTED] wrote... : Thanks for your inputs. Will proceed from here. Well, if you did not know, NetWare is an operating system brought out by Novell. I know :) We are working on porting PHP onto NetWare. In fact, we already have ported PHP 4.2.3 onto NetWare and we have synched up our souces for the 4.3 branch. Interesting. Are you working with the php-dev team or on your own? -- Maxim Maletsky [EMAIL PROTECTED] Maxim Maletsky [EMAIL PROTECTED] 02/04/03 08:45PM Ananth Kesari [EMAIL PROTECTED] wrote... : I am working on porting PHP onto NetWare. What exactly do you mean? I am newbie to Unix / Linux systems and at this point of time, I am trying to understand the way security is implemented for PHP on Unix / Linux. I mean, how are the different users distinguished from Unix / Linux. From PHP's point of view, every PHP process will run as apache's process, with apache's user. Most often `nobody' or `apache'. Do they get to login into the Unix / Linux system? No. Do they have separate data space for each user? No. Only sessions, if you use them. Sessions have their own unique IDs and are stored in a certain directory by default. A database solution can also be implemented. What is the API that is used to login to Unix / Linux. There is no login to the Unix / Linux. You might write one on your own, if you wish, but that would be your thing. PHP as it is, logs nobody to the Linux, it runs everybody's request as Apache's user. User may enter his username and password on the browser, but how do they get translated onto the Unix / Linux box? Whatever inputted to the broswer, is send to your script. Stays up to you to decide what to do with the user/pass. Basically, you would usually store the credentials in a database and then authenticate the users against the database, not Linux Shell itself. Since I am a newbie, I may have misunderstood some concepts here. Most of them. PHP is a programming language, not a shell interface or something. Stays up to you what to do once user runs your PHP script. -- Maxim Maletsky [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] writing to the db on close
Hello, I need a way to write a record to the db when the user closes their browser. How can I do this? I looked last night at the onunload javascript event but am not sure how that can trigger the php code to enter a row in the db. I am using sessions so is there a way to write to the db when the session is deleted? Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] getting javascript string values
Hey Guys, How can I get the value of an javascript string and pass it to a php variable? i.e. script var x = test; /script ? $x = // need to get the value of x ? thanks Iced Sun
Re: [PHP] PHP connecting to MS Access
You could use ODBC -- Maxim Maletsky [EMAIL PROTECTED] Phil Schwarzmann [EMAIL PROTECTED] wrote... : If a MS Access database and a PHP server were on the same machine, could they connect without having to use something like MS SQL Server? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Execute at a defined time
Hi, I was looking on PHP manual but didn't find anything about it. How can I execute a script all days at the same time? I kno i must have access to the CRON of the system, but don't know what function should I use to make this happen (run the script). Miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getting javascript string values
How can I get the value of an javascript string and pass it to a php variable? script var x = test; /script ? $x = // need to get the value of x ? Well as you know, but just as a reminder, when you make a page with both php and javascript in it, the PHP code is executed on the server and then the resulting html plus javascript is send to the user, and the browser executes the javascript. So it is easy to fill in PHP-made variables into the javascript, e.g. ?PHP $phpvar=3+8+31; ? script language=javascript theanswer = ?PHP echo $phpvar; ? /script But to give javascript results to PHP you have to give it back to another PHP page. I can think of three ways: - write a cookie with javascript and have the next page read the cookie with PHP - set a form element's value with javascript (document.formname.elementname.value=(6*7)) then submit the form (document.formname.submit()), In the following php page read $_POST['elementname'] (PHP=4.10) - build the variable into the URL like window.location.href='http://www.mysite.org/nextpage.php?variable1=' + (50-8) +'variable2='+theanswer . in the nextpage read $_GET['variable1'] and 2 In all cases make sure that you are very careful with inserting the result in SQL queries or to include files. Imagine that [your favourite enemy] tries to add some sql code or include a selfchosen file from the server. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Execute at a defined time
Hi, Wednesday, February 5, 2003, 11:49:35 PM, you wrote: MB Hi, MB I was looking on PHP manual but didn't find anything about it. MB How can I execute a script all days at the same time? I kno i must have MB access to the CRON of the system, but don't know what function should I use MB to make this happen (run the script). MB Miguel One simple way is with cron and a web page using lynx like this: 00 00 * * * /usr/bin/lynx -dump http://domain.com/countdown.php 1 /dev/null 2 /dev/null (-dump tells lynx to read the url, dump the page out and exit) -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 5 Feb 2003 14:06:41 -0000 Issue 1865
php-general Digest 5 Feb 2003 14:06:41 - Issue 1865 Topics (messages 134364 through 134404): Re: Array find a element 134364 by: Bobby Patel 134384 by: mattias.ballou.se Printing 134365 by: Chris Kay 134367 by: Jason Sheets php problem 134366 by: Aaron Downes 134368 by: Jason Sheets 134369 by: Jason k Larson Sessions and Cookies 134370 by: acleave 134371 by: Leif K-Brooks 134372 by: Dmitri 134391 by: 1LT John W. Holmes inserting datas through table 134373 by: kumar Best way to include multi-lingual support in an application. 134374 by: JJ Harrison 134385 by: mattias.ballou.se 134386 by: rush Re: Security question with PHP on Unix / Linux. 134375 by: Ananth Kesari 134376 by: Ananth Kesari 134398 by: Maxim Maletsky Re: Making /something/blah work instead of /something.php/blah 134377 by: Jason Wong Re: WYSIWYG Content Management system? 134378 by: Jason Wong fputs / fwrites 134379 by: Lee Herron 134381 by: Jason Wong Re: Protect Access to a Directory 134380 by: Jason Wong 134383 by: Adrian Portsmouth Object oriented Programming 134382 by: Sascha Braun Re: PhpMyADmin Help 134387 by: Simon restricting acces to files 134388 by: Shams PHP connecting to MS Access 134389 by: Phil Schwarzmann 134401 by: Maxim Maletsky Re: Is there a way to retrieve an entire source code from a php file? 134390 by: Chris Hayes problems with gzuncompress data from fsockopen (data error) 134392 by: akorthaus.web.de Creating associative array 134393 by: PHP 134394 by: Leif K-Brooks 134396 by: Chris Hayes 134397 by: Jason Wong Re: Problem with include PHP 4.3.0 134395 by: Jean-Pierre Gallou writing to the db on close 134399 by: Edward Peloke getting javascript string values 134400 by: Gilberto Garcia Jr. 134403 by: Chris Hayes Execute at a defined time 134402 by: Miguel Brás 134404 by: Tom Rogers Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- look at array_key_exists Narciso Miguel Rodrigues [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is possible to do something like if ($username in $users) ... or i need to do a foreach($user){...} Thks [MsR] ---End Message--- ---BeginMessage--- You can use in_array (http://www.php.net/function.in_array) for this. -- Mattias --|-Original Message- --|From: Narciso Miguel Rodrigues --|[mailto:[EMAIL PROTECTED]] --|Sent: Wednesday, February 05, 2003 02:03 --|To: [EMAIL PROTECTED] --|Subject: [PHP] Array find a element --| --| --|Is possible to do something like --| --| if ($username in $users) ... or i need to do a foreach($user){...} --| --|Thks --| --|[MsR] --| --| --|-- --|PHP General Mailing List (http://www.php.net/) --|To unsubscribe, visit: http://www.php.net/unsub.php --| --| ---End Message--- ---BeginMessage--- I am thinking of running a print job from one system via the internet to a network printer, this can be done... Question 1.. Anyway had experience with a certain printer that would be goof for this... Question 2.. Could some one point me to the right place I may learn how to print to a network printer with php on a RH 8.0 box Thank you in advance - Chris Kay (Systems Development) Techex Communications Website: www.techex.com.au Email: [EMAIL PROTECTED] Telephone: 1300 88 111 2 - Fax: 1300 882 221 - ---End Message--- ---BeginMessage--- If you have setup your printer with lpr then you can send print jobs with PHP via lpr (using command line execution) to the printer. You should be able to use other print systems that offer command line printing as well. Look at the PHP process execution functions for actually executing the print command. Jason On Tue, 2003-02-04 at 21:09, Chris Kay wrote: I am thinking of running a print job from one system via the internet to a network printer, this can be done... Question 1.. Anyway had experience with a certain printer that would be goof for this... Question 2.. Could some one point me to the right place I may learn how to print to a network printer with php on a RH 8.0 box Thank you in advance - Chris Kay (Systems Development) Techex Communications Website: www.techex.com.au Email: [EMAIL PROTECTED] Telephone: 1300 88 111 2 - Fax: 1300 882 221
Re: [PHP] Execute at a defined time
Hi Miguel, You can use cron to execute the CGI or CLI version of PHP against your PHP script, for example /usr/local/bin/php example.php, simply create a cron entry that will execute at the desired time. If you need information on the crontab format do a man crontab or search google for cron help as there is a lot of information available. Jason On Wed, 2003-02-05 at 06:49, Miguel Brás wrote: Hi, I was looking on PHP manual but didn't find anything about it. How can I execute a script all days at the same time? I kno i must have access to the CRON of the system, but don't know what function should I use to make this happen (run the script). Miguel -- 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] Execute at a defined time
If you have PHP compiled as cgi then you can run something like: php /path/to/my/script.php or if you can request the page via your website with something like: lynx -dump http://your site.com/yourscript.php Also if you want to know how to use cron, try typing man cron in your shell Hope this helps Andrew - Original Message - From: Miguel Brás [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 05, 2003 1:49 PM Subject: [PHP] Execute at a defined time Hi, I was looking on PHP manual but didn't find anything about it. How can I execute a script all days at the same time? I kno i must have access to the CRON of the system, but don't know what function should I use to make this happen (run the script). Miguel -- 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] mcrypt installation problems
Can anyone point to information on how to install mcrypt support for PHP. I tried the PHP mcrypt pages but they are quite lacking in details. I downloaded libmcrypt and got that installed fine. I also downloaded mcrypt (do I really need it?) but that wouldn't configure. It complains that: checking for libmcrypt - version = 2.5.0... no *** Could not run libmcrypt test program, checking why... *** The test program compiled, but did not run. This usually means *** that the run-time linker is not finding LIBMCRYPT or finding the wrong ... I tried compiling PHP with --with-mcrypt=/usr/src/mcrypt-2.6.3/ (the locate of the mcrypt source files) but that gave me an error when I did make: cc1: warning: changing search order for system directory /usr/local/include cc1: warning: as it has already been specified as a non-system directory /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:229:1: warning: MCRYPT_FAILED redefined In file included from /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:34: [...] Questions: 1- Do I need both libmcrypt AND mcrypt? 2- What is the installation procedure? I tried the obvious ./configure make combination but to no avail ... Thanks! Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Execute at a defined time
Do a man crontab to get info. Or Google for turotials on how to use cron. Also make sure that PHP is available from the command line. Do a simple test, on the command line type: php --version If you get version iformation as output the PHP is installed for command line useage and will work with cron. Miguel BráS wrote: Hi, I was looking on PHP manual but didn't find anything about it. How can I execute a script all days at the same time? I kno i must have access to the CRON of the system, but don't know what function should I use to make this happen (run the script). Miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mcrypt installation problems
Download MCRYPT SRC. tar -zxf mcrypt.tar.gz cd mcrypt ./configure --prefix=/usr/local/mcrypt make make install cd /usr/local/php ./configure --with-mcrypt=/usr/local/mcrypt Replace path's with your own. On Wed, 2003-02-05 at 09:07, Jean-Christian Imbeault wrote: Can anyone point to information on how to install mcrypt support for PHP. I tried the PHP mcrypt pages but they are quite lacking in details. I downloaded libmcrypt and got that installed fine. I also downloaded mcrypt (do I really need it?) but that wouldn't configure. It complains that: checking for libmcrypt - version = 2.5.0... no *** Could not run libmcrypt test program, checking why... *** The test program compiled, but did not run. This usually means *** that the run-time linker is not finding LIBMCRYPT or finding the wrong ... I tried compiling PHP with --with-mcrypt=/usr/src/mcrypt-2.6.3/ (the locate of the mcrypt source files) but that gave me an error when I did make: cc1: warning: changing search order for system directory /usr/local/include cc1: warning: as it has already been specified as a non-system directory /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:229:1: warning: MCRYPT_FAILED redefined In file included from /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:34: [...] Questions: 1- Do I need both libmcrypt AND mcrypt? 2- What is the installation procedure? I tried the obvious ./configure make combination but to no avail ... Thanks! Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP] mcrypt installation problems
Adam Voigt wrote: Download MCRYPT SRC. tar -zxf mcrypt.tar.gz cd mcrypt ./configure --prefix=/usr/local/mcrypt From the commands you give you imply that libmcrypt is not needed. Are you sure? The configure command you give does not work. Here's the complete error: [root@host110 mcrypt-2.6.3]# ./configure --prefix=/usr/local/mcrypt [delete configure messages ...] checking for libmcrypt - version = 2.5.0... no *** Could not run libmcrypt test program, checking why... *** The test program compiled, but did not run. This usually means *** that the run-time linker is not finding LIBMCRYPT or finding the wrong *** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to set your *** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point *** to the installed location Also, make sure you have run ldconfig if that *** is required on your system *** *** If you have an old version installed, it is best to remove it, although *** you may also be able to get things to work by modifying LD_LIBRARY_PATH *** configure: error: *** libmcrypt was not found -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] A scrollable area within a page?
Hello friends, Can anyone please suggest me some lnks orhelp me with some info on how to make 2 scrollable areas inside one webpage? Also, can I put dynamic data output into these areas? Thanks very much. Denis
RE: [PHP] A scrollable area within a page?
Denis, There are two ways: 1. Using text areas textarea name=thename rows=10 cols=50Content/textarea, you can modify it dinamically using JS. 2. Using the IFRAME tag (which I think is not advised). I'd recommend the first one. HTH -- Un gran saludo/Big regards... Arturo Barajas, IT/Systems PPG MX (SJDR) (427) 271-9918, x448 -Original Message- From: Denis L. Menezes [mailto:[EMAIL PROTECTED]] Sent: Miércoles, 05 de Febrero de 2003 08:24 a.m. To: PHP general list Subject: [PHP] A scrollable area within a page? Hello friends, Can anyone please suggest me some lnks orhelp me with some info on how to make 2 scrollable areas inside one webpage? Also, can I put dynamic data output into these areas? Thanks very much. Denis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mcrypt installation problems
Hi, Thursday, February 6, 2003, 12:07:49 AM, you wrote: JCI Can anyone point to information on how to install mcrypt support for JCI PHP. I tried the PHP mcrypt pages but they are quite lacking in details. JCI I downloaded libmcrypt and got that installed fine. JCI I also downloaded mcrypt (do I really need it?) but that wouldn't JCI configure. It complains that: JCI checking for libmcrypt - version = 2.5.0... no JCI *** Could not run libmcrypt test program, checking why... JCI *** The test program compiled, but did not run. This usually means JCI *** that the run-time linker is not finding LIBMCRYPT or finding the JCI wrong ... JCI I tried compiling PHP with --with-mcrypt=/usr/src/mcrypt-2.6.3/ (the JCI locate of the mcrypt source files) but that gave me an error when I did JCI make: JCI cc1: warning: changing search order for system directory JCI /usr/local/include JCI cc1: warning: as it has already been specified as a non-system directory JCI /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:229:1: warning: MCRYPT_FAILED JCI redefined JCI In file included from /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:34: JCI [...] JCI Questions: JCI 1- Do I need both libmcrypt AND mcrypt? JCI 2- What is the installation procedure? I tried the obvious ./configure JCI make combination but to no avail ... JCI Thanks! JCI Jc I did it this way untar libmcrypt and mcrypt into /usr/src then in libmcrypt ./configure --prefix=/usr (could be /usr/local if you want make make install ldconfig cd ../mcrypt-2.6.3 ./configure --prefix=/usr make make install then in php --with-mcrypt=/usr/src/mcrypt-2.6.3 -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WYSIWYG Content Management system?
Hey Jason, I am looking for the same. Do you have or any one in this list has any idea? Please let me know. thanks Hardik Jason Wong [EMAIL PROTECTED] wrote:On Wednesday 05 February 2003 09:43, J J wrote: I've seen CMS systems like phpnuke but it's kind of overkill for what I need and almost more news like. I'm looking for something that would allow the user to change content, change/upload images, all in a wysiwyg style so it's easy to see and use. It'd be cool to be able to login to the admin area, select a page to edit, and it would allow you to preview the page just like it looks. Then you click on a text area or image you want to update. Is there a CMS that allows for WYSIWYG like editing but will work within specified headers/footers, style sheets, etc? Then the site content would all be generated on the fly from php/mysql. All the major/popular ones would/should have been registered at freshmeat and soureforge so check them out. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* You're already carrying the sphere! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now
Re: [PHP] mcrypt installation problems
Tom Rogers wrote: I did it this way untar libmcrypt and mcrypt into /usr/src then in libmcrypt ./configure --prefix=/usr (could be /usr/local if you want make make install ldconfig cd ../mcrypt-2.6.3 Up to here fine. ./configure --prefix=/usr configure: error: You need at least libmhash 0.8.15 to compile this program. http://mhash.sf.net/; Hum ... the PHP manual nor the mcrypt web site mentionned the need for mhash Do I really need it? Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mcrypt installation problems
You need only libmcrypt, mcrypt is a command line program that is intended to replace the Unix crypt program. To build the mcrypt binary you need mhash and libmcrypt, for PHP unless you want mhash you need only libmcrypt. Jason On Wed, 2003-02-05 at 07:07, Jean-Christian Imbeault wrote: Can anyone point to information on how to install mcrypt support for PHP. I tried the PHP mcrypt pages but they are quite lacking in details. I downloaded libmcrypt and got that installed fine. I also downloaded mcrypt (do I really need it?) but that wouldn't configure. It complains that: checking for libmcrypt - version = 2.5.0... no *** Could not run libmcrypt test program, checking why... *** The test program compiled, but did not run. This usually means *** that the run-time linker is not finding LIBMCRYPT or finding the wrong ... I tried compiling PHP with --with-mcrypt=/usr/src/mcrypt-2.6.3/ (the locate of the mcrypt source files) but that gave me an error when I did make: cc1: warning: changing search order for system directory /usr/local/include cc1: warning: as it has already been specified as a non-system directory /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:229:1: warning: MCRYPT_FAILED redefined In file included from /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:34: [...] Questions: 1- Do I need both libmcrypt AND mcrypt? 2- What is the installation procedure? I tried the obvious ./configure make combination but to no avail ... Thanks! Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: writing to the db on close
Try the window.open method to popup a php page that does the desired job. script window.onunload=doRec function doRec() { window.open(writeToDB.php) } /script and writeToDb.php ?php //.. ?scriptwindow.close() /script -- Regards, Ns_Andy, [EMAIL PROTECTED] Edward Peloke [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, I need a way to write a record to the db when the user closes their browser. How can I do this? I looked last night at the onunload javascript event but am not sure how that can trigger the php code to enter a row in the db. I am using sessions so is there a way to write to the db when the session is deleted? Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mcrypt installation problems
Jason Sheets wrote: You need only libmcrypt, mcrypt is a command line program that is intended to replace the Unix crypt program. To build the mcrypt binary you need mhash and libmcrypt, for PHP unless you want mhash you need only libmcrypt. Ok, so to build mcrypt support into PHP I only need libmcrypt ... that's it? I can compile and install that with no errors. But when I try and compile PHP I get this big long error error ... Any hints?? gcc -Iext/mcrypt/ -I/usr/src/php-4.3.0/ext/mcrypt/ -DPHP_ATOM_INC -I/usr/src/php-4.3.0/include -I/usr/src/php-4.3.0/main -I/usr/src/php-4.3.0 -I/usr/src/php-4.3.0/Zend -I/usr/local/psql//include -I/usr/src/php-4.3.0/ext/xml/expat -I/usr/src/php-4.3.0/TSRM -g -O2 -c /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c -o ext/mcrypt/mcrypt.o echo ext/mcrypt/mcrypt.lo /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:229:1: warning: MCRYPT_FAILED redefined In file included from /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:34: /usr/local/include/mcrypt.h:31:1: warning: this is the location of the previous definition /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c: In function `zm_startup_mcrypt': /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:279: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:280: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:281: `MCRYPT_BLOWFISH_128' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:281: (Each undeclared identifier is reported only once /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:281: for each function it appears in.) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:282: `MCRYPT_BLOWFISH_192' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:283: `MCRYPT_BLOWFISH_256' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:284: `MCRYPT_BLOWFISH_448' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:285: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:286: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:287: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:288: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:289: `MCRYPT_IDEA' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:290: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:291: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:292: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:293: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:294: `MCRYPT_RC2_128' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:295: `MCRYPT_RC2_256' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:296: `MCRYPT_RC2_1024' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:297: `MCRYPT_RC4' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:298: `MCRYPT_RC6_128' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:299: `MCRYPT_RC6_192' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:300: `MCRYPT_RC6_256' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:301: `MCRYPT_SAFER_64' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:302: `MCRYPT_SAFER_128' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:303: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:304: `MCRYPT_SERPENT_128' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:305: `MCRYPT_SERPENT_192' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:306: `MCRYPT_SERPENT_256' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:307: `MCRYPT_TWOFISH_128' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:308: `MCRYPT_TWOFISH_192' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:309: `MCRYPT_TWOFISH_256' undeclared (first use in this function)
[PHP] Re: fputs / fwrites
yes,I think this is the script you're looking for. However,This script requires you to have lcnt.txt existing at the time this script runs. ?php $cfile = fopen(lcnt.txt, 'r+'); $lcnt = @fgets($cfile,10); rewind($cfile); fwrite ($cfile,++$lcnt); fclose($cfile); ? -- Regards, Ns_Andy, [EMAIL PROTECTED] Lee Herron [EMAIL PROTECTED] wrote in message 005601c2cce4$48e59350$6501a8c0@bluewebcow">news:005601c2cce4$48e59350$6501a8c0@bluewebcow... Okay, so I want to open a file, get a small number from it (less than 3 digits) then overwrite a new number (incremented the original by 1) and close the file. The goal is to do this in the fastest way possible .. it seems that there should be a way of doing this without having to open and close the file twice. I've tried: $cfile = fopen(lcnt.txt, 'r+'); $lcnt = fgets($cfile,10); This results in $lcnt having a value of 1 (loaded from value within text file) Now, if I increment it: $nc = $lcnt+1; then write it back to the file: $nul = fwrite($cfile, $nc); It writes starting at where the last read left off -- I want to start at zero offset so to overwrite the existing value. I can't find a method for resetting the offset pointer without having to close the file and reopen it with w+ There must be a simpler way to do this ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] mcrypt installation problems
Hi, Thursday, February 6, 2003, 12:30:01 AM, you wrote: JCI Tom Rogers wrote: I did it this way untar libmcrypt and mcrypt into /usr/src then in libmcrypt ./configure --prefix=/usr (could be /usr/local if you want make make install ldconfig cd ../mcrypt-2.6.3 JCI Up to here fine. ./configure --prefix=/usr JCI configure: error: You need at least libmhash 0.8.15 to compile this JCI program. http://mhash.sf.net/; JCI Hum ... the PHP manual nor the mcrypt web site mentionned the need for JCI mhash JCI Do I really need it? JCI Jc Looks that way :) I also have that in /usr/src and in php as --with-mhash=/usr/src/mhash-0.8.17 (configured with the same --prefix=?usr -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is my syntax wrong?
On Tuesday, February 4, 2003, at 05:03 PM, John W. Holmes wrote: I think we are almost there. This code is not producing an error, but it is also not incrementing the database. The value stays at zero. Any idea what could be wrong? $inc_current_ad = WrapMySQLDatabaseResults(macasap, update ads where ad_id = .$current_ad-Value(ad_id). set rotate=.($current_ad-Value(rotate)+1), block=0,inc_current_ad); Are you sure $current_ad-Value(rotate) is returning a value? Yes it is. If you're just trying to increment rotate by one, then you can use Update ... set rotate = rotate + 1 where ... Could you give me the full SQL statement? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mcrypt installation problems
Tom Rogers wrote: Looks that way :) I also have that in /usr/src and in php as --with-mhash=/usr/src/mhash-0.8.17 Still no go. Did you compile into php 4.3.0? I finally got libmcrypt, mhash and mcrypt to make and install, but can't get PHP to work with --with-mcrypt OR --with-mcrypt=/usr/local OR --with-mcrypt=../mcrypt-2.6.3/ I get this big compile error: gcc -Iext/mcrypt/ -I/usr/src/php-4.3.0/ext/mcrypt/ -DPHP_ATOM_INC -I/usr/src/php-4.3.0/include -I/usr/src/php-4.3.0/main -I/usr/src/php-4.3.0 -I/usr/src/php-4.3.0/Zend -I/usr/local/psql//include -I/usr/src/php-4.3.0/ext/xml/expat -I/usr/src/php-4.3.0/TSRM -g -O2 -c /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c -o ext/mcrypt/mcrypt.o echo ext/mcrypt/mcrypt.lo /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:229:1: warning: MCRYPT_FAILED redefined In file included from /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:34: /usr/local/include/mcrypt.h:31:1: warning: this is the location of the previous definition /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c: In function `zm_startup_mcrypt': /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:279: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:280: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:281: `MCRYPT_BLOWFISH_128' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:281: (Each undeclared identifier is reported only once /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:281: for each function it appears in.) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:282: `MCRYPT_BLOWFISH_192' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:283: `MCRYPT_BLOWFISH_256' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:284: `MCRYPT_BLOWFISH_448' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:285: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:286: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:287: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:288: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:289: `MCRYPT_IDEA' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:290: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:291: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:292: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:293: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:294: `MCRYPT_RC2_128' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:295: `MCRYPT_RC2_256' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:296: `MCRYPT_RC2_1024' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:297: `MCRYPT_RC4' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:298: `MCRYPT_RC6_128' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:299: `MCRYPT_RC6_192' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:300: `MCRYPT_RC6_256' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:301: `MCRYPT_SAFER_64' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:302: `MCRYPT_SAFER_128' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:303: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:304: `MCRYPT_SERPENT_128' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:305: `MCRYPT_SERPENT_192' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:306: `MCRYPT_SERPENT_256' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:307: `MCRYPT_TWOFISH_128' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:308: `MCRYPT_TWOFISH_192' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:309: `MCRYPT_TWOFISH_256' undeclared (first use in this function) /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:310: warning: passing arg 3 of `zend_register_long_constant' makes integer from
Re: [PHP] Execute at a defined time
Thx all for the help Problem solved Miguel Jason Sheets [EMAIL PROTECTED] escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi Miguel, You can use cron to execute the CGI or CLI version of PHP against your PHP script, for example /usr/local/bin/php example.php, simply create a cron entry that will execute at the desired time. If you need information on the crontab format do a man crontab or search google for cron help as there is a lot of information available. Jason On Wed, 2003-02-05 at 06:49, Miguel Brás wrote: Hi, I was looking on PHP manual but didn't find anything about it. How can I execute a script all days at the same time? I kno i must have access to the CRON of the system, but don't know what function should I use to make this happen (run the script). Miguel -- 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] Include today's date in a SQL statement?
What would the SQL be to find a record where: start_date today = end_date Thanks, - Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] POP3 ... syntax error
Hello, I'm trying to access pop3 server via PHP code. I can establish the connection, send the USER command (I receive the +OK answer). After that I sent the PASS command but I receive the answer -ERR syntax error. I don't understand why syntax error. Do you have an idea ? Christian, --- Christian Ista (AFAS member) Hosting - Dedicated server http://www.bee-hosting.com http://www.your-softwares.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Include today's date in a SQL statement?
Hi Brian, What would the SQL be to find a record where: start_date today = end_date ... WHERE start_date today AND today = end_date If you're asking how do I get today's date into an SQL statement, there are two ways: - use your DBMS's built-in function to get today's date - use PHP's date() function to format a timestamp as -MM-DD Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Object oriented Programming
Creating functions is a real easy part of programming. Classes are a differect story (or at least at first). Anyway, If I were you, I would get Professional PHP4 by Wrox and read the OOP section. I would first start writting functions. Think if it like this, if you use exact code twice (you cut and paste it) write a function. If you use code that is ninety or eighty percent similar make a function. Figure out how to do that and then worry about classes. The problem with books on classes are that they tell you how/when to use a lightswitch but they dont tell you how to turn it on. I have been thinking about writing an article about how to turn the figurative light switch on when it comes to classes. Have you been writting functions? Cheers! Leonard. -Original Message- From: Sascha Braun [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 3:22 AM To: PHP General list Subject: [PHP] Object oriented Programming Hi, I need a basic Tutorial on how to write objectoriented Scripts in PHP, like classes and functions I can use at many places. If there is something like that, please tell me where I can find it (Book or Web). Thank Ya'll Sascha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] POP3 ... syntax error
How about some code? On Wed, 2003-02-05 at 10:21, Christian Ista wrote: Hello, I'm trying to access pop3 server via PHP code. I can establish the connection, send the USER command (I receive the +OK answer). After that I sent the PASS command but I receive the answer -ERR syntax error. I don't understand why syntax error. Do you have an idea ? Christian, --- Christian Ista (AFAS member) Hosting - Dedicated server http://www.bee-hosting.com http://www.your-softwares.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP] Include today's date in a SQL statement?
Brian, $Today = // Date format that you use that can be compared to the date stored in the database. $Query = WHERE start_date $Today and end_date =$Today; I just showed the where statement of the query. You can add in any statement you want before that to select or manipulate data based on the results. Jonathan Pitcher Webmaster Capitol Federal Savings On Wednesday, February 5, 2003, at 09:14 AM, Brian Dunning wrote: What would the SQL be to find a record where: start_date today = end_date Thanks, - Brian -- 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] Documentation Help
Hi Everyone, I worked on educational intranet and library management system. I did comment my code but i dont know how to document functional and technical specification as well as database schema. Can anyone help me how to start working on documentation part so other developer can easily understand of these massive projects. Thanks and really appreciate if someone can help me Hardik - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now
Re: [PHP] Creating associative array
Don't use array_push - simply set the value: $image_array[$file_name] = $image_url; - Original Message - From: Leif K-Brooks [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, February 05, 2003 1:28 PM Subject: Re: [PHP] Creating associative array Try: $image_array = array(); $image_array[$file_name] = $image_url; PHP wrote: I am trying to create associative array in a while loop.. $image_array = array(); $image_array = array_push($file_name=$image_url); what i am doing wrong?? -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] writing to the db on close
As you correctly found out, the onUnload handler would be the place to do this, something like this: Within your page, have a hidden form: form name=oncloseform action=onclose.php input type=hidden name=any_data_you_want_to_pass value= /form In your body statement you'll have body onUnload=document.oncloseform.submit(); Be aware that this will trigger _always_ if the user leaves the page, regardless if he closes the browser, or goes to another page (even within your own site). Having JS disabled will also inhibit transmission of the form. - Original Message - From: Edward Peloke [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 05, 2003 2:33 PM Subject: [PHP] writing to the db on close Hello, I need a way to write a record to the db when the user closes their browser. How can I do this? I looked last night at the onunload javascript event but am not sure how that can trigger the php code to enter a row in the db. I am using sessions so is there a way to write to the db when the session is deleted? Thanks, Eddie -- 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] Documentation Help
Hi Hardik, I worked on educational intranet and library management system. I did comment my code but i dont know how to document functional and technical specification as well as database schema. Theoretically, you should write the specs before the program (that way, the program matches the specs, not the other way round) Looks like it's too late for that now though :-) Here's a good article on writing functional specs (part 1 of 4): http://joelonsoftware.com/articles/fog36.html Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Date format from file
Is it possible to read a string from a text file (i.e. 0502031130) and be able to use that in a date function such as: $date = date(dmyHi, strtotime('+28 days)); How would I use that string as the date in the above code? TIA, Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question about $DOCUMENT_ROOT and include
Why does the absolute path work and not document_root? include ($DOCUMENT_ROOT/root_functionsT.php); //error message says function undefined include (/www/r/myID/htdocs/root_functions.php); // Works just fine echo $DOCUMENT_ROOT/root_functionsT.php; // shows /www/r/myID/htdocs/root_functionsT.php php 4.2.3 apache Actually, I'm trying to get away from using the full absolute path for includes but have not been able to get the htaccess declaration to work. php_value include_dir .:/www/r/myID/htdocs/ [I've tried every syntax variation I can find and think of] many thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reading CD information
Is it possible to have PHP read cd label information? You know in windows like after you put in a CD and use Windows Explorer and go to your CD rom drive's letter it will say like D: (MSOffice2K) or D: (date of burned cd) or D: (XPProCD), etc...If you know what I am talking about, is there a way to have PHP read that cd label? Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Redirecting to PHP
Dear list, My home page is index.html, that doesn't run PHP. I also have index.php which shows the same content with PHP. Can I do to automatically redirect a visitor from index.html to index.php? TIA Alberto
Re: [PHP] Question about $DOCUMENT_ROOT and include
--- Al [EMAIL PROTECTED] wrote: Why does the absolute path work and not document_root? include ($DOCUMENT_ROOT/root_functionsT.php); //error message says function undefined include (/www/r/myID/htdocs/root_functions.php); // Works just fine Try $_SERVER['DOCUMENT_ROOT'] and see if that works. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question on readdir()
I've been attempting to use the readdir() function in conjunction with opendir() and a couple others like the ones found here http://www.php.net/manual/en/function.readdir.php to generate some file listings. My problem is, I've tried all the examples found on the web page linked above and all return and empty listing whether or not there are files present. I'm running this script in the same directory as the one I'm trying to list the files for. I suspect my problem is that these directories are under symbolic links and the actual files reside on Windows shares which my FreeBSD webserver accesses via the Samba client. Are there known issues pertaining to this usage? Thanks Steve Brown
Re: [PHP] Redirecting to PHP
You can do it with JavaScript or a Meta refresh, but why? If both the pages are the same, why even use the HTML one? Alberto Brea wrote: Dear list, My home page is index.html, that doesn't run PHP. I also have index.php which shows the same content with PHP. Can I do to automatically redirect a visitor from index.html to index.php? TIA Alberto -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reading CD information
--- Adam Williams [EMAIL PROTECTED] wrote: Is it possible to have PHP read cd label information? Yes. I have never done this myself, but I know of at least one or two open source projects that read information such as that from a CD. They usually go one step better and communicate with opendb.org to get a good bit of information, such as genre, artist, album name, track titles, etc. You might want to just find an open source project that does something similar and see how they did it. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Control what is going to be exibited on screen
Ok, guys this is it With th code bellow I can get the html file from a url and get the content without the html tags, but I wanna control the exibition of this content and only display the lines 1 to 4, and I can't seem to get how to do this. I thank any advice you can get me. Rodrigo // Get a file into an array. In this example we'll go through HTTP to get // the HTML source of a URL. $lines = file ('http://www.site.com'); // Loop through our array, show html source as html source; and line numbers too. foreach ($lines as $line_num = $line) { $notags = Line #b{$line_num}/b : . strip_tags($line) . br\n; echo $notags; }
Re: [PHP] Date format from file
Hi, Thursday, February 6, 2003, 2:41:42 AM, you wrote: ehhc Is it possible to read a string from a text file (i.e. ehhc 0502031130) and be able to use that in a date function such as: ehhc $date = date(dmyHi, strtotime('+28 days)); ehhc How would I use that string as the date in the above code? ehhc TIA, ehhc Ed If you change the format of your string you can do this: $t = 20030205 1530; echo 'New date/time = '.date(d/m/Y H:i,strtotime($t. + 28 days)).'br'; -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] headers and redirect
Hi everyone, I have a question about clearing or resetting headers. My script executes a function based on the variables passed to it, such as: events.php?action=add However, when the function is finished, I need to redirect to events.php with no variables, because refreshing the page causes another event to be added. I tried: header(Location: ./php/events.php); But that did not reset the headers. Any tips? -Erich- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about $DOCUMENT_ROOT and include
Thanks for the feedback That works if I leave off the quotes from around DOCUMENT_ROOT. Simply $_SERVER[DOCUMENT_ROOT] I'd really like to get this working in the htaccess file. php_value include_dir .:/www/r/myID/htdocs/ I redoing a site with several php files in assorted directories and would like be certain things will work if we move the site to a new host. Several references I've found suggest staying away from using $DOCUMENT_ROOT since it can be different on virtual hosts. Chris Shiflett wrote: --- Al [EMAIL PROTECTED] wrote: Why does the absolute path work and not document_root? include ($DOCUMENT_ROOT/root_functionsT.php); //error message says function undefined include (/www/r/myID/htdocs/root_functions.php); // Works just fine Try $_SERVER['DOCUMENT_ROOT'] and see if that works. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] headers and redirect
I have a question about clearing or resetting headers. My script executes a function based on the variables passed to it, such as: events.php?action=add However, when the function is finished, I need to redirect to events.php with no variables, because refreshing the page causes another event to be added. I tried: header(Location: ./php/events.php); But that did not reset the headers. Any tips? www.php.net/header the correct syntax is header(Location: http://www.yourdomain.com/php/events.php;); ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Date format from file
Is it possible to read a string from a text file (i.e. 0502031130) and be able to use that in a date function such as: $date = date(dmyHi, strtotime('+28 days)); How would I use that string as the date in the above code? What database are you using? You can probably do all of this in your SQL statement if you're using the correct columns. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirecting to PHP
There are three ways to do this that I can think of. 1.) The first is the most effective but also requires access to the apache config file: Find the line that reads: DirectoryIndex index.html Change it to read DirectoryIndex index.html index.php As always when working with a config file. Save a backup of the file before doing the changes. 2.) Add A Meta Redirect or a Javascript Redirect inside of the index.html file. This Option will work for any server but does not always work on older browsers and browsers that have javascript turned off. 3.) Create a .htaccess file in your root web directory and put the following line into it. DirectoryIndex index.php This option should work for that directory and any directories inside of that dir. You need apache for this option to work. Jonathan Pitcher Capitol Federal Savings Webmaster On Wednesday, February 5, 2003, at 11:15 AM, Alberto Brea wrote: Dear list, My home page is index.html, that doesn't run PHP. I also have index.php which shows the same content with PHP. Can I do to automatically redirect a visitor from index.html to index.php? TIA Alberto -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] reading CD information
Hi Adam, Is it possible to have PHP read cd label information? Where is the CD? If it's in the CD-ROM drive of the webserver: probably. If it's in the CD-ROM drive of a visitor to your website: no. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirecting to PHP
Put a .htaccess file in your document root for your website with this line DirectoryIndex index.php Alberto Brea wrote: My ISP tells me that the home page must be index.html. However, I cannot make PHP scripts run on this page, so I made an index.php page with the same content, and thought of redirecting the visitor as a solution. What is the usual way everybody uses to run PHP on a home page with .html ending? Thanks Alberto -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] reading CD information
It would be in the cd-rom drive of the webserver. The CD's would be rotated periodically and the only way I have to identify what is on each cd and which .exe to run on it is by identifying it by its cd label. I've searched google and php.net but haven't found a function that can read cd labels. Any help is appreciated. Adam On Wed, 5 Feb 2003, Jon Haworth wrote: Hi Adam, Is it possible to have PHP read cd label information? Where is the CD? If it's in the CD-ROM drive of the webserver: probably. If it's in the CD-ROM drive of a visitor to your website: no. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reading CD information
Hi, Thursday, February 6, 2003, 3:06:29 AM, you wrote: AW Is it possible to have PHP read cd label information? You know in windows AW like after you put in a CD and use Windows Explorer and go to your CD rom AW drive's letter it will say like D: (MSOffice2K) or D: (date of burned cd) AW or D: (XPProCD), etc...If you know what I am talking about, is there a way AW to have PHP read that cd label? AW Adam You could try the vol command using exec{} and parse out the volume name -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Date format from file
I'm not using this for any database related function. What I'm trying to do is come up with a method for scheduling processes needed for our company that are run through command line php scripts. I'll be using cron or to run a command that will check the date within the file and see if the process needs to be run on that day and then rewrite the date + 28 days back into the file spawning the process if need be. To the best of my knowledge cron cannot run schedules this way. It can only run on specific days or times outlined directly. Our processes must run every 28 days, not a specific day of the month. If there is any other scheduling system out there that can do this type of thing on Linux/Unix I'd much rather use it than doing it this way. Ed On Wed, 5 Feb 2003, John W. Holmes wrote: Is it possible to read a string from a text file (i.e. 0502031130) and be able to use that in a date function such as: $date = date(dmyHi, strtotime('+28 days)); How would I use that string as the date in the above code? What database are you using? You can probably do all of this in your SQL statement if you're using the correct columns. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to store a file in an array and access each line
How can I read a file in a url, into an array so that I can access each line by itself? Thanx Rodrigo
Re[2]: [PHP] reading CD information
Hi, Adam TR You could try the vol command using exec{} and parse out the volume name TR -- TR regards, TR Tom This should do it: ? exec(vol g:,$result); $label = trim(strrchr($result[0],' ')); echo 'Label is '.$label.'br'; ? -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] In Need of a PHP freelancer...
You can also try the following site. It is loaded with freelance developers who are sitting there waiting for requests like yours. http://webhostingtalk.com/forumdisplay.php?s=deff1e6ceaa5f13e400bfefc1702a2f cforumid=33 -Original Message- From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 3:14 PM To: Shane; [EMAIL PROTECTED] Subject: Re: [PHP] In Need of a PHP freelancer... -Original Message- Greetings... I am in need of a freelancer to write an additional function to our company's extranet. Before I go and post a request to this list, I would like to know if there is a more appropriate place to post such a request, and still get quality folks who know their stuff. This is probably the best place, assuming you need a PHP function.. :) I'd be interested, also, if you want to send more details offlist. ---John Holmes... -- 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] How to store a file in an array and access each line
How can I read a file in a url, into an array so that I can access each line by itself? A certain four letters come to mind for this question... www.php.net/file ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] reading CD information
Thanks Tom, that works perfect! Adam On Thu, 6 Feb 2003, Tom Rogers wrote: Hi, Adam TR You could try the vol command using exec{} and parse out the volume name TR -- TR regards, TR Tom This should do it: ? exec(vol g:,$result); $label = trim(strrchr($result[0],' ')); echo 'Label is '.$label.'br'; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reading CD information
Guess it's not on Linux, eh? :) Adam Williams wrote: Thanks Tom, that works perfect! Adam On Thu, 6 Feb 2003, Tom Rogers wrote: Hi, Adam TR You could try the vol command using exec{} and parse out the volume name TR -- TR regards, TR Tom This should do it: ? exec(vol g:,$result); $label = trim(strrchr($result[0],' ')); echo 'Label is '.$label.'br'; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Date format from file
I'm not using this for any database related function. What I'm trying to do is come up with a method for scheduling processes needed for our company that are run through command line php scripts. I'll be using cron or to run a command that will check the date within the file and see if the process needs to be run on that day and then rewrite the date + 28 days back into the file spawning the process if need be. To the best of my knowledge cron cannot run schedules this way. It can only run on specific days or times outlined directly. Our processes must run every 28 days, not a specific day of the month. If there is any other scheduling system out there that can do this type of thing on Linux/Unix I'd much rather use it than doing it this way. Sorry, I though I read database in there somewhere. I don't know of another program. As long as you write a unix timestamp or some date format that can be parsed by strtotime(), then you can do it this way. Use fopen()/fread() to get the last time saved in the file. If you're using unix timestamps, just see if the current time is greater than the old timestamp + 28 days... If(time() $old_timestamp + 60*60*24*28) { //run script and save new time(); } ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] empty variables from a form
hi.. how would you test for an empty (unused) variable from a form.. i have a phone number split into 3 different vairiables and want to test to see if they were used in the form before displaying either the phone number itself or just leaving it out of the display... what code would be good to test it with.. the variables are $ac2 $ext2 and $num2 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reading CD information
Unfortunately not. I'm putting PHP on a windows 95 computer and the person will put a cdrom into the cd drive. Then they will double click on a shortcut that will run the php executable with script, and the script will read the cd label. depending on what the cd label is, it will call the correct .exe file on it to load the application. Its for a library and will be used by the general public, so I am making it as simple as possible :) Adam On Wed, 5 Feb 2003, John Nichel wrote: Guess it's not on Linux, eh? :) Adam Williams wrote: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] reading CD information
Hi, Thursday, February 6, 2003, 4:49:23 AM, you wrote: JN Guess it's not on Linux, eh? :) JN Adam Williams wrote: Thanks Tom, that works perfect! Adam On Thu, 6 Feb 2003, Tom Rogers wrote: Hi, Adam TR You could try the vol command using exec{} and parse out the volume name TR -- TR regards, TR Tom This should do it: ? exec(vol g:,$result); $label = trim(strrchr($result[0],' ')); echo 'Label is '.$label.'br'; ? For linux you could read the header using dd -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] empty variables from a form
how would you test for an empty (unused) variable from a form.. i have a phone number split into 3 different vairiables and want to test to see if they were used in the form before displaying either the phone number itself or just leaving it out of the display... what code would be good to test it with.. the variables are $ac2 $ext2 and $num2 umm i don't know maybe empty() ? www.php.net/empty ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Date format from file (END)
I don't know of another program. As long as you write a unix timestamp or some date format that can be parsed by strtotime(), then you can do it this way. Use fopen()/fread() to get the last time saved in the file. If you're using unix timestamps, just see if the current time is greater than the old timestamp + 28 days... If(time() $old_timestamp + 60*60*24*28) { //run script and save new time(); } ---John W. Holmes... Thanks alot for all the help. Using cron to run the checktime script I can then make sure the process gets run on the exact time it needs to be run along with the exact date in the file. Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] best oop book
Ok, I have seen a suggestion or two for oop books but I would like to buy one so what is the best php object oriented book on the market...in everyone's opinion. The Professional PHP4 XML book looks good for xml, so I hope to get that one, I have a php/mysql book, just want a good oop book now. I have read a few reviews on the professional php book by wrox but it seems to need for oop stuff Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DEV] Database Abstraction
* forwarding to PHP general Kasper Skårhøj [EMAIL PROTECTED] wrote... : There are millions of PHP-scripts using MySQL. Most of them probably doesn't use an Database Abstraction Layer (DBAL) in order to support other databases. When the requirement is made some day that a script should support another DB than MySQL programmers are facing the challenge of literally rewrite most of their code to fit some DBAL, like ADOdb or whatever. There are already tons of them written. The most famous ones are PEAR and ADODB. No need reinventing the wheel, contributing, maybe. So my idea was to make a DBAL which basically offers a parallel set of functions to the current MySQL-functions (search/replace) but internally parses the queries and re-makes the query into something Oracle or MSSql or some third DB would understand. This would be totally transparent and give instant DBA to millions of PHP-scripts. A MySQL emulator. For MySQL it wouldn't affect performance. For other DBs I would require a little parsing time of the query. Parsing the query is 1) bad idea because I don't want anything to mess with my SQL code 2) does not substitute something and limits something else 3) when moving to another database you also change your database design, this way the queries will have to be rewritten anyway I know this is not as simple as it sounds, but is it *totally impossible* since noone made it yet and if some of you think it is, please let me know why. I think the idea is obvious. Pretty much impossible. Oh well, adding all the logic, you can reduce the problems at most, but never to the perfection. Consider this: to select some data in mySQL you do SELECT ... while Oracle supports stored procedures, where you will have to bind the variables with OCIBindByName() function and a whole PL/SQL block as the query. How will you accomplish that? Also, databases differ bewteen themselves too much in the SQL itself, which is never SQL92 compatible. Rewriting that will lead to many unexpected results and, in most parts it is impossible. For instance, in Oralce I can do: SELECT * FROM customers WHERE customer_id = SELECT customer_id FROM purchases WHERE product_id = '$product' AND rownum = 1 ) How would you transform that from Oracle to mySQL? You'd need to whole queries in mySQL for that thing... The only solution is: storing queries separately. Check out how I did that for ZoomStats: www.sf.net/projects/zoomstats I have also written about it at PHP Architect (www.phparch.com) -- Maxim Maletsky [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] empty variables from a form
Next time please consider searching on PHP.net or Google before you post. This is an exceedingly basic question and there is an extraordinary amount of information already out there.. if(empty($_POST['ac2'])) { echo Area Code is a required field.; } -Kevin - Original Message - From: Sunfire [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 05, 2003 11:49 AM Subject: [PHP] empty variables from a form hi.. how would you test for an empty (unused) variable from a form.. i have a phone number split into 3 different vairiables and want to test to see if they were used in the form before displaying either the phone number itself or just leaving it out of the display... what code would be good to test it with.. the variables are $ac2 $ext2 and $num2 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003 -- 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] empty variables from a form
tnx will try that my other code looked something like that but it didnt work.. probably had the (and ) in the wrong places... i set it up as the whole statement as 1 if statement not 3 different ones.. - Original Message - From: Erich Beyrent [EMAIL PROTECTED] To: Sunfire [EMAIL PROTECTED] Sent: Wednesday, February 05, 2003 1:54 PM Subject: Re: [PHP] empty variables from a form hi.. how would you test for an empty (unused) variable from a form.. i have a phone number split into 3 different vairiables and want to test to see if they were used in the form before displaying either the phone number itself or just leaving it out of the display... what code would be good to test it with.. the variables are $ac2 $ext2 and $num2 Use the isset() function: if(isset($ac2)) and if(isset($ext2)) and if(isset($num2)) { do something } else { do something else } -Erich- --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] empty variables from a form
FYI, isset() will return true for an empty variable. You use isset() only when you expect there to be no variable. But for a hard coded HTML form the variable will *always* be set (except in the case of check boxes) even if thas no value. So your only options are to use empty() or test the string against the litteral expression. if($myvar == ''); ..or.. if(empty($myvar)); -Kevin - Original Message - From: Sunfire [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 05, 2003 12:40 PM Subject: Re: [PHP] empty variables from a form tnx will try that my other code looked something like that but it didnt work.. probably had the (and ) in the wrong places... i set it up as the whole statement as 1 if statement not 3 different ones.. - Original Message - From: Erich Beyrent [EMAIL PROTECTED] To: Sunfire [EMAIL PROTECTED] Sent: Wednesday, February 05, 2003 1:54 PM Subject: Re: [PHP] empty variables from a form hi.. how would you test for an empty (unused) variable from a form.. i have a phone number split into 3 different vairiables and want to test to see if they were used in the form before displaying either the phone number itself or just leaving it out of the display... what code would be good to test it with.. the variables are $ac2 $ext2 and $num2 Use the isset() function: if(isset($ac2)) and if(isset($ext2)) and if(isset($num2)) { do something } else { do something else } -Erich- --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003 -- 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] How can I link to all BUT $PHP_SELF
I use the following function to create links to files in the same catalog (and format the link text): function createLink() { $handle=opendir(.); while ($file = readdir($handle)){ if (($file == .) || ($file == ..) || (ereg(index, $file) == true) || ($file == basename ($PHP_SELF))) { continue; } if(is_file($file)) { $files[] = $file; } } $link = sort($files); foreach($files as $file) { $linktext = substr_replace($file,'',0,3); $linktext = substr_replace($linktext,'',-4); $linktext = ucfirst($linktext); echo nbsp;A HREF=\$file\ CLASS=\light\$linktext/A\n; } return true; } The part $file == basename ($PHP_SELF) is intended to not link to the calling document, but this part doesn't work. So, what shall I do instead? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session_cache_limiter with Internet Explorer
Has anyone gotten this function or something like it to work correctly with Micorsoft IE 5/6. When I have it set to private, Mozilla and Opera works wonderfully, but IE doesn't seem to have half a brain, and would continually would have to refresh the page to get current data. I've tried it under php 4.2.3 and 4.3.0 on FreeBSD/Apache and WinXP/Apache. Any suggestions would be appreciated. Thanks -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] POP3 ... syntax error
On Wednesday 05 February 2003 23:32, Adam Voigt wrote: How about some code? On Wed, 2003-02-05 at 10:21, Christian Ista wrote: Hello, I'm trying to access pop3 server via PHP code. I can establish the connection, send the USER command (I receive the +OK answer). After that I sent the PASS command but I receive the answer -ERR syntax error. I don't understand why syntax error. Do you have an idea ? No need for code, it's not a php problem. Google for pop3 commands to find out how to talk to pop3 servers. -- 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 -- /* The Beatles: Paul McCartney's old back-up band. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I link to all BUT $PHP_SELF
On Thursday 06 February 2003 04:21, Øystein Håland wrote: The part $file == basename ($PHP_SELF) is intended to not link to the calling document, but this part doesn't work. So, what shall I do instead? Could you explain HOW it doesn't work? -- 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 -- /* Please don't recommend me to your friends-- it's difficult enough to cope with you alone. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php pages broken after moving to a newer version
I have a web site on a server running freebsd-4.2/mysql-3.23.10/php-4.0.3pl1. I am replacing that machine with a new box running freebsd-4.7/mysql-3.23.52/php-4.2.3. After copying the web site to the new server some pages no longer include the 'include' pages. I am using php frames. I load the index page, it's just blank, white. I can load the included pages manually through the url and they load okay. I am wondering if there is something in the php config file I need to set for the include path, but when I was in that file I didn't see any such setting, like in the earlie versions of php. Any suggestions? Regards, -- Chip Wiegand Computer Services Simrad, Inc www.simradusa.com [EMAIL PROTECTED] There is no reason anyone would want a computer in their home. --Ken Olson, president, chairman and founder of Digital Equipment Corporation, 1977 (Then why do I have 8? Somebody help me!) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] empty variables from a form
hi i tried the code below as well as empty and isset and it seems that even if the variables that have valid data in them they also get excluded from display with the empty ones.. does mean any string? or is it the normal empty string? i need to know if the vars that dont get filled in from the form are empty or not... and this isnt working very will... any idea why this happens? ps if i put or between if statements it gives me a parse error... - Original Message - From: Sunfire [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 05, 2003 2:40 PM Subject: Re: [PHP] empty variables from a form tnx will try that my other code looked something like that but it didnt work.. probably had the (and ) in the wrong places... i set it up as the whole statement as 1 if statement not 3 different ones.. - Original Message - From: Erich Beyrent [EMAIL PROTECTED] To: Sunfire [EMAIL PROTECTED] Sent: Wednesday, February 05, 2003 1:54 PM Subject: Re: [PHP] empty variables from a form hi.. how would you test for an empty (unused) variable from a form.. i have a phone number split into 3 different vairiables and want to test to see if they were used in the form before displaying either the phone number itself or just leaving it out of the display... what code would be good to test it with.. the variables are $ac2 $ext2 and $num2 Use the isset() function: if(isset($ac2)) and if(isset($ext2)) and if(isset($num2)) { do something } else { do something else } -Erich- --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] server date
is there a function to get the server date date(); uses the date of the client machine i need a function that grabs the date on the server. Any help apreciated -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dynamically Generated Images ( PHPGraph ) and timeouts.
I'm using JPGraph in a PHP script, and I have caching turned on in JPGraph. The graph making PHP is called from a img tag like so: img src=testgraph.php If JPGraph has determined that the image is too old, it regenerates it on the fly. Problem is, if the image takes more than 1-2 seconds for JPGraph to create, I get a broken image link in IE, and a blank image area in Mozilla. They're not waiting long enough for the image generation to finish and JPGraph to send the image. ( The images are small, and so download quickly, so it's not a DL issue ). Is there some way to tell the browser to wait for the image? A meta tag, or something? -Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] empty variables from a form
how would you test for an empty (unused) variable from a form.. i have a phone number split into 3 different vairiables and want to test to see if they were used in the form before displaying either the phone number itself or just leaving it out of the display... what code would be good to test it with.. the variables are $ac2 $ext2 and $num2 Use the isset() function: if(isset($ac2)) and if(isset($ext2)) and if(isset($num2)) { do something } else { do something else } That's not a good idea if your trying to check for an empty variable. An empty text box, when submitted, will still be set and pass isset(). You should use empty() is that's really what you're looking for. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php pages broken after moving to a newer version
On Thursday 06 February 2003 04:41, [EMAIL PROTECTED] wrote: I have a web site on a server running freebsd-4.2/mysql-3.23.10/php-4.0.3pl1. I am replacing that machine with a new box running freebsd-4.7/mysql-3.23.52/php-4.2.3. After copying the web site to the new server some pages no longer include the 'include' pages. I am using php frames. I load the index page, it's just blank, white. I can load the included pages manually through the url and they load okay. I am wondering if there is something in the php config file I need to set for the include path, but when I was in that file I didn't see any such setting, like in the earlie versions of php. 1) Read the changelog/history/release notes of all versions of php between the 4.0.3 and up to 4.2.3 2) Check the php log (turn on full error reporting). -- 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 -- /* Woodward's Law: A theory is better than its explanation. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Variable Problem
I have a variable that get's chopped off at the %20 character. In the form page I have: bFrom: ?= $name;? brE-mail address: ?= $email;?br ?= $sent;?/b/font/td $sent and $name shows up fine, but immedieately I added (for testing) input type=text name=sent value=?= $sent;? input type=text name=name value=?= $name;? this statement shows a text box, with only the first word before the space charcter %20 is shown, and is fact the only data that is submitted upon: form action=?=$PHP_SELF;? method=post Can someone assist me? J.J. Johnson