[PHP] cookie problem....
Hello, I created a PHP page that included cookie, here is the PHP code: if (isset($HTTP_POST_VARS['Name'])) { setcookie("Name", $HTTP_POST_VARS['Name'], time()+86400*10); } Untitled Document Name: But when I called the cookie variable in another page, it showed "Notice: Undefined index: Name in". Here is the PHP code in another page: Untitled Document HI!! Any problems in my PHP pages? How to solve it? THANKS!! Terry _ MSN ¬Ûï´£¨Ñ±z³Ì²³æªº¤è¦¡¤À¨É¨Ã¦C¦L±zªº¬Û¤ù¡A½Ð²¾¦Ü : http://photos.msn.com.hk/support/worldwide.aspx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 13 Feb 2003 08:07:17 -0000 Issue 1880
php-general Digest 13 Feb 2003 08:07:17 - Issue 1880 Topics (messages 135350 through 135395): Re: Passing PostgreSQL resource 135350 by: Joshua Moore-Oliva 135351 by: Joshua Moore-Oliva Re: php & javascript drop down menu??? 135352 by: Jeff Bluemel Re: setcookie on PHP?? 135353 by: Daniel Masson string to array 135354 by: Kevin Waterson 135356 by: Leif K-Brooks 135357 by: Steve Werby Announcement: Smarty template engine 2.4.2 released 135355 by: Monte Ohrt How do you... get a text stream into IMAP parsing... 135358 by: Les Barstow when is OOP a good choice? 135359 by: anders thoresson 135369 by: Le Yang 135371 by: Vladimir Galkov 135388 by: php.errorcode.com Re: PHP & JavaScript 135360 by: Greg Re: Failed opening 135361 by: Ernest E Vogelsinger PGP and PHP together??? 135362 by: MIKE YRABEDRA 135384 by: David T-G 135385 by: Jason Sheets 135386 by: David T-G undefined function - crypt() 135363 by: Anthony Ritter 135364 by: Greg 135365 by: Barajas, Arturo 135367 by: Anthony Ritter Re: restricting access to files using PHP 135366 by: Ernest E Vogelsinger Re: MySQL Login Setup not working with PHP 135368 by: Ernest E Vogelsinger Re: Learning PHP 135370 by: Ernest E Vogelsinger IS PEAR Secure? 135372 by: MIKE YRABEDRA Re: var_export() strips slashes 135373 by: Shawn McKenzie Database problem - works in Windows - not Linux 135374 by: Lee P. Reilly 135378 by: Chris Hewitt 135392 by: Mike Mannakee ftp_get() 135375 by: Muti 135376 by: Barajas, Arturo 135389 by: Tom Rogers Pspell 135377 by: John Nichel Output Compression stops working after a while 135379 by: Zavier Sheran $$ Variable? 135380 by: jtx.hatesville.com 135381 by: Philip Hallstrom 135382 by: jtx.hatesville.com 135383 by: Ernest E Vogelsinger Re: File not rewritable - why? Help needed. 135387 by: Paul Dunkel IIS 135390 by: Joe Njeru GD and 4.3 135391 by: Joseph Bannon 135393 by: Kevin Waterson Q: file writing problem - help desperately needed 135394 by: Paul Dunkel cookie problem 135395 by: Terry Lau 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] -- --- Begin Message --- There's really no other way to do it... You can't serialize a connection or resultset since they are both resources... If you really wanted you could turn a recordset into an array and store that as a serialised object and pass it around... but a) Depending on how much data a recordset returned it could be quite a slowdown on page viewing. b) It could be a security breach in case there was data int he recordset you never show to the public btu you need for calculations. c) Changes made to the database since the last retrieval would not display. A server is meant to store and serve data.. There really is no other way about it =). Josh. On February 12, 2003 01:52 pm, Lucas Lain wrote: > i will use it for the moment but i was thinking in a "light" solution > ... i dont like the idea of creating a temp table for each page... > --- End Message --- --- Begin Message --- Oh btw, you will have to remove those isString and isint functions.. they are other parts of my library that just check the type of a variable... and log a message through an error handling system I've set up.. I'd have the library up now but it's not that well commented.. Josh. On February 12, 2003 01:30 pm, Joshua Moore-Oliva wrote: > Try this function... it's one part of a php class I've been thinking about > making open-source. Give it any sql statement and a page (0 based for the > page) and a number of records for a page and you are set. > > I've only tested this on postgresql. > > function pageSql( $sql, $page, $recs_per_page ) { > > $this->isString( '$sql', $sql ); > $this->isInt( '$page', $page ); > $this->isInt( '$recs_per_page', $recs_per_page ); > > $sql = trim( $sql ); > $sql = substr( $sql, strlen( "SELECT" ) ); > > if ( $sql[strlen($sql)-1] != ";" ) { > $sql .= ";"; > } > > $sql = sprintf( "CREATE TEMP SEQUENCE temp_sequence;\n" > . "CREATE TEMP TABLE temp_table AS\n" > . "SELECT nextval( 'temp_sequence' ) AS temporary_idASDF, > %s\n" > . "SELECT ( SELECT COUNT(*) >FROM temp_table\n" > . " > WHERE temporary_idASDF > %d ) AS recs_remaining, \n" > . "
Re: [PHP] when is OOP a good choice?
Hello There isn't an easy answer to this but I guess the most important thing being that it is easier to maintain in big projects and this makes it more robust since you can test in a more modular way. Also it makes it easier to reuse code also this seems to be one of those urban legends. At least most people I have seen so far tend to throw old code away and reimplement the wheel... well its getting better. Especially good Frameworkdesign is a lot easier with OO. There is one drawback to OOP using PHP at least in version 4. (This is supposed to change in 5) PHP doesn't support the concept of abstract classes (can be emulated) and function overloading (two functions having the same name but different signature). This makes it hard to implement polymorphism in some situations (IMHO) which is one of the key concepts of OOP. If you are coming from a different OO Language like JAVA it tends to screw you up that PHP Objects only live for the duration of the script. So you have to be sure to recreate objects on every request or you have to use sessions in order to preserve Objects. This makes it a bit of a pain IMHO to use OO in PHP. As I see it (correct me if I'm wrong) in version 4, OO is just a way to construct modular PHP that can be easily extended for custom behaviour. So to your second point I'd say: If you have a very complicated and long script, which can be broken down into modules, so that each module can function on its own then it would be a good choice to create this module as a class. Further if you plan on extending the behaviour of this module (add new functionality or override some functionality) thenyou have to create it as a class since only OO allows you to override the functionality. Another pro for OO is when you have modules (objecty/classes) that you are reusing very often, but these modules change in functionality it is also a good idea to create classes. (Example: DB access, each DB handles access differently. So create a base class with a common API for DB access and extend the actual DB handling classes from that. When your scirpt uses the base class to interface with the DB you can easily switch databases by simply switching the implementing class. NOT sure this makes sense ; )) On the other hand if you simply need to do something over and over, e.g. change characters into entitites and viceversa, a function is better suited. Basically it is a design choice and there is no real pro and contra for the one or the other. There are enough people out there that do OO but don't really use OO. Hope that shed some light on the matter Stefan
[PHP] PHP mail function From header not working
When I try to use a php script, to send an email, the From header is replaced by a senders email address of my provider. Is there any way to make it so my email address shows up in the From header? In the script I used fake addresses, because of client privacy reasons... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Confirmation e-mail
>> I am developing a website with a user login system, i would like to send >> an confirmation e-mail to the user when he/she registers for the site, >> asking for confirmation...for instance click on a link to activate thier >> account. >> My question is what would be the best approach to achieve this? How is >> this usualy done? Any thoughts and help is appreciated. You keep the content of e-mail in a file and use to complete an e-mail after clicking. You send such e-mail by PHP command "mail" and that is all. -- Krzysztof Dziekiewicz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie php.ini
Thursday, February 13, 2003, , wrote: In my opinion php.ini is the least problem. Appache configuration is also important. You must secure your server, switch off unused ports. There is no default security configuration because it depends on the whole system. > I'm completely new to php but am interested in getting things runnng on a > "live" apache server. The default php.ini file has a huge security > disclaimer at the top stating that the default configuration is not > sufficiently secure for "production". It references the php manual chapter > on security for more information. > I've read the manual, but in my green state it's still not clear to me what > I should change to keep my server from being hacked. > Would anyone be able to provide a "standard" ini file or list of changes to > the default that would keep me out of trouble with regards to security and > let me learn to use php as time permits? > Thanks, > Val -- Krzysztof Dziekiewicz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] File handling
How do i delete all file in a directory??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] File handling
> How do i delete all file in a directory??? > You could use a function like this: (html code at end) function delFiles($filter, $sDir) { $cDirectory = includeTrailingSlash($sDir); $handle = opendir($cDirectory); while ($file = readdir($handle)) { if ($file == '.' || $file == '..') { continue; } if (is_dir($cDirectory . $file)) { echo "ignoring $cDirectory$file "; delFiles($filter, $cDirectory . $file); continue; } if (eregi($filter, $file)) { echo " deleting $cDirectory$file "; unlink($cDirectory . $file); } } closedir($handle); } function includeTrailingSlash($path) { if (!eregi("/$", $path)) { $path .= "/"; } return $path; } // delete all the .htm files in this directory and it's sub directories $sDir="the directory you want to delete files in"; delFiles("\.htm$", $sDir); //where\.htm$ is the filter you are applying echo "done deleting old files "; hth -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] restricting access to files using PHP
Ooops, I didn't mean to post my question a number of times! Just that my message didn't appear (in Outlook Express), so I reposted it. Thanks to everyone who replied. I'd rather not convert .HTML files to .PHP files because there are other files in the members area that I also wish to protect (.DOC and .PDF files). I'm interested in your solution David, what is the format of the external auth script that you use.. is there some kind of return you have to give .htaccess ? Also, is there no way I can allow a user to login using a PHP login script, and then pass the "username" and "password" over to .htaccess to verify ? Thanks for the help, Shams "David T-G" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... You've seen the suggestions from others to change your .html files. You may or may not want to do that. If you don't want to do that, then you need a .htaccess file. You don't necessarily, however, need a .htpasswd file as well; just make your php script the authenticator: AuthName AccessYourDirectory AuthType Basic AuthExternal /path/to/your/script order allow,deny allow from all require valid-user This is untested code, but you get the idea. You may have to define your external auth script with some name and then call it; our version of this uses NickName instead of /path/to/your/script and in the httpd.conf file we have AddExternalAuth NickName "/path/to/script" SetExternalAuthMethod NickName pipe and I dunno if 1) adding and nicknaming is necessary or 2) you can do it in a .htaccess file instead of having to put it in the http.conf file. HTH & HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File handling
This one time, at band camp, Kenneth Suralta <[EMAIL PROTECTED]> wrote: > How do i delete all file in a directory??? bit ugly but... function del_dir($dirname) { $dh = opendir($dirname); while(false !== ($file = readdir($dh))) { if($file != '.' && $file != '..') { $path = $dirname.'/'.$file; if(is_dir($path)) { del_dir($path); } else { @unlink($path); } } } if(@rmdir($dirname)==true) { echo $dirname.' deleted successfully'; } else { echo 'Unable to delete directory '.$dirname.''; } } if(file_exists($dirname)) { del_dir($dirname); } else { echo 'Directory '.$dirname.' does not exist'; } or something Kevin -- __ (_ \ _) ) | / / _ ) / _ | / ___) / _ ) | | ( (/ / ( ( | |( (___ ( (/ / |_| \) \_||_| \) \) Kevin Waterson Port Macquarie, Australia -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail question
is it possible to do something like mail("[EMAIL PROTECTED]","subject","hello if($a){ return andreas; }"); or what would be the best solution for this ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: File not rewritable - why? Help needed.
If the file does not exists, the web server needs write priviledge to the directory where you want to create it. Paul Dunkel wrote: Marek Kilimajer wrote: use chmod 755 directory on each directory that is in the way to your file I tried that, too. Didn't help. Here is the code, stripped to the original, straight from the tutorial. And I can't get it work. What's wrong here? $somecontent = 'PERKELE\n'; $filename = 'teksti.txt'; $handle = fopen($filename, 'wb'); fwrite($handle, $somecontent); fclose($handle); I've tried this in two totally different servers, tomorrow I'll try on the third one. All help absolutely welcome! Paul Dunkel -- pdunkel.nic.fi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Best way to create a preference-file?
I would like to create a file that holds the preferences for a site, for example the name of the database, the size of thumbnail pictures etc But which is the best way to do this and to access the file? It would be nice with an xml-file, but perhaps it is an overkill Anyway it must be possible to update the file in an easy way, that is, not rewrite it but update it Sincerely Victor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] restricting access to files using PHP
on 13/02/03 9:19 PM, Shams ([EMAIL PROTECTED]) wrote: > Also, is there no way I can allow a user to login using a PHP login script, > and then pass the "username" and "password" over to .htaccess to verify ? Just use .htaccess for the whole lot Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can I have PHP set the linux system date/time?
Yep, I am trying to have a php web page change the linux system date/time, but obviously running into the snag that /bin/date, while "chmod 775" doesn't allow a user to set the date/time. Why is that, given the permissions? Sure it makes sense, but it's annoying. Ideas on how to circumvent this problem? -rwxr-xr-x1 root root26780 Jul 23 2001 /bin/date Seems to me that anyone should be able to use it then right? Where is the "write" portion defined? The 'info date' page says, "You must have appropriate privileges to set the system clock." But it doesn't say what that is or how to change them. If anyone cares, here's a nice bit-o-code: Change Time / Date New Date %02d\n",$i); } ?> / %02d\n",$i); } ?> / >2003 >2004 >2005 >2006 New Time %02d\n",$i); } ?> : %02d\n",$i); } ?> You entered an invalid date, so it was converted to ".$NewDateTime."\n"; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Best way to create a preference-file?
What about an .ini file? http://www.php.net/manual/en/function.parse-ini-file.php If you want read/write from php, try a searching http://www.phpclasses.org/ for inifile. Mark Victor wrote: "Victor spång arthursson" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I would like to create a file that holds the preferences for a site, for example the name of the database, the size of thumbnail pictures etc But which is the best way to do this and to access the file? It would be nice with an xml-file, but perhaps it is an overkill Anyway it must be possible to update the file in an easy way, that is, not rewrite it but update it Sincerely Victor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IIS
On Thursday 13 February 2003 13:06, Joe Njeru wrote: > I'm using IIS on win2k. Well done. -- 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 -- /* As a goatherd learns his trade by goat, so a writer learns his trade by wrote. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] counter question
hi guys i am trying to increment a counter echoed out to the screen to be used for flash for ($i=0; $i < 10; $i++) { //$string = $i; echo "varText=$i&"; flush(); ob_flush(); sleep(1); } i cant seem to get each one out at a time , it will go through it then output at the end ?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I have PHP set the linux system date/time?
You need root priviledges, that means /bin/date must run as root. You can use sudo Daevid Vincent wrote: Yep, I am trying to have a php web page change the linux system date/time, but obviously running into the snag that /bin/date, while "chmod 775" doesn't allow a user to set the date/time. Why is that, given the permissions? Sure it makes sense, but it's annoying. Ideas on how to circumvent this problem? -rwxr-xr-x1 root root26780 Jul 23 2001 /bin/date Seems to me that anyone should be able to use it then right? Where is the "write" portion defined? The 'info date' page says, "You must have appropriate privileges to set the system clock." But it doesn't say what that is or how to change them. If anyone cares, here's a nice bit-o-code: if ($year == "") $year = date("Y"); if ($month == "") $month = date("m"); if ($day == "") $day = date("d"); if ($hour == "") $hour = date("h"); if ($minute == "") $minute = date("i"); $NewDateTime = date ("m/d/Y H:i", mktime ($hour,$minute,0,$month,$day,$year)); $binDate = date ("mdhiY", mktime ($hour,$minute,0,$month,$day,$year)); exec("/bin/date ".$binDate); //TODO: um, yeah, how do you expect this to work? you have to be root to do this ?> Change Time / Date New Date for($i = 1; $i <= 12; $i++) { echo " if ($month == $i) echo " SELECTED"; printf(">%02d\n",$i); } ?> / for($i = 1; $i <= 31; $i++) { echo " if ($day == $i) echo " SELECTED"; printf(">%02d\n",$i); } ?> / ?>>2003 ?>>2004 ?>>2005 ?>>2006 New Time for($i = 0; $i <= 23; $i++) { echo " if ($hour == $i) echo " SELECTED"; printf(">%02d\n",$i); } ?> : for($i = 0; $i <= 59; $i++) { echo " if ($minute == $i) echo " SELECTED"; printf(">%02d\n",$i); } ?> if (!checkdate($month,$day,$year)) print "\nYou entered an invalid date, so it was converted to ".$NewDateTime."\n"; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] implement gpgext
hello everybody, I'm very interesting in using gpg to encrypt my mails in my php script. so I have download the gpgext file http://www.sourceforge.net/projects/gpgext/ but I don't understand how use it? I suppose that I must inform my php.ini that I want using this librairy, but I don't uderstant how do it, and how making the librairy. could you explain me please, I'm lost... thanks in advance PS: I work under windows OS. _ GRAND JEU SMS : Pour gagner un NOKIA 7650, envoyez le mot IF au 61321 (prix d'un SMS + 0.35 euro). Un SMS vous dira si vous avez gagné. Règlement : http://www.ifrance.com/_reloc/sign.sms -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parsing CSV with parameters?
I'm trying to parse CSV data with parameters, i.e. foo(something),bar(something),something(foobar). Any suggestions on doing this, hopefully with some way to escape )s in the parameters? -- 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: mail question
Jonas Geiregat wrote: is it possible to do something like mail("[EMAIL PROTECTED]","subject","hello if($a){ return andreas; }"); or what would be the best solution for this ? i dont think that anybody understand this... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] counter question
You might still have a buffer at apache or system level, you can try to output spaces or coments, but I'm not sure something like this is possible in flash electroteque wrote: hi guys i am trying to increment a counter echoed out to the screen to be used for flash for ($i=0; $i < 10; $i++) { //$string = $i; echo "varText=$i&"; flush(); ob_flush(); sleep(1); } i cant seem to get each one out at a time , it will go through it then output at the end ?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
After upgrading to MySQL 4.0.1.2 I ma getting the message : Fatal error: Call to undefined function: mysql_connect() in /home/penpals/pub/mysql.php on line 3 Please help my production server is down! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing CSV with parameters?
fgetcsv() - for reading the file str_replace('(', '\(', $string) - for escaping )s Leif K-Brooks wrote: I'm trying to parse CSV data with parameters, i.e. foo(something),bar(something),something(foobar). Any suggestions on doing this, hopefully with some way to escape )s in the parameters? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How can I have PHP set the linux system date/time?
I'm not sure what I'm doing wrong... In changetime.php: $binDate = date ("mdhiY", mktime($hour,$minute,0,$month,$day,$year)); $execString = "/usr/bin/sudo /bin/date ".$binDate.""; //echo $execString.""; exec($execString); And then in /etc/sudoers: nobody ALL=NOPASSWD: /bin/date If I run the command (as daevid) "/usr/bin/sudo /bin/date 011304042003" for example, it works fine. Apache is running as nobody it seems: [daevid=pts/6]4:10am@dev:{/www/htdocs}> ps aux | grep "httpd" root 590 0.0 1.5 4996 1988 ?SFeb12 0:00 /www/bin/httpd -D nobody 592 0.0 2.9 5396 3704 ?SFeb12 0:01 /www/bin/httpd -D nobody 593 0.0 3.0 5524 3804 ?SFeb12 0:00 /www/bin/httpd -D nobody 594 0.0 3.0 5556 3856 ?SFeb12 0:01 /www/bin/httpd -D So What is the problem? Ideas? > -Original Message- > From: Marek Kilimajer [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 13, 2003 3:43 AM > To: Daevid Vincent > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] How can I have PHP set the linux system date/time? > > > You need root priviledges, that means /bin/date must run as root. You > can use sudo > > Daevid Vincent wrote: > > >Yep, I am trying to have a php web page change the linux system > >date/time, but obviously running into the snag that /bin/date, while > >"chmod 775" doesn't allow a user to set the date/time. Why is that, > >given the permissions? Sure it makes sense, but it's > annoying. Ideas on > >how to circumvent this problem? > > > >-rwxr-xr-x1 root root26780 Jul 23 2001 /bin/date > > > >Seems to me that anyone should be able to use it then right? Where is > >the "write" portion defined? The 'info date' page says, "You > must have > >appropriate privileges to set the system clock." But it > doesn't say what > >that is or how to change them. > > > >If anyone cares, here's a nice bit-o-code: > > > > > if ($year == "") $year = date("Y"); > > if ($month == "") $month = date("m"); > > if ($day == "") $day = date("d"); > > if ($hour == "") $hour = date("h"); > > if ($minute == "") $minute = date("i"); > > > > $NewDateTime = date ("m/d/Y H:i", mktime > >($hour,$minute,0,$month,$day,$year)); > > > > $binDate = date ("mdhiY", mktime > >($hour,$minute,0,$month,$day,$year)); > > exec("/bin/date ".$binDate); //TODO: um, yeah, how do you expect > >this to work? you have to be root to do this > >?> > > > > > >Change Time / Date > > > > > > > > > >New Date > > > > > for($i = 1; $i <= 12; $i++) > > { > > echo " > if ($month == $i) echo " SELECTED"; > > printf(">%02d\n",$i); > > } > > ?> > > / > > > > > for($i = 1; $i <= 31; $i++) > > { > > echo " > if ($day == $i) echo " SELECTED"; > > printf(">%02d\n",$i); > > } > > ?> > > / > > > > >?>>2003 > > >?>>2004 > > >?>>2005 > > >?>>2006 > > > > > >New Time > > > > > for($i = 0; $i <= 23; $i++) > > { > > echo " > if ($hour == $i) echo " SELECTED"; > > printf(">%02d\n",$i); > > } > > ?> > > : > > > > > for($i = 0; $i <= 59; $i++) > > { > > echo " > if ($minute == $i) echo " SELECTED"; > > printf(">%02d\n",$i); > > } > > ?> > > > > > > > > > > > > class=button> > > > > > > > > > > > > > if (!checkdate($month,$day,$year)) print "\nYou entered an > >invalid date, so it was converted to ".$NewDateTime."\n"; > >?> > > > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
Just so you know, MySQL is working. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing CSV with parameters?
Thanks, but you totally misunderstood me. I'm not looking to get normal CSV data (as in foo,bar,foobar), I'm looking to get CSV data with parameters and get each piece of data and its parameter. For example, I have a string something like foo(data),bar(data),foobar(data). I need to get each parameter, and each value, and put them into arrays. I also need to have a way to escape any )s in the parameter. Marek Kilimajer wrote: fgetcsv() - for reading the file str_replace('(', '\(', $string) - for escaping )s Leif K-Brooks wrote: I'm trying to parse CSV data with parameters, i.e. foo(something),bar(something),something(foobar). Any suggestions on doing this, hopefully with some way to escape )s in the parameters? -- 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
Re: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
This one time, at band camp, "Vernon" <[EMAIL PROTECTED]> wrote: > After upgrading to MySQL 4.0.1.2 I ma getting the message : > > Fatal error: Call to undefined function: mysql_connect() in > /home/penpals/pub/mysql.php on line 3 hmm, did you install from RPM?? Kevin -- __ (_ \ _) ) | / / _ ) / _ | / ___) / _ ) | | ( (/ / ( ( | |( (___ ( (/ / |_| \) \_||_| \) \) Kevin Waterson Port Macquarie, Australia -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] counter question
i mean can u output the counter to the screen with php ? like 1 wait a few seconds 2 wait a few more seconds 3 etc .., atm it will go through the loop first then output -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 11:12 PM To: electroteque Cc: [EMAIL PROTECTED] Subject: Re: [PHP] counter question You might still have a buffer at apache or system level, you can try to output spaces or coments, but I'm not sure something like this is possible in flash electroteque wrote: >hi guys i am trying to increment a counter echoed out to the screen to be >used for flash > >for ($i=0; $i < 10; $i++) { > //$string = $i; > echo "varText=$i&"; > flush(); > ob_flush(); > sleep(1); >} > >i cant seem to get each one out at a time , it will go through it then >output at the end ?? > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
Yes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail question
On Friday 14 February 2003 18:53, Jonas Geiregat wrote: > is it possible to do something like mail("[EMAIL PROTECTED]","subject","hello > if($a){ return andreas; }"); > or what would be the best solution for this ? Try it. I would prefer: if ($a) { $name = 'andreas'; } else { $name = ''; } mail("[EMAIL PROTECTED]","subject","hello $name"); -- 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 -- /* Seize the day, put no trust in the morrow! -- Quintus Horatius Flaccus (Horace) */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
On Thursday 13 February 2003 20:12, Vernon wrote: > After upgrading to MySQL 4.0.1.2 I ma getting the message : > > Fatal error: Call to undefined function: mysql_connect() in Search archive on the above. > Please help my production server is down! If it's critical shouldn't you test all upgrades on a development server before rolling out onto the production server? -- 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 -- /* There never was a good war or a bad peace. -- B. Franklin */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] counter question
On Thursday 13 February 2003 20:23, Dan Rossi wrote: > i mean can u output the counter to the screen with php ? like 1 wait a few > seconds 2 wait a few more seconds 3 etc .., atm it will go through the loop > first then output In theory yes. But it depends on your webserver. 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 -- /* Nihilism should commence with oneself. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Char check
Hi I want to check if $var is a char or an int. Freddy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Char check
On Thursday 13 February 2003 20:38, Fredrik wrote: > I want to check if $var is a char or an int. manual > Variable Functions -- 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 -- /* Two peanuts were walking through the New York. One was assaulted. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Unit-testing PHP code
Hi all, I've written some small Web applications with PHP and I like it. Since I'm accustomed to thinking OO, I was using the object-oriented language features. This worked quite well, giving a reasonably clean design. However, as with all software projects beyond a certain scope, things start getting hard to maintain/test at some point. Now, the next step for me is to make my code unit-testable. I want to run automatic tests on my local development machine, testing the PHP code without having to upload to the Web Server and manually test something. Most preferrably would be a solution similar to nUnit/jUnit. As far as I understand, a local installation of the ZEND engine could be used to run the PHP code, and some test driver framework would be needed to run all tests through ZEND and verify the results. Has anybody done this yet? I've found the phpunit project, but there seems to be nothing more than the sourceforge project page, which is not very informative. regards Karl -- _ DI Karl Traunmüller [EMAIL PROTECTED] DI Karl Traunmüller Softwareentwicklung Starhembergstr. 44/1, A-4020 Linz, Austria tel +43 732 667950, mobile +43 664 4037084 ICQ 179001232 www.sofascience.com _ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
This is not helping me. I know very well that I should not and I tried the upgrade on two other machines and all went wll. My problem still stands and a search does ntohiong but tell me to check that the path is correct. If it worked before then obviously the path is fine, unless something has changed. Please I need help getting this thing up now. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I have PHP set the linux system date/time?
$execString = "/usr/bin/sudo /bin/date ".$binDate.""; ^ I believe the problem is here Daevid Vincent wrote: I'm not sure what I'm doing wrong... In changetime.php: $binDate = date ("mdhiY", mktime($hour,$minute,0,$month,$day,$year)); $execString = "/usr/bin/sudo /bin/date ".$binDate.""; //echo $execString.""; exec($execString); And then in /etc/sudoers: nobody ALL=NOPASSWD: /bin/date If I run the command (as daevid) "/usr/bin/sudo /bin/date 011304042003" for example, it works fine. Apache is running as nobody it seems: [daevid=pts/6]4:10am@dev:{/www/htdocs}> ps aux | grep "httpd" root 590 0.0 1.5 4996 1988 ?SFeb12 0:00 /www/bin/httpd -D nobody 592 0.0 2.9 5396 3704 ?SFeb12 0:01 /www/bin/httpd -D nobody 593 0.0 3.0 5524 3804 ?SFeb12 0:00 /www/bin/httpd -D nobody 594 0.0 3.0 5556 3856 ?SFeb12 0:01 /www/bin/httpd -D So What is the problem? Ideas? -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 3:43 AM To: Daevid Vincent Cc: [EMAIL PROTECTED] Subject: Re: [PHP] How can I have PHP set the linux system date/time? You need root priviledges, that means /bin/date must run as root. You can use sudo Daevid Vincent wrote: Yep, I am trying to have a php web page change the linux system date/time, but obviously running into the snag that /bin/date, while "chmod 775" doesn't allow a user to set the date/time. Why is that, given the permissions? Sure it makes sense, but it's annoying. Ideas on how to circumvent this problem? -rwxr-xr-x1 root root26780 Jul 23 2001 /bin/date Seems to me that anyone should be able to use it then right? Where is the "write" portion defined? The 'info date' page says, "You must have appropriate privileges to set the system clock." But it doesn't say what that is or how to change them. If anyone cares, here's a nice bit-o-code: if ($year == "") $year = date("Y"); if ($month == "") $month = date("m"); if ($day == "") $day = date("d"); if ($hour == "") $hour = date("h"); if ($minute == "") $minute = date("i"); $NewDateTime = date ("m/d/Y H:i", mktime ($hour,$minute,0,$month,$day,$year)); $binDate = date ("mdhiY", mktime ($hour,$minute,0,$month,$day,$year)); exec("/bin/date ".$binDate); //TODO: um, yeah, how do you expect this to work? you have to be root to do this ?> Change Time / Date New Date for($i = 1; $i <= 12; $i++) { echo " if ($month == $i) echo " SELECTED"; printf(">%02d\n",$i); } ?> / for($i = 1; $i <= 31; $i++) { echo " if ($day == $i) echo " SELECTED"; printf(">%02d\n",$i); } ?> / ?>>2003 ?>>2004 ?>>2005 ?>>2006 New Time for($i = 0; $i <= 23; $i++) { echo " if ($hour == $i) echo " SELECTED"; printf(">%02d\n",$i); } ?> : for($i = 0; $i <= 59; $i++) { echo " if ($minute == $i) echo " SELECTED"; printf(">%02d\n",$i); } ?> class=button> if (!checkdate($month,$day,$year)) print "\nYou entered an invalid date, so it was converted to ".$NewDateTime."\n"; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP mail function From header not working
"Marco Alting" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > When I try to use a php script, to send an email, the From header is > replaced by a senders email address of my provider. Is there any way to make > it so my email address shows up in the From header? > > In the script I used fake addresses, because of client privacy reasons... > > $email = "[EMAIL PROTECTED]"; > $mailheaders = "From: My Name\n"; > $mailheaders .= "Reply-To: [EMAIL PROTECTED]\n\n"; > > $message2 ="MESSAGE GOES HERE"; > mail($email,"TITLE",$message2,$mailheaders); > ?> > > Are you running this on Windows? If you are have a look at: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing CSV with parameters?
Then use (after fgetcsv) preg_match_all to get your data and parameters. It is a bit more difficult so I won't give an example Leif K-Brooks wrote: Thanks, but you totally misunderstood me. I'm not looking to get normal CSV data (as in foo,bar,foobar), I'm looking to get CSV data with parameters and get each piece of data and its parameter. For example, I have a string something like foo(data),bar(data),foobar(data). I need to get each parameter, and each value, and put them into arrays. I also need to have a way to escape any )s in the parameter. Marek Kilimajer wrote: fgetcsv() - for reading the file str_replace('(', '\(', $string) - for escaping )s Leif K-Brooks wrote: I'm trying to parse CSV data with parameters, i.e. foo(something),bar(something),something(foobar). Any suggestions on doing this, hopefully with some way to escape )s in the parameters? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP mail function From header not working
"Marco Alting" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > When I try to use a php script, to send an email, the From header is > replaced by a senders email address of my provider. Is there any way to make > it so my email address shows up in the From header? > > In the script I used fake addresses, because of client privacy reasons... > > $email = "[EMAIL PROTECTED]"; > $mailheaders = "From: My Name\n"; > $mailheaders .= "Reply-To: [EMAIL PROTECTED]\n\n"; > > $message2 ="MESSAGE GOES HERE"; > mail($email,"TITLE",$message2,$mailheaders); > ?> > > Are you running this on windows? If you are have a look at: http://www.php.net/manual/en/ref.mail.php The "sendmail_from" setting may be what you are looking for. You will need to set it using ini_set. Regards Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
What are apache logs telling you? Vernon wrote: After upgrading to MySQL 4.0.1.2 I ma getting the message : Fatal error: Call to undefined function: mysql_connect() in /home/penpals/pub/mysql.php on line 3 Please help my production server is down! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] counter question
ahuh "Jason Wong" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Thursday 13 February 2003 20:23, Dan Rossi wrote: > > i mean can u output the counter to the screen with php ? like 1 wait a few > > seconds 2 wait a few more seconds 3 etc .., atm it will go through the loop > > first then output > > In theory yes. But it depends on your webserver. 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 > -- > /* > Nihilism should commence with oneself. > */ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
> -Original Message- > If it worked before then obviously the path is fine, > unless something has changed. Obviously something changed if it worked on 2 other servers. Check all your logs. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
For some reason I do not see any error logs for today. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
I think the point is here that I can connect with a MySQL client, so MySQL is running. I cannot however connect using PHP. What would cause this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
On Thursday 13 February 2003 20:42, Vernon wrote: > This is not helping me. I know very well that I should not and I tried the > upgrade on two other machines and all went wll. > > My problem still stands and a search does ntohiong but tell me to check > that the path is correct. If it worked before then obviously the path is > fine, unless something has changed. > > Please I need help getting this thing up now. archives > Call to undefined function mysql_connect() -- 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 -- /* With clothes the new are best, with friends the old are best. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie problem....
On Thursday 13 February 2003 16:07, Terry Lau wrote: > Hello, > I created a PHP page that included cookie, here is the PHP code: > if (isset($HTTP_POST_VARS['Name'])) { > setcookie("Name", $HTTP_POST_VARS['Name'], time()+86400*10); > } [snip] > But when I called the cookie variable in another page, it showed > "Notice: Undefined index: Name in". Here is the PHP code in another > page: > > > > Untitled Document > > > > > HI!! > > On the page where you want to read the cookie you need to call session_start(). -- 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 -- /* Electrocution, n.: Burning at the stake with all the modern improvements. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
try ldd /usr/lib/php4/mysql.so Vernon wrote: I think the point is here that I can connect with a MySQL client, so MySQL is running. I cannot however connect using PHP. What would cause this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie problem....
This cannot be the problem, session_start is for sessions Jason Wong wrote: >On Thursday 13 February 2003 16:07, Terry Lau wrote: > > >>Hello, >>I created a PHP page that included cookie, here is the PHP code: >>>if (isset($HTTP_POST_VARS['Name'])) { >>setcookie("Name", $HTTP_POST_VARS['Name'], time()+86400*10); >>} >> >> > >[snip] > > > >>But when I called the cookie variable in another page, it showed >>"Notice: Undefined index: Name in". Here is the PHP code in another >>page: >> >> >> >>Untitled Document >> >> >> >> >>HI!! >> >> >> >> > >On the page where you want to read the cookie you need to call >session_start(). > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
I'm sorry I have no idea what that means. "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > try > ldd /usr/lib/php4/mysql.so -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
Sorry, this is a shell command, you need to log in to your server. Also I'm not sure about the path, it could be different on your system. This command should print you something like libmysqlclient.so.10 => /usr/lib/mysql/libmysqlclient.so.10 (0x4000b000) libc.so.6 => /lib/i686/libc.so.6 (0x40048000) libz.so.1 => /usr/lib/libz.so.1 (0x40184000) libcrypt.so.1 => /lib/libcrypt.so.1 (0x40192000) libnsl.so.1 => /lib/libnsl.so.1 (0x401bf000) libm.so.6 => /lib/i686/libm.so.6 (0x401d6000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x8000) It's important that libmysqlclient.so.* points to the right library, rpm -qf /usr/lib/mysql/libmysqlclient.so.YOUR_VERSION should print you mysql-4.0.1.2-* Vernon wrote: I'm sorry I have no idea what that means. "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... try ldd /usr/lib/php4/mysql.so -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
it happened to me something pretty similar when I upgraded to mysql 3.23.54a. While solving the problem, I suggest to uninstall mysql 4.0.1 and reinstall your previous working version (unless there's a real urge to upgrade to 4.0.1) and then try to upgrade to a devoloper server reinstalling not only mysql but also php and apache. I succeeded doing that way. Hope this helps, good luck. - Original Message - From: "Vernon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 13, 2003 2:36 PM Subject: Re: [PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2 > I'm sorry I have no idea what that means. > > "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > try > > ldd /usr/lib/php4/mysql.so > > > > -- > 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: Unit-testing PHP code
Check out. http://www.phpbuilder.com/columns/reiersol20030126.php3 http://pear.php.net/manual/en/packages.phpunit.tutorial.php Mark "Karl Traunmueller" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi all, > > I've written some small Web applications with PHP and I like it. > Since I'm accustomed to thinking OO, I was using the object-oriented > language features. This worked quite well, giving a reasonably clean design. > However, as with all software projects beyond a certain scope, things > start getting hard to maintain/test at some point. > > Now, the next step for me is to make my code unit-testable. I want to run > automatic tests on my local development machine, testing the PHP code > without having to upload to the Web Server and manually test something. > > Most preferrably would be a solution similar to nUnit/jUnit. As far as I > understand, a local installation of the ZEND engine could be used to run the > PHP code, and some test driver framework would be needed to run all tests > through ZEND and verify the results. > > Has anybody done this yet? I've found the phpunit project, but there seems > to be nothing more than the sourceforge project page, which is not > very informative. > > regards > Karl > > -- > _ > DI Karl Traunmüller > [EMAIL PROTECTED] > > DI Karl Traunmüller Softwareentwicklung > > Starhembergstr. 44/1, A-4020 Linz, Austria > tel +43 732 667950, mobile +43 664 4037084 > ICQ 179001232 > www.sofascience.com > _ > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] restricting access to files using PHP
Shams -- ...and then Shams said... % ... % I'm interested in your solution David, what is the format of the external % auth script that you use.. is there some kind of return you have to give % .htaccess ? Yep. It's just a simple perl script; it's attached for reference. % % Also, is there no way I can allow a user to login using a PHP login script, % and then pass the "username" and "password" over to .htaccess to verify ? Dunno about that one, but since you can tell .htaccess to run your php script to verify you should get the same results... % % Thanks for the help, Sure thing! % % Shams HTH & HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! #!/usr/bin/perl $user = <>; chomp($user); $pass = <>; chomp($pass); exit(2) if($user =~ /^root$/); exit(3) if($user =~ /[^a-zA-Z0-9_@.-]/); open(CHKPW,"| /home/vpopmail/bin/vchkpw /bin/true 3<&0 >&2"); print CHKPW $user,"\0"; print CHKPW $pass,"\0"; print CHKPW time(),"\0"; if(not close(CHKPW)) { exit(4); } msg96801/pgp0.pgp Description: PGP signature
Re: [PHP] cookie problem....
I always use 4 parameters in my setcookie(cookie_name,cookie_value,time,"/") Also, verify that $HTTP_POST_VARS['Name'] exists by printing it - Original Message - From: "Jason Wong" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 13, 2003 7:20 AM Subject: Re: [PHP] cookie problem On Thursday 13 February 2003 16:07, Terry Lau wrote: > Hello, > I created a PHP page that included cookie, here is the PHP code: > if (isset($HTTP_POST_VARS['Name'])) { > setcookie("Name", $HTTP_POST_VARS['Name'], time()+86400*10); > } [snip] > But when I called the cookie variable in another page, it showed > "Notice: Undefined index: Name in". Here is the PHP code in another > page: > > > > Untitled Document > > > > > HI!! > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
Hey Vern, PHP does not think you have the MySQL module installed. none of the mysql_* commands are going to work. check the output of phpinfo() to verify. What version of PHP are you running? Since you are using RPMs the only (helpful) advice I can give is try re-installing the PHP rpm. Possibly it needs to refresh itself. (I can offer some unhelpful advice like quit using RPMs and compile from source...switch to gentoo linux instead of RedHat for a better package manager...you know, stuff like that. But that's not helpful at the moment!) :) =C= * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com -Original Message- From: Vernon [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 6:13 AM To: [EMAIL PROTECTED] Subject: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2 After upgrading to MySQL 4.0.1.2 I ma getting the message : Fatal error: Call to undefined function: mysql_connect() in /home/penpals/pub/mysql.php on line 3 Please help my production server is down! -- 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] module php4_module is already loaded
Hello Recently i have installed apache 2.0.40-11 that comes with Redhat 8.0 Linux, i have tried installing php 4.2.2-8.0.7 with it but when i put the LoadModule php4_module modules/libphp4.so i get the following error when running apache. [warn] module php4_module is already loaded, skipping And php isnt functional. Has anyone seen this problem before? I have searched for an answer for it but so far havent found any reason why this is happening. Thanks for any help in advance! __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] module php4_module is already loaded
You might have LoadModule libphp4.so somewhere before where you added it bob pilly wrote: Hello Recently i have installed apache 2.0.40-11 that comes with Redhat 8.0 Linux, i have tried installing php 4.2.2-8.0.7 with it but when i put the LoadModule php4_module modules/libphp4.so i get the following error when running apache. [warn] module php4_module is already loaded, skipping And php isnt functional. Has anyone seen this problem before? I have searched for an answer for it but so far havent found any reason why this is happening. Thanks for any help in advance! __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] module php4_module is already loaded
No i have searched my httpd.conf file and i dont. --- Marek Kilimajer <[EMAIL PROTECTED]> wrote: > You might have LoadModule libphp4.so somewhere > before where you added it > > bob pilly wrote: > > >Hello > > > >Recently i have installed apache 2.0.40-11 that > comes > >with Redhat 8.0 Linux, i have tried installing php > >4.2.2-8.0.7 with it but when i put the LoadModule > >php4_module modules/libphp4.so i get the following > >error when running apache. > > > >[warn] module php4_module is already loaded, > skipping > > > >And php isnt functional. Has anyone seen this > problem > >before? I have searched for an answer for it but so > >far havent found any reason why this is happening. > >Thanks for any help in advance! > > > > > >__ > >Do You Yahoo!? > >Everything you'll ever need on one web page > >from News and Sport to Email and Music Charts > >http://uk.my.yahoo.com > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PEAR with php 4.2.3 on Apache 1.3.27 on WinXP
Hi guys, I have been trying to setup PEAR with php 4.2.3 on Apache 1.3.27 on WinXP. I have followed all the installation instructions religiously and installaion is done properly. I have also tried PEAR webbased installer and working fine. But when i try to use DB it doesn;t seem to like the idea. it does not give any errors and it does not show any records too. just throws blank page on my face. what could be the reason for this indifference. any pointers? cheers Manoj --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
When I try to restart Apche I get the following error: PHP Warning: Unable to load dynamic library '/usr/lib/php4/mysql.so' - /usr/lib/php4/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 Any ideas, pleas ethis thing is still down. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
ldd /usr/lib/php4/mysql.so? Vernon wrote: When I try to restart Apche I get the following error: PHP Warning: Unable to load dynamic library '/usr/lib/php4/mysql.so' - /usr/lib/php4/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 Any ideas, pleas ethis thing is still down. -- Lucas Lain [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
There is no mysql.so file "Lucas Lain" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > ldd /usr/lib/php4/mysql.so? > > Vernon wrote: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
did you install php-mysql support?? Vernon wrote: There is no mysql.so file "Lucas Lain" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... ldd /usr/lib/php4/mysql.so? Vernon wrote: -- Lucas Lain [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
When I try to install that I am told: libmysqlclient.so.10 is needed by php-mysql-4.1.2-7.2.6 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
OK, I looked up that file and found that I needed to install the MySQL-shared-3.23.51-1.i386.rpm which I did and realized that I already have the php-mysql installed. But am still getting the same erro message when restarting. However I did find the file you were asking about but in the /usr/lib/php folder and here is what I got: ldd /usr/lib/php/mysql.so libmysqlclient.so.10 => /usr/lib/libmysqlclient.so.10 (0x40026000) libc.so.6 => /lib/i686/libc.so.6 (0x40057000) libz.so.1 => /usr/lib/libz.so.1 (0x40193000) libcrypt.so.1 => /lib/libcrypt.so.1 (0x401a1000) libnsl.so.1 => /lib/libnsl.so.1 (0x401ce000) libm.so.6 => /lib/i686/libm.so.6 (0x401e5000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x8000) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Before you upgrade mod_php4 on FreeBSD!
I too have been very dismayed by their decision to remove the CyberCash module. I'm consequently forced to never upgrade my PHP again as I depend on that module. Verisign, as you mention, *DOES* support Cybercash still, and switching to payflow will cost us money - not only with Verisign, but with the time it would take to rewrite the portion of our website that has to talk with them. -matthew I think I heard Kirk Strauser say: >I just finished struggling with repairing a bad situation on a FreeBSD >4.7-STABLE server. During a routine ports upgrade, we discovered to our >dismay that the folks who make PHP4 decided that the Cybercash module was >obsolete since Verisign doesn't support Cybercash anymore. > >Unfortunately, they were wrong; Verisign *does* support Cybercash, and >people still depend on that module. > >If you use mod_php4 in a production environment, please be warned that >several modules were removed from the 4.3.0 system. Be absolutely sure that >you don't use any of the deleted features before updating. >=2D-=20 >Kirk Strauser > > >--=-=-= >Content-Type: application/pgp-signature > >-BEGIN PGP SIGNATURE- >Version: GnuPG v1.2.1 (GNU/Linux) > >iD8DBQA+Swli5sRg+Y0CpvERAi5WAJoDYAkFtleAxFzZYOup0ri+gz+PawCgijne >+dsZ2OM3jpIZ80uxlgiDGfs= >=XvbP >-END PGP SIGNATURE- >--=-=-=-- > > >To Unsubscribe: send mail to [EMAIL PROTECTED] >with "unsubscribe freebsd-stable" in the body of the message > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD and 4.3
Are there any special configuration commands I have to include at install to use GD? J. __ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
I finally got it! I had to downgrade to an older verison of the php-mysql for God know what reason. I am back up now. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD and 4.3
On Friday 14 February 2003 00:22, Joseph Bannon wrote: > Are there any special configuration commands I have to > include at install to use GD? Depending on what you mean by special the answer could be YES or NO. --with-gd --enable-gd-native-ttf --with-jpeg-dir=/usr --with-png-dir=/usr --with-freetype-dir=/usr --with-zlib-dir=/usr ... will probably cover all the common functionality -- 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 -- /* Change your language to Finnish. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] cookie problem....
>From your code snip it looks like you are missing ?> after the if contruct. Bryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Before you upgrade mod_php4 on FreeBSD!
msg96819/pgp0.pgp Description: PGP signature
Re: [PHP] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
So the file is looked for in /usr/lib/php4, but resides in /usr/lib/php, you should move it Vernon wrote: OK, I looked up that file and found that I needed to install the MySQL-shared-3.23.51-1.i386.rpm which I did and realized that I already have the php-mysql installed. But am still getting the same erro message when restarting. However I did find the file you were asking about but in the /usr/lib/php folder and here is what I got: ldd /usr/lib/php/mysql.so libmysqlclient.so.10 => /usr/lib/libmysqlclient.so.10 (0x40026000) libc.so.6 => /lib/i686/libc.so.6 (0x40057000) libz.so.1 => /usr/lib/libz.so.1 (0x40193000) libcrypt.so.1 => /lib/libcrypt.so.1 (0x401a1000) libnsl.so.1 => /lib/libnsl.so.1 (0x401ce000) libm.so.6 => /lib/i686/libm.so.6 (0x401e5000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x8000) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SNMPGET returns "Invalid object identifier: .1.3.6.1.2.1.1.1.0"
Hey All, Ok I've been going nuts (as well as spending 6hours) trying to figure out what's going on with this. When I poll my switch from the commandline using net-snmp's snmpget tool I get the proper response: adxitutil1# ./snmpget -v 1 -c public xxx.xxx.xxx.xxx 1.3.6.1.2.1.1.1.0 SNMPv2-MIB::sysDescr.0 = STRING: Cisco Internetwork Operating System Software IOS (tm) C3500XL Software (C3500XL-C3H2S-M), Version 12.0(5.2)XU, MAINTENANCE INTERIM SOFTWARE Copyright (c) 1986-2000 by cisco Systems, Inc. Compiled Mon 17-Jul-00 18:29 by ayounes Now, when I do the SNMPGET call from PHP: $a = snmpget("10.1.0.11", "public", ".1.3.6.1.2.1.1.1.0"); echo "A == $a "; I get: Warning: snmpget() [function.snmpget]: Invalid object identifier: .1.3.6.1.2.1.1.1.0 in /usr/local/apache2/htdocs/snmpget_test.php on line 11 Yet: $a = snmpwalkoid("xxx.xxx.xxx.xxx", "public", ""); for (reset($a); $i = key($a); next($a)) { echo "$i: $a[$i]\n"; } Returns: SNMPv2-MIB::sysDescr.0: Cisco Internetwork Operating System Software IOS (tm) C3500XL Software (C3500XL-C3H2S-M), Version 12.0(5.2)XU, MAINTENANCE INTERIM SOFTWARE Copyright (c) 1986-2000 by cisco Systems, Inc. Compiled Mon 17-Jul-00 18:29 by ayounes SNMPv2-MIB::sysObjectID.0: SNMPv2-SMI::enterprises.9.1.248 SNMPv2-MIB::sysUpTime.0: 229:1:20:43.90 SNMPv2-MIB::sysContact.0: SNMPv2-MIB::sysName.0: is.good.beer.com I am running: FreeBSD5.0 Apache-2.0.44 PHP-4.3.0 net-snmp-5.0.6 (I have also tried net-snmp-5.0.7, net-snmp-5.0.4, net-snmp-5.0.0 and ucd-snmp-4.2.x with the same results. #define NO_ZEROLENGTH_COMMUNITY 1 has been uncommented in net-snmp-5.0.6's acconfig.h file and PHP was configured with: ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-snmp=/usr/local --with-gd=/usr/local --with-png-dir=/usr/local --with-zlib-dir=/usr/local *whimper* help! Has anyone seen this behaviour before? The scripts that I am using for testing work fine on my windows server with php, apache, and mysql...any suggestions aside from formating and rebuilding the box with an older OS and apps? Cheers, Mike Lindsay [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sending e-mail with 'Bcc:' and 'Cc:' not working....
I'm a little puzzled on why does either of these two, 'Bcc' and 'Cc' not work when I had successfully send the e-mail. My best guess is that I need additional header, if so then what are the required header needed to make this 'Bcc' and 'Cc' work? Here's the Internet Header from the " To: " e-mail that worked. --clip-- Received: from localhost (host.domain.com [0.0.0.0]) by hostname.domain with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 1KAAMHG6; Thu, 13 Feb 2003 11:58:34 -0500 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Return-Path: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: e-Mail Test Date: Thu, 13 Feb 2003 12:03:48 EST --clip-- Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Need help with PHP CLI
Hello everyone! I'm having trouble accessing the argument list from a php script, from the command line. I'm calling the script as >>./myscript.php argument1 argument2 myscript.php contains #!/usr/local/php -q $argv and $argc both returns blank. I looked at the global variables ($GLOBALS and $GLOBALS[$argv]) and noticed that $ARGC and $ARGV were not listed. Am I missing something? Is this method outdated? i.e. echo $argv[$i]. It seems like $ARGV is not even present, let alone be an array. Please advise. I'm using PHP 4.2.3 on Apache 1.23.xx and Linux. Thanks in advance! -john =P e p i e D e s i g n s www.pepiedesigns.com Providing Solutions That Increase Productivity Web Developement. Database. Hosting. Multimedia. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problems with cookies and PHP
I'm having problems with cookies and PHP and I'm not sure how to solve them. I've been working on a user tracking system for our site and I need to have the site remember them after they close their browser then come back. The only way I can think to do that is with cookies. I need to have PHP set a temp cookie on the first page then on the second page have it see the temp cookie and set it with an ID that will follow them on our site for a month or so. the simple code I've written to try to do this this is just for my use... basically call the page once and it'll set a temp cookie then call another page with the same script and it'll see the temp cookie and set it with a different variable. Thoughts? I'm using IE 6 to test this little bit. Thanks!
Re: [PHP] mail question
Try: mail('[EMAIL PROTECTED]','subject','hello '.($a ? 'andreas')); Jonas Geiregat wrote: is it possible to do something like mail("[EMAIL PROTECTED]","subject","hello if($a){ return andreas; }"); or what would be the best solution for this ? -- 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] problems with cookies and PHP
ok now it will print it's value correctly but what about actually changing the cookie's value? this line: $_COOKIE['userInfo']="userID"; sets $_COOKIE['userInfo'] to "userID" but it does not change the cookie file itself. what must I do to accomplish that? - Original Message - From: "Leif K-Brooks" <[EMAIL PROTECTED]> To: "Fireborn Silvaranth" <[EMAIL PROTECTED]> Sent: Thursday, February 13, 2003 9:41 AM Subject: Re: [PHP] problems with cookies and PHP > > >print "$_COOKIE['userInfo']"; > > > > > Should be: > print $_COOKIE['userInfo']; > > -- > 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
Fw: [PHP] sending e-mail with 'Bcc:' and 'Cc:' not working....
mail("[EMAIL PROTECTED]","This Is A Subject",$message,"From: [EMAIL PROTECTED]\r\nCc: [EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]\r\nBcc: [EMAIL PROTECTED],[EMAIL PROTECTED]"); Separate addesses with commas. Separate CC and BCC with \r\n - Original Message - From: "Scott Fletcher" <[EMAIL PROTECTED]> To: <> Sent: Thursday, February 13, 2003 11:32 AM Subject: [PHP] sending e-mail with 'Bcc:' and 'Cc:' not working I'm a little puzzled on why does either of these two, 'Bcc' and 'Cc' not work when I had successfully send the e-mail. My best guess is that I need additional header, if so then what are the required header needed to make this 'Bcc' and 'Cc' work? Here's the Internet Header from the " To: " e-mail that worked. --clip-- Received: from localhost (host.domain.com [0.0.0.0]) by hostname.domain with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 1KAAMHG6; Thu, 13 Feb 2003 11:58:34 -0500 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Return-Path: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: e-Mail Test Date: Thu, 13 Feb 2003 12:03:48 EST --clip-- Thanks -- 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] problems with cookies and PHP
setcookie("userinfo","userid",NULL,"/"); - Original Message - From: "Fireborn Silvaranth" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, February 13, 2003 11:58 AM Subject: [PHP] problems with cookies and PHP ok now it will print it's value correctly but what about actually changing the cookie's value? this line: $_COOKIE['userInfo']="userID"; sets $_COOKIE['userInfo'] to "userID" but it does not change the cookie file itself. what must I do to accomplish that? - Original Message - From: "Leif K-Brooks" <[EMAIL PROTECTED]> To: "Fireborn Silvaranth" <[EMAIL PROTECTED]> Sent: Thursday, February 13, 2003 9:41 AM Subject: Re: [PHP] problems with cookies and PHP > > >print "$_COOKIE['userInfo']"; > > > > > Should be: > print $_COOKIE['userInfo']; > > -- > 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] problems with cookies and PHP
You have to set the cookie again. Fireborn Silvaranth wrote: ok now it will print it's value correctly but what about actually changing the cookie's value? this line: $_COOKIE['userInfo']="userID"; sets $_COOKIE['userInfo'] to "userID" but it does not change the cookie file itself. what must I do to accomplish that? - Original Message - From: "Leif K-Brooks" <[EMAIL PROTECTED]> To: "Fireborn Silvaranth" <[EMAIL PROTECTED]> Sent: Thursday, February 13, 2003 9:41 AM Subject: Re: [PHP] problems with cookies and PHP print "$_COOKIE['userInfo']"; Should be: print $_COOKIE['userInfo']; -- 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. -- 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] ftp file to client machine
HI I am trying to do the following: I have an ftp server configured, but instead of the user having to use an ftp client, I'd like them to use the browser: So I'm trying to make a mini web-based ftp client. Idea is to get their username and password ( and maybe the ftp address as well?) and to then have php log into the server and list the contents of the folder (no need to handel subfolders etc.). Then I would want them to be able to click on the file to download it. I have done the first part with no problem as per below: "; die; } else { echo "Connected to $ftp_server, for user $ftp_user_name"; } // get dir listing $file_list = ftp_nlist($conn_id,""); foreach ($file_list as $num=>$val) { echo "$val "; } ftp_close($conn_id); ?> But I am baffeled for the rest, ie, what to do on the download.ftp page. First I tried the ftp_get() with the $file used as the local and remote files, but it seems that that will not download the file to the client machine, but rather to the server itself. So, how can I have the file download to the client's machine ( ps, the files are NOT inside a webfolder, so I cannot simply make links to them, and yes, it is done for security reasons; basically I am trusting/using vsftp's security instead of having to devise my own method..) Please point out my obvious lack in knowledge of these matters. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Removing a comma from a form field
I'm trying to update a field which contains a $USD figure. But when I update it as 200,000 it become 200. I need to take out the comma. Is using ereg_replace function the best way of doing so? What do you think. Thanks, Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] form within form
I am creating a form to allow the user to change his/her password. After the user enters their username and old password, I need to verify that info before they can change their user name and password. So I tried using a form within a form but am having some problems with passing the parameters back and forth...any new ideas would be greatly appreciated. I will fill in all the db stuff later. Thanks, Eddie UserName: '> Password: New Password: Verify Password: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Removing a comma from a form field
If the comma is all you have to worry about, you don't need regex. Use www.php.et/str-replace. Ben C. wrote: I'm trying to update a field which contains a $USD figure. But when I update it as 200,000 it become 200. I need to take out the comma. Is using ereg_replace function the best way of doing so? What do you think. Thanks, Ben -- 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
Re: [PHP] Removing a comma from a form field
$thestr = str_replace(",","",$thestring); - Original Message - From: "Ben C." <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 13, 2003 12:13 PM Subject: [PHP] Removing a comma from a form field I'm trying to update a field which contains a $USD figure. But when I update it as 200,000 it become 200. I need to take out the comma. Is using ereg_replace function the best way of doing so? What do you think. Thanks, Ben -- 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] Re: URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2
you can breath now ... :) Vernon wrote: I finally got it! I had to downgrade to an older verison of the php-mysql for God know what reason. I am back up now. -- Lucas Lain [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] form within form
ALso, global variables are off... -Original Message- From: Edward Peloke [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 1:22 PM To: Php-General@Lists. Php. Net Subject: [PHP] form within form I am creating a form to allow the user to change his/her password. After the user enters their username and old password, I need to verify that info before they can change their user name and password. So I tried using a form within a form but am having some problems with passing the parameters back and forth...any new ideas would be greatly appreciated. I will fill in all the db stuff later. Thanks, Eddie UserName: '> Password: New Password: Verify Password: -- 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] form within form
What do you mean by "verify that info"? Do you mena verify for content, or form, or what... - Original Message - From: "Edward Peloke" <[EMAIL PROTECTED]> To: "Php-General@Lists. Php. Net" <[EMAIL PROTECTED]> Sent: Thursday, February 13, 2003 12:22 PM Subject: [PHP] form within form I am creating a form to allow the user to change his/her password. After the user enters their username and old password, I need to verify that info before they can change their user name and password. So I tried using a form within a form but am having some problems with passing the parameters back and forth...any new ideas would be greatly appreciated. I will fill in all the db stuff later. Thanks, Eddie UserName: '> Password: New Password: Verify Password: -- 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] form within form
Can we see some code? Maybe we could help.. Cory On Thu, 2003-02-13 at 12:26, [EMAIL PROTECTED] wrote: > ALso, global variables are off... > > -Original Message- > From: Edward Peloke [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 13, 2003 1:22 PM > To: Php-General@Lists. Php. Net > Subject: [PHP] form within form > > > I am creating a form to allow the user to change his/her password. After > the user enters their username and old password, I need to verify that info > before they can change their user name and password. So I tried using a > form within a form but am having some problems with passing the parameters > back and forth...any new ideas would be greatly appreciated. I will fill in > all the db stuff later. > > Thanks, > Eddie > > > > > > > > > > UserName: > > > > '> > > > > > > > Password: > > > > > > > > > > > > > > > > > > New Password: > > > > > > > > > > > > Verify Password: > > > > > > > > > > > > > > > > > name=reset> > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Cory Hicks <[EMAIL PROTECTED]> TRI-International -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form within form
My bad...I see your code now. On Thu, 2003-02-13 at 12:22, [EMAIL PROTECTED] wrote: > I am creating a form to allow the user to change his/her password. After > the user enters their username and old password, I need to verify that info > before they can change their user name and password. So I tried using a > form within a form but am having some problems with passing the parameters > back and forth...any new ideas would be greatly appreciated. I will fill in > all the db stuff later. > > Thanks, > Eddie > > > > > > > > > > UserName: > > > > '> > > > > > > > Password: > > > > > > > > > > > > > > > > > > New Password: > > > > > > > > > > > > Verify Password: > > > > > > > > > > > > > > > > > name=reset> > -- Cory Hicks <[EMAIL PROTECTED]> TRI-International -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] form within form
I apologize I mean when they click the 'verify' button, I verify their username and password before I allow them to update it. Eddie -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 1:27 PM To: Edward Peloke; Php-General@Lists. Php. Net Subject: Re: [PHP] form within form What do you mean by "verify that info"? Do you mena verify for content, or form, or what... - Original Message - From: "Edward Peloke" <[EMAIL PROTECTED]> To: "Php-General@Lists. Php. Net" <[EMAIL PROTECTED]> Sent: Thursday, February 13, 2003 12:22 PM Subject: [PHP] form within form I am creating a form to allow the user to change his/her password. After the user enters their username and old password, I need to verify that info before they can change their user name and password. So I tried using a form within a form but am having some problems with passing the parameters back and forth...any new ideas would be greatly appreciated. I will fill in all the db stuff later. Thanks, Eddie UserName: '> Password: New Password: Verify Password: -- 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] ftp file to client machine
At 18:45 13.02.2003, Petre Agenbag spoke out and said: [snip] >But I am baffeled for the rest, ie, what to do on the download.ftp page. >First I tried the ftp_get() with the $file used as the local and remote >files, but it seems that that will not download the file to the client >machine, but rather to the server itself. You need to "think" being the server - that is the server (on behalf of your script) downloads the file. >So, how can I have the file download to the client's machine ( ps, the >files are NOT inside a webfolder, so I cannot simply make links to them, >and yes, it is done for security reasons; basically I am trusting/using >vsftp's security instead of having to devise my own method..) You have two options: 1) Don't download the file yourself but give the user an ftp link after reading the directory. This seems impractical in your case since you need to log into the server. 2) Download the file to the server, then transmit it to the client's machine using an appropriate mime header: header('Content-Type: application/octet-stream'); This will have the browser give the user the "save as" dialog. -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form within form
On Friday 14 February 2003 02:22, Edward Peloke wrote: > I am creating a form to allow the user to change his/her password. After > the user enters their username and old password, I need to verify that info > before they can change their user name and password. So I tried using a > form within a form but am having some problems with passing the parameters > back and forth...any new ideas would be greatly appreciated. I will fill > in all the db stuff later. You cannot nest tags. Sort that out then worry about the PHP. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I know what "custody" [of the children] means. "Get even." That's all custody means. Get even with your old lady. -- Lenny Bruce */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form within form
Forms cannot be nested, there can be no form within form. Simply use 4 fields - username, oldpassw, newpassw, newpassw2 (must be equal newpassw), when the form is submited, check if username and oldpassw are valid, newpassw = newpassw2, and if everything is right, you can update to the new password Edward Peloke wrote: I am creating a form to allow the user to change his/her password. After the user enters their username and old password, I need to verify that info before they can change their user name and password. So I tried using a form within a form but am having some problems with passing the parameters back and forth...any new ideas would be greatly appreciated. I will fill in all the db stuff later. Thanks, Eddie UserName: '> Password: New Password: Verify Password: name=reset> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form within form
Rather than form within a form, provide 3 fields: old password, new password, username Verify against old password. If that's valid, then change password. Or am I missing something here? - Original Message - From: "Edward Peloke" <[EMAIL PROTECTED]> To: "Php-General@Lists. Php. Net" <[EMAIL PROTECTED]> Sent: Thursday, February 13, 2003 12:30 PM Subject: RE: [PHP] form within form I apologize I mean when they click the 'verify' button, I verify their username and password before I allow them to update it. Eddie -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 1:27 PM To: Edward Peloke; Php-General@Lists. Php. Net Subject: Re: [PHP] form within form What do you mean by "verify that info"? Do you mena verify for content, or form, or what... - Original Message - From: "Edward Peloke" <[EMAIL PROTECTED]> To: "Php-General@Lists. Php. Net" <[EMAIL PROTECTED]> Sent: Thursday, February 13, 2003 12:22 PM Subject: [PHP] form within form I am creating a form to allow the user to change his/her password. After the user enters their username and old password, I need to verify that info before they can change their user name and password. So I tried using a form within a form but am having some problems with passing the parameters back and forth...any new ideas would be greatly appreciated. I will fill in all the db stuff later. Thanks, Eddie UserName: '> Password: New Password: Verify Password: -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] uploading files and MAX_FILE_SIZE and php.ini
Hi, all -- Yes, I'm back again with another upload question. I promise I've been paying attention in class, but I just can't get this to work! The default upload_max_filesize in my php.ini was 2M, but I changed it to 200M and restarted the server, and now phpinfo() reports 200M. I created a dinky little upload form, which is attached, to either accept an upload or tell me that it got one, and I can successfully upload files of 7M (much bigger than the original 2M). After initial failures, I added a hidden form field MAX_FILE_SIZE as has been suggested (but sometimes contested) in other posts. I still cannot, however, upload anything larger; a 9M file as well as some 30M and 40M tests just doesn't appear. I have only 5-10M of my 256M available, but I have 90M of swap free and over 1G free on /, the monolithic root partition. Now I'm at a loss for where to turn to fix this. It would seem that everything is in place! Is there an apache directive that I need as well, perhaps? TIA & HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! Send me some files! " ; #print(exec("id")); ### #phpinfo() ; ### if ( $_FILES[uploads] ) { print "I HAVE _FILES!\n" ; ### print "\n";### print_r($_FILES); print "\n"; ### } else { print " OK, buddy. Time to send me some files. " ; } print " " ; ?> msg96845/pgp0.pgp Description: PGP signature