[PHP] Cookies not expiring
I understand that if an expiration time is not set, the cookie should expire at the end of the session (when the browser is closed). This is not happening. What is wrong here? I would actually prefer for the cookie to expire when the user left the Web site. Any ideas? Thanks, -- David A McInnis Information Technology Manager CareerPerfect.com(r) -- solutions for a perfect career(sm) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem upgrading to PHP 4.1.2
Hi, We are currently using PHP 4.0.4pl1 with the following configure: ./configure --with-apxs --with-mysql --with-gd --with-zlib --prefix=/usr/local/php/ This configuration works with GD 1.3-6 and Freetype 1.x. When we try to upgrade to PHP 4.1.2 with the same configuration, we can't use the ImageTTF* functions. We tried to add --with-ttf to the configuration with the result that apache wouldn't start (complained about gdImageResolveColor). We use apache 1.3.20, btw. Does anyone have any idea on what the problem is? Thank you in advance. David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Variables within a string
On Thursday 14 March 2002 14:14, Analysis Solutions wrote: [snip] The examples on that page are lame. For example: if($HTTP_COOKIE_VARS['username']){ // can only come from a cookie, forged or otherwise $good_login = 1; fpassthru (/highly/sensitive/data/index.html); } [snip] Admittedly the example given in the manual wasn't very good or clear. Let's change the example slightly. if($HTTP_COOKIE_VARS['username']) { // can only come from a cookie, forged or otherwise $good_login = 1; } // later on ... if ($good_login) { fpassthru (/highly/sensitive/data/index.html); } else { echo(Hello, you're not logged in!); } Now if register_globals was ON then it's a simple matter of passing a value in the URL to gain access to the sensitive data without actually having to log in: http://www.domain.com/display_secret_data.php?good_login=1 If register_globals is OFF then the above ploy would not work because good_login would not automatically make it into the variable namespace. Enabling register_globals is nice and convenient but it's very easy to shoot yourself in the foot if you don't track where your variables are coming from, or you don't initialise your variables properly. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Carmel, New York, has an ordinance forbidding men to wear coats and trousers that don't match. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamically fill list box
On Thursday 14 March 2002 16:07, gee wrote: A real newbie would be grateful for some help. I have a sports club membership database (Mysql) with first and last names, address and paid or not paid. In edit.php I would like to be able to pre-fill a list box with whether the person has paid or not, change if necessary, update the database and view the resultant changes in members.php I have tried the following in edit.php but can't get it to work. By stating *how* it doesn't work makes it easier for others to help you. For starters, do you get any errors? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* I hope you millionaires are having fun! I just invested half your life savings in yeast!! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem upgrading to PHP 4.1.2
At 9:22 AM +0100 14/3/02, David Brannlund wrote: This configuration works with GD 1.3-6 and Freetype 1.x. When we try to upgrade to PHP 4.1.2 with the same configuration, we can't use the ImageTTF* functions. We tried to add --with-ttf to the configuration with the result that apache wouldn't start (complained about gdImageResolveColor). We use apache 1.3.20, btw. The following patch fixed it for me: diff -r -U3 php-4.1.2/ext/gd/php_gd.h php-4.1.2.gd/ext/gd/php_gd.h --- php-4.1.2/ext/gd/php_gd.h Sat Aug 25 06:07:07 2001 +++ php-4.1.2.gd/ext/gd/php_gd.hThu Feb 28 15:03:02 2002 -66,7 +66,7 PHP_MSHUTDOWN_FUNCTION(gd); #ifndef HAVE_GDIMAGECOLORRESOLVE -static int gdImageColorResolve(gdImagePtr, int, int, int); +extern int gdImageColorResolve(gdImagePtr, int, int, int); #endif PHP_FUNCTION(imagearc); PHP_FUNCTION(imagechar); ...R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Hi what is the prob with this small file?
Hi friend, I am getting null values (0) for the following program. what will be the problem? Any help greatly appreciable!! example.php === ?php // Connect to MySQL $connection = mysql_connect( 'localhost', 'balaji', 'pingpong' ); // Select database on MySQL server mysql_select_db( 'amerm' ) or die ( 'Unable to select database.'.mysql_error()); // Formulate the queries $sql1=select UNIX_TIMESTAMP('start_date') startdate,UNIX_TIMESTAMP('end_date') enddate from request where req_status='Approved'; $result1=mysql_query($sql1) or die ('Error in sql1'.mysql_error()); $n=mysql_numrows($result1); echo 'number of rows:'.$n; while($row=mysql_fetch_object($result1)) { echo 'starttime'.$row-startdate.'endtime'.$row-enddate; } mysql_close($connection); ? = I am getting values printed is 0. Actually UNIX_TIMESTAMP(2001:03:21 10:45:00) means what? What it returns? Thanks in advance Balaji **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Hi what is diff. Between mktime() and UNIX_TIMESTAMP()
Hi, UNIX_TIMESTAMP(2002-03-21 08:30:00) and mktime(2002,03,21,08,30,00) equal or not? But both are same timestamp..but returning values are different.y? Unixtimestamp from Mysql :1016679600 Unixtimestamp from PHP :953699601 y this much difference? Any help would be appreciable. Thanks in advance Balaji **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Hi what is diff. Between mktime() and UNIX_TIMESTAMP()
Unixtimestamp from Mysql :1016679600 Unixtimestamp from PHP :953699601 y this much difference? A PHP timestamp is the number of seconds since 1st Jan 1970 A MySQL UNIX_TIMESTAMP is the date in MMDDHHMMSS format. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] installing php-interbase support
Hi, I would like to solve this problem on my apache-php instalation Fatal error: Call to undefined function: ibase_connect() in /home/pcash/public_html/includes/conexioninterbase.inc on line 7 To solve first i have try to do [root@www download]# rpm -i php-interbase-3.0.16-2bc.i386.rpm error: failed dependencies: php = 3.0.16 is needed by php-interbase-3.0.16-2bc but i can´t found an rpm for interbase 4 Second i have try [root@www download]# ./configure --with-mysql --enable-trackvars --with-ibase=/opt/interbase --wi th-pgsql make make install (and not have recompiled apache) then i restart apache but the problem go on. Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hi what is the prob with this small file?
On Thursday 14 March 2002 17:38, Balaji Ankem wrote: [snip] $sql1=select UNIX_TIMESTAMP('start_date') startdate,UNIX_TIMESTAMP('end_date') enddate from request where req_status='Approved'; Did you try entering this query ($sql1) into mysql at the command line to ensure that it's valid and returns some results? I am getting values printed is 0. Actually UNIX_TIMESTAMP(2001:03:21 10:45:00) means what? What it returns? UNIX_TIMESTAMP returns the number of seconds between the unix epoch (1970-01-01 00:00:00) and the date. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* A certain amount of opposition is a help, not a hindrance. Kites rise against the wind, not with it. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hi what is diff. Between mktime() and UNIX_TIMESTAMP()
UNIX_TIMESTAMP(2002-03-21 08:30:00) and mktime(2002,03,21,08,30,00) equal or not? Careful, 08 != 8 A leading 0 indicates an octal number in PHP. Also, you have the arguments to mktime() completely messed up. It is hour, minute, second, month, day, year. 2002 is a strange-looking hour. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hi what is diff. Between mktime() and UNIX_TIMESTAMP()
On Thursday 14 March 2002 18:03, Balaji Ankem wrote: Hi, UNIX_TIMESTAMP(2002-03-21 08:30:00) and mktime(2002,03,21,08,30,00) equal or not? But both are same timestamp..but returning values are different.y? Unixtimestamp from Mysql :1016679600 Unixtimestamp from PHP :953699601 y this much difference? The arguments you're giving to mktime are in the wrong order. mktime (hour, minute, second, month, day, year [, is_dst]); -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* 186,282 miles per second: It isn't just a good idea, it's the law! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hi what is diff. Between mktime() and UNIX_TIMESTAMP()
On Thursday 14 March 2002 18:11, Jon Haworth wrote: Unixtimestamp from Mysql :1016679600 Unixtimestamp from PHP :953699601 y this much difference? A PHP timestamp is the number of seconds since 1st Jan 1970 To be pedantic, in PHP it is time() A MySQL UNIX_TIMESTAMP is the date in MMDDHHMMSS format. Not correct. In MySQL UNIX_TIMESTAMP also returns the number of seconds since the unix epoch. Thus: php -- time(); mysql -- select UNIX_TIMESTAMP(); should both return the same value; -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* In the next world, you're on your own. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail() and qmail
Hy list, seems like my PHP installation won't send mails with qmail. I'm using it with vpopmail. As suggested in the manual nots for mail() I tried using both /path/to/qmail/bin/sendmail -t -i and directly using /path/to/qmail/bin/qmail-inject for sendmail_path in php.ini. Anyway ... it doesn't send mails, there even are no error messages in both php log an qmail log. Anybody on the list using qmail who could help? Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Hi some logical help is required!!!
**Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Hi some logic help is required!!!!!
Hi friend, I need some help on this logic... 1. I have some range (A to B) which is fixed and A,B are very large numbers.(AB) 2. I have X to Y and I want to check this range should not match with A to B. How can I check this? Ex: 1) A=4 B=8 Totally 4 cases will come!! X=2 Y=5 X=5 Y=6 X=2 Y=9 X=6 Y=9 In all the above cases that logic should return false. How can I solve this?? Don't use for loop!(Because those are very large numbers (chrores)) And logic should be simple and cute! Cheers Balaji **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] trouble with deleting files on unix
Hi there, I know this is not a unix board, but maybe someone had to cope with the same problem. I have a couple of wired filenames matching all this pattern .jpeg: How can I delete all files matching this pattern recursive in all directories? I tryed : rm -r test *.jpeg:* But this only deletes the files in the test dir not in the test/subdir Thanx for any help Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Hi some logic help is required!!!!!
-Original Message- From: Balaji Ankem [mailto:[EMAIL PROTECTED]] Sent: 14 March 2002 11:51 Hi friend, I need some help on this logic... 1. I have some range (A to B) which is fixed and A,B are very large numbers.(AB) 2. I have X to Y and I want to check this range should not match with A to B. How can I check this? If I understand you correctly, this should do it: if (($X$A $Y$A) || ($X$B $Y$B)): // range X-Y is totally outside range A-B else: // range X-Y overlaps A-B partially or totally endif; Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Hi some logic help is required!!!!!
First of all, take that 'I want to know when you received my e-mail' -thingie away. It's anoying. But to the solution: if ((x A || x B) (y A || x B)) { do something.. } Niklas -Original Message- From: Balaji Ankem [mailto:[EMAIL PROTECTED]] Sent: 14. maaliskuuta 2002 13:51 To: Php-General Subject: [PHP] Hi some logic help is required! Hi friend, I need some help on this logic... 1. I have some range (A to B) which is fixed and A,B are very large numbers.(AB) 2. I have X to Y and I want to check this range should not match with A to B. How can I check this? Ex: 1) A=4 B=8 Totally 4 cases will come!! X=2 Y=5 X=5 Y=6 X=2 Y=9 X=6 Y=9 In all the above cases that logic should return false. How can I solve this?? Don't use for loop!(Because those are very large numbers (chrores)) And logic should be simple and cute! Cheers Balaji -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] What is needed to test php mail on a local testserver
Hi there, I am wondering, how I could test the mail functions of php on a local machine. Do I have to install something like a mailserver, or does this come with php? Maybe someone knows some good articles on that. Thanx, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Hi some logic help is required!!!!!
Last X should be Y. Niklas -Original Message- From: Niklas Lampén [mailto:[EMAIL PROTECTED]] Sent: 14. maaliskuuta 2002 14:05 To: Php-General Subject: RE: [PHP] Hi some logic help is required! First of all, take that 'I want to know when you received my e-mail' -thingie away. It's anoying. But to the solution: if ((x A || x B) (y A || x B)) { do something.. } Niklas -Original Message- From: Balaji Ankem [mailto:[EMAIL PROTECTED]] Sent: 14. maaliskuuta 2002 13:51 To: Php-General Subject: [PHP] Hi some logic help is required! Hi friend, I need some help on this logic... 1. I have some range (A to B) which is fixed and A,B are very large numbers.(AB) 2. I have X to Y and I want to check this range should not match with A to B. How can I check this? Ex: 1) A=4 B=8 Totally 4 cases will come!! X=2 Y=5 X=5 Y=6 X=2 Y=9 X=6 Y=9 In all the above cases that logic should return false. How can I solve this?? Don't use for loop!(Because those are very large numbers (chrores)) And logic should be simple and cute! Cheers Balaji -- 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] getting values from multiple select
-Original Message- From: Scott St. John [mailto:[EMAIL PROTECTED]] Sent: 13 March 2002 21:32 I am working on a javascript box that will allow the user to drag values from one select box to another. I will use this box to set the values. This is a standard, multiple select box. On the next page I need to figure out what PHP is doing with the data coming in. If I send 5 fields to the next page PHP will show me one when I echo the variable to the page. Name your field with trailing brackets (e.g. INPUT NAME=field_name[] ...) and you will see it as an array in PHP containing your 5 (or however many) values. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What is needed to test php mail on a local testserver
On Thu, 14 Mar 2002, andy wrote: Hi there, I am wondering, how I could test the mail functions of php on a local machine. Do I have to install something like a mailserver, or does this come with php? If you are using a Unix/Linux type server for your local system, sendmail (or an equivalent such as exim, smail, qmail, etc) will almost certainly be installed and running. Then you can send mail to your_usernamelocalhost and assuming your sendmail/exim configuration is reasonably standard, it should work. Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] trouble with deleting files on unix
On Thursday 14 March 2002 20:01, andy wrote: Hi there, I know this is not a unix board, but maybe someone had to cope with the same problem. I have a couple of wired filenames matching all this pattern .jpeg: How can I delete all files matching this pattern recursive in all directories? I tryed : rm -r test *.jpeg:* But this only deletes the files in the test dir not in the test/subdir try: find /path/to/dir -iname *.jpeg -exec ls -al {} \; If the files listed are the ones you want to delete then find /path/to/dir -iname *.jpeg -exec rm {} \; -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* The cost of living is going up, and the chance of living is going down. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sorting in php
Hello, Can anyone please tell me is there any function in php for sorting in which the contents are stored in array -Uma -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to UnRegist session when Close Browser
Hello,I'am Beginner in PHP, Now I meet a Problem with Session . I am Using Session to track my php web application Users ,I just want to know Who is online and Who has offline. I make a Quit Botton on my webpage, But Someone do not use it to quit my system .So I Can't know who has quit my system definitely. My Question is How to unregist session when User Close his browser . Could Anybody help me? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sorting in php
check the 1001 sort functions in the manual http://www.php.net for instance... Edward - Original Message - From: Uma Shankari T. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 14, 2002 1:36 PM Subject: [PHP] Sorting in php Hello, Can anyone please tell me is there any function in php for sorting in which the contents are stored in array -Uma -- 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] CLI through PHP
14/03/2002 10:51:10 PM Hi, I was wondering how I'd go about manipulating some command line software through PHP. For instance, I have an FTP program installed that allows you to add users through the command line, but it's in this format: -- mailto:root@apathy;root@apathy#: pure-pw useradd joedirt -d /home/jpedirt -u ftpuser Enter User's Password: Enter User's Password Again: User Created mailto:root@apathy;root@apathy#: -- How would I go about writing a simple PHP script that will add users for me using the data submitted by a form? Thanks for your help. Liam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parse Error
Hy, When I try to see my page I have this message and I don't know why. If someone can explain to me. Thank You Parse error: parse error, expecting `')'' in liensfr.php on line 17 Source code : htmlheadLINK REL="stylesheet" HREF="mmenu.css"SCRIPT LANGUAGE="javascript" src="javascript:void(0);"/SCRIPTtitleLiens/title/head body SCRIPT LANGUAGE="javascript" src="javascript:void(0);"/SCRIPTbrbrbrbrtable align="center" cellspacing="0" cellpadding="0" border="0" width="80%"?php$db = mysql_connect(database);$sql= "SELECT * FROM liens";$res = mysql_query($sql, $db);$nbline = mysql_num_rows($res);For ($i = 1; $i ($nbline+1); i++) { // Line 17print "tr";print "td";$req = "SELECT nom FROM liens WHERE auto = $i";$result = mysql_query($req, $db);print "center";echo "$result";print "br";$req = "SELECT adresse FROM liens WHERE auto = $i";$result = mysql_query($req, $db);print "a href='".$result."'";echo "$result";print "br";$req = "SELECT banniere FROM liens WHERE auto = $i";$result = mysql_query($req, $db);If ($result != "") {print "img scr='".$result."' width='300' height='150'/abr";}$req = "SELECT comment FROM liens WHERE auto = $i";$result = mysql_query($req, $db);echo "$result";print "/center/td";print "/tr";}php?centerfont size="2"a href="newliens.php" target="_blank"Ajouter votre lien/a/font/centerSCRIPT LANGUAGE="JavaScript"texte2 = 'CRAZYMANGA le site de reference !! Episode de grande qualite uniquement en Francais !! - ';x = texte2.length-1;place = 0;function defilStat(){if (place == texte2.length){place = 0;}if (place = x){texteDef = texte2.substring((texte2.length-(x-place)),texte2.length) + texte2.substring(0,place);place++;}window.status = texteDef;tempo22 = setTimeout("defilStat()", 150);}/SCRIPT/body/html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Update File Woe (Maybe OT!)
This is not truly a php programming question but a problem I have when programming php on which I was hoping someone would shed some light. When I write php code I generally upload directly to a server via ftp. As I am on a pretty fast adsl line I have never seen toi the need to have a sever setup locally. The problem is that the pages I upload seem to cache and therefore unless I rename the file I have edited on the server (and there request a new file) I do not see the changes I have just made- which is problematic when I am trying new things and changes comer thick and fast. The cache on my browser is set to clear itself on every file request. I also manually clear it. However no matter what I seem to have to rename the the file on the server and request it that way. This is an issue in both IE and NS so it is not a browser specific problem. Likewise I do not see to have this same trouble with html or javascript files- only php. Any ideas? I thought it might be to do with some sort of server side cacheing script? Does anyone have any ideas of a few lines of code I could insert at the top of a file that would overcome this? It is really annoying more than anything Cheers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] include, include_once bug or feature ?
Hello! I have a trouble :( When I try this: --[index.php]-- ?php function f($action) { switch($action){ case 'one': include_once('M/one.php'); break; } } f('one'); ? -- --[M/one.php]-- ?php print pre\n; print_r(get_defined_vars()); print /pre\n; ? -- At output i'll gets nothing :( No any global variables. But, at index.php I get it all. If I move include() to global scope, all ok. It's feature, or bug ? -- Pavel Plesov Simpage support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error
For ($i = 1; $i ($nbline+1); $i++) { // Line 17 not : For ($i = 1; $i ($nbline+1); i++) { // Line 17 hope it helps you SR Jérome Moisy a écrit : Hy,When I try to see my page I have this message and I don't know why.If someone can explain to me.Thank You Parse error: parse error, expecting `')'' in liensfr.php on line 17 Source code :html head LINK REL=stylesheet HREF=mmenu.css SCRIPT LANGUAGE=javascript src=dhtml_lib_lite.js/SCRIPT titleLiens/title /head body onload=defilStat(),multiplemenus(); onUnload=clearTimeout(tempo22) SCRIPT LANGUAGE=javascript src=multiplemenusfr.js/SCRIPT brbrbrbr table align=center cellspacing=0 cellpadding=0 border=0 width=80% ?php $db = mysql_connect(database); $sql= SELECT * FROM liens; $res = mysql_query($sql, $db); $nbline = mysql_num_rows($res); For ($i = 1; $i ($nbline+1); i++) { // Line 17 print tr; print td; $req = SELECT nom FROM liens WHERE auto = $i; $result = mysql_query($req, $db); print center; echo $result; print br; $req = SELECT adresse FROM liens WHERE auto = $i; $result = mysql_query($req, $db); print a href='.$result.'; echo $result; print br; $req = SELECT banniere FROM liens WHERE auto = $i; $result = mysql_query($req, $db); If ($result != ) { print img scr='.$result.' width='300' height='150'/abr; } $req = SELECT comment FROM liens WHERE auto = $i; $result = mysql_query($req, $db); echo $result; print /center/td; print /tr; } php? centerfont size=2a href=newliens.php target=_blankAjouter votre lien/a/font/center SCRIPT LANGUAGE=JavaScript texte2 = 'CRAZYMANGA le site de reference !! Episode de grande qualite uniquement en Francais !! - '; x = texte2.length-1; place = 0; function defilStat() { if (place == texte2.length) { place = 0; } if (place = x) { texteDef = texte2.substring((texte2.length-(x-place)),texte2.length) + texte2.substring(0,place); place++; } window.status = texteDef; tempo22 = setTimeout(defilStat(), 150); } /SCRIPT /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] DHTML Trouble please help
You could modify near line 575 of tetrisIE.html: function Show_Score() { _block.score.document.forms[0].High_Score.value = high_score; _block.score.document.forms[0].Game_Score.value = game_score; } to something similar to: function Show_Score() { document.images['hiddenimage'].src=script.php?score=+game_score; _block.score.document.forms[0].High_Score.value = high_score; _block.score.document.forms[0].Game_Score.value = game_score; } Then create a file script.php that inputs the value of $score into a database. This would be easy to cheat though, is that a problem? If you really need help with this feel free to contact me off list. -Rob Z. http://www.zwink.net/daid.php -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Saturday, March 13, 2010 10:16 PM To: [EMAIL PROTECTED] Subject: [PHP] DHTML Trouble please help Hi all, I am no DHTML expert and don't even know the language also didn't know where to post this. But after today I am going to learn. I downloaded a tetris game from Dynamic Drive: http://www.dynamicdrive.com/dynamicindex12/tetris/index.htm Have a look. I would add it here but it's too long. I want to add the high score to a users data in the database. Would one of you DHTML and PHP Gurues (SP) please point out what section of the code I would use to get the high score. I would like to (I can do this part if someone would show what I use from the DHTML) echo or print the score to the bottom of the browser window and then have that added to the db. TIA GC -- 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: Get row number from mysql
The greater question: Why does irow order matter? What are you REALLY trying to do? == In article 000701c1cb06$3b54f3b0$0101a8c0@nightengale, [EMAIL PROTECTED] says... Hello, How can I get the number of the current row, something like this: ? $sql = mysql_query(SELECT * FROM table ORDER BY id DESC); while ($row = mysql_fetch_array($sql)) { $id = $row[id]; $name = $row[name]; print $current_row_number. $nameBr; } ? I can't just use the id field, because the ID's might not always be 1, 2, 3, 4, 5, 6, etc...they could go 1, 2, 4, 5, 8. I need it to look like this: 1. first person 2. second person 3. third person and so on and so forth. Can anyone advise me on how I should do this? thanks, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail() and qmail
I use qmail with PHP on a RH v 7.0 system. Works like a charm. I compiled/installed qmail from source. Installed RH, Apache, PHP from RPMs. I'm not at my home-office, where I have this set-up, so I cannot provide you with my set-up info. I dod not use vpopmail yet, but I will soon instll it and qmail-popd3. -Original Message- From: Daniel Reichenbach [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 5:42 AM To: Php-General Subject: [PHP] mail() and qmail Hy list, seems like my PHP installation won't send mails with qmail. I'm using it with vpopmail. As suggested in the manual nots for mail() I tried using both /path/to/qmail/bin/sendmail -t -i and directly using /path/to/qmail/bin/qmail-inject for sendmail_path in php.ini. Anyway ... it doesn't send mails, there even are no error messages in both php log an qmail log. Anybody on the list using qmail who could help? Daniel -- 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] Cookies not expiring
Can't read your mind, bud. Show us your code... -Original Message- From: David McInnis [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 2:25 AM To: [EMAIL PROTECTED] Subject: [PHP] Cookies not expiring I understand that if an expiration time is not set, the cookie should expire at the end of the session (when the browser is closed). This is not happening. What is wrong here? I would actually prefer for the cookie to expire when the user left the Web site. Any ideas? Thanks, -- David A McInnis Information Technology Manager CareerPerfect.com(r) -- solutions for a perfect career(sm) -- 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] include, include_once bug or feature ?
I think that since you are including a file into a function - the vars become local so they only exist when the function is running. Therefore, a call to get_defined_vars will not show them since the vars do not exist in the global scope. In fact, during the call to get_defined_vars, the included vars do not exist at all. This is a feature, not a bug. Matt Friedman Web Applications Developer www.SpryNewMedia.com Email: [EMAIL PROTECTED] -Original Message- From: Pavel Plesov [mailto:[EMAIL PROTECTED]] Sent: Thursday March 14, 2002 7:56 AM To: [EMAIL PROTECTED] Subject: [PHP] include, include_once bug or feature ? Hello! I have a trouble :( When I try this: --[index.php]-- ?php function f($action) { switch($action){ case 'one': include_once('M/one.php'); break; } } f('one'); ? -- --[M/one.php]-- ?php print pre\n; print_r(get_defined_vars()); print /pre\n; ? -- At output i'll gets nothing :( No any global variables. But, at index.php I get it all. If I move include() to global scope, all ok. It's feature, or bug ? -- Pavel Plesov Simpage support -- 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] getting values from multiple select
On Wednesday, March 13, 2002, at 04:31 PM, Scott St. John wrote: If I send 5 fields to the next page PHP will show me one when I echo the variable to the page. If I try to split the varaiable I still get only one value in the echo. Tried to reponse.write it in asp and I get the string with comma seperate values. Did you try putting brackets at the end of the input names? This tells PHP to put the values into an array, whose key is the name of the input. select name=choice[] multiple=yes option value=aA/option option value=bB/option option value=cC/option /select This might work for you, Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Connecting Form result to PHP query?
Form elements are passed to the following page as variable names. For instance, the text value in subject 1 input element: INPUT type=text name=subject1 is passed to the following page as: $subject1 -Original Message- From: PHPList [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 11:59 PM To: [EMAIL PROTECTED] Subject: [PHP] Connecting Form result to PHP query? On first page, there is a form where User must select choice from Subject1 (mandatory) User may select choice from Geographic Area (optional) When you click on Go, you go to Results page where there will be instructions for PHP: Search database where Subject1=$subject1 OR Subject2=$subject1 AND Geographic=$geographic Whenever there is a match in Subject1 OR Subject2 AND MAYBE a match in Geographic Then display results in an HTML-format. Q: How do I send the results from the form on first page to the results page? -- 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] include, include_once bug or feature ?
: I think that since you are including a file into a function - the vars : become local so they only exist when the function is running. Therefore, : a call to get_defined_vars will not show them since the vars do not : exist in the global scope. In fact, during the call to get_defined_vars, : the included vars do not exist at all. : : This is a feature, not a bug. Thanks. Now, I understood :) -- Pavel Plesov Simpage support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] CLI through PHP
index.html FORM method=post action=adduser.php INPUT type=text name=pwBR INPUT type=text name=pw2BR INPUT type=submit name=submit valuye=submit /FORM adduser.php - ?php ...write $pw and $pw2 to database ? did you try to do this yourself yet? what were the results? -Original Message- From: Liam [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 4:51 PM To: [EMAIL PROTECTED] Subject: [PHP] CLI through PHP 14/03/2002 10:51:10 PM Hi, I was wondering how I'd go about manipulating some command line software through PHP. For instance, I have an FTP program installed that allows you to add users through the command line, but it's in this format: -- mailto:root@apathy;root@apathy#: pure-pw useradd joedirt -d /home/jpedirt -u ftpuser Enter User's Password: Enter User's Password Again: User Created mailto:root@apathy;root@apathy#: -- How would I go about writing a simple PHP script that will add users for me using the data submitted by a form? Thanks for your help. Liam -- 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] Targetted redirection?
On Wednesday, March 13, 2002, at 07:36 PM, Analysis Solutions wrote: Sure it works... execpt when people who have Java'sCrap turned off come to your site. Oh, and then there's the folks with browsers that don't have JS at all? HTTP headers work across all browsers. header('Location: http://foo.org/') is the real solution. For more info on why not to use Java'sCrap and how accomplish the same things without it, see http://www.analysisandsolutions.com/code/weberror.htm?j=y I agree with what you say -- never rely on JavaScript. A good rule of thumb (IMO) is to make sure that your site works perfectly and does exactly what it should using HTML/PHP code alone (test with JS turned off), and then add features with JavaScript that may make it -better-, but not features that are ever -required-. For instance, make sure that your PHP validates the forms that are submitted to the server, but if you have already done this then you can add JavaScript form validation so that the user doesn't have to wait for a full resubmit to make sure that they have everything. There are other ways that I can see JS enhancing a web site, as long as you don't require JS to do what you want... but in all honesty I haven't learned much JS so even I don't really take this route. It's just a theory. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: getting values from multiple select
On Wednesday, March 13, 2002, at 10:27 PM, David Robley wrote: If you are using a SELECT MULTIPLE you need to name the item as an array, e.g. NAME=multi[] - then loop through the array in the target script to extract the values. Don't forget to either define a default selection or check for 'none selected' Such as if ($_POST['multi']) { // loop thru the array and extract the values } else { // there were none selected so don't loop thru // the array (or you'll raise an error) } Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What is needed to test php mail on a local testserver
... and AFAIK, if you're running windows, read 'php.ini' and you can specify an SMTP server to use for mail sending. andy thomas wrote: On Thu, 14 Mar 2002, andy wrote: Hi there, I am wondering, how I could test the mail functions of php on a local machine. Do I have to install something like a mailserver, or does this come with php? If you are using a Unix/Linux type server for your local system, sendmail (or an equivalent such as exim, smail, qmail, etc) will almost certainly be installed and running. Then you can send mail to your_usernamelocalhost and assuming your sendmail/exim configuration is reasonably standard, it should work. Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CLI through PHP
Pipes. I've only had to do it with perl, so i have no idea what the syntax or function calls are with PHP, but i'm almost positive that PHP supports reading/writing to/from pipes. Liam wrote: 14/03/2002 10:51:10 PM Hi, I was wondering how I'd go about manipulating some command line software through PHP. For instance, I have an FTP program installed that allows you to add users through the command line, but it's in this format: -- mailto:root@apathy;root@apathy#: pure-pw useradd joedirt -d /home/jpedirt -u ftpuser Enter User's Password: Enter User's Password Again: User Created mailto:root@apathy;root@apathy#: -- How would I go about writing a simple PHP script that will add users for me using the data submitted by a form? Thanks for your help. Liam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CLI through PHP
On Thu, 14 Mar 2002, Liam wrote: 14/03/2002 10:51:10 PM Hi, I was wondering how I'd go about manipulating some command line software through PHP. For instance, I have an FTP program installed that allows you to add users through the command line, but it's in this format: -- mailto:root@apathy;root@apathy#: pure-pw useradd joedirt -d /home/jpedirt -u ftpuser Enter User's Password: Enter User's Password Again: User Created mailto:root@apathy;root@apathy#: -- How would I go about writing a simple PHP script that will add users for me using the data submitted by a form? Thanks for your help. Someone else has already posted an example of a form to collect the data and pass it to a script called adduser.php. In adduser.php you could try the exec() function to execute the adduser/useradd command, something like: exec(useradd -u $uid -g $gid -d $home_dir -s $shell -c 'comments' $user); Hope this helps, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getting values from multiple select
Yes, I have tried that. To view them on the next page I would call them as $choice[0];$choice[1];, etc, but only the first item in the list is available. -Scott On Thu, 14 Mar 2002, Erik Price wrote: Did you try putting brackets at the end of the input names? This tells PHP to put the values into an array, whose key is the name of the input. select name=choice[] multiple=yes option value=aA/option option value=bB/option option value=cC/option /select This might work for you, Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Multiple layout strategy, advice saught!
Hi all, We have a unix server with apache and php on it. We have a set of client site that all share the same codebase. Our problem is that we end up with multiple URL layouts for essentially the same thing. Let me explain. Say we have clients x, y, and z. These buy template sites from us, and access that as http://some.ip.add.ress/x/, /y/, and /z/. Inside these are a number of urls such as /en/england/foo/bar/cat1/1.php and /en/england/foo/bar/cat2/1.php, where all */foo/* urls need to be handled by the /foo.php script via AliasMatch. This by itself is not so difficult, however we also have a significant number of client with their own domain names that need to be mapped directly to their sitename. Thus we end up with at two sets of AliasMatches: AliasMatch ^/(.*)/(.*)/(.*)/foo/(.*) /www/shared/foo.php for the templated sites where the (.*) correspond to sitename, language, and country, and AliasMatch ^/(.*)/(.*)/foo/(.*) /www/shared/foo.php for domain-based sites. Has anyone done anything similar? What did you end up doing? Any suggestions about how to proceed? I'm thinking it'll be necessary to figure out from foo.php whether we are in a /sitename/ or not and proceed to build urls from there. Thoughts gratefully appreciated. Help! :) -- James Green Developer Stealthnet.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] get the greatest key of an array???
Hi, How can i get the greatest key of an array?? $array[1] = ...; $array[5] = ...; $array[0] = ...; $array[10] = ...; $array[7] = ...; $greatest_key = ??? (this must be 10 in this example) Alex Elderson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail() and qmail
I use qmail with PHP on a RH v 7.0 system. Works like a charm. Same here, RH 7.0 with some updates from RPM. I compiled/installed qmail from source. Installed RH, Apache and PHP from source, too. Do you have a possibility to look at a phpinfo() page? There the option your php version uses for sendmail_path should be visible? Would be interesting to know what parameters your php version uses. Mine uses sendmail -t -i. Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getting values from multiple select
On Thursday, March 14, 2002, at 09:33 AM, Scott St. John wrote: Yes, I have tried that. To view them on the next page I would call them as $choice[0];$choice[1];, etc, but only the first item in the list is available. Hm... have you tried using a loop to get their values, rather than using the numeric indexes? Like this: foreach ($choice as $array_element) { echo $array_element; } This will go through the entire array, regardless of numeric index, and echo the value of each element in the array. Try this, if it doesn't work then perhaps only one value is being passed to the receiving script. Have you made sure your listbox features the attribute multiple=yes and have you made sure to select more than one item in the listbox by holding down either Alt (PC) or Cmd (Mac) as you make your selections. If you're only selecting ONE item, then only one item will be passed to the receiving script. Use the above techniques to make sure that you are actually passing more than one value. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] get the greatest key of an array???
On Thursday, March 14, 2002, at 09:47 AM, Alex Elderson wrote: How can i get the greatest key of an array?? $array[1] = ...; $array[5] = ...; $array[0] = ...; $array[10] = ...; $array[7] = ...; $greatest_key = ??? (this must be 10 in this example) I think you mean the element with the greatest index? It's not guaranteed to be the greatest element in your array, depending on how you have set up your indexes (associative or numeric), but the end() function should do it: http://www.php.net/manual/en/function.end.php It sets the internal pointer to the very last element in the array. Python, incidentally, has a neat way of doing this: array[-1] (of course they're called lists, not arrays, in Python). Just a side note. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] get the greatest key of an array???
krsort(array) then grab first key. -Original Message- From: Alex Elderson [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 8:47 AM To: [EMAIL PROTECTED] Subject: [PHP] get the greatest key of an array??? Hi, How can i get the greatest key of an array?? $array[1] = ...; $array[5] = ...; $array[0] = ...; $array[10] = ...; $array[7] = ...; $greatest_key = ??? (this must be 10 in this example) Alex Elderson -- 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] Cookies not expiring
Here is what I am using to set my cookie. $cp_sessionid = $CP_partnerid . _ . uniqid(str_pad(getenv(REMOTE_ADDR), 15, 0)); setcookie('cp_sessionid', $cp_sessionid); David McInnis -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 6:01 AM To: 'David McInnis'; [EMAIL PROTECTED] Subject: RE: [PHP] Cookies not expiring Can't read your mind, bud. Show us your code... -Original Message- From: David McInnis [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 2:25 AM To: [EMAIL PROTECTED] Subject: [PHP] Cookies not expiring I understand that if an expiration time is not set, the cookie should expire at the end of the session (when the browser is closed). This is not happening. What is wrong here? I would actually prefer for the cookie to expire when the user left the Web site. Any ideas? Thanks, -- David A McInnis Information Technology Manager CareerPerfect.com(r) -- solutions for a perfect career(sm) -- 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
Re: [PHP] getting values from multiple select
Ok, how about a code snipet since I seem to be blind this morning. The select box code: select multiple=yes name=groups id=av ? $sql = select groupID,groupName from groups order by groupName; $result = mssql_query($sql,$connection); while($row = mssql_fetch_array($result)){ $groupID = $row[groupID]; $groupName = $row[groupName]; echo option value=\$groupID\$groupName/option; } ? /select On the next page I tried the code Erik recommended doing this: foreach ($groups as $group_list){ echo $group_list; } Any eye openers? Thanks, -Scott On Thu, 14 Mar 2002, Erik Price wrote: Hm... have you tried using a loop to get their values, rather than using the numeric indexes? Like this: foreach ($choice as $array_element) { echo $array_element; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Cookies not expiring
OK...that looks valid. Now, what indications are you getting that the cookie is not expiring when you close the browser? As far as expiring when user leaves the web-site? M.C. Hammer said it best...can't touch that -Original Message- From: David McInnis [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 9:04 AM To: 'Rick Emery'; [EMAIL PROTECTED] Subject: RE: [PHP] Cookies not expiring Here is what I am using to set my cookie. $cp_sessionid = $CP_partnerid . _ . uniqid(str_pad(getenv(REMOTE_ADDR), 15, 0)); setcookie('cp_sessionid', $cp_sessionid); David McInnis -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 6:01 AM To: 'David McInnis'; [EMAIL PROTECTED] Subject: RE: [PHP] Cookies not expiring Can't read your mind, bud. Show us your code... -Original Message- From: David McInnis [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 2:25 AM To: [EMAIL PROTECTED] Subject: [PHP] Cookies not expiring I understand that if an expiration time is not set, the cookie should expire at the end of the session (when the browser is closed). This is not happening. What is wrong here? I would actually prefer for the cookie to expire when the user left the Web site. Any ideas? Thanks, -- David A McInnis Information Technology Manager CareerPerfect.com(r) -- solutions for a perfect career(sm) -- 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
Re: [PHP] DHTML Trouble please help
On Saturday, March 13, 2010, at 10:15 PM, Jennifer Downey wrote: I am no DHTML expert and don't even know the language also didn't know where to post this. But after today I am going to learn. Isn't DHTML more of a buzzword? i don't think it's really a language. It just refers to using scripting languages and plugins like JavaScript, Flash, CSS tricks, and even server-side manipulation to achieve an effect. There's a lot of stuff on this topic at http://dhtmlcentral.com/ if you're interested. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getting values from multiple select
On Thursday, March 14, 2002, at 09:52 AM, Scott St. John wrote: Ok, how about a code snipet since I seem to be blind this morning. The select box code: select multiple=yes name=groups id=av ? $sql = select groupID,groupName from groups order by groupName; ... Any eye openers? Thanks, -Scott Sure! First go get a cup of coffee! :) Then change the first line to say this: select multiple=yes name=groups[] id=av Let me know how that works for you. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() and qmail
On Thursday 14 March 2002 22:56, Daniel Reichenbach wrote: I use qmail with PHP on a RH v 7.0 system. Works like a charm. Same here, RH 7.0 with some updates from RPM. I compiled/installed qmail from source. Installed RH, Apache and PHP from source, too. Do you have a possibility to look at a phpinfo() page? There the option your php version uses for sendmail_path should be visible? Would be interesting to know what parameters your php version uses. Mine uses sendmail -t -i. I'm using qmail and these are the settings in php.ini: -- [mail function] ; For Win32 only. SMTP = localhost ; For Win32 only. sendmail_from = [EMAIL PROTECTED] ; For Unix only. You may supply arguments as well (default: 'sendmail -t -i'). ;sendmail_path = -- In other words it's the default settings. RH7.1, php-4.0.6, qmail 1.03 -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Post proelium, praemium. [After the battle, the reward.] */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Auth against system userlist vice .htpasswd
Aside from creating an .ht* type of list, it is possible to simply auth against a valid user on the server in question? Looking to do the following; User wishes to access directory... enters their system login/passwd... login is auth'ed against the system password list... php then performs a pwd or something to determines the users home directory etc... and perform the tasks that it needs to. Can it be done? And what are the security ramifications? Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getting values from multiple select
On Thu, 14 Mar 2002, Erik Price wrote: Sure! First go get a cup of coffee! :) Then change the first line to say this: select multiple=yes name=groups[] id=av Let me know how that works for you. Erik- I don't do coffee, but the Iced Tea works just as well :) Thank you, all is well and my happy face is back on. I was missing the [], I had tried that before but had an error because I forgot to update my javascript code. Thanks everyone, -Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] textarea/textarea
Hi, I have the following probably very simple problem. Basically what I need to do is to collect info from the user via 4 steps... like a set of input type(s) throughout STEP 1 of 4 ... STEP 4 of 4... etc... submitted to db on STEP 5. The only problem I have is I need to display textarea on step 3, and once again the same textarea on step 4 so that user has another chance to review what s/he's written in and on the fifth page all date submitted to db. The problem though is that it adds slashes, and on the submission page (page 5) there's like three slashes for the info collected via textarea. Basically, for instance I submit I'm Russian on step 3, by the time this data reached final step it's I\\\'m Russian. How can I overcome this issue? If I avoid putting variable taken from step 3 to 4th into textarea name=about_eng $about_eng/textarea and do input type=hidden name=about_eng value=about_eng half of the data gets lost, only first word from the submitted previously remains... Hope this was descriptive and hope someone can suggest something. Thanks, Vlad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] textarea/textarea
stripslahses($variable) -Original Message- From: Vlad Kulchitski [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 9:26 AM To: [EMAIL PROTECTED] Subject: [PHP] textarea/textarea Hi, I have the following probably very simple problem. Basically what I need to do is to collect info from the user via 4 steps... like a set of input type(s) throughout STEP 1 of 4 ... STEP 4 of 4... etc... submitted to db on STEP 5. The only problem I have is I need to display textarea on step 3, and once again the same textarea on step 4 so that user has another chance to review what s/he's written in and on the fifth page all date submitted to db. The problem though is that it adds slashes, and on the submission page (page 5) there's like three slashes for the info collected via textarea. Basically, for instance I submit I'm Russian on step 3, by the time this data reached final step it's I\\\'m Russian. How can I overcome this issue? If I avoid putting variable taken from step 3 to 4th into textarea name=about_eng $about_eng/textarea and do input type=hidden name=about_eng value=about_eng half of the data gets lost, only first word from the submitted previously remains... Hope this was descriptive and hope someone can suggest something. Thanks, Vlad -- 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] textarea/textarea
I mean: stripslashes($variable) -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 9:24 AM To: 'Vlad Kulchitski'; [EMAIL PROTECTED] Subject: RE: [PHP] textarea/textarea stripslahses($variable) -Original Message- From: Vlad Kulchitski [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 9:26 AM To: [EMAIL PROTECTED] Subject: [PHP] textarea/textarea Hi, I have the following probably very simple problem. Basically what I need to do is to collect info from the user via 4 steps... like a set of input type(s) throughout STEP 1 of 4 ... STEP 4 of 4... etc... submitted to db on STEP 5. The only problem I have is I need to display textarea on step 3, and once again the same textarea on step 4 so that user has another chance to review what s/he's written in and on the fifth page all date submitted to db. The problem though is that it adds slashes, and on the submission page (page 5) there's like three slashes for the info collected via textarea. Basically, for instance I submit I'm Russian on step 3, by the time this data reached final step it's I\\\'m Russian. How can I overcome this issue? If I avoid putting variable taken from step 3 to 4th into textarea name=about_eng $about_eng/textarea and do input type=hidden name=about_eng value=about_eng half of the data gets lost, only first word from the submitted previously remains... Hope this was descriptive and hope someone can suggest something. Thanks, Vlad -- 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
Re: [PHP] textarea/textarea
On Thursday, March 14, 2002, at 10:26 AM, Vlad Kulchitski wrote: The only problem I have is I need to display textarea on step 3, and once again the same textarea on step 4 so that user has another chance to review what s/he's written in and on the fifth page all date submitted to db. The problem though is that it adds slashes, and on the submission page (page 5) there's like three slashes for the info collected via textarea. Basically, for instance I submit I'm Russian on step 3, by the time this data reached final step it's I\\\'m Russian. Does the stripslashes() function solve your problem? I'm interested in hearing about it. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] regular expression for (NOT 'word')
how would i build a regular expression in php that would match everything but the given word. For example, match the string only if there isnt a word 'php' in the string. I understand i can list characters i dont want to see in the string: [^php]. but this means there cant be any p or h in the string. And ^(php) checks if the string starts with 'php'. How should i do it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] INSERT IMAGE INTO DATABASE / PHP
Hi, I have a windows 2000 Database Server with IBM DB2 V7.2 FP5 I have a linux web server with Apache/PHP I installed IBM DB2 IMAGE Extender and enable my database for it. Now I'm uploading a file to the server and I want to copy this file in the database. I'm using the following script: $userfile=str_replace(,\\,$userfile); $TableName=imgdb; $FieldName1=imgname;$FieldValue1='.session_id().'; $FieldName2=imgval;$FieldValue2='.$userfile.'; $insOS=Insert Into $TableName ($FieldName1,$FieldName2) values($FieldValue1,MMDBSYS.DB2IMAGE('MyDatabase',$FieldValue2,'ASIS',1,'Thi s my image'));; $resultOSins=odbc_exec($conn,$insOS); $userfile is the file uploaded by the user using an INPUT type=FILE I received the following error: Warning: SQL error: [IBM][CLI Driver][DB2/NT] SQL0443N Routine MMDBSYS.DB2IMAGE (specific name DB2IMAGEIMPORTF1) has returned an error SQLSTATE with diagnostic text Can't resolve import file. . SQLSTATE=38686 , SQL state 38686 in SQLExecDirect in /svr/myfile.php But if I have $userfile=C:\myimage.jpg; it will work (of course if the file is present on the C drive...) My question is How can I insert an image in the database without using its file name ? Can I directly send the image object to the database ? Thanks Jerry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] regular expression for (NOT 'word')
the best you can do is: ?php $a = this has php in the string; if( ! ereg(php, $a ) ) { print a: not in string; } $a = this has in the string; if( ! ereg(php, $a ) ) { print b: not in string; } ? -Original Message- From: Ando Saabas [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 9:33 AM To: [EMAIL PROTECTED] Subject: [PHP] regular expression for (NOT 'word') how would i build a regular expression in php that would match everything but the given word. For example, match the string only if there isnt a word 'php' in the string. I understand i can list characters i dont want to see in the string: [^php]. but this means there cant be any p or h in the string. And ^(php) checks if the string starts with 'php'. How should i do 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
[PHP] simple yet weird... help pls
Please take a look at the script below. If i want to show an image it doesnt work if it's under an if statement. Why in this case? ? $feedb=0; if($feedb==0){ echo img scr='somepic.jpg';} echo img src='somepic.jpg'; ? How can i solve this problem? thank you! Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] regular expression for (NOT 'word')
Ok let me explain my problem further some. I need the regular expression to purify the html page from script tags: I used: $file = eregi_replace((script(.*).*/script), , $file); Now this works fine, until theres a webpage like: script somethingscript data./script Some webpage data script somethinganother script data /script so the regexp above replaces everything between first script and last /script ie the webpage data also. So i thought to change the regexp to something like this: $file = eregi_replace((script(.*)NOT(script)/script), , $file); where NOT(script) would match everything that contains word script Rick Emery wrote: the best you can do is: ?php $a = this has php in the string; if( ! ereg(php, $a ) ) { print a: not in string; } $a = this has in the string; if( ! ereg(php, $a ) ) { print b: not in string; } ? -Original Message- From: Ando Saabas [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 9:33 AM To: [EMAIL PROTECTED] Subject: [PHP] regular expression for (NOT 'word') how would i build a regular expression in php that would match everything but the given word. For example, match the string only if there isnt a word 'php' in the string. I understand i can list characters i dont want to see in the string: [^php]. but this means there cant be any p or h in the string. And ^(php) checks if the string starts with 'php'. How should i do 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
[PHP] Opera broswer file upload
Also another question, my fileupload works everywhere (IE, Netscape) but Opera. Does Opera support it at all? My fileupload is very simple. It checks is the file is JPEG/GIF/BMP and then saves it, if not, gives an error message. Vlad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] If...Else question
Is it legal for an if...else statement to span PHP code blocks? Here's an example: ? $a = 0; if ($a 5) { $b = 50; $c=500; // Take a break from php and put in some HTML ? HTML HEAD/HEAD BODYMORE HTML CODE HERE/BODY /HTML ? // Now back to the PHP code $d = 250; } else { $e = Does not apply. } ? I have some code similar to this example. When I run the code in my browser, I get a parse error on the last line (?). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] If...Else question
Of course it's legal, absolutely. You have to make sure though that you don't use double quotes in php portion, and if you do, you have to escape them for instance: echo font color=\red\; if you paste the code that's causing the problem, we can take a look. Vlad -Original Message- From: Brad Harriger [mailto:[EMAIL PROTECTED]] Sent: 14 ÂÅÒÅÚÎÑ 2002 Ò. 10:52 To: [EMAIL PROTECTED] Subject: [PHP] If...Else question Is it legal for an if...else statement to span PHP code blocks? Here's an example: ? $a = 0; if ($a 5) { $b = 50; $c=500; // Take a break from php and put in some HTML ? HTML HEAD/HEAD BODYMORE HTML CODE HERE/BODY /HTML ? // Now back to the PHP code $d = 250; } else { $e = Does not apply. } ? I have some code similar to this example. When I run the code in my browser, I get a parse error on the last line (?). -- 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] If...Else question
On Thu, 14 Mar 2002, Brad Harriger wrote: !-- snip -- ? // Now back to the PHP code $d = 250; } else { $e = Does not apply. } ? I have some code similar to this example. When I run the code in my browser, I get a parse error on the last line (?). Replace: $e = Does not apply. with: $e = Does not apply.; Cheers, Nick Winfield. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Opera broswer file upload
On Thursday 14 March 2002 23:57, Vlad Kulchitski wrote: Also another question, my fileupload works everywhere (IE, Netscape) but Opera. Does Opera support it at all? My fileupload is very simple. It checks is the file is JPEG/GIF/BMP and then saves it, if not, gives an error message. I use Opera 5.12 for uploads and have no problems. What problems are you getting? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* The more crap you put up with, the more crap you are going to get. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Opera broswer file upload
This problem was fixed in the CVS. Best regards, Andrey Hristov - Original Message - From: Vlad Kulchitski [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 14, 2002 5:57 PM Subject: [PHP] Opera broswer file upload Also another question, my fileupload works everywhere (IE, Netscape) but Opera. Does Opera support it at all? My fileupload is very simple. It checks is the file is JPEG/GIF/BMP and then saves it, if not, gives an error message. Vlad -- 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] Opera broswer file upload
The message I get is that the file is invalid format... I tested on Netscape 4.xx and Netscape 6.xx tested on IE 4 through 5. Works fine. I can paste the code I am using if you want to take a look. Vlad -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: 14 ÂÅÒÅÚÎÑ 2002 Ò. 10:58 To: [EMAIL PROTECTED] Subject: Re: [PHP] Opera broswer file upload On Thursday 14 March 2002 23:57, Vlad Kulchitski wrote: Also another question, my fileupload works everywhere (IE, Netscape) but Opera. Does Opera support it at all? My fileupload is very simple. It checks is the file is JPEG/GIF/BMP and then saves it, if not, gives an error message. I use Opera 5.12 for uploads and have no problems. What problems are you getting? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* The more crap you put up with, the more crap you are going to get. */ -- 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] Opera broswer file upload / MY CODE
This is the code I am using for uploading: if(($userfile) ($userfile != none)) { $type=basename($userfile_type); switch ($type) { case jpeg: case pjpeg: $filename=talkroom_gallery_photographs/$username.jpg; copy($userfile, $filename); echo file copied OK!; echo img src=$filename; break; case gif: $filename=talkroom_gallery_photographs/$username.gif; copy($userfile, $filename); echo file copied OK!; echo img src=$filename; break; case bmp: $filename=talkroom_gallery_photographs/$username.bmp; copy($userfile, $filename); echo file copied OK!; echo img src=$filename; break; default: echo invalid picture format; } Vlad -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: 14 ÂÅÒÅÚÎÑ 2002 Ò. 10:58 To: [EMAIL PROTECTED] Subject: Re: [PHP] Opera broswer file upload On Thursday 14 March 2002 23:57, Vlad Kulchitski wrote: Also another question, my fileupload works everywhere (IE, Netscape) but Opera. Does Opera support it at all? My fileupload is very simple. It checks is the file is JPEG/GIF/BMP and then saves it, if not, gives an error message. I use Opera 5.12 for uploads and have no problems. What problems are you getting? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* The more crap you put up with, the more crap you are going to get. */ -- 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] Opera broswer file upload
CVS is the code repository. The PHP code is developed by many programmers and the CVS is used to store the code. CVS = concurent versioning systems. It is used to prevent race conditions when two or more programmers are writing/patching a code. Also there are many other pretty things. So when bug is reported it is patched in the CVS and after some time new version is released at some time. Andrey - Original Message - From: Vlad Kulchitski [EMAIL PROTECTED] To: Andrey Hristov [EMAIL PROTECTED] Sent: Thursday, March 14, 2002 6:06 PM Subject: RE: [PHP] Opera broswer file upload Andrey what is CVS? - Original Message - This problem was fixed in the CVS. Best regards, Andrey Hristov - Original Message - From: Vlad Kulchitski [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 14, 2002 5:57 PM Subject: [PHP] Opera broswer file upload Also another question, my fileupload works everywhere (IE, Netscape) but Opera. Does Opera support it at all? My fileupload is very simple. It checks is the file is JPEG/GIF/BMP and then saves it, if not, gives an error message. Vlad -- 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] YET another question re: magic quotes
If I have magic quotes on, will stripslashes() / addslashes() work? Doesn't seem to work for me... -Original Message- From: Vlad Kulchitski Sent: 14 ÂÅÒÅÚÎÑ 2002 Ò. 11:10 To: [EMAIL PROTECTED] Subject: [PHP] Opera broswer file upload / MY CODE This is the code I am using for uploading: if(($userfile) ($userfile != none)) { $type=basename($userfile_type); switch ($type) { case jpeg: case pjpeg: $filename=talkroom_gallery_photographs/$username.jpg; copy($userfile, $filename); echo file copied OK!; echo img src=$filename; break; case gif: $filename=talkroom_gallery_photographs/$username.gif; copy($userfile, $filename); echo file copied OK!; echo img src=$filename; break; case bmp: $filename=talkroom_gallery_photographs/$username.bmp; copy($userfile, $filename); echo file copied OK!; echo img src=$filename; break; default: echo invalid picture format; } Vlad -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: 14 ÂÅÒÅÚÎÑ 2002 Ò. 10:58 To: [EMAIL PROTECTED] Subject: Re: [PHP] Opera broswer file upload On Thursday 14 March 2002 23:57, Vlad Kulchitski wrote: Also another question, my fileupload works everywhere (IE, Netscape) but Opera. Does Opera support it at all? My fileupload is very simple. It checks is the file is JPEG/GIF/BMP and then saves it, if not, gives an error message. I use Opera 5.12 for uploads and have no problems. What problems are you getting? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* The more crap you put up with, the more crap you are going to get. */ -- 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
Re: [PHP] Problem upgrading to PHP 4.1.2
Thank you VERY much!!! Worked like a charm... David Richard Archer [EMAIL PROTECTED] wrote in message news:a05100301b8b615655f5f@[203.89.243.68]... At 9:22 AM +0100 14/3/02, David Brannlund wrote: This configuration works with GD 1.3-6 and Freetype 1.x. When we try to upgrade to PHP 4.1.2 with the same configuration, we can't use the ImageTTF* functions. We tried to add --with-ttf to the configuration with the result that apache wouldn't start (complained about gdImageResolveColor). We use apache 1.3.20, btw. The following patch fixed it for me: diff -r -U3 php-4.1.2/ext/gd/php_gd.h php-4.1.2.gd/ext/gd/php_gd.h --- php-4.1.2/ext/gd/php_gd.h Sat Aug 25 06:07:07 2001 +++ php-4.1.2.gd/ext/gd/php_gd.hThu Feb 28 15:03:02 2002 @@ -66,7 +66,7 @@ PHP_MSHUTDOWN_FUNCTION(gd); #ifndef HAVE_GDIMAGECOLORRESOLVE -static int gdImageColorResolve(gdImagePtr, int, int, int); +extern int gdImageColorResolve(gdImagePtr, int, int, int); #endif PHP_FUNCTION(imagearc); PHP_FUNCTION(imagechar); ...R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Opera broswer file upload
Look here for more info about file upload problems with Opera: http://bugs.php.net/search.php?cmd=displaysearch_for=operax=0y=0 Andrey - Original Message - From: Vlad Kulchitski [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 14, 2002 5:57 PM Subject: [PHP] Opera broswer file upload Also another question, my fileupload works everywhere (IE, Netscape) but Opera. Does Opera support it at all? My fileupload is very simple. It checks is the file is JPEG/GIF/BMP and then saves it, if not, gives an error message. Vlad -- 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] Cookies not expiring
Also you have to close all instances of the browser for this to occur. That is even if you close the browser that has a session to the site if you have another window open to any other site then the cookie stays. OK...that looks valid. Now, what indications are you getting that the cookie is not expiring when you close the browser? As far as expiring when user leaves the web-site? M.C. Hammer said it best...can't touch that -Original Message- From: David McInnis [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 9:04 AM To: 'Rick Emery'; [EMAIL PROTECTED] Subject: RE: [PHP] Cookies not expiring Here is what I am using to set my cookie. $cp_sessionid = $CP_partnerid . _ . uniqid(str_pad(getenv(REMOTE_ADDR), 15, 0)); setcookie('cp_sessionid', $cp_sessionid); David McInnis -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 6:01 AM To: 'David McInnis'; [EMAIL PROTECTED] Subject: RE: [PHP] Cookies not expiring Can't read your mind, bud. Show us your code... -Original Message- From: David McInnis [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 2:25 AM To: [EMAIL PROTECTED] Subject: [PHP] Cookies not expiring I understand that if an expiration time is not set, the cookie should expire at the end of the session (when the browser is closed). This is not happening. What is wrong here? I would actually prefer for the cookie to expire when the user left the Web site. Any ideas? Thanks, -- David A McInnis Information Technology Manager CareerPerfect.com(r) -- solutions for a perfect career(sm) -- 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 -- Ray Todd Stevens Specialists in Network and Security Consulting Senior ConsultantSoftware audit service available Stevens Services Suite 21 3754 Old State Rd 37 N Bedford, IN 47421 (812) 279-9394 [EMAIL PROTECTED] Thought for the day: Intuition (n): an uncanny sixth sense which tells people that they are right, whether they are or not. For PGP public key send message with subject please send PGP key If this message refers to an attachment the attachment may arrive as a seperate mail message depending on the type of mail client and gateway software you are using. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Opera broswer file upload / MY CODE
On Friday 15 March 2002 00:10, Vlad Kulchitski wrote: This is the code I am using for uploading: if(($userfile) ($userfile != none)) { $type=basename($userfile_type); [snip] Hmm, Andrey says the bug has been fixed and committed to the CVS. But looking at the bug reports there have been quite a number of fixes for Opera, and uploads against various versions of PHP. So your best bet is to search at http://bugs.php.net for your particular version of php and see what comes up. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* He who hates vices hates mankind. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simple yet weird... help pls
Please take a look at the script below. If i want to show an image it doesnt work if it's under an if statement. Why in this case? ? $feedb=0; if($feedb==0){ echo img scr='somepic.jpg';} echo img src='somepic.jpg'; ? How can i solve this problem? By spelling src correctly. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing an array as an argument
Hello, I've built a function that receives an array as an argument to create an HTML drop-down list, but when I try to print the list this is all I got: select name=my_list option value=Array[0]Array[1] option value=Array[0]Array[1] /select This is my code: --- Function TextList($sName, $aOptions) { $nCount = Count($aOptions); //Counts the elements of the array Print(select name=\$sName\\n); For ($i = 1; $i = $nCount; $i++) { Print( option value=\$aOptions[1][0]\$aOptions[1][1]\n); } Print(/select\n); } */ Now I build the array */ $my_array = Array( Array(0,0), Array(1,Enero), Array(2,Febrero), Array(3,Marzo), Array(4,Abril); */ And call the function */ TextList(my_list, $my_array); I need to know how exaclty can I pass and receive an array as a function argument. Hope you can help me, TIA. -- Mauricio Cuenca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing an array as an argument
Hello, I've built a function that receives an array as an argument to create an HTML drop-down list, but when I try to print the list this is all I got: select name=my_list option value=Array[0]Array[1] option value=Array[0]Array[1] /select This is my code: --- Function TextList($sName, $aOptions) { $nCount = Count($aOptions); //Counts the elements of the array Print(select name=\$sName\\n); For ($i = 1; $i = $nCount; $i++) { Print( option value=\$aOptions[1][0]\$aOptions[1][1]\n); } Print(/select\n); } */ Now I build the array */ $my_array = Array( Array(0,0), Array(1,Enero), Array(2,Febrero), Array(3,Marzo), Array(4,Abril); */ And call the function */ TextList(my_list, $my_array); I need to know how exaclty can I pass and receive an array as a function argument. Hope you can help me, TIA. -- Mauricio Cuenca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing an array as an argument
You can't put $a[][] inside a qouted string like that. Either use ${a[][]} or put it outside like this: Print( option value=\.$aOptions[1][0].\.$aOptions[1][1].\n); -Rasmus On Thu, 14 Mar 2002, Mauricio Cuenca wrote: Hello, I've built a function that receives an array as an argument to create an HTML drop-down list, but when I try to print the list this is all I got: select name=my_list option value=Array[0]Array[1] option value=Array[0]Array[1] /select This is my code: --- Function TextList($sName, $aOptions) { $nCount = Count($aOptions); //Counts the elements of the array Print(select name=\$sName\\n); For ($i = 1; $i = $nCount; $i++) { Print( option value=\$aOptions[1][0]\$aOptions[1][1]\n); } Print(/select\n); } */ Now I build the array */ $my_array = Array( Array(0,0), Array(1,Enero), Array(2,Febrero), Array(3,Marzo), Array(4,Abril); */ And call the function */ TextList(my_list, $my_array); I need to know how exaclty can I pass and receive an array as a function argument. Hope you can help me, TIA. -- Mauricio Cuenca -- 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] putting a url in an anchor tag
Hello, I've been playing with this since lastnight. I have a string of text...Example: This is a test string of test, please go to http://www.google.com now. I need something that will catch the http://www.google.com; part, and make into a link instead of just plain text. Does anyone know how I should go about doing this? I've looked through a few code repositories, but haven't found anything. Thanks, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Readfile() Download Issues
Hi, I'm having trouble supporting Internet Explorer 5.5 and earlier versions in a PHP download script. People are reporting that the file comes out as 'download.htm'. Here is the code in my download.php: $len = filesize($file); header(Content-type: application/zip); header(Content-Length: $len); header(Content-Disposition: attachment; filename=$filename); readfile($file); Other browsers appear to work fine. An thoughts? Thanks, Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] putting a url in an anchor tag
Here's a function that was sent to me in response to me needing the exact same thing: function pb_t2h_URLMarkup ($Text, $StyleClass = '', $Target = '') { if ($StyleClass != '') $ClassS = class='$StyleClass'; else $ClassS = ; if ($Target != '') $TargetS = target='$Target'; else $TargetS = ''; /* Match for URL strings (the part after 'http://'). Only does quite * loose matching. Handles URL parameters and urlencoded chars (%xy). * '' chars have to be treated specially because htmlentities() * converts them to '' */ $URLSMatch = '([\w\.\/~\?%=\-\]|)+)'; $Patterns = array ('/([^\']|\A)(http:\/\/' . $URLSMatch . '/', '/([^\'])(ftp:\/\/[\w\.\/~\-]+)/', '/([^\'\w-\.\/]|\A)(www\.' . $URLSMatch . '/', '/([^\'\w\.~\-=]+@[\w\.~\-]+)/'); $Replacements = array (\\1a href='\\2'$ClassS$TargetS\\2/a, \\1a href='\\2'$ClassS$TargetS\\2/a, \\1a href='http://\\2'$ClassS$TargetS\\2/a, a href='mailto:\\1'$ClassS\\1/a); return preg_replace ($Patterns, $Replacements, $Text); } At 10:35 AM 3/14/2002 -0600, Tyler Longren wrote: Hello, I've been playing with this since lastnight. I have a string of text...Example: This is a test string of test, please go to http://www.google.com now. I need something that will catch the http://www.google.com; part, and make into a link instead of just plain text. Does anyone know how I should go about doing this? I've looked through a few code repositories, but haven't found anything. Thanks, Tyler -- 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] posting without a from
I am trying to post to another server without a form. The input is from a form on my server. I log the entry in MySQL and then pass the input to this function to open the connection and return a query result. The post to the other server requires authentication in the form of USERID and PASSWORD. At first this function returned HTTP 1.1/ Authentication Required and now it is timing out. Incidentally, I have posted this data directly from a form with no problems. Anyone know why this isn't working? function process_CRIS($USERID, $PASSWORD, $S_S, $S_M, $SRCH__LNAME, $SRCH__FNAME) { $url = http://10.0.0.10/premium/comb/Results.phtml;; $url = preg_replace(^http://i;, , $url); $host = substr($url, 0, strpos($url, /)); $uri = strstr($url, /); $UserID = ; $Password = x; $reqbody=USERID=.urlencode($UserID); $reqbody=$reqbody.PASSWORD=.urlencode($Password); $reqbody = $reqbody.S_S=.urlencode($S_S); // $S_S can consist of an array of possible search parameters that need to be concatenated to ab,ac,ad, etc. if (isset($S_S)){ foreach($S_S as $key=$val) { if ($key == 0){ $reqbody = $reqbody.S_S=.urlencode($val);} else {$reqbody = $reqbody.,.urlencode($val);} } } if (isset($S_M)){ foreach($S_M as $key=$val) { if ($key == 0){$reqbody = $reqbody.S_M=.urlencode($val);} else {$reqbody = $reqbody.,.urlencode($val);} } } $reqbody = $reqbody .SRCH__LNAME=.urlencode($SRCH__LNAME).SRCH__FNAME=. urlencode($SRCH__FNAME); $contentlength = strlen($reqbody); $reqheader = POST $uri HTTP/1.1\r\n. Host: $host\n. Content-Type: application/x-www-form-urlencoded\r\n. Content-Length: $contentlength\r\n. $reqbody\r\n; $socket = fsockopen($host, 80, $errno, $errstr); if (!$socket) { $result = Error: .$errno. $errstr; return $result; exit; } fputs($socket, $reqheader); $result = fgets($socket, 4096); fclose($socket); return $result; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Format of browser image requests
Please CC me, I'm on digest --- Has anyone looked at what the browsers send when they request stuff like: images flash Real Audio etc Do they send the cookies/post/get vars from the previous page, the requesting URI, or anything but the request? This is in reference to possibly preventing things like: http://mydomain.com/images/image_I_only_want_seen_in_pages.jpg -- If You want to buy computer parts, see the reviews at: http://www.cnet.com/ **OR EVEN BETTER COMPILATIONS**!! http://sysopt.earthweb.com/userreviews/products/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Get row number from mysql
Rick, I agree. opinionRow ids should be for internal database use. SQL frees us from needing them. /opinion Tyler, what order do you want these records returned in? That is what goes into the ORDER BY clause. If, for example, it is alphabetical order of NAME then use ORDER BY NAME. If it is the order in which people are entered into the database then I would either use a sequence and enter that into a person_id or sequence field, alternatively put a date/time stamp into a person_entered_at field. These result in ORDER BY PERSON_ID, ORDER BY SEQUENCE and ORDER BY PERSON_ENTERED_AT respectively. I'd narrow the question down to what is it about first person, second person and third person that makes them first, second and third.. If we know that then I think we may be able to help better. Hope this helps. Regards Chris Rick Emery wrote: The greater question: Why does irow order matter? What are you REALLY trying to do? == In article 000701c1cb06$3b54f3b0$0101a8c0@nightengale, [EMAIL PROTECTED] says... Hello, How can I get the number of the current row, something like this: ? $sql = mysql_query(SELECT * FROM table ORDER BY id DESC); while ($row = mysql_fetch_array($sql)) { $id = $row[id]; $name = $row[name]; print $current_row_number. $nameBr; } ? I can't just use the id field, because the ID's might not always be 1, 2, 3, 4, 5, 6, etc...they could go 1, 2, 4, 5, 8. I need it to look like this: 1. first person 2. second person 3. third person and so on and so forth. Can anyone advise me on how I should do this? thanks, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] header(Location:) problem with Netscape
I'm working on a app that uses the header(Location) is the middle of the file, but since I'm using output buffering it shouldn't matter. The application works fine in Mozilla, Konqueror, and IE, but not in Netscape 4 or 6. I don't get the error that the headers have already been written error, it just loads the page as if the header(Location:) was commented out. Some of my thoughts on the subject. I'm redirecting to $PHP_SELF is Netscape trying to be extra smart and think it doesn't have to refresh? I'm using gzip compression in output buffering, maybe there is a situation where Netscape 4 6 may not use the gzip compression, hence causing the output buffering not to work correctly? But if that was the case I should see the error about headers already been written. Any suggestions would be great, thanks. -- Jeff Bearer, RHCE Webmaster PittsburghLIVE.com 2002 EPpy Award, Best Online U.S. Newspaper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header(Location:) problem with Netscape
Jeff, I just had this problem! Using $PHP_SELF did not work with Netscape 4.7 for some reason. I was using it in form submissions and kept getting the error 'Method Not Allowed'. My fix was simple, I just hard coded the action url since. If you really need $PHP_SELF, I don't know what the fix is. I also tried getenv(PHP_SELF) and $_SERVER[PHP_SELF] without any luck. Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] On Thursday, March 14, 2002, at 10:29 AM, Jeff Bearer wrote: I'm working on a app that uses the header(Location) is the middle of the file, but since I'm using output buffering it shouldn't matter. The application works fine in Mozilla, Konqueror, and IE, but not in Netscape 4 or 6. I don't get the error that the headers have already been written error, it just loads the page as if the header(Location:) was commented out. Some of my thoughts on the subject. I'm redirecting to $PHP_SELF is Netscape trying to be extra smart and think it doesn't have to refresh? I'm using gzip compression in output buffering, maybe there is a situation where Netscape 4 6 may not use the gzip compression, hence causing the output buffering not to work correctly? But if that was the case I should see the error about headers already been written. Any suggestions would be great, thanks. -- Jeff Bearer, RHCE Webmaster PittsburghLIVE.com 2002 EPpy Award, Best Online U.S. Newspaper -- 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] Data from multipart/form-data goes missing
(Sorry if this is a duplicate post; I sent it through the news server but began to think that might not be forwarding posts to the list) For some reason, on just one server, data from forms posted with ENCTYPE=multipart/form-data never makes it to the PHP script. We use this extremely simple test script: form method=post enctype=multipart/form-data action=?= $PHP_SELF ? !--form method=post action=?= $PHP_SELF ?-- input name=textbox input type=submit /form pre ?= var_dump($_REQUEST) ?hr?= $GLOBALS['CONTENT_LENGTH'] ? /pre And on this one server, no output shows unless the first form tag is commented and the second uncommented. On all other servers, with apparently identical configuration, form data appears normally. In all cases the Content_Length value rises and falls with the length of the string I type into the text box. The build on this server (PHP 4.1.2) is extremely simple: ./configure --with-apache=../apache_1.2.23 --with-mysql Apache is built with PHP and mod_rewrite. Any ideas? miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Data from multipart/form-data discarded
For some reason, on just one server, data from forms posted with ENCTYPE=multipart/form-data never makes it to the PHP script. We use this extremely simple test script: form method=post enctype=multipart/form-data action=?= $PHP_SELF ? !--form method=post action=?= $PHP_SELF ?-- input name=textbox input type=submit /form pre ?= var_dump($_REQUEST) ? /pre And on this one server, no output shows unless the first form tag is commented and the second uncommented. On all other servers, with apparently identical configuration, form data appears normally. The build on this server (PHP 4.1.2) is extremely simple: ./configure --with-apache=../apache_1.2.23 --with-mysql Any ideas? miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can Event Handlers Trigger PHP Code?
My question is can event handlers on form objects trigger PHP code? input type=submit name=submit value=Submit Form onclick='PHP CODE HERE' Or even an onsubmit event handler on forms? If something like this is possible, could any of you tell me how? I've tried, and tried. I've used PHP tags inside the event handler input type=submit name=submit value=Submit Form onclick='? PHP CODE HERE ?' But the result is that the event handler is blank input type=submit name=submit value=Submit Form onclick='' since the interpreter hides any PHP code. Thus nothing happens on the event. Any help is appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamically fill list box
Sorry... The error I get on members.php page is if ( == paid) is printed if 'paid' is selected or if ($paid == no) is printed if 'not paid' is selected from this piece of code print trtd class=LabelColumnPaid:/tdtd class=TextColumnselect name='paid' value='$row-paid' option value='if ($paid == paid)'paid/option option value='if ($paid == no)'not paid/option /select/td/tr; - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 14, 2002 9:36 PM Subject: Re: [PHP] dynamically fill list box On Thursday 14 March 2002 16:07, gee wrote: A real newbie would be grateful for some help. I have a sports club membership database (Mysql) with first and last names, address and paid or not paid. In edit.php I would like to be able to pre-fill a list box with whether the person has paid or not, change if necessary, update the database and view the resultant changes in members.php I have tried the following in edit.php but can't get it to work. By stating *how* it doesn't work makes it easier for others to help you. For starters, do you get any errors? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* I hope you millionaires are having fun! I just invested half your life savings in yeast!! */ -- 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