[PHP] Fw: problems with php and jscript....
- Original Message - From: Silvia Mahiques To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, November 12, 2001 9:04 PM Subject: problems with php and jscript I have written an html page with jscript and php code, but I have some problems. The errors are in black letter: why is not correct this code? ?php include(configuration.php4); global $g_language; $lang = $g_language; ? HTML HEAD meta http-equiv=Content-Type content=text/html; charset=windows-1252 META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=iso-8859-1 script language=JavaScript !-- BtOver = (((navigator.appName == Netscape) (parseInt(navigator.appVersion) = 3 )) || ((navigator.appName == Microsoft Internet Explorer) (parseInt(navigator.appVersion) = 4 ))); function BtPreload(img) { var a=new Image(); a.src=img; return a; } if(BtOver) { BnavN_Info=BtPreload('images/button_informacion.jpg'); BnavO_Info=BtPreload('images/button_informacion_over.jpg'); BnavN_eInfo=BtPreload('images/button_information.jpg'); BnavO_eInfo=BtPreload('images/button_information_over.jpg'); } function process_mouse_over(obj){ if (document.lang.value==0){ obj.src = BnavO_Info.src ; } else obj.src=BnavO_eInfo.src; } // -- /script /HEAD BODY BGCOLOR=#00 input type=hidden name=lang CENTER TABLE WIDTH=775 BORDER=0 CELLPADDING=0 CELLSPACING=0 TR TD !-- BOTON INFORMACION -- a href=frm_information.htm onmouseover=process_mouse_over(document.Bnav_Info) onmouseout=if(BtOver) document['Bnav_Info'].src=BnavN_Info.src IMG SRC=images/button_informacion.jpg BORDER=0 WIDTH=175 HEIGHT=75 name=Bnav_Info/abr/TD . /TABLE /CENTER /BODY /HTML If somebody has an idea, please, help me Silvia Mahiques
[PHP] Weird database stuff.
Hey fellow PHP-codemonkeys. :) Let me start by laying out some facts: SELECT e.NAME AS customer, g.NAME AS driver_lastname, g.FIRSTNAME AS driver_firstname, $CommonSQL, COUNT(g.NAME) AS number FROM ENTITY e, ENTITY g, EXPERTISE_FILE f, DAMAGE_CASE d WHERE (f.CUSTOMER = '$CustomerID') AND (e.ID = f.CUSTOMER) AND (g.ID = f.DRIVER) AND (d.OWNER_EXP_FILE = f.ID) AND (f.DATE_REPORT BETWEEN '$StartDate' AND '$EndDate') GROUP BY e.NAME, g.NAME, g.FIRSTNAME The query above is one of the statistics gathering queries in my application. This one will run flawlessly. If however I add this condition: AND (f.DRIVER = '$DriverID') before AND (g.ID = f.DRIVER), the script will eat all CPU and RAM (and eventually swap aswell) on my PowerEdge 2500SC. If I run both queries from inside psql (I use PostgreSQL), they -both- (!) complete within split seconds... If I leave set_time_limit() on the default of 30 secs, my script will time out somewhere around these lines (though it seems like coincidence...): function CalcDenied ( $Requested, $Agreed ) { $Denied = $Requested - $Agreed;-- Timeout here if ($Denied 0) -- Sometimes here { $Denied = 0; } return $Denied; } To me, this does not seem to make any sense, especially since the first query (without the additional condition) runs fine, whilst it has to return many more rows. Does anyone have any idea what could be going on? If you reply, please include a CC for me, as I am on digest (I don't have time to sort through all the messages at work anyway, but I do contribute from home. :) Thanks -- Alexander Deruwe ([EMAIL PROTECTED]) AQS-CarControl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Regular Expression
I am just learning them, but I think something like this may be in order... I know that you would use the | (or) operator. if(! (ereg('^[a-z|A-Z|0-9|\-]+$', $fn) (ereg('^[a-z|A-Z|0-9|\-]+$', $fs))) { Either $fn or $sn failed the match } -Jason Garber IonZoft.com At 04:41 PM 11/13/2001 +0930, [EMAIL PROTECTED] wrote: Hi All- This is probably very simple for most of you. I have the following statement if ((ereg('[^([:alnum:]|\-)]',$fn)) || (ereg('[^([:alnum:]|\-)]',$sn))) { // Do something here } What it's doing is checking two variables to make sure they contain only alphanumeric characters. I have a requirement that hyphens (-) be allowed in $fn and $sn as well. What do I need to add to the regular expression to allow hyphens? I know this is a relatively silly question. I plan on buying a book on regular expressions today and learning as much as I need to know about building them. Cheers. Regards, Adam Whitehead Systems Developer - Computer Support and Maintenance Ph. (08) 8936 3164 ** Mobile (0411) 241 120 E-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] anti-alias
Hello, I have a little question about the GD-Lib. Is it possible to parse anti-aliassed text? This would be very interesting because anti-aliassed buttons are more beatiful! Thanks, Sjoerd van Oosten Digitaal vormgever [EMAIL PROTECTED] Datamex E-sites B.V. http://www.esites.nl Minervum 7368 Telefoon: (076) 5 730 730 4817 ZH BREDA Telefax: (076) 5 877 757 ___ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Regular Expression
if (count(preg_grep('/(([0-9a-zA-Z]+)|\-)/',array($fn,$sn)))==2){ } Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS - Original Message - From: Jason G. [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, November 13, 2001 10:18 AM Subject: Re: [PHP] Regular Expression I am just learning them, but I think something like this may be in order... I know that you would use the | (or) operator. if(! (ereg('^[a-z|A-Z|0-9|\-]+$', $fn) (ereg('^[a-z|A-Z|0-9|\-]+$', $fs))) { Either $fn or $sn failed the match } -Jason Garber IonZoft.com At 04:41 PM 11/13/2001 +0930, [EMAIL PROTECTED] wrote: Hi All- This is probably very simple for most of you. I have the following statement if ((ereg('[^([:alnum:]|\-)]',$fn)) || (ereg('[^([:alnum:]|\-)]',$sn))) { // Do something here } What it's doing is checking two variables to make sure they contain only alphanumeric characters. I have a requirement that hyphens (-) be allowed in $fn and $sn as well. What do I need to add to the regular expression to allow hyphens? I know this is a relatively silly question. I plan on buying a book on regular expressions today and learning as much as I need to know about building them. Cheers. Regards, Adam Whitehead Systems Developer - Computer Support and Maintenance Ph. (08) 8936 3164 ** Mobile (0411) 241 120 E-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Regular Expression
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Adam Whitehead) wrote: if ((ereg([^[:alnum:]],$fn)) || (ereg([^[:alnum:]],$sn))) { // Do something here } What it's doing is checking two variables to make sure they contain only alphanumeric characters. I have a requirement that hyphens (-) be allowed in $fn and $sn as well. What do I need to add to the regular expression to allow hyphens? Insert it as the last item in the character class: [^[:alnum:]-] -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP CGI
i have .htaccess on root of my web: ErrorDocument 400 /e.php ErrorDocument 401 /e.php ErrorDocument 403 /e.php ErrorDocument 404 /e.php ErrorDocument 500 /e.php When i try get via http an nonexisten html document : noneasdfaasd.html i got result of e.php script. When i try to get nonexisten dfsdfksf.php i got Internal Server Error of Apache ,- not result of working e.php .. Any suggestions , why it happens? Arsen Kiriilov http://www.softm.h1.ru/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] mail() with mailing lists problem
True. I had the attachment outside of the function (encoding once) but this is a leftover of debugging and trying to get it to work. I hadn't thought of Bcc-ing everybody. I'll try that, thanks. Still doesn't solve the problem, though. Maybe a socket is the answer. -Original Message- From: TD - Sales International Holland B.V. [mailto:[EMAIL PROTECTED]] Sent: 12 November 2001 04:15 To: Rudolf Visagie Subject: Re: [PHP] mail() with mailing lists problem If you send the same message over and over wouldn't it be a LOT wiser to BCC the rest of the people? This way you are MIME-encoding the attachment over and over which consumes a lot of resources. MIME-encoding a 10MB file will suck up a P-III 600 for 20 to 30 secs or so depending on other background processes and diskspeed. MIME encoding the same attachment a 1000 times doesn't appear really fast to me. Also, with all the headers you use, you could just as well open a socket to the SMTP service, then you could have additional error checking I guess... Just some thoughts.. regards On Monday 12 November 2001 13:47, you wrote: Hi All, While everybody is on this topic, here's a problem I have been having. I use mail() in a function in a loop to send e-mail with an attachment. The e-mails get sent out to the different recipients but only the last one gets sent correctly. The rest loses the 'From:' somewhere so that the message ends up with the server name as from who and with the encoded attachment inside of the message body. Here's the function: function mail_attachment ($to, $subject, $message, $addr_from, $attachment, $filename) { /* This function sends an e-mail with a file attachment using the standard PHP mail function with parameters $to, $subject and $message. The $attachment parameter is a string with the attachment file content with filename $filename. */ $boundary = b.md5(uniqid(time())); $mime = From: $addr_from\n; $mime .= Reply-To: $addr_from\n; $mime .= X-Mailer: Digital Healthcare Solutions\n; $mime .= X-Sender: $addr_from\n; $mime .= Content-type: multipart/mixed; ; $mime .= boundary = $boundary\n\n; $mime .= This is a MIME encoded message.\n\n; // First the regular message $mime .= --$boundary\n; $mime .= Content-type: text/plain\n; $mime .= Content-Transfer-Encoding: base64; $mime .= \n\n.chunk_split(base64_encode($message)).\n; // Now the attachment $mime .= --$boundary\n; $mime .= Content-type: text/plain\n; $mime .= Content-Transfer-Encoding: base64\n; $mime .= Content-Disposition: attachment; ; $mime .= filename = .chr(34).$filename.chr(34); $mime .= \n\n.chunk_split(base64_encode($attachment)).\n; $mime .= --$boundary--; mail ($to, $subject, , $mime); } and here's the loop in which it gets called: $i = 0; while (isset($EmailAddress[$i])) { mail_attachment ($EmailAddress[$i], URGENT Communication, $message, $addr_from, $attachment, $filename); $i++; } Does anybody have any ideas? Rudolf Visagie Principal Software Developer Digital Healthcare Solutions Tel. +27(0)11 266 6946 Fax. +27(0)11 266 5080 Cell: +27(0)82 895 1598 E-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Solution for testing PHP/MS Access on Linux
Hello, some days ago I asked help on this list because I have to develop and test on Linux/Apache some PHP pages that will have to run on on an IIS/NT box. On the real server the pages must manage a MS Access database via ODBC (this mixed setup cannot be changed: explanations in the original message). Now, first of all I would like to thank everybody for their help, and ask about the following solutions. I know they're awkward, but I must make it work ASAP (and performance is not a problem, even the real server is a relatively low traffic site) 1) I could convert the Access DB to Mysql and then write PHP pages which use a wrapper layer for all standard db management calls (as explained in the PHP Developer's Cookbook, chapter 6). Then the only change needed before uploading on the server would be the include of the file with the wrapper functions. In this way I could test all the DB management part of PHP on Linux/MySQL and be sure that it will work on NT/Access also. 2) I could recreate a Mysql database with the same tables on Linux, and access it indirectly from PHP using the ODBC/MySQL interface. In this way the I would be using ODBC in both cases. I guess this would give bet ter performance, as the wrapper layer is not needed anymore, right? What do you think about: which solution is easier to set up? which gives more guarantees that the PHP code will work transparently? did anybody do it before? any other issue (performance, stability, whatever) TIA, mweb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] even or not
Hello, How can is check with php wether a number is even or not? What i want is that in a while loop the background color of a cell changes! Thanks, Sjoerd van Oosten Digitaal vormgever [EMAIL PROTECTED] Datamex E-sites B.V. http://www.esites.nl Minervum 7368 Telefoon: (076) 5 730 730 4817 ZH BREDA Telefax: (076) 5 877 757 ___ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Can If Else statements be split into code blocks??
Try putting curly brackets around the if and else clauses. I'm guessing the embeded html form counts as another statement in the program, which means you want to execute 2 statements if the strstr is true. I ALWAYS use curly brackets, even if I'm only executing one statemenet in my if, and I've never had problems with stuff like this. So... ?php if (strstr($DomResults,$Match)) { print Congratulations! $domain.$suffix is available!; ? form method=POST action=step2.asp name=form2 pinput type=submit value=Register name=B1/p /form ?php } else { print Sorry, $domain.$suffix is already taken.; } ? Should hopefully work... Richy -Original Message- From: Brad Melendy [SMTP:[EMAIL PROTECTED]] Sent: 13 November 2001 09:16 To: [EMAIL PROTECTED] Subject:[PHP] Can If Else statements be split into code blocks?? Hello, I'm trying to execute some HTML in an IF ELSE statement. I'm trying something like: ?php if (strstr($DomResults,$Match)) print Congratulations! $domain.$suffix is available!; ? form method=POST action=step2.asp name=form2 pinput type=submit value=Register name=B1/p /form ?php else print Sorry, $domain.$suffix is already taken.; ? Basically, it works great without the form I'm trying to insert, but with the form after the IF statement, it fails. Is what I want to do against the rules? I'm converting an ASP script I have to PHP and I have it all working under ASP. That means it should be eaiser with PHP right? ;-) Thanks in advance. ...Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] even or not
OSv How can is check with php wether a number is even or not? What i want is OSv that in a while loop the background color of a cell changes! Try echo (($i++ % 2) == 0) ? #FFBR : #00FF00BR; First it performs an integerdivision and checks if the remainder is 0. If that is the case it prints FF if the remainder is 1 it prints 00FF00 Finally is increments $i. -- Kind regards, Morten Winkler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re[2]: [PHP] Can If Else statements be split into code blocks??
RB ?php RB if (strstr($DomResults,$Match)) RB print Congratulations! $domain.$suffix is available!; ? RB form method=POST action=step2.asp name=form2 RB pinput type=submit value=Register name=B1/p RB /form RB ?php RBelse RB print Sorry, $domain.$suffix is already taken.; ? You definitely needs curly brackets. Kind regards, Morten Winkler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] for loop problem?
Tyler, It must be something weird with your NT version of MySQL, you might try asking on the MySQL list, or checking the bug list on mysql.com. I have an even older version here on 95, that doesn't display any of those problems. Here's the code I used with it's output (no duplicates, I checked). Notice that I did have to change the CREATE TABLE to meet 3.21.29a-gamma restrictions. You might try changing the passcode to an int, and tacking the 'P' on the front in your application. Not sure if that's possible... John ?php /* testdb.php */ /* Win95 OSR2, Xitami v2.4d6 PHP Version 4.0.2, Zend Engine v1.0.2, Zend Optimizer v0.99 MySQL Version: MySQL 3.21.29a-gamma MyISAM only - Max key length is 256 = 11 + 245 CREATE DATABASE testdb; CREATE TABLE passcodes ( id int(11) NOT NULL auto_increment, passcode varchar(255) NOT NULL default '', PRIMARY KEY (id), KEY idpass (id,passcode(245)) ); */ error_reporting(E_ALL); set_time_limit (0); if (!$connection = mysql_connect('localhost','root','*')) die (Can't connect to server: . mysql_error()); if (!$db = mysql_select_db('testdb', $connection)) die (Can't select database testdb: . mysql_error()); if (!mysql_query(DELETE FROM passcodes)) die ('Delete Failed: '. mysql_error()); $value1 = 100; $value2 = 1223109; for($i=$value1; $i=$value2; $i++) { if (!mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'))) die (INSERT failed at $i: .mysql_error()); } echo 'INSERTs completed.brbr'; if (!$qid = mysql_query(SELECT id,passcode FROM passcodes ORDER BY passcode DESC LIMIT 10)) die (SELECT failed: . mysql_error()); while ($arr = mysql_fetch_array($qid)) echo $arr[0]: $arr[1]br\n; if (!mysql_close($connection)) die (Can't close connection: . mysql_error()); ? And it's output: INSERTs completed. 223110: P1223109 223109: P1223108 223108: P1223107 223107: P1223106 223106: P1223105 223105: P1223104 223104: P1223103 223103: P1223102 223102: P1223101 223101: P1223100 Hi John, MySQL Version: MySQL 3.23.44-nt SQL: CREATE TABLE passcodes ( id int(11) NOT NULL auto_increment, passcode varchar(255) NOT NULL default '', PRIMARY KEY (id), KEY id (id,passcode) ) TYPE=MyISAM; I'm beginning to think it's a MySQL problem also because this PHP SHOULD work. Tyler - Original Message - From: John Steele [EMAIL PROTECTED] To: PHP General List [EMAIL PROTECTED] Sent: Monday, November 12, 2001 3:33 PM Subject: Re: [PHP] for loop problem? Hi Tyler, This doesn't sound like a problem with PHP, but MySQL. Can you show your CREATE TABLE and MySQL version? John Hi Martin, I just got done doing that, and i got the same thing! :-( Here's something interesting though. There's an id field that's set to AUTO_INCREMENT. I did a SELECT * FROM passcodes WHERE passcode='P100' This gave me this: id | passcode --- 1 |P100 82145 |P100 209398 |P100 Shouldn't the ID's be further apart than that? Know what I'm saying? Tyler - Original Message - From: Martin Towell [EMAIL PROTECTED] To: 'Tyler Longren' [EMAIL PROTECTED]; Jack Dempsey [EMAIL PROTECTED] Cc: PHP-General [EMAIL PROTECTED] Sent: Monday, November 12, 2001 10:45 PM Subject: RE: [PHP] for loop problem? How about changing the logic lightly? try this: $value1 = 0; $value2 = 223109; for($i=$value1; $i=$value2; $i++) { $tmp = sprintf(1%06d\n, $i); mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$tmp')); basically taking away 1,000,000 from the numbers then adding it back on later Martin T -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 3:38 PM To: Jack Dempsey Cc: PHP-General Subject: Re: [PHP] for loop problem? I've ran it a few times without the MySQL code in there. Runs just fine that way for me too. After it's run a few times for me (with the MySQL code), I start getting duplicate entries of codes in there. For example, I'll end up with a few 'P100' entries in the 'passcodes' field. Oh well, here I come perl! Thanks, Tyler - Original Message - From: Jack Dempsey [EMAIL PROTECTED] To: Tyler Longren [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, November 12, 2001 10:43 PM Subject: RE: [PHP] for loop problem? ran it (without mysql queries) and worked finereal strange. have you tried the loop without the mysql queries? -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Monday, November 12, 2001 11:28 PM To: Jack Dempsey; [EMAIL PROTECTED] Subject: Re: [PHP] for loop problem? Exact code: ? $connection = mysql_connect(host_here,user_here,pass_here); $db = mysql_select_db(db_here, $connection); $value1 = 100; $value2 = 1223109; for($i=$value1; $i=$value2; $i++) { mysql_query(INSERT
[PHP] Any easy way of finding yesterday...?
It is easy to use the function getDate() to obtain the date of today. But instead of writing plenty of conditions, is there any easy way to get the date of yesterday? Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Any easy way of finding yesterday...?
$yesterday = mktime(0,0,0,date(m),date(d) -1,date(Y)); Sjoerd van Oosten Digitaal vormgever [EMAIL PROTECTED] Datamex E-sites B.V. http://www.esites.nl Minervum 7368 Telefoon: (076) 5 730 730 4817 ZH BREDA Telefax: (076) 5 877 757 ___ -Oorspronkelijk bericht- Van: Harry Lau [mailto:[EMAIL PROTECTED]] Verzonden: dinsdag 13 november 2001 10:36 Aan: [EMAIL PROTECTED] Onderwerp: [PHP] Any easy way of finding yesterday...? It is easy to use the function getDate() to obtain the date of today. But instead of writing plenty of conditions, is there any easy way to get the date of yesterday? Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Extracting table names
Hi, I am relatively new to mysql - I'm developing a site using mysql php. I need to populate a drop down menu with all of the table names in a database. I can do standard queries (SELECT * FROM blah WHERE ...) but I'm having trouble returning all of the table names. Can anyone help? Thanks, Damien -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] File Upload Form
Hello, The PHP manual provides a method for File Upload. The sample code is as follows: FORM ENCTYPE=multipart/form-data ACTION=_URL_ METHOD=POST INPUT TYPE=hidden name=MAX_FILE_SIZE value=1000 Send this file: INPUT NAME=userfile TYPE=file INPUT TYPE=submit VALUE=Send File /FORM While this works when this is part of an HTML page, it strangely does not work when it is part of a PHP3 file. I found this to be problem with my PHP page after some struggle. Any reasons why this does not work in a PHP3 file? Regards, Sharat * Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Any easy way of finding yesterday...?
Following is a solution... $now = getdate(); $today = date(d-m-Y); $yesterday = date(d-m-Y,mktime(0,0,0,$today['mon'],$today['mday']-1,$today['year']); echo(Today is . $today . and yesterday was . $yesterday); Harry Lau [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... It is easy to use the function getDate() to obtain the date of today. But instead of writing plenty of conditions, is there any easy way to get the date of yesterday? Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Any easy way of finding yesterday...?
Oh what a big mistake...sorry! $now = getdate(); $today = date(d-m-Y); $yesterday = date(d-m-Y,mktime(0,0,0,$now['mon'],$now['mday']-1,$now['year']); echo(Today is . $today . and yesterday was . $yesterday); Harry Lau [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Following is a solution... $now = getdate(); $today = date(d-m-Y); $yesterday = date(d-m-Y,mktime(0,0,0,$today['mon'],$today['mday']-1,$today['year']); echo(Today is . $today . and yesterday was . $yesterday); Harry Lau [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... It is easy to use the function getDate() to obtain the date of today. But instead of writing plenty of conditions, is there any easy way to get the date of yesterday? Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Extracting table names
Hallo Damien, Tuesday, November 13, 2001, 10:39:31 AM, you wrote: I am relatively new to mysql - I'm developing a site using mysql php. I need to populate a drop down menu with all of the table names in a database. I can do standard queries (SELECT * FROM blah WHERE ...) but I'm having trouble returning all of the table names. SHOW TABLES FROM $DB; -- Thargor mailto:[EMAIL PROTECTED] http://www.vergessene-welt.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Very non-PHP (this is Java)
This time VERY non-php, but I trust you guys! ;) Are Java applets stored automatically to cache? Can I prevent it somehow? Niklas
[PHP] Re: Any easy way of finding yesterday...?
[EMAIL PROTECTED] (Harry Lau) wrote: It is easy to use the function getDate() to obtain the date of today. But instead of writing plenty of conditions, is there any easy way to get the date of yesterday? echo date(m-d-Y, mktime(0,0,0,date(n), date(d)-1, date(Y))); -- Henrik Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Problems with headers in redirect
Hi, I'm hoping someone can help me with this one... I'm doing redirects to various types of file (Flash, Office, DWF etc) and have found a problem with IE5. I pass the script a document ID, and it retrieves the document record from a database, which stores the location of the file on the web server, and redirects the browser to the document. What happens is that the browser gets redirected, but doesn't get the content-type header, and subsequently can't display the document. Until yesterday I was using javascript redirection, which worked fine. However for other reasons (ie that didn't work with IE 5.5 or IE6) I had to change to using the header(Location: ) way. Only work around I can see is to do the redirection based on browser type (i.e. one way for IE5, the other for IE5.5/IE6) but thats messy. Any other ideas??? Richy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] server side games question
Hi, Right I'm still pretty new to server side programming and have a few questions regarding the possible uses of existing technology in 'low-tech' (not 3d FPS/RTS/RPGs) online games. As I understand it PHP is used to add dynamic content to HTML (from MySQL database for example) and it is also possible to write applications in C/C++ that run on server computer (SUSE 7.2 + APACHE for example) that update databases at set time intervals. I am a games programmer and was wondering if it would be possible to code the following system which would run on an SUSE Apache server box: An database containing client and game data (use MySQL?), An HTML/PHP based front end (is PHP best choice for this?), A Some form of application that process the game or turn info (in the DB) at set time intervals and updates the game database with it (use C/C++?). I am competent in C/C++, ok at php and ok at MySQL but not sure how to fit it all together like how do I go about creating an application that process's the database? Can any one suggest sites/books/people who I could read/ask to find out more about this idea? Also are the languages I specified the best languages to use for this? I am open to suggestions and constructive criticism. Cheers, Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Weird database stuff.
Third db question today: do folk know there is a (lightly loaded) '[PHP-DB] list' with some v.competent members? Hi Alexander, - Original Message - Let me start by laying out some facts: SELECT e.NAME AS customer, g.NAME AS driver_lastname, g.FIRSTNAME AS driver_firstname, $CommonSQL, COUNT(g.NAME) AS number FROM ENTITY e, ENTITY g, EXPERTISE_FILE f, DAMAGE_CASE d WHERE (f.CUSTOMER = '$CustomerID') AND (e.ID = f.CUSTOMER) AND (g.ID = f.DRIVER) AND (d.OWNER_EXP_FILE = f.ID) AND (f.DATE_REPORT BETWEEN '$StartDate' AND '$EndDate') GROUP BY e.NAME, g.NAME, g.FIRSTNAME The query above is one of the statistics gathering queries in my application. This one will run flawlessly. If however I add this condition: AND (f.DRIVER = '$DriverID') before AND (g.ID = f.DRIVER), the script will eat all CPU and RAM (and eventually swap aswell) on my PowerEdge 2500SC. If I run both queries from inside psql (I use PostgreSQL), they -both- (!) complete within split seconds... If I leave set_time_limit() on the default of 30 secs, my script will time out somewhere around these lines (though it seems like coincidence...): function CalcDenied ( $Requested, $Agreed ) { $Denied = $Requested - $Agreed;-- Timeout here if ($Denied 0) -- Sometimes here { $Denied = 0; } return $Denied; } To me, this does not seem to make any sense, especially since the first query (without the additional condition) runs fine, whilst it has to return many more rows. Does anyone have any idea what could be going on? =I've got this sinking feeling that suggests I'm missing something obvious, but ... =Have you tried ECHOing those long SELECT statements in PHP to see how they resolve, before throwing them at PostGres? Have you tried putting an ECHO into CalcDenied() to ensure that you are getting what you, er, $Requested and that it agrees/$Agreed with what you expected? (sorry, had to ask) - the $CommonSQL bothers me for some reason... =I don't use PostGres, but the clause that you introduce does not require another index/table/resource, so on the face of it I can see no problem with the SQL - except consider using: GROUP BY customer, driver_lastname, driver_firstname =Apart from the time-out point, why do you link the SELECT and the function - what data passes between them (is it ECHOed...)? =Are you sure that the function is not being repeatedly called until the script times out (default time is 30secs) because of some never-ending loop condition - how many times is it being called per data-row? How many data rows are we talking about here? =Sorry if they're just 'shots in the dark'! =Let me know, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] mail() with mailing lists problem
Rudolph, Mail() is v.finicky! Windows machines need more than the \n - what are you running? Have you tried putting some string of characters into the (text) msg body? Can you send us a copy of the actual email msg showing the headers etc (output as received at the POP/IMAP server) - after clipping all/most of the encoded contents please? =dn - Original Message - From: Rudolf Visagie [EMAIL PROTECTED] To: TD - Sales International Holland B.V. [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: 13 November 2001 08:40 Subject: RE: [PHP] mail() with mailing lists problem True. I had the attachment outside of the function (encoding once) but this is a leftover of debugging and trying to get it to work. I hadn't thought of Bcc-ing everybody. I'll try that, thanks. Still doesn't solve the problem, though. Maybe a socket is the answer. -Original Message- From: TD - Sales International Holland B.V. [mailto:[EMAIL PROTECTED]] Sent: 12 November 2001 04:15 To: Rudolf Visagie Subject: Re: [PHP] mail() with mailing lists problem If you send the same message over and over wouldn't it be a LOT wiser to BCC the rest of the people? This way you are MIME-encoding the attachment over and over which consumes a lot of resources. MIME-encoding a 10MB file will suck up a P-III 600 for 20 to 30 secs or so depending on other background processes and diskspeed. MIME encoding the same attachment a 1000 times doesn't appear really fast to me. Also, with all the headers you use, you could just as well open a socket to the SMTP service, then you could have additional error checking I guess... Just some thoughts.. regards On Monday 12 November 2001 13:47, you wrote: Hi All, While everybody is on this topic, here's a problem I have been having. I use mail() in a function in a loop to send e-mail with an attachment. The e-mails get sent out to the different recipients but only the last one gets sent correctly. The rest loses the 'From:' somewhere so that the message ends up with the server name as from who and with the encoded attachment inside of the message body. Here's the function: function mail_attachment ($to, $subject, $message, $addr_from, $attachment, $filename) { /* This function sends an e-mail with a file attachment using the standard PHP mail function with parameters $to, $subject and $message. The $attachment parameter is a string with the attachment file content with filename $filename. */ $boundary = b.md5(uniqid(time())); $mime = From: $addr_from\n; $mime .= Reply-To: $addr_from\n; $mime .= X-Mailer: Digital Healthcare Solutions\n; $mime .= X-Sender: $addr_from\n; $mime .= Content-type: multipart/mixed; ; $mime .= boundary = $boundary\n\n; $mime .= This is a MIME encoded message.\n\n; // First the regular message $mime .= --$boundary\n; $mime .= Content-type: text/plain\n; $mime .= Content-Transfer-Encoding: base64; $mime .= \n\n.chunk_split(base64_encode($message)).\n; // Now the attachment $mime .= --$boundary\n; $mime .= Content-type: text/plain\n; $mime .= Content-Transfer-Encoding: base64\n; $mime .= Content-Disposition: attachment; ; $mime .= filename = .chr(34).$filename.chr(34); $mime .= \n\n.chunk_split(base64_encode($attachment)).\n; $mime .= --$boundary--; mail ($to, $subject, , $mime); } and here's the loop in which it gets called: $i = 0; while (isset($EmailAddress[$i])) { mail_attachment ($EmailAddress[$i], URGENT Communication, $message, $addr_from, $attachment, $filename); $i++; } Does anybody have any ideas? Rudolf Visagie Principal Software Developer Digital Healthcare Solutions Tel. +27(0)11 266 6946 Fax. +27(0)11 266 5080 Cell: +27(0)82 895 1598 E-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Any easy way of finding yesterday...?
strtotime('yesterday') should work! Harry Lau [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... It is easy to use the function getDate() to obtain the date of today. But instead of writing plenty of conditions, is there any easy way to get the date of yesterday? Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] server side games question
Hallo Daniel, Tuesday, November 13, 2001, 11:31:49 AM, you wrote: Hi, Right I'm still pretty new to server side programming and have a few questions regarding the possible uses of existing technology in 'low-tech' (not 3d FPS/RTS/RPGs) online games. As I understand it PHP is used to add dynamic content to HTML (from MySQL database for example) and it is also possible to write applications in C/C++ that run on server computer (SUSE 7.2 + APACHE for example) that update databases at set time intervals. I am a games programmer and was wondering if it would be possible to code the following system which would run on an SUSE Apache server box: An database containing client and game data (use MySQL?), An HTML/PHP based front end (is PHP best choice for this?), A Some form of application that process the game or turn info (in the DB) at set time intervals and updates the game database with it (use C/C++?). I am competent in C/C++, ok at php and ok at MySQL but not sure how to fit it all together like how do I go about creating an application that process's the database? Can any one suggest sites/books/people who I could read/ask to find out more about this idea? Also are the languages I specified the best languages to use for this? I am open to suggestions and constructive criticism. Yes, i think php and mysql are the best languages for this. I have scripted something like you describe. unfortunately the game-server(tus/sphere) save its data in normal acsii-files and i have to prase them and put the content into the mysql-db. I cant say anything to C/C++ and mysql because i have never had the time to learn c/c++ :-( Your project sounds interesting. :-) -- Thargor mailto:[EMAIL PROTECTED] http://www.vergessene-welt.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: server side games question
Hi! For the programming language, I would go with PHP over any other. Yes, yes, there's no best language for every task, but with your C++ background it should be easy to develop advanced techniques on PHP than on others on short time. Depending from what you meant with 'background apps to update database', you could even use Cron on Linux or At on Windows. These will run php files for you that you can use to maintain the db. I've seen and played a lot of online role playing games on the last couple years. Most were done on Perl, and it's time to develop one on PHP! :-) I've tried but my lack of time prevented me to continue a similar open source project. It's was an IA game of 'life-simulation', where you would buy a house, work, buy gear/cars/furniture/etc... Sponsors would come from these products. It was a pretty good idea, you would be able even to get a politics career for mayor, governor, etc... Too bad I had to stop. Anyway, here's a link that might help you with ideas and codes. http://sourceforge.net/softwaremap/trove_list.php?form_cat=80discrim=183 -- Julio Nobrega A hora está chegando: http://toca.sourceforge.net Daniel [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, Right I'm still pretty new to server side programming and have a few questions regarding the possible uses of existing technology in 'low-tech' (not 3d FPS/RTS/RPGs) online games. As I understand it PHP is used to add dynamic content to HTML (from MySQL database for example) and it is also possible to write applications in C/C++ that run on server computer (SUSE 7.2 + APACHE for example) that update databases at set time intervals. I am a games programmer and was wondering if it would be possible to code the following system which would run on an SUSE Apache server box: An database containing client and game data (use MySQL?), An HTML/PHP based front end (is PHP best choice for this?), A Some form of application that process the game or turn info (in the DB) at set time intervals and updates the game database with it (use C/C++?). I am competent in C/C++, ok at php and ok at MySQL but not sure how to fit it all together like how do I go about creating an application that process's the database? Can any one suggest sites/books/people who I could read/ask to find out more about this idea? Also are the languages I specified the best languages to use for this? I am open to suggestions and constructive criticism. Cheers, Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Frames and Sessions
Hi All I have a client who has presented me with a near finished website that uses frames. She would like me to build a simple PHP cart into it. I've built simple carts before without drama, but this one has me baffled. I have avoided using frames in almost everything I've done to date and don't understand them that well. I can't figure out how I'm going to maintain a session across the three seperate HTML files in the frameset. Is there a way of doing this, or do I need to pull it all apart and have all the parts just included into one PHP-generated HTML file? I have tried starting a session in the main frameset file, then adding ?=SID? to the URLs of the frame files, which sort of works but breaks where JavaScript is used for buttons in one of the frames. JavaScript doesn't seem to cope with the PHP tags. Thanks Michael -- ## Michael Hall Web: http://openlearningcommunity.org Mail1: [EMAIL PROTECTED] Mail2: [EMAIL PROTECTED] Ph/Fax: (+61 8) 8953 1442 ## -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] fopen and paths
Thanks but I am still having problems, $DOCUMENT_ROOT does not seem to work(I am using an NT4 server), I cannot use an absolute path as the content management software that is running has a tendency to strip them out! It seems (to me) that it is a precedence problem, as it does not look in the include_path first to see if the file exists but simply creates it in the active documents directory. Any ideas would be appreciated! Steffan -Original Message- From: David Robley [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 3:22 AM To: PACKER, Steffan; '[EMAIL PROTECTED]' Subject: Re: [PHP] fopen and paths On Tue, 13 Nov 2001 03:14, PACKER, Steffan wrote: I am trying to log particular information in an access log and I need it to be used on several pages all in different directories, I would like the actual log to be stored in a directory called data in the root directory of my web page. I using an include() on each page where I would like the info logged. I am using: $log_fp = fopen(../data/access_log.txt, a,1); with the use_include_path set to 1. My problem is that a new file is being created in each directory that the logging.inc file is added to. Can anyone help? Steffan ../data/access_log.txt seems to be a relative address to me, pointing to the directory data which hangs off the parent of the current directory. Why not give full path information, so there is no ambiguity? Or use $DOCUMENT_ROOT for portability? -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Do the joke. Get the laugh. Move on. _ This message has been checked for all known viruses by the MessageLabs Virus Scanning Service. For further information visit http://www.messagelabs.com/stats.asp DISCLAIMER Any opinions expressed in this email are those of the individual and not necessarily the company. This email and any files transmitted with it, including replies and forwarded copies (which may contain alterations) subsequently transmitted from the Company, are confidential and solely for the use of the intended recipient. It may contain material protected by attorney-client privilege. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this email in error and that any use is strictly prohibited. If you have received this email in error please notify the Network Manager by telephone on +44 (0) 870 243 2431. Please then delete this email and destroy any copies of it. This email has been swept for viruses before leaving our system. Admiral Insurance Services Limited, Cardiff CF10 3AZ _ This message has been checked for all known viruses by the MessageLabs Virus Scanning Service. For further information visit http://www.messagelabs.com/stats.asp
[PHP] Re: server side games question
Good day! Some time ago I tried to create game server for games on line(people with people)... poker, preferance, chess and so on well as I was wery new in this action I tried diferent languages and even operation systems. At last (for some hawy rezons :-) ) I stoped on Client-Server model (Delphi+any database supported ODBCBDE) on Win NT (I feel that beter way is the same model on Unix C++ but I am not expiriensed in Unix process memory organization so have to use more light way). So the best way for online games is write your own client and server on C++ but use Appach-Some_Browser(by the way what it will be? IE1,2,3,4,5,6? NC? Mozilla? object model support?). There much gains you reciving using the model (first you know how it works + low trafick). Well but if you simply whant create games like Tetris or Digger online (man.server) than ofcouse better use IE5-6 as client (with it exelent object model) and server on PHPMySQL. Vladimir. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTTP Headers
Yes, you can do it, but this is not a PHP feature, it is an HTML trick, the only thing you need to do is create a page which contains a frame only (yes neither two or more, only one frame). Then, when you select a link on this page the URL displayed on the browser does not change. This is a nice and basic trick everyone should know, it's easy and cool. If this fails to you, please, drop me a line and i will try to fix it. Kintups ([EMAIL PROTECTED]) UN FALSO sentido de seguridad es peor que estar inseguro From: Mike Harvey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] HTTP Headers Date: Fri, 9 Nov 2001 18:55:16 -0500 Is it possible to redirect to an IP address but have the browser address bar show an URL? Mike H. http://ibiz-tools.com http://vestudiohost.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] _ Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Form's : making me sick!
I just want to know how to make a form inside a form get to respond or dont make any browser errors? It looks someting like this : form input type = text input type = text form select onchange = this.form.submit(); //This must change the next select values ! /select /form select //this values must be cahnge /select /form Everthing is working fine but i just cant get the two forms to work together.If i only can get some ideas on what action,or onchange values to change it will be greatfull! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Form's : making me sick!
I don't think that you can nest forms. George - Original Message - From: De Necker Henri [EMAIL PROTECTED] To: PHP-General (E-mail) [EMAIL PROTECTED] Sent: Tuesday, November 13, 2001 1:09 PM Subject: [PHP] Form's : making me sick! I just want to know how to make a form inside a form get to respond or dont make any browser errors? It looks someting like this : form input type = text input type = text form select onchange = this.form.submit(); //This must change the next select values ! /select /form select //this values must be cahnge /select /form Everthing is working fine but i just cant get the two forms to work together.If i only can get some ideas on what action,or onchange values to change it will be greatfull! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Form's : making me sick!
You cannot nest forms however if you set the action to the same page and submit the entire form to itself, then you can use javascript to change the action to the eventual target by using an onChange event on the final field: input type=text name-lastField onChange=document.formName.action='newAction.cgi' Hope this helps! Steffan -Original Message- From: De Necker Henri [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 1:10 PM To: PHP-General (E-mail) Subject: [PHP] Form's : making me sick! I just want to know how to make a form inside a form get to respond or dont make any browser errors? It looks someting like this : form input type = text input type = text form select onchange = this.form.submit(); //This must change the next select values ! /select /form select //this values must be cahnge /select /form Everthing is working fine but i just cant get the two forms to work together.If i only can get some ideas on what action,or onchange values to change it will be greatfull! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] _ This message has been checked for all known viruses by the MessageLabs Virus Scanning Service. For further information visit http://www.messagelabs.com/stats.asp DISCLAIMER Any opinions expressed in this email are those of the individual and not necessarily the company. This email and any files transmitted with it, including replies and forwarded copies (which may contain alterations) subsequently transmitted from the Company, are confidential and solely for the use of the intended recipient. It may contain material protected by attorney-client privilege. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this email in error and that any use is strictly prohibited. If you have received this email in error please notify the Network Manager by telephone on +44 (0) 870 243 2431. Please then delete this email and destroy any copies of it. This email has been swept for viruses before leaving our system. Admiral Insurance Services Limited, Cardiff CF10 3AZ _ This message has been checked for all known viruses by the MessageLabs Virus Scanning Service. For further information visit http://www.messagelabs.com/stats.asp
[PHP] Redeclare a Function
Hi everybody, I would like to declare/redeclare a function twice in the same doc. Is it possible to unset/undeclare the function and include it again a second time? I have searched the manual but can´t find anything useful, any ideas? TIA Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Redeclare a Function
I think it's not possible. Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS - Original Message - From: Michael Cronström [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 13, 2001 3:13 PM Subject: [PHP] Redeclare a Function Hi everybody, I would like to declare/redeclare a function twice in the same doc. Is it possible to unset/undeclare the function and include it again a second time? I have searched the manual but can´t find anything useful, any ideas? TIA Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Form's : making me sick!
Couldn't you also make your initial page a php page? So then you would have onChange as Steffan says but then pass the values to self.php?vars which would then be used by the php page to fill in the next select with vars? Hope that makes sense.. On Tue, 13 Nov 2001, PACKER, Steffan wrote: You cannot nest forms however if you set the action to the same page and submit the entire form to itself, then you can use javascript to change the action to the eventual target by using an onChange event on the final field: input type=text name-lastField onChange=document.formName.action='newAction.cgi' Hope this helps! Steffan -Original Message- From: De Necker Henri [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 1:10 PM To: PHP-General (E-mail) Subject: [PHP] Form's : making me sick! I just want to know how to make a form inside a form get to respond or dont make any browser errors? It looks someting like this : form input type = text input type = text form select onchange = this.form.submit(); //This must change the next select values ! /select /form select //this values must be cahnge /select /form Everthing is working fine but i just cant get the two forms to work together.If i only can get some ideas on what action,or onchange values to change it will be greatfull! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] _ This message has been checked for all known viruses by the MessageLabs Virus Scanning Service. For further information visit http://www.messagelabs.com/stats.asp DISCLAIMER Any opinions expressed in this email are those of the individual and not necessarily the company. This email and any files transmitted with it, including replies and forwarded copies (which may contain alterations) subsequently transmitted from the Company, are confidential and solely for the use of the intended recipient. It may contain material protected by attorney-client privilege. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this email in error and that any use is strictly prohibited. If you have received this email in error please notify the Network Manager by telephone on +44 (0) 870 243 2431. Please then delete this email and destroy any copies of it. This email has been swept for viruses before leaving our system. Admiral Insurance Services Limited, Cardiff CF10 3AZ _ This message has been checked for all known viruses by the MessageLabs Virus Scanning Service. For further information visit http://www.messagelabs.com/stats.asp --- Ashwin kutty.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Form's : making me sick!
OK.Please give some code that i can work with.I have heared about self.php but dont have any idea how it works. I am using php with my two select's but how will i get the first one to respond to some change?At this stage i just dont have any idea! -Original Message- From: Ashwin Kutty [mailto:[EMAIL PROTECTED]] Sent: 13 November 2001 15:19 To: PACKER, Steffan Cc: 'De Necker Henri'; PHP-General (E-mail) Subject: RE: [PHP] Form's : making me sick! Couldn't you also make your initial page a php page? So then you would have onChange as Steffan says but then pass the values to self.php?vars which would then be used by the php page to fill in the next select with vars? Hope that makes sense.. On Tue, 13 Nov 2001, PACKER, Steffan wrote: You cannot nest forms however if you set the action to the same page and submit the entire form to itself, then you can use javascript to change the action to the eventual target by using an onChange event on the final field: input type=text name-lastField onChange=document.formName.action='newAction.cgi' Hope this helps! Steffan -Original Message- From: De Necker Henri [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 1:10 PM To: PHP-General (E-mail) Subject: [PHP] Form's : making me sick! I just want to know how to make a form inside a form get to respond or dont make any browser errors? It looks someting like this : form input type = text input type = text form select onchange = this.form.submit(); //This must change the next select values ! /select /form select //this values must be cahnge /select /form Everthing is working fine but i just cant get the two forms to work together.If i only can get some ideas on what action,or onchange values to change it will be greatfull! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] _ This message has been checked for all known viruses by the MessageLabs Virus Scanning Service. For further information visit http://www.messagelabs.com/stats.asp DISCLAIMER Any opinions expressed in this email are those of the individual and not necessarily the company. This email and any files transmitted with it, including replies and forwarded copies (which may contain alterations) subsequently transmitted from the Company, are confidential and solely for the use of the intended recipient. It may contain material protected by attorney-client privilege. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this email in error and that any use is strictly prohibited. If you have received this email in error please notify the Network Manager by telephone on +44 (0) 870 243 2431. Please then delete this email and destroy any copies of it. This email has been swept for viruses before leaving our system. Admiral Insurance Services Limited, Cardiff CF10 3AZ _ This message has been checked for all known viruses by the MessageLabs Virus Scanning Service. For further information visit http://www.messagelabs.com/stats.asp --- Ashwin kutty.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Redeclare a Function
its possible to create lambda-style functions with create_function() and redeclare the variable functions --- $funct = create_function('$x', 'return ++$x;'); echo $funct(10); $funct = create_function('$x', 'return --$x;'); echo $funct(10); --- its fun to create array's of functions :) try it :P with kind regards, Joffrey van Wageningen On Tue, 13 Nov 2001, Andrey Hristov wrote: I think it's not possible. Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS - Original Message - From: Michael Cronström [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 13, 2001 3:13 PM Subject: [PHP] Redeclare a Function Hi everybody, I would like to declare/redeclare a function twice in the same doc. Is it possible to unset/undeclare the function and include it again a second time? I have searched the manual but can´t find anything useful, any ideas? TIA Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Running PHP from Telnet/Cron
I got something similar and it had to do with a corupted binary file. It could have been on a download or the upload to the install directory. thats the only problem I had. have you tried running ? phpinfo(); ? you should see a ZendOptimizer line if its running. --- Robert Kemp [EMAIL PROTECTED] wrote: Hello-- I am getting the following error message when running a PHP script from a Telnet session or from Cron: Failed loading /usr/local/Zend/lib/ZendOptimizer.so: /usr/local/Zend/lib/ZendOptimizer.so: undefined symbol: zend_get_ini_entry. The problem appears to have started when my hosting service updated their kernel. == General Info == PHP v4.0.6 Zend Engine v1.0.6 Linux Apache v1.3.20 PHP running as an Apache Module PHP/Zend has been rebuilt (to troubleshot problem) == test.php == ?php Print Test script to help get the ZendOptimizer problem worked out...; ? == Command Line 1 (Manual) == php test.php == Command Line 2 (Cron) == php /home/rkemp/public_html/sec/admin/sitemaint.php /dev/null Has anyone seen this error before, and if so have you come up with a solution? Thanks, Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = Dan McCullough --- Theres no such thing as a problem unless the servers are on fire! h: 603.444.9808 w: McCullough Family w: At Work __ Do You Yahoo!? Find the one for you at Yahoo! Personals http://personals.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] cron not allowed
I have a php script I'd like to run at regular intervals, but my isp will not set a cron job for it but will for a perl script Is there anyway round tis, or does anyone one know of a perl script that might then execute the php script if I can get that to be automated? thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Redeclare a Function
Thanks Joffrey You learn everyday Michael its possible to create lambda-style functions with create_function() and redeclare the variable functions --- $funct = create_function('$x', 'return ++$x;'); echo $funct(10); $funct = create_function('$x', 'return --$x;'); echo $funct(10); --- its fun to create array's of functions :) try it :P with kind regards, Joffrey van Wageningen On Tue, 13 Nov 2001, Andrey Hristov wrote: I think it's not possible. Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS - Original Message - From: Michael Cronström [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 13, 2001 3:13 PM Subject: [PHP] Redeclare a Function Hi everybody, I would like to declare/redeclare a function twice in the same doc. Is it possible to unset/undeclare the function and include it again a second time? I have searched the manual but can´t find anything useful, any ideas? TIA Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] $GLOBALS
If you use a form with method=GET and submit it all the field names and values are stored in a global associative array called HTTP_GET_VARS as name/value pairs. Steffan -Original Message- From: Peter Tilm [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 2:16 PM To: [EMAIL PROTECTED] Subject: [PHP] $GLOBALS hi, i´m new in PHP. What does the expression: $ref=$GLOBALS[HTTP_GET_VARS][ref]; $id=$GLOBALS[HTTP_GET_VARS][id]; do? What is $GLOBALS? What are the parameters [HTTP_GET_VARS][ref]? thanks Peter -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] _ This message has been checked for all known viruses by the MessageLabs Virus Scanning Service. For further information visit http://www.messagelabs.com/stats.asp DISCLAIMER Any opinions expressed in this email are those of the individual and not necessarily the company. This email and any files transmitted with it, including replies and forwarded copies (which may contain alterations) subsequently transmitted from the Company, are confidential and solely for the use of the intended recipient. It may contain material protected by attorney-client privilege. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this email in error and that any use is strictly prohibited. If you have received this email in error please notify the Network Manager by telephone on +44 (0) 870 243 2431. Please then delete this email and destroy any copies of it. This email has been swept for viruses before leaving our system. Admiral Insurance Services Limited, Cardiff CF10 3AZ _ This message has been checked for all known viruses by the MessageLabs Virus Scanning Service. For further information visit http://www.messagelabs.com/stats.asp
Re: [PHP] Flash and PHP loadvariablesnum
Hello, this question should be ask to a flash forum, php would never open a window!! I used this class to achieve what you asked (http://www.hotscripts.com/Detailed/8970.html) but I know nothing about flash... py - Original Message - From: dharvell [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 12, 2001 11:13 PM Subject: [PHP] Flash and PHP loadvariablesnum I have a flash movie that is submitting to a PHP page using loadvariablenum but after being submitted it opens a new window that displays the print line that was supposed to go back to flash. does anyone have any ideas?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] cron not allowed
On Tue, 13 Nov 2001, Caspar Kennerdale wrote: I have a php script I'd like to run at regular intervals, but my isp will not set a cron job for it but will for a perl script Is there anyway round tis, or does anyone one know of a perl script that might then execute the php script if I can get that to be automated? thanks at spooler with shell script that sets up new job at exit ;) Code reviews are like sex, just anyone can do it, but skill and training can make you a lot better at it. - LJ Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] cron not allowed
how did you plan on running php from cron? however you do that you could run a perl script that just makes a system call and does the same thing -Original Message- From: Caspar Kennerdale [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 9:04 AM To: Php-General Subject: [PHP] cron not allowed I have a php script I'd like to run at regular intervals, but my isp will not set a cron job for it but will for a perl script Is there anyway round tis, or does anyone one know of a perl script that might then execute the php script if I can get that to be automated? thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] $GLOBALS
i´m new in PHP. What does the expression: $ref=$GLOBALS[HTTP_GET_VARS][ref]; $id=$GLOBALS[HTTP_GET_VARS][id]; do? It gives you the content of the querystring variable ref and id. eg. page.php?id=20ref=value What is $GLOBALS? $GLOBALS is an array wich contains all the varibles in the global variable scope. http://dk.php.net/manual/en/language.variables.scope.php You can get an overview of all the variables by using the print_r() function: print_r($GLOBALS); http://dk.php.net/manual/en/function.print-r.php What are the parameters [HTTP_GET_VARS][ref]? [HTTP_GET_VARS] is also an array, and it contains alle the variables from the querystring. And ['ref'] is a querystring variable. /Emil -- Emil Rasmussen http://noget.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Flash and PHP loadvariablesnum
Hello, I use a lot Flash with PHP. I really don't understand why your browser opens a new window. Could you tell me exactly which function you run (loadVariablesNum ...) and which browser you are using. (MAC IE5 doesn't work well with loadVariablesNum. Eric www.b-tween.com web design e-communication e-education on 13:11:2001 15:28, py at [EMAIL PROTECTED] wrote: Hello, this question should be ask to a flash forum, php would never open a window!! I used this class to achieve what you asked (http://www.hotscripts.com/Detailed/8970.html) but I know nothing about flash... py - Original Message - From: dharvell [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 12, 2001 11:13 PM Subject: [PHP] Flash and PHP loadvariablesnum I have a flash movie that is submitting to a PHP page using loadvariablenum but after being submitted it opens a new window that displays the print line that was supposed to go back to flash. does anyone have any ideas?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Eric Trezza www.b-tween.com web design e-communication e-education -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] cron not allowed
On Tue, 13 Nov 2001, Jack Dempsey wrote: how did you plan on running php from cron? however you do that you could run a perl script that just makes a system call and does the same thing [blah.php] #!/path/to/php -q do_stuff(); [/blah.php] Then just add a record to user crontab, running the script whenever and writing any output to either a log file or /dev/null - a matter of taste, I believe. :) You have to ./configure PHP without Apache support though for it to build a PHP binary. Cheers, Nick Winfield. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Mysql and Images
His list, I have some images stores in a mysql database and now i need to recover them to put in a html. My question is there's a way to do this in the same page, I mean, withou the need to buil another php page that process th image? Something like a function that output the image to the img src= in the html. Thank's in advance Rodrigo Peres -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] cron not allowed
how did you plan on running php from cron? Well, this works for me: 0 3 * * * lynx -dump http://mysite.com/mypage.php /dev/null HTH Jon ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] $GLOBALS
hi, i´m new in PHP. What does the expression: $ref=$GLOBALS[HTTP_GET_VARS][ref]; $id=$GLOBALS[HTTP_GET_VARS][id]; do? What is $GLOBALS? What are the parameters [HTTP_GET_VARS][ref]? thanks Peter -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] URL Headers - Retrieval
I currently have a script which gathers information from a site, adds a new variable and then resubmits it as a post back to the originating script. I need to gather the header information from the final response to categorise the errors received. At the moment the error I get is not consistant with the information that has been sent. My hosting server, w/ Apache/1.3.19 PHP 4.0.6 and Linux does not have the CURL lib installed. Any help much appreciated. Jonathan S Hardiman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RE: server side games question
PHP will do fine. What's the project? I'm a wannabe game developer, and I had a bit of fun a few months back with randomly generated, but reproducable, game worlds (in my case it was a star map for a space conquest type of game). It's a really neat concept, and its how alot of the 'big world' games were done when games came on floppy disks. The code isn't very polished, but if you're interested in that sort of thing, I can dig it up and fire it off to you. - Theo -Original Message- From: Daniel [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 5:32 AM To: [EMAIL PROTECTED] Subject: server side games question Hi, Right I'm still pretty new to server side programming and have a few questions regarding the possible uses of existing technology in 'low-tech' (not 3d FPS/RTS/RPGs) online games. As I understand it PHP is used to add dynamic content to HTML (from MySQL database for example) and it is also possible to write applications in C/C++ that run on server computer (SUSE 7.2 + APACHE for example) that update databases at set time intervals. I am a games programmer and was wondering if it would be possible to code the following system which would run on an SUSE Apache server box: An database containing client and game data (use MySQL?), An HTML/PHP based front end (is PHP best choice for this?), A Some form of application that process the game or turn info (in the DB) at set time intervals and updates the game database with it (use C/C++?). I am competent in C/C++, ok at php and ok at MySQL but not sure how to fit it all together like how do I go about creating an application that process's the database? Can any one suggest sites/books/people who I could read/ask to find out more about this idea? Also are the languages I specified the best languages to use for this? I am open to suggestions and constructive criticism. Cheers, Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Mysql and Images
If I understand you right, then what you want is just impossible. You have to give a source as filepath. You can't put the binary picture data into the same output. What you could is to have a file which calls itself with params telling it to output now the image instead of the html e.g. example.php which produces without given parameters html like HTMLIMG SRC=example.php?showimage=true/HTML You can then check in the example.php file if $showimage is set. if it is set then you call a function to send correct header and binary data and die afterwards (better: exit ;-) But due hold it more simple I would hardly suggest you to have image-output functions in a separate file. You can still use that file for all images in your database If I misunderstood you and you just want a sample code for outputting picture-data then look at this: ?php #make sure that above this line nothing is printed to the browser require(your_mysql_access_routines.php); header(content-type: image/jpg); #replace jpg with gif or png or whatever you want $result = mysql_query(SELECT imageBinaryField FROM imagesTable WHERE id='$id'); #you can give $id as parameter to the file $row = mysql_fetch_array($result); echo $row['imageBinaryField']; #don't print anything below this to the browser ? I hope I could help you Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- - Original Message - From: Rodrigo Peres [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Tuesday, November 13, 2001 3:32 PM Subject: [PHP] Mysql and Images His list, I have some images stores in a mysql database and now i need to recover them to put in a html. My question is there's a way to do this in the same page, I mean, withou the need to buil another php page that process th image? Something like a function that output the image to the img src= in the html. Thank's in advance Rodrigo Peres -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] cron not allowed
thanks jonwas more of a 'how are you going to' rather than 'how is it possible' :-) either way, from lynx or from php being a cgi a simple shell script or perl script should be able to make the appropriate call... jack -Original Message- From: Jon Haworth [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 9:29 AM To: 'Jack Dempsey'; [EMAIL PROTECTED] Subject: RE: [PHP] cron not allowed how did you plan on running php from cron? Well, this works for me: 0 3 * * * lynx -dump http://mysite.com/mypage.php /dev/null HTH Jon ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Empty form variables when uploading, Help please???
In a form you can't really have 2 submit buttons. Either a submit submits or it is just a button. That's because the var name is already submit (check out your http_post_vars). And you have it twice! Change one of them and make it just a button (HTML4). Recheck your post-vars. This should help. Otherwise you're loosing your post vars somehwere in the fire-wall. That's bad! Sandra Rascheli [EMAIL PROTECTED] wrote in message 003601c16abd$3985ae70$c46223c8@srascheli">news:003601c16abd$3985ae70$c46223c8@srascheli... Hi everybody, I hope someone is able to help me with this, I've been having this problem for a couple of months now and I have not been able to find a solution. I have a form to upload a file which submits to itself, and has two submit buttons, one called eliminarfoto (deletephoto) and salvar (savephoto), but for some weird and unexplainable reason (it only happens to some users, not all of them) when they hit any of these two submit buttons, the form returns empty variables. This is part of my script, has anybody had a similar problem before??? Any help would be greatly appreciated. FORM ENCTYPE=multipart/form-data ACTION=foto.php METHOD=POST TABLE border=0 cellPadding=2 TR TD VALIGN=TOPPFONT face=Verdana size=1BFoto/B (opcional,brtamaño máximo: 20k,brformatos permitidos: JPEG, GIF)/FONT/TD TD ? if ($foto) { echo IMG align=bottom border=0 width=140 height=160 src=\../fotos/$foto?nc= . time() .\br; } ? INPUT TYPE=hidden name=MAX_FILE_SIZE value=100 INPUT NAME=userfile TYPE=file INPUT TYPE=submit NAME=eliminarfoto VALUE=Eliminar INPUT TYPE=hidden NAME=foto VALUE=? echo $foto ? /TD /TR TR TD VALIGN=TOP COLSPAN=2 ALIGN=CENTER font face=Verdana,Arial,Helvetica,Sans-serif size=2 INPUT TYPE=SUBMIT NAME=salvar VALUE=Continuar -/TD /TR /TABLE /FORM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: Empty form variables when uploading, Help please???
another option could be to make the choice between delete and update two radio buttons with the same name and just have the one submit button, then add extra logice to your PHP script to either delete or update depending on the value of this field. good luck! Steffan -Original Message- From: The Big Roach [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 4:19 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: Empty form variables when uploading, Help please??? In a form you can't really have 2 submit buttons. Either a submit submits or it is just a button. That's because the var name is already submit (check out your http_post_vars). And you have it twice! Change one of them and make it just a button (HTML4). Recheck your post-vars. This should help. Otherwise you're loosing your post vars somehwere in the fire-wall. That's bad! Sandra Rascheli [EMAIL PROTECTED] wrote in message 003601c16abd$3985ae70$c46223c8@srascheli">news:003601c16abd$3985ae70$c46223c8@srascheli... Hi everybody, I hope someone is able to help me with this, I've been having this problem for a couple of months now and I have not been able to find a solution. I have a form to upload a file which submits to itself, and has two submit buttons, one called eliminarfoto (deletephoto) and salvar (savephoto), but for some weird and unexplainable reason (it only happens to some users, not all of them) when they hit any of these two submit buttons, the form returns empty variables. This is part of my script, has anybody had a similar problem before??? Any help would be greatly appreciated. FORM ENCTYPE=multipart/form-data ACTION=foto.php METHOD=POST TABLE border=0 cellPadding=2 TR TD VALIGN=TOPPFONT face=Verdana size=1BFoto/B (opcional,brtamaño máximo: 20k,brformatos permitidos: JPEG, GIF)/FONT/TD TD ? if ($foto) { echo IMG align=bottom border=0 width=140 height=160 src=\../fotos/$foto?nc= . time() .\br; } ? INPUT TYPE=hidden name=MAX_FILE_SIZE value=100 INPUT NAME=userfile TYPE=file INPUT TYPE=submit NAME=eliminarfoto VALUE=Eliminar INPUT TYPE=hidden NAME=foto VALUE=? echo $foto ? /TD /TR TR TD VALIGN=TOP COLSPAN=2 ALIGN=CENTER font face=Verdana,Arial,Helvetica,Sans-serif size=2 INPUT TYPE=SUBMIT NAME=salvar VALUE=Continuar -/TD /TR /TABLE /FORM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] _ This message has been checked for all known viruses by the MessageLabs Virus Scanning Service. For further information visit http://www.messagelabs.com/stats.asp DISCLAIMER Any opinions expressed in this email are those of the individual and not necessarily the company. This email and any files transmitted with it, including replies and forwarded copies (which may contain alterations) subsequently transmitted from the Company, are confidential and solely for the use of the intended recipient. It may contain material protected by attorney-client privilege. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this email in error and that any use is strictly prohibited. If you have received this email in error please notify the Network Manager by telephone on +44 (0) 870 243 2431. Please then delete this email and destroy any copies of it. This email has been swept for viruses before leaving our system. Admiral Insurance Services Limited, Cardiff CF10 3AZ _ This message has been checked for all known viruses by the MessageLabs Virus Scanning Service. For further information visit http://www.messagelabs.com/stats.asp
[PHP] I Need To Upload Massive Huge Files : 20Mb
Fans! I need your help, but first you must worship me. Does PHP have a flakey file upload limit? Or what could be wrong? max_upload_size and all that is set to 32Mb. post_max_size is also set to 32Mb. max_exec_time is set to 0 (unlimited). apache's timeout is set to 1800 (30 mins). And my 6Mb or less files upload. But not my 7+Mb files. This is frustrating. But I think Rasmus can answer this for me. Rasmus, over to you... Here's my code just to prove I'm not a proud ^%#@! $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); if ((!$conn_id) || (!$login_result)){ echo Ftp connection failed!; die; } else { echo Connected to $ftp_server!br; } @ftp_chdir($conn_id, $my_dir); @ftp_pasv ($conn_id, TRUE); /*Using ftp_fput*/ $local_file = fopen($source_file, r); $upload = @ftp_fput($conn_id, $destination_file, $local_file, FTP_BINARY); /*Using ftp_put*/ /* $upload = @ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);*/ if (!$upload) { echo Ftp upload failed!brbr; $headers = getallheaders(); while (list ($header, $value) = each ($headers)) { echo $header: $valuebr\n; } } else { echo Ftp upload successfull!brbrUploaded $destination_file to $ftp_server/$my_dirbrbr; $headers = getallheaders(); while (list ($header, $value) = each ($headers)) { echo $header: $valuebr\n; } } @ftp_quit($conn_id); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Re: Empty form variables when uploading, Help please???
The Big Roach wrote: In a form you can't really have 2 submit buttons. Either a submit submits or it is just a button. That's because the var name is already submit (check out your http_post_vars). And you have it twice! Change one of them and make it just a button (HTML4). Recheck your post-vars. This should help. That's definetely not true. You can have more than one submit buttons in a form. I often make formulars with more than one submit button, there have not been any problems. You just have give a name and a value to your submit buttons. Then you can check which one was pressed by the user. For example: ... input type=submit name=submit1 value=do this input type=submit name=submit2 value=do that ... Then just write: if ($submit1 == do this) ... else if ($submit2) == do that) ... To [EMAIL PROTECTED]: Please post some code your formular action script (foto.php). Having just the form, we can guess what went wrong. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] cron not allowed
thanks for the ideas -Original Message- From: Jack Dempsey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 15:23 To: Jon Haworth; [EMAIL PROTECTED] Subject: RE: [PHP] cron not allowed thanks jonwas more of a 'how are you going to' rather than 'how is it possible' :-) either way, from lynx or from php being a cgi a simple shell script or perl script should be able to make the appropriate call... jack -Original Message- From: Jon Haworth [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 9:29 AM To: 'Jack Dempsey'; [EMAIL PROTECTED] Subject: RE: [PHP] cron not allowed how did you plan on running php from cron? Well, this works for me: 0 3 * * * lynx -dump http://mysite.com/mypage.php /dev/null HTH Jon ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Variable definitions...
Hello, first of all I didn't exactely know where the right place is to ask this question. Well, my problem is that I just had some exams and am very unhappy on how certain things were rated. There's especially one question and I try to translate it as exact as possible: When is it possible that two variables have the same name but display different variables? The official solution was when in a script a global variable is declared and then in a local part this variable is destroyed and declared again with the same name (maybe even using different data type). As for me, I'm of the opinion that this definition according to the question is too narrow minded. I think that a variable is already different if the the value within the variable is changed due to script OR if you appoint a new value to the variable OR if the variable is an array and some elements are accessed / elements are added / elements are removed. The reason why I think variables with different values can be considered as different variable according to the question asked in the exam is that when you declare a variable it also has a value even if this value is NULL. Now I'd like very much to hear your opinion on this issue since for me very much depends on that (3 years of studying at college). Stephan P.S.: If you agree with me or not can you also send me an email to me? [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP versus all other languages
Hello Pat, Tuesday, November 13, 2001, 4:10:31 AM, you wrote: PH I'm doing my senior exit project on database languages online. I'm asking PH for help from anyone who can provide any information on the comparison PH between the different languages. I'm comparing languages such as PHP, ASP, PH ColdFussion, perl and any others that I might not know about that you guys PH might know. Thank you to anyone who helps me out in the least. Will we be able to see the result when it's ready? -- Best regards, Olexandrmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Serial Port Programing
Brian C. Doyle wrote: Hello all, Does PHP have the ability to control a serial port? I see we can use the Printer but that was All I saw. I guess you may fopen COM1: or COM2: You should be able to fopen PRN: or LPT1: as well. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] matches problem (preg_match)
hello we want to save every word of a text in an array field. we want to solve the problem without split. Here's our code: $str=eins zwei drei vier fünf sechs; preg_match('(\w+)(\s+\w+)*',$str,$Wort); $n=count($Wort); for($i=0;$i$n;$i++){echo $i: $Wort[$i]br;} The result is: 0: eins zwei drei vier fünf sechs 1: eins 2: sechs it only saves the first and the last word. why doesn't it save every single word in one array field? can anybody give us the (corrected) code to achieve the desired result? thanks for every answer !! Bruno and Ewald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] matches problem (preg_match)
Try this code: $str=eins zwei drei vier fünf sechs; $Wort = explode (' ',$str); $n=count($Wort); for($i=0;$i$n;$i++){echo $i: $Wort[$i]br;} It should works Zliy Pes [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: matches problem (preg_match)
? $str=eins zwei drei vier fünf sechs sieben acht neun; if (preg_match_all(/\w+/, $str, $matches)) { $words = $matches[0]; var_dump($words); } ? viele Grüße, lallous! Ewald Schoeller [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... hello we want to save every word of a text in an array field. we want to solve the problem without split. Here's our code: $str=eins zwei drei vier fünf sechs; preg_match('(\w+)(\s+\w+)*',$str,$Wort); $n=count($Wort); for($i=0;$i$n;$i++){echo $i: $Wort[$i]br;} The result is: 0: eins zwei drei vier fünf sechs 1: eins 2: sechs it only saves the first and the last word. why doesn't it save every single word in one array field? can anybody give us the (corrected) code to achieve the desired result? thanks for every answer !! Bruno and Ewald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: Empty form variables when uploading, Help please???
Interesting because I have used multiple submit buttons on forms for years. Each can have a different name, and even if I use the same name for all of them, which I often do, each can have a separate value. Each will cause all other form fields to transmit their variables in their usual manner, but obviously I will only receive one submit button( the one that was clicked). If all are named go with different values (what displays on the button), all I have to do is; Switch($go) { Case Add: something; break; Case Update: something, break; Case Delete: something else, break; } -Original Message- From: The Big Roach [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 13, 2001 8:19 AM To: [EMAIL PROTECTED] Subject:[PHP] Re: Empty form variables when uploading, Help please??? File: [PHP] Re Empty form variables when uploading, Help please.txt In a form you can't really have 2 submit buttons. Either a submit submits or it is just a button. That's because the var name is already submit (check out your http_post_vars). And you have it twice! Change one of them and make it just a button (HTML4). Recheck your post-vars. This should help. Otherwise you're loosing your post vars somehwere in the fire-wall. That's bad! Sandra Rascheli [EMAIL PROTECTED] wrote in message 003601c16abd$3985ae70$c46223c8@srascheli">news:003601c16abd$3985ae70$c46223c8@srascheli... Hi everybody, I hope someone is able to help me with this, I've been having this problem for a couple of months now and I have not been able to find a solution. I have a form to upload a file which submits to itself, and has two submit buttons, one called eliminarfoto (deletephoto) and salvar (savephoto), but for some weird and unexplainable reason (it only happens to some users, not all of them) when they hit any of these two submit buttons, the form returns empty variables. This is part of my script, has anybody had a similar problem before??? Any help would be greatly appreciated. FORM ENCTYPE=multipart/form-data ACTION=foto.php METHOD=POST TABLE border=0 cellPadding=2 TR TD VALIGN=TOPPFONT face=Verdana size=1BFoto/B (opcional,brtamaño máximo: 20k,brformatos permitidos: JPEG, GIF)/FONT/TD TD ? if ($foto) { echo IMG align=bottom border=0 width=140 height=160 src=\../fotos/$foto?nc= . time() .\br; } ? INPUT TYPE=hidden name=MAX_FILE_SIZE value=100 INPUT NAME=userfile TYPE=file INPUT TYPE=submit NAME=eliminarfoto VALUE=Eliminar INPUT TYPE=hidden NAME=foto VALUE=? echo $foto ? /TD /TR TR TD VALIGN=TOP COLSPAN=2 ALIGN=CENTER font face=Verdana,Arial,Helvetica,Sans-serif size=2 INPUT TYPE=SUBMIT NAME=salvar VALUE=Continuar -/TD /TR /TABLE /FORM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] User Authentication
Hi, Can anyone recommend a good place on the web to learn about user authentication. I want users of my site to login with a username password - once they are logged in they can see information customised to each separate user. Without being logged in the won't see any valuable information. Especially issues dealing with hackers. Thanks, Damien -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Advice Needed
Hi there. I have a small php app connected to sqlServer db. The app is used as a code library for various programming languages. Basically, a code repository. My problem is this, I would like to be able to insert the code for a function (the actual code) into the db. However, I keep running into the quote problem when inserting. In Asp for example, commenting is done by using a ' . When I try to insert some asp code into the db via my php app, it throws errors. Somebody had mentioned that using addslashes() and stripslashes () functions would do the trick. Is there a better way to do this or are these two functions the best to use? Also, how do I keep the formatting of a function to stay the same while inputting and retrieving? Your time is greatly appreciated! Thx Joe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] User Authentication
http://www.google.com/search?q=php+mysql+user+authenticationbtnG=Google+Search First hit's a winner :) Damien Burke wrote: Hi, Can anyone recommend a good place on the web to learn about user authentication. I want users of my site to login with a username password - once they are logged in they can see information customised to each separate user. Without being logged in the won't see any valuable information. Especially issues dealing with hackers. Thanks, Damien -- ___ ____ _ Chris Hobbs / \ \/ / | | |/ ___\| __ \ Head Geek| (___ \ \ / /| | | | (___ | | | | WebMaster \___ \ \ \/ / | | | |\___ \| | | | PostMaster) | \ / | |__| |) | |__| | \/\/\/ \/|_/ http://www.silvervalley.k12.ca.us [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Variable definitions...
Hi Stephan, IMHO, I think the answer requested is the only one that really makes sense - as soon as I read it, _my_ first thought went to scope. If a variable changes values, the other value is no longer usable, and thus there aren't really two variables with the same name in that case. When comparing global to local scope, however, you can definitely have the same name in use in two places. Of course, I wasn't a CS major, so someone else might be able to give you an answer that will help you justify yours - but prima facie, you got it wrong :( Now, if you're talking about the compiler level, then no two variables (which are actually memory registers at this point, iirc) can share the same memory space with different values - this is just logically impossible. But the question is certainly referring to source code, and so scope is the only reasonable answer. HTH! Stephan wrote: Hello, first of all I didn't exactely know where the right place is to ask this question. Well, my problem is that I just had some exams and am very unhappy on how certain things were rated. There's especially one question and I try to translate it as exact as possible: When is it possible that two variables have the same name but display different variables? The official solution was when in a script a global variable is declared and then in a local part this variable is destroyed and declared again with the same name (maybe even using different data type). As for me, I'm of the opinion that this definition according to the question is too narrow minded. I think that a variable is already different if the the value within the variable is changed due to script OR if you appoint a new value to the variable OR if the variable is an array and some elements are accessed / elements are added / elements are removed. The reason why I think variables with different values can be considered as different variable according to the question asked in the exam is that when you declare a variable it also has a value even if this value is NULL. Now I'd like very much to hear your opinion on this issue since for me very much depends on that (3 years of studying at college). Stephan P.S.: If you agree with me or not can you also send me an email to me? [EMAIL PROTECTED] -- ___ ____ _ Chris Hobbs / \ \/ / | | |/ ___\| __ \ Head Geek| (___ \ \ / /| | | | (___ | | | | WebMaster \___ \ \ \/ / | | | |\___ \| | | | PostMaster) | \ / | |__| |) | |__| | \/\/\/ \/|_/ http://www.silvervalley.k12.ca.us [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Expiration problem
Hi everybody, this is my first time writing in this list. I have the next problem: I have a page called login.php and when I log in, there's a new page who receive the user and the password, and this page is called main.php This page, check if the user have a valid account and a password; and if this is OK, then make a session for the user. This work OK; but, from the main.php I go to a link in the same page, but with a new parameter, for example: a href=main.php?option=1 and the page showme another screen (because this new screen only appears when I put the option=1 as parameter); and this also OK. The problem appears when I make click on the BACK BUTTON from my browser, and the browser go back from main.php?option=1 to the main.php page, and get me a error: the page was expire, you have to click REFRESH button on your browser to send the information again. (( or sometime like that; I don't remember the exacts words, 'cause is a spanish Internet Explorer )) Can somebody helpme with this problem? Thanks Gustavo Pereira -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Variable definitions...
BTW, the official explanation is wrong. local part this variable is destroyed and declared again is incorrect. The global variable is not destroyed. The local namespace pushes the variable name onto the stack and gives it a value for the duration of the function. Every time you try and access this variable it is taken from the stack by the parser. Once you exit the function the local namespace is destroyed and all the local variables are popped from the stack. If the call stack is in the Global area then all variabels are accessed from the heap, so your original variable (and its original value) are still accessible. -Original Message- From: Chris Hobbs [mailto:[EMAIL PROTECTED]] Sent: 13 November 2001 17:09 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Variable definitions... Hi Stephan, IMHO, I think the answer requested is the only one that really makes sense - as soon as I read it, _my_ first thought went to scope. If a variable changes values, the other value is no longer usable, and thus there aren't really two variables with the same name in that case. When comparing global to local scope, however, you can definitely have the same name in use in two places. Of course, I wasn't a CS major, so someone else might be able to give you an answer that will help you justify yours - but prima facie, you got it wrong :( Now, if you're talking about the compiler level, then no two variables (which are actually memory registers at this point, iirc) can share the same memory space with different values - this is just logically impossible. But the question is certainly referring to source code, and so scope is the only reasonable answer. HTH! Stephan wrote: Hello, first of all I didn't exactely know where the right place is to ask this question. Well, my problem is that I just had some exams and am very unhappy on how certain things were rated. There's especially one question and I try to translate it as exact as possible: When is it possible that two variables have the same name but display different variables? The official solution was when in a script a global variable is declared and then in a local part this variable is destroyed and declared again with the same name (maybe even using different data type). As for me, I'm of the opinion that this definition according to the question is too narrow minded. I think that a variable is already different if the the value within the variable is changed due to script OR if you appoint a new value to the variable OR if the variable is an array and some elements are accessed / elements are added / elements are removed. The reason why I think variables with different values can be considered as different variable according to the question asked in the exam is that when you declare a variable it also has a value even if this value is NULL. Now I'd like very much to hear your opinion on this issue since for me very much depends on that (3 years of studying at college). Stephan P.S.: If you agree with me or not can you also send me an email to me? [EMAIL PROTECTED] -- ___ ____ _ Chris Hobbs / \ \/ / | | |/ ___\| __ \ Head Geek| (___ \ \ / /| | | | (___ | | | | WebMaster \___ \ \ \/ / | | | |\___ \| | | | PostMaster) | \ / | |__| |) | |__| | \/\/\/ \/|_/ http://www.silvervalley.k12.ca.us [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] is_null misses spaces... another solution?
I need to check variables for blank values but it appears that is_null and == return true if there is a space. Any other suggestions? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] User Authentication
Caveat: Don't forget to escape user input before sending to SQL. Those samples leave that part to your imagination. Bad guys might take advantage of that :) http://www.google.com/search?q=php+mysql+user+authenticationb tnG=Google+Search First hit's a winner :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: is_null misses spaces... another solution?
trim(); it before? -- Julio Nobrega No matter where you go, this. Spunk S. Spunk III [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I need to check variables for blank values but it appears that is_null and == return true if there is a space. Any other suggestions? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Help! How do i mail a value from a mysql databse?
Hi! I'm trying to send a mail with password to the new user of my website, but . Does anyone know how to put the variable inside my mail? I have tried this: -- else { // sende kundeopplysninger til databasen $db = mysql_connect(localhost, root); mysql_select_db(subway,$db); $sql = INSERT INTO nettkunder (fornavn,etternavn,firma,adresse,postnr,sted,telefon,epost) VALUES ('$fornavn','$etternavn','$firma','$adresse','$postnr','$sted','$telefon','$ epost'); $result = mysql_query($sql); echo Velkommen som kunde hos Subway.\n; } $db = mysql_connect(localhost, root); mysql_select_db(subway,$db); $id = mysql_query(GET id FROM nettkunder WHERE epost = '$epost',$db); mail($epost, Velkommen som kunde hos Subway, Her har du ditt passord: $myrow[id] \n God appetitt! Hilsen Subway); Regards Raymond -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: is_null misses spaces... another solution?
A space is a valid string. Are you sure there is a space? ? $a = ' '; if($a == '') { echo a is blankbr; } else { echo a is not blankbr; // this is printed } if(is_null($a)) { echo a is nullbr; } else { echo a is not nullbr; // this is printed } ? Kirk I need to check variables for blank values but it appears that is_null and == return true if there is a space. Any other suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Basic handling of pre 1901 dates
I'm feeling dumb! The Basic Problem = Basically all I want to do is to output each day in turn from 1900 i.e. 01-Jan-1900 02-Jan-1900 03-Jan-1900 etc. But date() won't accept dates pre 13-Dec-1901 and mktime doesn't like anything pre 01-Jan-1970. I know I can get mysql to do this without trouble but not efficiently. So how do you work with pre-1901 dates in php? The Full Problem In actual fact what I'm trying to do is list all dates within a given range which are NOT in a mysql table. The dates and date ranges can span anywhere from 1850 to the present. I can very easily use mysql to generate an array of the days which are present in the table. What I can't seem to do is get php to run through each day in turn and let me output it. The only possible solution I can think of is to just generate a dummy mysql table with all dates I might ever use and then join that to my actual date table and select the non-matches. Not a very elegant solution! What have I missed? George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
AW: [PHP] I Need To Upload Massive Huge Files : 20Mb
Hi We encountere some problems with our Squid-Proxy. When we user direct internet connection the sky was the limit, but with our Proxy, the limit was 2MB... Sebastian -Ursprüngliche Nachricht- Von: The Big Roach [mailto:[EMAIL PROTECTED]] Gesendet: Dienstag, 13. November 2001 17:31 An: [EMAIL PROTECTED] Betreff: [PHP] I Need To Upload Massive Huge Files : 20Mb Fans! I need your help, but first you must worship me. Does PHP have a flakey file upload limit? Or what could be wrong? max_upload_size and all that is set to 32Mb. post_max_size is also set to 32Mb. max_exec_time is set to 0 (unlimited). apache's timeout is set to 1800 (30 mins). And my 6Mb or less files upload. But not my 7+Mb files. This is frustrating. But I think Rasmus can answer this for me. Rasmus, over to you... Here's my code just to prove I'm not a proud ^%#@! $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); if ((!$conn_id) || (!$login_result)){ echo Ftp connection failed!; die; } else { echo Connected to $ftp_server!br; } @ftp_chdir($conn_id, $my_dir); @ftp_pasv ($conn_id, TRUE); /*Using ftp_fput*/ $local_file = fopen($source_file, r); $upload = @ftp_fput($conn_id, $destination_file, $local_file, FTP_BINARY); /*Using ftp_put*/ /* $upload = @ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);*/ if (!$upload) { echo Ftp upload failed!brbr; $headers = getallheaders(); while (list ($header, $value) = each ($headers)) { echo $header: $valuebr\n; } } else { echo Ftp upload successfull!brbrUploaded $destination_file to $ftp_server/$my_dirbrbr; $headers = getallheaders(); while (list ($header, $value) = each ($headers)) { echo $header: $valuebr\n; } } @ftp_quit($conn_id); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] $QUERY_STRING
Hi, I'm a newbie using Apache 1.3.22 and PHP 4.0.6 on Windows. I'm trying to access the $QUERY_STRING var, but it's empty even when I do have a query string. On one server (Win2K), it works ok. On the other server (WinXP) it's always empty. If I use index.php?s=1, $HTTP_GET_VARS['s'] is 1, but I need the raw query string because it's something like index.php?1. Is this a known bug on PHP/WinXP? Regards, Ernesto -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] getrusage() not supported
I'm trying to run a script in my server (IIS 5) that uses the function getrusage(), but it returns the following warning: Warning: getrusage() is not supported in this PHP build in file_name.php on line 377 Does anyone know how I can solve this problem? Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] I Need To Upload Massive Huge Files : 20Mb
Thanks Sebastian, I'll take a look at our proxy logs. I've also discovered a perl script deep in the bowels of our servers which seem to be a problem. Here's an error log excerpt: POPSTACK panic: POPSTACK panic: POPSTACK panic: POPSTACK panic: POPSTACK panic: POPSTACK [Tue Nov 13 13:26:57 2001] [error] [client IP ADDRESS HERE] Premature end of script headers: /usr/local/etc/httpd/htdocs/imanager/wizards/fm_upload.cgi FATAL: erealloc(): Unable to allocate 6940001 bytes Can't imagine why it panics when it pops the stack. Anyhow, proof here-in lies that I'm being limited : unable to allocate bytes. Unforunately I have no admin rights setup for this machine to mess with this cgi. I'll keep you all posted... seems like there's a lot of interest in uploading files, c. Sebastian [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi We encountere some problems with our Squid-Proxy. When we user direct internet connection the sky was the limit, but with our Proxy, the limit was 2MB... Sebastian -Ursprüngliche Nachricht- Von: The Big Roach [mailto:[EMAIL PROTECTED]] Gesendet: Dienstag, 13. November 2001 17:31 An: [EMAIL PROTECTED] Betreff: [PHP] I Need To Upload Massive Huge Files : 20Mb Fans! I need your help, but first you must worship me. Does PHP have a flakey file upload limit? Or what could be wrong? max_upload_size and all that is set to 32Mb. post_max_size is also set to 32Mb. max_exec_time is set to 0 (unlimited). apache's timeout is set to 1800 (30 mins). And my 6Mb or less files upload. But not my 7+Mb files. This is frustrating. But I think Rasmus can answer this for me. Rasmus, over to you... Here's my code just to prove I'm not a proud ^%#@! $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); if ((!$conn_id) || (!$login_result)){ echo Ftp connection failed!; die; } else { echo Connected to $ftp_server!br; } @ftp_chdir($conn_id, $my_dir); @ftp_pasv ($conn_id, TRUE); /*Using ftp_fput*/ $local_file = fopen($source_file, r); $upload = @ftp_fput($conn_id, $destination_file, $local_file, FTP_BINARY); /*Using ftp_put*/ /* $upload = @ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);*/ if (!$upload) { echo Ftp upload failed!brbr; $headers = getallheaders(); while (list ($header, $value) = each ($headers)) { echo $header: $valuebr\n; } } else { echo Ftp upload successfull!brbrUploaded $destination_file to $ftp_server/$my_dirbrbr; $headers = getallheaders(); while (list ($header, $value) = each ($headers)) { echo $header: $valuebr\n; } } @ftp_quit($conn_id); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: $QUERY_STRING
Try getenv() function to import the query string from apache ambient. This is not a bug, maybe the index.php?1 isn't standard at all. Ernesto [EMAIL PROTECTED] ha scritto nel messaggio [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I'm a newbie using Apache 1.3.22 and PHP 4.0.6 on Windows. I'm trying to access the $QUERY_STRING var, but it's empty even when I do have a query string. On one server (Win2K), it works ok. On the other server (WinXP) it's always empty. If I use index.php?s=1, $HTTP_GET_VARS['s'] is 1, but I need the raw query string because it's something like index.php?1. Is this a known bug on PHP/WinXP? Regards, Ernesto -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] EXPIRATION PROBLEM; PLEASE HELP ME !!!
- Original Message - From: Gustavo Luis Pereira Verly [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Tuesday, November 13, 2001 2:26 PM Subject: [PHP] Expiration problem Hi everybody, this is my first time writing in this list. I have the next problem: I have a page called login.php and when I log in, there's a new page who receive the user and the password, and this page is called main.php This page, check if the user have a valid account and a password; and if this is OK, then make a session for the user. This work OK; but, from the main.php I go to a link in the same page, but with a new parameter, for example: a href=main.php?option=1 and the page showme another screen (because this new screen only appears when I put the option=1 as parameter); and this also OK. The problem appears when I make click on the BACK BUTTON from my browser, and the browser go back from main.php?option=1 to the main.php page, and get me a error: the page was expire, you have to click REFRESH button on your browser to send the information again. (( or sometime like that; I don't remember the exacts words, 'cause is a spanish Internet Explorer )) Can somebody helpme with this problem? Thanks Gustavo Pereira -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: $QUERY_STRING
Nop. getenv(QUERY_STRING) also returns an empty string. The crazy thing is that getenv returns an empty string instead of FALSE. Anyway, if I do index.php?a=1, I get HTTP_GET_VARS['a']==1, but $QUERY_STRING is still empty :( dav wrote: Try getenv() function to import the query string from apache ambient. This is not a bug, maybe the index.php?1 isn't standard at all. Ernesto [EMAIL PROTECTED] ha scritto nel messaggio [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I'm a newbie using Apache 1.3.22 and PHP 4.0.6 on Windows. I'm trying to access the $QUERY_STRING var, but it's empty even when I do have a query string. On one server (Win2K), it works ok. On the other server (WinXP) it's always empty. If I use index.php?s=1, $HTTP_GET_VARS['s'] is 1, but I need the raw query string because it's something like index.php?1. Is this a known bug on PHP/WinXP? Regards, Ernesto -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] explain these testresults (search/replace)
1.7303379774094 seconds with strtr() 1.557923078537 seconds with preg_replace() 1.494078040123 seconds with str_replace() 1.4984160661697 seconds with ereg_replace() /* source ---8---*/ ?php $files = array(html1.html, html2.html); $strtr_rep = array( pre = PRE, li=LI, tr = TABLE ROW START, b = BOLD, td = TABLE CELL START ); /* - END CONFIG -- */ // read in filedata for ($i = 0; $i count($files); $i++) { $raw[] = implode(, file($files[$i])); } // build preg_replace reg/replace pattern arrays while(list($reg, $rep) = each($strtr_rep)) { $preg_reg[] = /.$reg./; $preg_repl[] = $rep; } //START TEST $timer = new Timer(); for ($i=0; $i 1000; $i++) { $data = ($i % 2 == 0) ? $raw[0] : $raw[1]; if ($test == 1) { $test = strtr; $data = strtr($data, $strtr_rep); } elseif ($test == 2) { $test = preg_replace; $data = preg_replace($preg_reg, $preg_repl, $data); } elseif ($test == 3) { $test = str_replace; while(list($k, $v) = each($strtr_rep)) { $data = str_replace($k, $v, $data); } } elseif ($test == 4) { $test = ereg_replace; while(list($k, $v) = each($strtr_rep)) { $data = ereg_replace($k, $v, $data); } } } print $timer-getElapsed() . seconds with $test; ? /* ---8- END SOURCE -8--8- */ -- Best Regards Niklas Fondberg - [EMAIL PROTECTED] System Developer - I3 Micro Technology -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] explain these testresults (search/replace)
1.7303379774094 seconds with strtr() 1.557923078537 seconds with preg_replace() 1.494078040123 seconds with str_replace() 1.4984160661697 seconds with ereg_replace() /* source ---8---*/ ?php $files = array(html1.html, html2.html); $strtr_rep = array( pre = PRE, li=LI, tr = TABLE ROW START, b = BOLD, td = TABLE CELL START ); /* - END CONFIG -- */ // read in filedata for ($i = 0; $i count($files); $i++) { $raw[] = implode(, file($files[$i])); } // build preg_replace reg/replace pattern arrays while(list($reg, $rep) = each($strtr_rep)) { $preg_reg[] = /.$reg./; $preg_repl[] = $rep; } //START TEST $timer = new Timer(); for ($i=0; $i 1000; $i++) { $data = ($i % 2 == 0) ? $raw[0] : $raw[1]; if ($test == 1) { $test = strtr; $data = strtr($data, $strtr_rep); } elseif ($test == 2) { $test = preg_replace; $data = preg_replace($preg_reg, $preg_repl, $data); } elseif ($test == 3) { $test = str_replace; while(list($k, $v) = each($strtr_rep)) { $data = str_replace($k, $v, $data); } } elseif ($test == 4) { $test = ereg_replace; while(list($k, $v) = each($strtr_rep)) { $data = ereg_replace($k, $v, $data); } } } print $timer-getElapsed() . seconds with $test; ? /* ---8- END SOURCE -8--8- */ -- Best Regards Niklas Fondberg - [EMAIL PROTECTED] System Developer - I3 Micro Technology -- -- Best Regards Niklas Fondberg - [EMAIL PROTECTED] System Developer - I3 Micro Technology -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PATH_INFO and the ' / ' (search friendly URLs)
Hi there, I am trying to put after .php an information like: .php/1234 This is because I am trying to build a searchfriedly URL like described in http://www.zend.com/zend/spotlight/searchengine.php#3 The problem is... it does not work I get an server error. As soon as there is a slash and info behind. This happens on win and unix. It workes for example at this site: http://www.stuttgarter-zeitung.de/stz/page/detail.php/13971 So..does anybody know whats going on with that? Maybe there is a need to enter something in a .htaccess file? Thanx for any help, Cheers Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Adding Dates (To Obtain Future Dates)
This problem took a while to figure out. I'm posting the solution so that = other's may find this example. If you know of a better way, please reply. = :-) Cheers, Rob Problem: Generate Future Dates: Sub-Problem: Future Dates are Dictated by Record Type (Permanent or = Temporary) The Script: $cyear =3D date(Y); $cmonth =3D date(m); $cday =3D date(d); if ($sType =3D=3D p) { $fyear =3D $cyear + 6 $sExpiry =3D $fyear.$cmonth.$cday; } else { $adv =3D $cmonth + 6; $newunix =3D mktime(0,0,0,$adv,$cmonth,$cyear); $sExpiry =3D date(Ymd, $newunix); } $sCreated =3D date(Ymd); $sUpdated =3D date(Ymd); It seems weird to have use months possibly greater than 12 ($adv =3D = $cmonth + 6;), but hey... it works. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PDF Library Not Working (Call to undefined function)
I RTFM but did not find a solution. My head hurts from banging it against = the wall. :-P Apache, OpenSSL, MySQL and PHP work fine... but the PDF libraries will not = work. I used the following configure commands: PHP: './configure' '--with-mysql=3D/usr/local/mysql/' '--with-xml' = '--with-apache=3D../apache_1.3.22/' '--with-curl=3D/usr/local/curl' = '--enable-shared-pdflib' '--enable-track-vars' PDFLib: Almost defaults... just turned off Python and C/C++. I can provide a complete list of configure options and the order they were = executed if you need them... The error message when attempting to use the PDFLib functions is: Fatal error: Call to undefined function: pdf_new() in /usr/local/apache/htd= ocs/program/dmipps/pdfdemo.php on line 2 Thanks for any help, it's really appreciated. Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] take date and convert to day of year
Hi guys, I know that you can take todays date and display it as the numeric day of the year, 1 - 365 / 0 - 364 etc. But can you take a date such as (November-30-1971) and convert that to the numeric day of the year? I have been trying to do this but have had no joy, I don't think my code is even close. $dob = getdate(Nov-30-1971); $dobnum = $dob['yday']; print $dobnum; $dob 'should' be an array and 'yday' should be the numeric value for the day of the year, right?!? This is what I am trying, and how I understand it, using 'yday' should give you basically the same output as date (z); What I would like is the ability to convert any date to the days numeric value. Any help would be GREATLY appreciated. (C: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] getrusage() not supported
According to the docs, it says to check your systems man pages for getrusage. Since they appear to referencing *nix system (no man in NT), my guess is that NT does not support it. In fact, executing getrusage at the NT command prompt gives the 'not recognized internal or external command' error. LRJ Daniel Berwig writes: I'm trying to run a script in my server (IIS 5) that uses the function getrusage(), but it returns the following warning: Warning: getrusage() is not supported in this PHP build in file_name.php on line 377 Does anyone know how I can solve this problem? Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] LRJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Frames and Sessions
On Tue, 13 Nov 2001, Martín Marqués wrote: I have tried starting a session in the main frameset file, then adding ?=SID? to the URLs of the frame files, which sort of works but breaks where JavaScript is used for buttons in one of the frames. JavaScript doesn't seem to cope with the PHP tags. Append manually the ?=SID? (or session_name().=.session_id()) to the javascript code it works well :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Problems with headers in redirect
Hi Richy, Try sending the content header before the location header: header(Content-type: image/jpeg); header(Location: http://yourhost.com/yourfile.jpg;); HTH, John Hi, I'm hoping someone can help me with this one... I'm doing redirects to various types of file (Flash, Office, DWF etc) and have found a problem with IE5. I pass the script a document ID, and it retrieves the document record from a database, which stores the location of the file on the web server, and redirects the browser to the document. What happens is that the browser gets redirected, but doesn't get the content-type header, and subsequently can't display the document. Until yesterday I was using javascript redirection, which worked fine. However for other reasons (ie that didn't work with IE 5.5 or IE6) I had to change to using the header(Location: ) way. Only work around I can see is to do the redirection based on browser type (i.e. one way for IE5, the other for IE5.5/IE6) but thats messy. Any other ideas??? Richy -- /* SteeleSoft Consulting John Steele - Systems Analyst/Programmer * We also walk dogs... Dynamic Web Design PHP/MySQL/Linux/Hosting * www.steelesoftconsulting.com [EMAIL PROTECTED] */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: $QUERY_STRING
Hi Ernesto, Try taking a look at the HTTP_SERVER_VARS array: test.php?1 HTTP_SERVER_VARS[argc] = 1 HTTP_SERVER_VARS[argv] = array([0] = test) XPerience the new windows (scary!) :) John Nop. getenv(QUERY_STRING) also returns an empty string. The crazy thing is that getenv returns an empty string instead of FALSE. Anyway, if I do index.php?a=1, I get HTTP_GET_VARS['a']==1, but $QUERY_STRING is still empty :( dav wrote: Try getenv() function to import the query string from apache ambient. This is not a bug, maybe the index.php?1 isn't standard at all. Ernesto [EMAIL PROTECTED] ha scritto nel messaggio [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I'm a newbie using Apache 1.3.22 and PHP 4.0.6 on Windows. I'm trying to access the $QUERY_STRING var, but it's empty even when I do have a query string. On one server (Win2K), it works ok. On the other server (WinXP) it's always empty. If I use index.php?s=1, $HTTP_GET_VARS['s'] is 1, but I need the raw query string because it's something like index.php?1. Is this a known bug on PHP/WinXP? Regards, Ernesto -- /* SteeleSoft Consulting John Steele - Systems Analyst/Programmer * We also walk dogs... Dynamic Web Design PHP/MySQL/Linux/Hosting * www.steelesoftconsulting.com [EMAIL PROTECTED] */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]