RE: [PHP] printing
Is there a way in php to print to a printer? say i have a order from , when someone clicks the submit button - then print the form plus the entered details to a page ? No, that's handled client side. PHP is server side. Use Javascript or the like... ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] printing
Yes. You'd better hope your server has a printer, though! :-) Seriousley though, PHP runs on the server. By the time the viewer sees it, it's already executed. Which means it can't do anything to the client's machine. Look into some client-side scripting. Shaun van den Berg wrote: Hey, Is there a way in php to print to a printer? say i have a order from , when someone clicks the submit button - then print the form plus the entered details to a page ? Thanks for you help Shaun -- Novtel Consulting Tel: +27 21 9822373 Fax: +27 21 9815846 Please visit our website: www.novtel.co.za -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP vs Perl for system scripts (non-web)
I'm more comfortable writing stuff in PHP. I use PHP alot more, and I find the resultant code more readable and easier to maintain. Aside from Perl's ubiquity and the dubious advantage of future flexibility by using Perl's DBI interface to talk to different SQL servers (I'm using MySQL at the moment), are there any compelling reasons I should write system stuff in Perl rather than PHP? If you have complicated tasks there may be more Perl examples on the internet, and that would be a vote for Perl. But then again, i once tried to translate Perl to PHP and that was unexpectedly easy. Except for the crypt() function which turned out to be different. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Thread safety
Hello ! I write extension for PHP. I create bibliothek for Windows and for Linux. I set switch ZTS for thread-safety in Windows and use project php4ts. How can I set thread-safety for Linux? Help!! Thank you at advance Olga -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need Guru's Help
At 07:52 28-1-03, you wrote: Hi All Guru's here, Sorry, i am not a guru. I do have visions to become the enigmatic leader of a sekte but i think that's slightly out of scope here. (Actually i have 500 html files containing this table struction,and need to read all 500 files and convert them to DB schema or XML format) I had to do something similar. Unfortunately that code is not very readable. Maybe you can find something readable in a script library, look for 'html page ripper' or 'ripping an html page'. What i did was i first cleaned up all HTML files in one sweep with the Search and Replace in Multiple Files option of UltraEdit. This to remove the head section which would bother me, and to remove newlines and tabs and double spaces. Then i selected the keywords (or key sentences) that came back in all files that would announce the coming of a new data element. In your case they are easy to distinguish: add the b tag to the search sequence. In my files the keywords where luckily very unique. I made an array of these keywords. I think i did this: $array['name']['key']='bName/b'; Then i read in the files one by one, and with each file content i would go through the content. I would look for the start of every keyword or sentence (strpos) and find the end of it by looking for the next /td tag. This value i would clean up and then add as value to the array. Maybe $array['name']['value']=trim($result); From this array it was easy to build a query. Next file. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: printing
On Tue, Jan 28, 2003 at 09:38:09AM +0200, Shaun van den Berg wrote: Is there a way in php to print to a printer? say i have a order from , when someone clicks the submit button - then print the form plus the entered details to a page ? Are you talking about having a submit button that launches a browser's print dialog, as if the user pressed the print button in their browser, or do you want a user's form submission to cause a printer on (or near) your web server to spit out something based on the form contents? I've build scripts that print to a server-side printer by creating output using pdflib, then submitting the PDF to the local (unix-based) lpr system. Then the only complexity is getting lpr to deal with PDF files (along with solutions to the security issues that surround giving your web server process the ability to submit print jobs). I do this for requests for paper invoices which fit inside window envelopes, so any invoices that turn up on the printer just get stuffed and mailed. I also do something similar for requests for FAXed quotes. The software builds a PDF, then submits it to Hylefax's sendfax program, which dumps it to a fax server elsewhere on the network. If you're doing this in a Microsoft environment, I have no clue how you'd even approach the problem, let alone solve it. -- Paul Chvostek [EMAIL PROTECTED] Operations / Abuse / Whatever it.canada, hosting and development http://www.it.ca/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem installing php
Hi I am trying to install php with PHP 4.3.0 installer on windows98. I have the Xitami server. When I try to run a php-file in the webbpages folder I get the following meaasge Security Alert! The PHP CGI cannot be accessed directly. This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive. Does anyone know how I can get it to work? Thanks for any help! Best regards /Anton -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] problem installing php
Hi I am trying to install php with PHP 4.3.0 installer on windows98. I have the Xitami server. When I try to run a php-file in the webbpages folder I get the following meaasge Security Alert! The PHP CGI cannot be accessed directly. This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive. Uncomment the last line shown here from php.ini and set it to zero. ; cgi.force_redirect is necessary to provide security running PHP as a CGI under ; most web servers. Left undefined, PHP turns this on by default. You can ; turn it off here AT YOUR OWN RISK ; **You CAN safely turn this off for IIS, in fact, you MUST.** ; cgi.force_redirect = 1 ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] set_error_handler inside a class
hi guys how is ti possible to do a set_error_handler within a class so it will trigger the callback function and so will be able to return the line and file in the message ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need Guru's Help
Tariq -- ...and then Tariq Murtaza said... % % Hi All Guru's here, Hi! [Hey, does that make me a guru now? ;-] % % I need your help regarding converting HTML Table structure to DB schema % or XML format. I am not a Regular expression expert. While I realize that this is a php list, I nonetheless recommend perl. I had a quick look around at search.cpan.org for html table parse and found lots of results, the first two of which look like exactly what you need. If this is a one-shot conversion for your 500 files, I'd go that route since it's already written. HTH HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg94699/pgp0.pgp Description: PGP signature
Re: [PHP] Need Guru's Help
Thanks David, I want it in php instead of perl anyway thanks for your help Regards, Tariq David T-G wrote: Tariq -- ...and then Tariq Murtaza said... % % Hi All Guru's here, Hi! [Hey, does that make me a guru now? ;-] % % I need your help regarding converting HTML Table structure to DB schema % or XML format. I am not a Regular expression expert. While I realize that this is a php list, I nonetheless recommend perl. I had a quick look around at search.cpan.org for html table parse and found lots of results, the first two of which look like exactly what you need. If this is a one-shot conversion for your 500 files, I'd go that route since it's already written. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ftp_ssl_connect
Hello, I try it again ... is anybody here who can tell me how to use the ftp_ssl_connect function in 4.3? Has anybody a sample code in which the use uf the openSSL functions are declared? rtfm does not help here, because I do read for days now. Thanks, Markus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with copy()
hi can the string source in copy () looks like that: c:\pic.jpg. If not than how should it look like. I'm not sure becouse script gives me Unable to open c:\pic.jpg for reading: No such file or directory but the file is there. and when i'm using $HTTP_POST_FILES['file']['tmp_name'] it returns me: 'Unable to open 'none' for reading: No such file or directory'. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] question about GD and colors
Hi I have the same Problem with the bundeled libary. I hade no time to fill in a bug report at bugs.php.net. Probably you could? regards Sebastian -Original Message- From: Jean-François Marseaut [mailto:[EMAIL PROTECTED]] Sent: Monday, January 27, 2003 5:16 PM To: [EMAIL PROTECTED] Subject: [PHP] question about GD and colors With this script under, I get resized image in only 16 colors. with an old version of gd, I got 16 million colors images. Has someone a response ? ?PHP /*** file [string] - filename jpg w [int] - width / header(Content-type: image/png); $file = urldecode($file); $file = ../.$file; $infofile = getimagesize($file); $long = $infofile[1]; $haut = $infofile[0]; $type = $infofile[2]; if ($long$w) $w=$long; $ratio = $haut / $w; $h = $long / $ratio; if ($h$w) { $h = $w; $ratio = $long / $w; $w = $haut / $ratio; } $h = (int)$h; $dst_img = ImageCreate($w, $h); $background_color = ImageColorAllocate ($dst_img, 0, 0, 0); switch ($type) { case 1 : $src_img=ImageCreateFromGif($file); break; case 2 : $src_img=ImageCreateFromJpeg($file); break; case 3 : $src_img=ImageCreateFromPng($file); break; case 6 : $src_img=imagecreatefromwbmp($file); break; default : ImagePng($dst_img); } imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $w, $h, ImageSX($src_img), ImageSY($src_img)); imagepng($dst_img); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fw: [PHP] help needed with session variables
Isnt it better to do it in this way? session_start(); session_register('USER'); $USER['valid'] = true; $USER['firstname'] = $first_name; $USER['lastname'] = $last_name; Then I really know what I am doing! Good luck Sascha - Original Message - From: 1LT John W. Holmes [EMAIL PROTECTED] To: Pushpinder Singh Garcha [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, January 27, 2003 11:02 PM Subject: Re: [PHP] help needed with session variables Are you sure $first_name and $last_name have a value? Double check... ---John Holmes... - Original Message - From: Pushpinder Singh Garcha [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 27, 2003 4:44 PM Subject: [PHP] help needed with session variables hello, I am making use of sessions in my PHp/MySQL Database application. When the user is successfully authenticated against the database, a session is created in following manner: session_register(valid_user,firstname,lastname); $valid_user = $login; $firstname = $first_name; $lastname = $last_name; While I am able to use the $valid_user variable all thru the sesion , when I try to use the $valid_user it works fine (i.e. I am able to access the value) throughout the session, however when I try to use the other two registered session variables i.e firstname and lastname, I am not able to extract the value. Can you suggest what might be going wrong. Note I am locally testing the setup on my Mac. Many Thanks Pushpinder Singh Garcha _ Web Architect -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php conditional formatting question
I know it's possible, but I just can't get it working. In an old file I have a straight php coding doc where it's used and am now trying to mimic the resulting output. I'm trying to get a result from a query in a specific color when it fits the bill ( if ($teamcaptain == $deelnemer) //if yes, we'll make the result green echo td class=achtergrondbottom; etc (SEE BELOW)) when the person ($deelnemer) also fits the $teamcaptain I want this one to be listed in different format, I dont care if it's only color or if it's a css. Hope there's someone able to help me here, thanks, Martin The Netherlands part of php code: do { ? tr class=laag2 ?php $teamcaptain = strtoupper($row_rsCompetitie['tmcap']);echo $teamcaptain; $deelnemer = strtoupper($row_rsCompetitie['zoekcode']);echo $deelnemer;? ?php if ($teamcaptain == $deelnemer) //if yes, we'll make the result green echo td class=achtergrondbottom; } ? td?php echo $row_rsCompetitie['zoekcode']; ?/td td class=achtergrondgrijs?php echo $row_rsCompetitie['roepnaam']; ?/td td?php echo $row_rsCompetitie['samennaam']; ?/td td?php echo $row_rsCompetitie['handicap']; ?/td td?php echo $row_rsCompetitie['tmnaam']; ?/td td?php echo $row_rsCompetitie['tmklasse']; ?/td td?php echo $row_rsCompetitie['tmpoule']; ?/td /tr ?php } while ($row_rsCompetitie = mysql_fetch_assoc($rsCompetitie)); ? /table -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Transition Page?
If there is really need for such a page, my first guess was, as i thought about it, to enter the content, which is responsible for the upload in a invisible frame. For an invisible Frame you just have to make a frameset, where you only can see one part of the frame frameset rows=*,1 or some like that, and on the other hand you are just making your transition page. after your upload is finished you just have to run a javascript parent.location.href= command. Dont know if it works but just give it a try. mh, dont know if it really works, have no time yet, would be nice to know :)) Greetings Sascha
[PHP] parsing ini files
Hey everybody, I'm new the list and to PHP, so I thought I'd launch right in with a question. I have a file which contains the following syntax: ; Events listings [event] month = january day = 23 year = 2003 venue = some club description = this is an event [event] month = january day = 12 year = 2003 venue = another club description = this is another event Each one of these headers sections represents the start of a new event. So, my code does the following: $EVENTS = parse_ini_file('./data/events', TRUE); while($key = key($EVENTS)) { $$key = current($EVENTS); //variable variables next($EVENTS); } The problem is that when I try to print the values for $venue, $day, etc, I only get the values for the last section encountered. I need a way to get the values of all the events - do my section heads need to be unique, or can I continue to use the same format in my ini file? Thanks in advance! -Erich- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Access
Access Does anyone here have any idea how to connect access to PHP? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Found a PHP bug!!!!!!!!!
just try doing it with === (three equal signs) and you'll see what is where -- Maxim Maletsky [EMAIL PROTECTED] Cal Evans [EMAIL PROTECTED] wrote... : John. Actually, 08 is equal to 8 in PHP. PHP will convert the string to an integer and the two will compare as equal. No they are not equal. Yes, PHP will do the conversion so that they are equal. That does not refute the fact that logically '08' != 8. Someone already posted why the problem was happening, because the numbers were being converted to invalid octal numbers and being set to zero. I understand the problem at hand. (and did when I posted) However, if Scott had been doing the conversions manually, he would never have run across this problem. It is a bad idea to rely on the language (whatever the language) to do automatic variable conversions. =C= -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Found a PHP bug!!!!!!!!!
Your bug is this: inconsistency of types. You split a formatted string into smaller strings and compare the integers to it. In order to do this correctly, you will need to take your integers and convert them into the strings, format of which you already know and used for deformatting the original string. Then compare. That is the only way to be safe, other ways are magic because PHP debugged them for you. It's really all about the programming logic. few of you who are fluent with C or Java would dump into this. -- Maxim Maletsky [EMAIL PROTECTED] Scott Fletcher [EMAIL PROTECTED] wrote... : Found a PHP bug, I'm using PHP version 4.2.3. I have been struggling with why PHP code failed to work with the month is August or September, so I have been playing around it and found the problem. I recently wrote a demo script for you all to play around with. Let me know which PHP version does this bug not affected you I'm going to file a PHP bug at http://bug.php.net.. I'll let you know where PHP bug # is it. To tell you the truth, I don't know how to search for existing bug on this one if there is any because I don't know if it is an if-statement issue or if it is something else Feel free to submit a patch if you know how. Let me know what you found and post it here... --clip-- ? //Sample Code. == $VARIABLE[0] = 2002-01; $VARIABLE[1] = 2002-02; $VARIABLE[2] = 2002-03; $VARIABLE[3] = 2002-04; $VARIABLE[4] = 2002-05; $VARIABLE[5] = 2002-06; $VARIABLE[6] = 2002-07; $VARIABLE[7] = 2002-08; $VARIABLE[8] = 2002-09; $VARIABLE[9] = 2002-10; $VARIABLE[10] = 2002-11; $VARIABLE[11] = 2002-12; //Loop Code to check the variable === for ($x=0;$x12;$x++) { $month = substr($VARIABLE[$x],5,2); echo The # of month is .$x.br; if ($month == 01) { echo It's a Match!!br; } else { echo It's not a Match!!br; } if ($month == 02) { echo It's a Match!!br; } else { echo It's not a Match!!br; } if ($month == 03) { echo It's a Match!!br; } else { echo It's not a Match!!br; } if ($month == 04) { echo It's a Match!!br; } else { echo It's not a Match!!br; } if ($month == 05) { echo It's a Match!!br; } else { echo It's not a Match!!br; } if ($month == 06) { echo It's a Match!!br; } else { echo It's not a Match!!br; } if ($month == 07) { echo It's a Match!!br; } else { echo It's not a Match!!br; } if ($month == 08) { echo It's a Match!!br; } else { echo It's not a Match!!br; } if ($month == 09) { echo It's a Match!!br; } else { echo It's not a Match!!br; } if ($month == 10) { echo It's a Match!!br; } else { echo It's not a Match!!br; } if ($month == 11) { echo It's a Match!!br; } else { echo It's not a Match!!br; } if ($month == 12) { echo It's a Match!!br; } else { echo It's not a Match!!br; } echo br; } //Strange Workaround to 08 and 09 === echo Strange Workaround to the Problem!!brbr; $month = substr($VARIABLE[7],5,2); echo The # of month is 08br; if (trim($month) == 8) { echo It's working!!!br; } $month = substr($VARIABLE[8],5,2); echo The # of month is 09br; if (trim($month) == 9) { echo It's working!!!br; } //Testing (Should this be working or not??) = echo brbr; $month = substr($VARIABLE[0],5,2); echo The # of month is 1br; if (trim($month) == 1) { //With 1 as an integer... echo It's working!!!br; } echo br; $month = substr($VARIABLE[0],5,2); echo The # of month is 01br; if (trim($month) == 01) { //With 01 as an integer echo It's working!!!br; } echo br; $month = substr($VARIABLE[0],5,2); echo The # of month is 1br; if (trim($month) == 1) { //With 1 as an integer... echo It's working!!!br; } echo br; $month = substr($VARIABLE[0],5,2); echo The # of month is 01br; if (trim($month) == 01) { //With 01 as an integer echo It's working!!!br; } ? --clip-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Do php extension need to be thread-safe?
Absolutely yes. Take a look at the current extensions there to see how it can be controlled. -- Maxim Maletsky [EMAIL PROTECTED] Joshua Moore-Oliva [EMAIL PROTECTED] wrote... : Do php extension need to be thread-safe? I am running php on apache2. I would guess that since it's compiled in as a module, it would need to be thread-safe correct? Josh. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpMyAdmin for Microsoft SQL
There is nothing for MS SQL that I know. phpMyAdmin was used for mySQL initially and then some volunteers like you made postreSQL and Oracle versions of it. So, you might want to try one on your own on SourceForge :) -- Maxim Maletsky [EMAIL PROTECTED] Joshua E Minnie [EMAIL PROTECTED] wrote... : Hey all, Does any body know of anything similar to phpMyAdmin for MS SQL? I have been doing some googling and haven't come across anything that would help me out. I have also checked out www.sourceforge.net and can't seem to come across anything either. I am looking for something that will be easy enough for my client to utilize to update/manipulate a database, rather than having me re-create the wheel so-to-speak. -- Joshua Minnie Advantage Computer Services, LLC Senior Project Manager [EMAIL PROTECTED] www.advantagecomputerservices.com Tel: 269.276.9690 Fax : 269.342.8750 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with Filesize
Try fstat() function on the file pointer - it will return you the various results, including its size. -- Maxim Maletsky [EMAIL PROTECTED] Rodrigo Corrêa [EMAIL PROTECTED] wrote... : How do i use the function filesize, because i´m using like: I just want associate the variable $body with a html file $file_name = 'c:/templates/resp_rep_efetiva_contrato.php'; $fd = fopen($file_name,r); line 27 $size = filesize($file_name); / Dá erro aqui $body = fread($fd, $size); $mail = mail($address, $subject, $body, $header); it keeps saind that: Warning: stat failed for c://templates/resp_rep_efetiva_contrato.php (errno=2 - No such file or directory) in line 27 but, the file exists because the fopen function works ok, I don´t known what to do Thanks in advance Equipe Pratic Sistemas Rodrigo Corrêa Fone: (14) 441-1700 [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help needed with session variables
pass it one value at the time: session_register(valid_user); session_register(firstname); session_register(lastname); Another recommended method is to use superglobal variable $_SESSION. You can then simply do: $_SESSION['valid_user'] = $login; $_SESSION['firstname'] = $first_name; $_SESSION['lastname'] = $last_name; and the three variables will be available on the next pages. remember to start sessions before hand: session_start(); -- Maxim Maletsky [EMAIL PROTECTED] Pushpinder Singh Garcha [EMAIL PROTECTED] wrote... : hello, I am making use of sessions in my PHp/MySQL Database application. When the user is successfully authenticated against the database, a session is created in following manner: session_register(valid_user,firstname,lastname); $valid_user = $login; $firstname = $first_name; $lastname = $last_name; While I am able to use the $valid_user variable all thru the sesion , when I try to use the $valid_user it works fine (i.e. I am able to access the value) throughout the session, however when I try to use the other two registered session variables i.e firstname and lastname, I am not able to extract the value. Can you suggest what might be going wrong. Note I am locally testing the setup on my Mac. Many Thanks Pushpinder Singh Garcha _ Web Architect -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] multiple entry forms !!
Create the 7 steps, or 7 pages. Create a session to contain all the answers you need from the user Submit a form on each step and register each data-set into the session respectively to the their locations. Fill up the whole session this way and proceed on the 7th step to the actual injection into the DB. That is the most elegant way, IMO. -- Maxim Maletsky [EMAIL PROTECTED] scott [EMAIL PROTECTED] wrote... : hi looking for some advice I have a site in progress. user to it have to enter a LOT of information (it will contain a club directory) in order to try and make it a less unpleasant experience for the user, I want to give them 7 smaller input forms, each one following the other what would be the correct way to do this, one very large, complex coded php conditional form that does everything, or several smaller ones ? if I use one form, it will conatin rather a lot of code, but execution would all be handled by the form itself but if I use multiple smaller forms, each form would need to process the previous forms input, and then display it's inputs for entry I am also using sessions, which adds a little to complexity any general good coding practice tips/links would be helpful thanks _scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HELP session cache limiters
this means that somewhere (on line 19 of /home/sisource/public_html/stage/administration/config.php) there is an output. For sessions to work, session_start() should be *before* any output was created. Even a new line or a whitespace would break it. -- Maxim Maletsky [EMAIL PROTECTED] Didier McGillis [EMAIL PROTECTED] wrote... : I dont know where this came from. The site was working fine, unless someone else on my team made a fix in this file. Any thoughts on this error? Warning: Cannot send session cache limiter - headers already sent (output started at /home/sisource/public_html/stage/administration/config.php:19) in /home/sisource/public_html/stage/administration/phpSecurePages/checklogin.php on line 134 _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP vs Perl for system scripts (non-web)
Paul Chvostek [EMAIL PROTECTED] wrote... : I have to write a swath of code to manage system-related stuff based on database content. Scripts will be run as root by cron, and determine what they have to do via user interaction and SQL lookups. Functions will include manipulation of system configuration files, legacy text file configs, and some signalling with posix_kill. On some of the machines in question, there won't even be an httpd installed, so I'd be building a php as a standalone binary, and running it with shell magic and a -q option. I've done this kind of stuff in the past in smaller environments, and it seems to work nicely. PHP can easily do all that, probably even easier that with Perl. Perl is somewhat too painful to write scripts in. For my needs, i whether use PHP or Ruby for stand-alone apps. Ruby is less flexible than PHP but its pure OOP and I often need to resort to it. I'm more comfortable writing stuff in PHP. I use PHP alot more, and I find the resultant code more readable and easier to maintain. You answered yourself again - if you are more comfortable with PHP then why hassle with painful Perl? Aside from Perl's ubiquity and the dubious advantage of future flexibility by using Perl's DBI interface to talk to different SQL servers (I'm using MySQL at the moment), are there any compelling reasons I should write system stuff in Perl rather than PHP? PHP natively works quite well with mySQL, thus its another reason to use it. -- Maxim Maletsky [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Access to Pear
It is a bad idea to hijack someone's thread. In other words, when posting a new question, do not reply to an existing post changing its subject and content. Mail headers still reference to the old one and we all see it just being another post of a thread. -- Maxim Maletsky [EMAIL PROTECTED] Warren Vail [EMAIL PROTECTED] wrote... : I know how to load extensions if they are not included in PHP.ini (dl function), but how do I gain access to PEAR? I can see the directory /apache/php/pear/ on my test machine, but when I try to reference via include_once(DB.php); not found on include list error, can I dynamically change include list, and what kind of security hole would that represent? my test machine is windows, and my production machine is Redhat Linux, so I need to find a way to gain access to pear in both environments. Warren Vail [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Page Refresh on Redirection
make sure that new page's headers do not cache. See www.php.net/header for examples. -- Maxim Maletsky [EMAIL PROTECTED] Phil [EMAIL PROTECTED] wrote... : I have a PHP page with a form that submits to another PHP processing page. On completion of the PHP actions on the processing page, I have echoed into the page the javascript action of 'location.href=...' and the location is redirected to the PHP form page that starting the process. Both pages take data from an SQL server. The problem I'm having is that the the javascript always grabs the cached page. I need a newly refreshed page to return with updated data from the SQL server. Any suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Good way to organize code using classes???
@ Nilaab [EMAIL PROTECTED] wrote... : Hello everyone, I want to be able to use objects to create my future pages. My goal is to use methods of classes to make the original front-line script easier to read, while all the processing is done with a simple call to the different classes from a single class. Please read futher, as I'll get to a point and to my question... I have many classes that do different tasks, like formValidator.class, stringManipulator.class, db.class, fileManipulation.class, template.class, etc (these are self-explanitory as their names suggest). Then, I might have a class called category.class that adds, deletes, edits, moves, and renames categories within the filesystem and database. But I would have a front-line script called category.php that would call the necessary methods of category.class at certain points, depending on the task being done on a specific step. In other words I want category.class to call the other classes and do something with them, then in turn I want category.php to call objects in category.class for a specific task, such as: ?php // category.php include (category.class); $cat = new category (); $cat-addCategory($new_cat_name); // or $cat-editCategory($cat_name); // or $cat-deleteCategory($cat_name); // or $cat-moveCategory($cat_name); // or $cat-renameCategory($cat_name); ? My question is: How can I call a class within another class and do something with it? Right now I'm doing it the most convenient way I know, which is including other classes using the include() function within the methods of the category.class. There is no multiple-inheritance allowed in PHP, so I can only use inheritance on one class. Including new classes within the existing classes is not such a bad idea as it ensures you to have only the necessary classes called. I am also extremely skeptical about creating too many classes at a time in one script. Do the above examples degrade performance speed of the script when I call too many classes? Also, isn't there a way to use sessions to save created classes and then use them again for other scripts without the need to make a new instance of the same class again and again? yes, you can serialize/unserialize classes into the sessions. This makes it a little more complicated, but can be helpful sometimes. I am really looking for a better way to organize my code while still being able to use these classes whenever I need them and at the same time keeping the category.php file clean and easy to read. Is there a tutorial on how to organize code? I'm not looking for html template tutorials. Just how to get around inheritance limits while still keeping performance and clean-code in mind. You know what I have once done? I created a file with functions that return you the object pointers. It would create (declare) the class whenever it was not declared before or just return the pointer from a global variable if it was declared before. That way, you only load a few functions, and whenever you need a class you assign a variable to the function's return to have the class. This limits you script to only classes you use and no includes within the script itself. A kind of silly method, but can be easy to work with. Also, check out the new Zend 2 engine, it has tons of improvements with classes for PHP5. Currently the code is in CVS (checkout php5 module). Changes are listed here: http://cvs.php.net/co.php/ZendEngine2/ZEND_CHANGES -- Maxim Maletsky [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need Guru's Help
What about looking for something like that written in C that would convert your HTML into XML and then use PEAR's XMLParser to get it into a PHP structure? -- Maxim Maletsky [EMAIL PROTECTED] Tariq Murtaza [EMAIL PROTECTED] wrote... : Hi All Guru's here, I need your help regarding converting HTML Table structure to DB schema or XML format. I am not a Regular expression expert. (Actually i have 500 html files containing this table struction,and need to read all 500 files and convert them to DB schema or XML format) Looking for anybody to help me out. Regards Tariq table width=83% border=1 cellpadding=2 cellspacing=0 tr td colspan=8 height=25 b a href=http://www.ababasons.com A. BABA amp; SONS/a/b /td tr td colspan=8 align=left valign=top p240/2, SECTOR 6.1, Lahore.br [LAHORE ] /p/td tr tdbPhone:/b/td td92021-6974878/td tdbMobile:/b/td td colspan=30333-66566 /td tdbFax:/b/td td colspan=392021-6901145/td /tr tr td colspan=8 height=25 b a href=http://www.ababasons.com ABC amp; CO/a/b /td tr td colspan=8 align=left valign=top p240/2, SECTOR 6.1, NORTH KARACHI, KARACHI.br [KARACHI ] /p/td tr tdbPhone:/b/td td92021-6974878/td tdbMobile:/b/td td colspan=3033-565659/td tdbFax:/b/td td colspan=392021-6118625 /td /tr tr td colspan=8 height=25 b a href=http://www.ababasons.com ARahat Textile/a/b /td tr td colspan=8 align=left valign=top p240/2, SECTOR 6.1, NORTH KARACHI, KARACHI.br [KARACHI ] /p/td tr tdbPhone:/b/td td92021-6974878/td tdbMobile:/b/td td colspan=3nbsp; /td tdbFax:/b/td td colspan=392021-6966625 /td /tr tr td colspan=8 height=25 b a href=http://www.ababasons.com A. Corvid Ltd/a/b /td tr td colspan=8 align=left valign=top p240/2, SECTOR 6.1, NORTH Peshawarbr [PESHAWAR ] /p/td tr td width=7%bPhone:/b/td td width=26%92021-6974878/td td width=8%bMobile:/b/td td colspan=30332-656656 /td td width=5%bFax:/b/td td width=33% colspan=392021-69086265/td /tr /table -- Tariq Murtaza Assistant Web Master Business Technology Team Small Medium Enterprise Development Authority -- Tariq Murtaza Assistant Web Master Business Technology Team Small Medium Enterprise Development Authority -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] printing
It's easy to do with JavaScript. Client will only have to confirm. Sometimes, in PDF nor even confirming is necessary. Not sure if what I said makes sense. -- Maxim Maletsky [EMAIL PROTECTED] Shaun van den Berg [EMAIL PROTECTED] wrote... : Hey, Is there a way in php to print to a printer? say i have a order from , when someone clicks the submit button - then print the form plus the entered details to a page ? Thanks for you help Shaun -- Novtel Consulting Tel: +27 21 9822373 Fax: +27 21 9815846 Please visit our website: www.novtel.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Thread safety
Don't the current PHP extensions have a good example there? It's pretty much easy to understand reading the code. -- Maxim Maletsky [EMAIL PROTECTED] Olga Tonkonog [EMAIL PROTECTED] wrote... : Hello ! I write extension for PHP. I create bibliothek for Windows and for Linux. I set switch ZTS for thread-safety in Windows and use project php4ts. How can I set thread-safety for Linux? Help!! Thank you at advance Olga -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with copy()
you need to escape the windows backslash: $file = c:\pic.jpg; should be $file = c:\\pic.jpg; or $file = c:/pic.jpg; which will work the same -- Maxim Maletsky [EMAIL PROTECTED] Bartosz Matosiuk [EMAIL PROTECTED] wrote... : hi can the string source in copy () looks like that: c:\pic.jpg. If not than how should it look like. I'm not sure becouse script gives me Unable to open c:\pic.jpg for reading: No such file or directory but the file is there. and when i'm using $HTTP_POST_FILES['file']['tmp_name'] it returns me: 'Unable to open 'none' for reading: No such file or directory'. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parsing ini files
there is a bunch of examples to parse the ini files in PHP. You can even do one on your own: 1. loop every line 2. if format is [**] then this is the key 3. everything till the empty line is a key = value pair P.S: please, when replying click on new email and cutpaste the email address. If you click reply-to and change the to and body to your own so it looks like a new post, some of us still get it as a thread of the previous one. -- Maxim Maletsky [EMAIL PROTECTED] Erich C. Beyrent [EMAIL PROTECTED] wrote... : Hey everybody, I'm new the list and to PHP, so I thought I'd launch right in with a question. I have a file which contains the following syntax: ; Events listings [event] month = january day = 23 year = 2003 venue = some club description = this is an event [event] month = january day = 12 year = 2003 venue = another club description = this is another event Each one of these headers sections represents the start of a new event. So, my code does the following: $EVENTS = parse_ini_file('./data/events', TRUE); while($key = key($EVENTS)) { $$key = current($EVENTS); //variable variables next($EVENTS); } The problem is that when I try to print the values for $venue, $day, etc, I only get the values for the last section encountered. I need a way to get the values of all the events - do my section heads need to be unique, or can I continue to use the same format in my ini file? Thanks in advance! -Erich- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Access
with ODBC www.php.net/odbc -- Maxim Maletsky [EMAIL PROTECTED] Todd Barr [EMAIL PROTECTED] wrote... : Access Does anyone here have any idea how to connect access to PHP? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parsing ini files
I have a file which contains the following syntax: ; Events listings [event] month = january day = 23 year = 2003 venue = some club description = this is an event [event] month = january day = 12 interesting function, i had not seen it yet. You could have a look at the alternative function mentioned by the users 'seb' and 'Tom' in the online manual http://nl.php.net/manual/nl/function.parse-ini-file.php, at least you can tweak that so the values get added to arrays. Or you could see whether this will work: [event] month[]=januari [event] month[]=februari I doubt whether it would work, the idea is that in this case $month[0] would be januari and $month[1] februari. $EVENTS = parse_ini_file('./data/events', TRUE); while($key = key($EVENTS)) { $$key = current($EVENTS); //variable variables next($EVENTS); } if you ask me, i would do it like this: while (list ($key, $val) = each ($_POST)) { { $$key = $val; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting a value back from POST (not the built-in return)
Using a fairly simple fsockopen and POST I'm sending form data to a script which populates fields in a database. Everything works fine, however I've been trying to figure out how to send a value set on the other machine (database) back through the open socket (note: not the return value usually retrieved by fgets($fp etc...) which is then available to the sending machine. Searching via Google hasn't given me an answer. Is it possible? Can somebody help? Syntax would be very nice, I'm not a PHP guru. TIA, Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Too many 'linespaces'
Thanks, problem solved! I moved the hidden-vars inside a td-tag and the problem was no more. Lars Lars Espelid [EMAIL PROTECTED] skrev i melding [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, I present some content of a mysql-table in an html-table. When the query which collects the content contains few rows I get the amount of space I want between the output and the above content. But when I get for instance 60 rows, the printed result jumps down about 7 lines. I would like to have the same small gap between the result of the query and the above content. The code is as follows: ..snip. table width=100% cellpadding=0 class=alle tr td nbsp;strong?php echo $row_Recordset1['mModell']; ?/strong /td td align=rightnbsp; /td /tr tr td colspan=2 ?php //checks if there exists any rows if($totalRows_Recordset1 0) { ? table width=70% border=0 tr ..around here the printed result jumps many rows down tdstrongKontonr./strong/td tdstrongDelkontonr./strong/td tdstrongTekst/strong/td tdstrongKostnad/strong/td tdstrongEnhet/strong/td /tr trtd colspan=5/td/tr ?php do { $kontonr = $row_Recordset1['mKontonr']; $delkontonr = $row_Recordset1['mDelkontonr']; if ($delkontonr == 0) { $strong = 'strong'; $strong2 = '/strong'; } else { $strong = ''; $strong2 = ''; } ? tr td?php echo $strong . fjern_null($row_Recordset1['mHovedkonto']) . $strong2; ?/td td?php echo $strong . $row_Recordset1['mDelkontonr'] . $strong2; ?/td td?php echo $strong . $row_Recordset1['mKontotekst'] . $strong2; ?/td td?php echo $strong . fjern_null($row_Recordset1['mKostnad']) . $strong2; ?/td td?php echo $strong . $row_Recordset1['mEnhet'] . $strong2; ?/td /tr !--input name=modell type=hidden value=?php //echo $modell; ?-- input name=modellId type=hidden value=?php echo $row_Recordset1['modellId']; ? ?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ? /table ?php } //if($totalRows_Recordset1 0) { ? /td /tr /table .. and so on When the query returns 60 rows I get ca. 7 blank lines between ?php echo $row_Recordset1['mModell']; ? and Kontonr. Does anyone understand? Anyone have a tip? Thanks a lot! Lars -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php conditional formatting question
I'm new to PHP but I had a similar problem. I was comparing information in a flat text file with a variable in my php code. They never matched according to the php. I echo'd both values to the screen and they matched. So then I echo'd them to the screen with three 'a' in front and three 'a' in back of the values. Much to my suspicion there was a blank space behind the value from the text file. So, I used rtrim to get rid of the blank space. Looks something like this: $contents[1] = rtrim($contents[1]); if ($idname = = $contents[0]) { echo Works Thus Far!; exit; } Hope this is helpful! ! ! Roger WMB wrote: I know it's possible, but I just can't get it working. In an old file I have a straight php coding doc where it's used and am now trying to mimic the resulting output. I'm trying to get a result from a query in a specific color when it fits the bill ( if ($teamcaptain == $deelnemer) //if yes, we'll make the result green echo td class=achtergrondbottom; etc (SEE BELOW)) when the person ($deelnemer) also fits the $teamcaptain I want this one to be listed in different format, I dont care if it's only color or if it's a css. Hope there's someone able to help me here, thanks, Martin The Netherlands part of php code: do { ? tr class=laag2 ?php $teamcaptain = strtoupper($row_rsCompetitie['tmcap']);echo $teamcaptain; $deelnemer = strtoupper($row_rsCompetitie['zoekcode']);echo $deelnemer;? ?php if ($teamcaptain == $deelnemer) //if yes, we'll make the result green echo td class=achtergrondbottom; } ? td?php echo $row_rsCompetitie['zoekcode']; ?/td td class=achtergrondgrijs?php echo $row_rsCompetitie['roepnaam']; ?/td td?php echo $row_rsCompetitie['samennaam']; ?/td td?php echo $row_rsCompetitie['handicap']; ?/td td?php echo $row_rsCompetitie['tmnaam']; ?/td td?php echo $row_rsCompetitie['tmklasse']; ?/td td?php echo $row_rsCompetitie['tmpoule']; ?/td /tr ?php } while ($row_rsCompetitie = mysql_fetch_assoc($rsCompetitie)); ? /table -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting a value back from POST (not the built-in return)
At 01:38 29-1-03, you wrote: Using a fairly simple fsockopen and POST I'm sending form data to a script which populates fields in a database. Everything works fine, however I've been trying to figure out how to send a value set on the other machine (database) back through the open socket (note: not the return value usually retrieved by fgets($fp etc...) which is then available to the sending machine. Searching via Google hasn't given me an answer. Is it possible? Can somebody help? Syntax would be very nice, I'm not a PHP guru. i never did use fsockopen, but reading a bit in the online user-annotated manual (http://www.php.net/manual/en/function.fsockopen.php) i found this link that may help you on the sending side: http://www.faqts.com/knowledge_base/view.phtml/aid/12039/fid/51 On the receiving side, if we're talking POST, then you HAVE to be aware of the change in handling them since PHP 4.10, before this version you could just try to read the POST variable directly, e.g. Name went to $Name, or better $HTTP_POST_VARS['Name']. But since then it is recommended to read it through $_POST['Name']. The old way only works if you set register_globals on in the php.ini file, if i remember well. Unfortunately for you i only have a Dutch link to explain this better. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpMyAdmin for Microsoft SQL
I might just have to do that, thanks. Maxim Maletsky wrote: There is nothing for MS SQL that I know. phpMyAdmin was used for mySQL initially and then some volunteers like you made postreSQL and Oracle versions of it. So, you might want to try one on your own on SourceForge :) -- Maxim Maletsky [EMAIL PROTECTED] Joshua E Minnie [EMAIL PROTECTED] wrote... : Hey all, Does any body know of anything similar to phpMyAdmin for MS SQL? I have been doing some googling and haven't come across anything that would help me out. I have also checked out www.sourceforge.net and can't seem to come across anything either. I am looking for something that will be easy enough for my client to utilize to update/manipulate a database, rather than having me re-create the wheel so-to-speak. -- Joshua Minnie Advantage Computer Services, LLC Senior Project Manager [EMAIL PROTECTED] www.advantagecomputerservices.com Tel: 269.276.9690 Fax : 269.342.8750 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] question about GD and colors
Hi, question was answered yesterday on the list. there is a new function imagecreatetruecolor(). use this instead of imagecreate(). Regard, Philipp - Original Message - From: nospam [EMAIL PROTECTED] To: 'Jean-François Marseaut' [EMAIL PROTECTED] Cc: 'Php-General [EMAIL PROTECTED] Sent: Monday, January 27, 2003 5:48 PM Subject: RE: [PHP] question about GD and colors Hi I have the same Problem with the bundeled libary. I hade no time to fill in a bug report at bugs.php.net. Probably you could? regards Sebastian -Original Message- From: Jean-François Marseaut [mailto:[EMAIL PROTECTED]] Sent: Monday, January 27, 2003 5:16 PM To: [EMAIL PROTECTED] Subject: [PHP] question about GD and colors With this script under, I get resized image in only 16 colors. with an old version of gd, I got 16 million colors images. Has someone a response ? ?PHP /*** file [string] - filename jpg w [int] - width / header(Content-type: image/png); $file = urldecode($file); $file = ../.$file; $infofile = getimagesize($file); $long = $infofile[1]; $haut = $infofile[0]; $type = $infofile[2]; if ($long$w) $w=$long; $ratio = $haut / $w; $h = $long / $ratio; if ($h$w) { $h = $w; $ratio = $long / $w; $w = $haut / $ratio; } $h = (int)$h; $dst_img = ImageCreate($w, $h); $background_color = ImageColorAllocate ($dst_img, 0, 0, 0); switch ($type) { case 1 : $src_img=ImageCreateFromGif($file); break; case 2 : $src_img=ImageCreateFromJpeg($file); break; case 3 : $src_img=ImageCreateFromPng($file); break; case 6 : $src_img=imagecreatefromwbmp($file); break; default : ImagePng($dst_img); } imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $w, $h, ImageSX($src_img), ImageSY($src_img)); imagepng($dst_img); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] regexps
I need to use regular expressions, but i found that the current Perl-compaitable API unuseful in my case, infact i need to get the positions of every match to the pattern and i found nothing in the Manual that does so, does any one know a way to do this (the only one i found is specific to PHP 4.3.0) Thanx in advance :) Regards, Khalid Al-Kary. _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] regexps
I need to use regular expressions, but i found that the current Perl-compaitable API unuseful in my case, infact i need to get the positions of every match to the pattern and i found nothing in the Manual that does so, does any one know a way to do this (the only one i found is specific to PHP 4.3.0) You could match all of the strings and then use one of the other string functions to find the position. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parsing ini files
I have a file which contains the following syntax: ; Events listings [event] month = january day = 23 year = 2003 venue = some club description = this is an event [event] month = january day = 12 year = 2003 venue = another club description = this is another event Each one of these headers sections represents the start of a new event. So, my code does the following: $EVENTS = parse_ini_file('./data/events', TRUE); while($key = key($EVENTS)) { $$key = current($EVENTS); //variable variables next($EVENTS); } The problem is that when I try to print the values for $venue, $day, etc, I only get the values for the last section encountered. I need a way to get the values of all the events - do my section heads need to be unique, or can I continue to use the same format in my ini file? Yes, each section has to be unique, otherwise you're just overwriting the values each time it's read. If you want to do it this way, I'd write your own function to read the file and not use parse_ini_file(). ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help needed with session variables
Isnt it better to do it in this way? Better than what? session_start(); session_register('USER'); $USER['valid'] = true; $USER['firstname'] = $first_name; $USER['lastname'] = $last_name; Then I really know what I am doing! It's personal preference... whatever you understand. I'd recommend just using $_SESSION and keep register_globals OFF, but that's me. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem installing php
Thanks. That solved the problem John W. Holmes [EMAIL PROTECTED] skrev i meddelandet 005e01c2c6ba$975f3110$7c02a8c0@coconut">news:005e01c2c6ba$975f3110$7c02a8c0@coconut... Hi I am trying to install php with PHP 4.3.0 installer on windows98. I have the Xitami server. When I try to run a php-file in the webbpages folder I get the following meaasge Security Alert! The PHP CGI cannot be accessed directly. This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive. Uncomment the last line shown here from php.ini and set it to zero. ; cgi.force_redirect is necessary to provide security running PHP as a CGI under ; most web servers. Left undefined, PHP turns this on by default. You can ; turn it off here AT YOUR OWN RISK ; **You CAN safely turn this off for IIS, in fact, you MUST.** ; cgi.force_redirect = 1 ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_ssl_connect
On Tuesday 28 January 2003 20:19, Markus Boettger wrote: Hello, I try it again ... is anybody here who can tell me how to use the ftp_ssl_connect function in 4.3? Has anybody a sample code in which the use uf the openSSL functions are declared? rtfm does not help here, because I do read for days now. Just what exactly is the problem? AFAICS its use is similar to the plain ftp_connect() -- and there are plenty of examples on how to use that. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet. -- Michael Jackson */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting a value back from POST (not the built-in return)
--- Paul [EMAIL PROTECTED] wrote: Using a fairly simple fsockopen and POST I'm sending form data to a script which populates fields in a database. Everything works fine, however I've been trying to figure out how to send a value set on the other machine (database) back through the open socket (note: not the return value usually retrieved by fgets($fp etc...) which is then available to the sending machine. Searching via Google hasn't given me an answer. Is it possible? Can somebody help? Syntax would be very nice, I'm not a PHP guru. Anything that the receiving Web server outputs is sent back to you just as it would be a Web browser. So, you can read this data just as if from a file (which is why fsockopen is so convenient). Thus, just echo whatever you want to send back. You make a statement that is very conflicting: I've been trying to figure out how to send a value set on the other machine (database) back through the open socket (note: not the return value usually retrieved by fgets($fp etc...) So, you want to send data back through the open socket, but you do not want read this data from the socket. I think you have a misunderstanding here somewhere that will make things difficult for you. What fgets() gives you *is* the data sent from the remote server. If you want to pass data back in a manageable way, you will probably want to output XML, because that is easier and more reliable to parse than HTML. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems with php.net
Good day, This is a bit off-topic for the list, but, I'm not sure where else I can send this. The search function on php.net appears to be broken. One can search through the function list, but any query via whole site or online documentation returns no results. I tried to send a message to [EMAIL PROTECTED], the address posted on the site for this sort of thing. However, my message eventually bounces back to me, with the php.net qmail deamon stating that it can not confirm that my address was valid. I presume that there is some sort of system that replies to me to confirm that my return address is valid, but this also appears to be broken, as no such e-mail is ever received. If anyone can pass this along, or even suggest where this could be sent, that would be great. This problem has been present for a couple of weeks now, at least. Thanks, Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] regexps
using any of the string functions on the output would ofcourse cause a performance drawback (do you agree with me?), i had used a combination of string functions to do instead of regexps, which one will be faster as you think ? where can i suggest such a function on the current regexps API ? Thanx, Khalid Al-Kary _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] set_error_handler inside a class
hi guys how is ti possible to do a set_error_handler within a class so it will trigger the callback function and so will be able to return the line and file in the message ? You'd set it just like you would anywhere else in your code. If you want the callback function to be a method in your class, then you pass an array to set_error_handler(). Details are in the manual on the format of the array. It'll be the same as any other callback function that you can send a classes method to. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] regexps
using any of the string functions on the output would ofcourse cause a performance drawback (do you agree with me?), i had used a combination of string functions to do instead of regexps, which one will be faster as you think ? It depends on exactly what your doing, how much text you have, and why you need to match the position as well as the text. where can i suggest such a function on the current regexps API ? I don't know. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] regexps
using any of the string functions on the output would ofcourse cause a performance drawback (do you agree with me?), i had used a combination of string functions to do instead of regexps, which one will be faster as you think ? Hi, i made some basic bench and see that it really depends... try to make some basic search like ^[0-9]{1,4}$ how can u do this ? with substr, strlen, strstr and ifthenelse ? i found really faster to use preg_match(), which is really faster than if (ereg())... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Allowing . in $_POST variable
Hi all: I filled a bug today that quickly got resolved invalid, but I think it deserves another look. I had a bit of a problem today with . getting converted to _ for my variable names automatically. I have been told that this was because if you have register_globals on, then you can't have a variable with a . in its name. Fair enough. However, since that's now considered to be bad practice, it would make sense to me that this feature get another look. I can see no logical reason to not allow . in the global $_POST variable... Basically, what I'd like is to be able to post a form element with id=myvariable.whatever and access it on the next page with $_POST[myvariable.whatever]. Comments are appreciated. Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Allowing . in $_POST variable
Well I think using periods in variable names in general is a no-no, but other then being a little out-of-the-norm I see no reason why you shouldn't be allowed to. P.S. OEOne is swet software, good job. On Tue, 2003-01-28 at 13:50, Mike Potter wrote: Hi all: I filled a bug today that quickly got resolved invalid, but I think it deserves another look. I had a bit of a problem today with . getting converted to _ for my variable names automatically. I have been told that this was because if you have register_globals on, then you can't have a variable with a . in its name. Fair enough. However, since that's now considered to be bad practice, it would make sense to me that this feature get another look. I can see no logical reason to not allow . in the global $_POST variable... Basically, what I'd like is to be able to post a form element with id=myvariable.whatever and access it on the next page with $_POST[myvariable.whatever]. Comments are appreciated. Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
[PHP] Access difficulties
Hello, I have figured out how to connect it, I think But now I get this error
[PHP] MS Access
I have it connected, now I am getting the following error Warning: SQL error: , SQL state 0 in SQLConnect in c:\program files\apache group\apache\htdocs\test.php on line 7 Any ideas?
Re: [PHP] Allowing . in $_POST variable
On Tue, 28 Jan 2003, Mike Potter wrote: sense to me that this feature get another look. I can see no logical reason to not allow . in the global $_POST variable... Basically, what I'd like is to be able to post a form element with id=myvariable.whatever and access it on the next page with $_POST[myvariable.whatever]. Here's just one of many good reasons ... // obviously this is some busted garbage $name.Array[first]=Chris; $name.Array[last]=Wesley; $name=$name.Array[first]. .$name.Array[last]; // and this is not $name_Array[first]=Chris; $name_Array[last]=Wesley; $name=$name_Array[first]. .$name_Array[last]; You'd make both your Lex and your Yacc puke while parsing the first one ;) ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MS Access
On Tuesday 28 January 2003 23:11, Todd Barr wrote: I have it connected, now I am getting the following error Warning: SQL error: , SQL state 0 in SQLConnect in c:\program files\apache group\apache\htdocs\test.php on line 7 What are you doing on line 7? What did you do on the lines 1-6? Sorry for the question, but my gem is broken... johannes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] register_globals
I know its stupid but i´ve been writing a site for a register_globals = on enviroment now i need to convert all the code to an off setting the page is built by sending a whole lot off vars to diferent pages. as you can see below the hyperlink sends the id var to the same page and then echos the code. can anyone help humpty dumpty? font size=2a href=left.php?id=1 target=_selfFinansiering/aBR ? If($id==1){ echo a href=info/leas.htm target=\mainFrame\font color=\#00\Leasing/font/aBR a href=info/avb.htm target=\mainFrame\font color=\#00\Räntefri avbet./font/aBR a href=info/stul.htm target=\mainFrame\font color=\#00\Studentlån/font/aBR; }; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Allowing . in $_POST variable
sense to me that this feature get another look. I can see no logical reason to not allow . in the global $_POST variable... Basically, what I'd like is to be able to post a form element with id=myvariable.whatever and access it on the next page with $_POST[myvariable.whatever]. Here's just one of many good reasons ... // obviously this is some busted garbage $name.Array[first]=Chris; $name.Array[last]=Wesley; $name=$name.Array[first]. .$name.Array[last]; That assumes register_globals is ON, though, which isn't recommended. If you read the questions, the poster talks about using the value such as $_POST['name.Array'], which is valid. Since it's encouraged to have register globals OFF, I think they should do aways with this period to underscore thing, also. It will only jack up people's code that rely on register_globals and they should be changing it anyhow. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] best way to save form data on user side
Hi I have a rather annoying problem regarding forms. I have built an app that allows the users to fill in a rather large form (much like a claim form) and then have the data pumped into a mysql db. The problem is: the users want to be able to save their forms on their systems as a) backup/proof that they have filled it in and b) for their records for future use and c) the hope is that it would also allow for a reliable method to complete the form off-line and then submit it when online again. So, I'm not sure what the best way is to tackle this situation. My gutt says it would need some kind of client stand alone app, but I wouldn't want to go there unless I am proven beyond reasonable doubt that it is the only way. The users are mostly in computer limbo, and if they had their way, they would want to use Word or Excel to complete the forms, save it to their hard drive and click to send it away... Help!, Please?! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Need help.
check your sql-statement! Thkiat wrote: Can someone tell me what should I do to solve this problem? Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/epcc/public_html/exoops/class/database/mysql.php on line 134 Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/epcc/public_html/exoops/class/database/mysql.php on line 134 Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/epcc/public_html/exoops/class/database/mysql.php on line 134 Warning: chmod failed: Operation not permitted in /home/epcc/public_html/exoops/modules/PP-News/include/admin_envois_mails.php on line 489 Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/epcc/public_html/exoops/class/database/mysql.php on line 134 Warning: chmod failed: Operation not permitted in /home/epcc/public_html/exoops/modules/PP-News/include/admin_envois_mails.php on line 489 Erreur : Directory /home/epcc/public_html/exoops/modules/PP-News/archives/ Directory , aucune archive n'a été crée Newsletter sent to 2 users -- Sebastian Mendel [EMAIL PROTECTED] www.sebastianmendel.de www.tekkno4u.de www.nofetish.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MS Access
that means there's an error in your sql, what's the sql your using. Best Wishes Paul Roberts [EMAIL PROTECTED] - Original Message - From: Johannes Schlueter [EMAIL PROTECTED] To: Todd Barr [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, January 28, 2003 7:25 PM Subject: Re: [PHP] MS Access On Tuesday 28 January 2003 23:11, Todd Barr wrote: I have it connected, now I am getting the following error Warning: SQL error: , SQL state 0 in SQLConnect in c:\program files\apache group\apache\htdocs\test.php on line 7 What are you doing on line 7? What did you do on the lines 1-6? Sorry for the question, but my gem is broken... johannes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] best way to save form data on user side
Hi Bryan Thanks for the suggestions. Can you elaborate on the pdf option? Wouldn't that mean the users would need a copy of adobe acrobat writer? On Tue, 2003-01-28 at 21:53, Bryan Brannigan wrote: 3 choices as I see it.. a) create a PDF for download b) let the users create the form in Excel and then figure out a way to import that into your database using a webapp c) client side app :( -Original Message- From: Petre Agenbag [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 28, 2003 2:35 PM To: [EMAIL PROTECTED] Subject: [PHP] best way to save form data on user side Hi I have a rather annoying problem regarding forms. I have built an app that allows the users to fill in a rather large form (much like a claim form) and then have the data pumped into a mysql db. The problem is: the users want to be able to save their forms on their systems as a) backup/proof that they have filled it in and b) for their records for future use and c) the hope is that it would also allow for a reliable method to complete the form off-line and then submit it when online again. So, I'm not sure what the best way is to tackle this situation. My gutt says it would need some kind of client stand alone app, but I wouldn't want to go there unless I am proven beyond reasonable doubt that it is the only way. The users are mostly in computer limbo, and if they had their way, they would want to use Word or Excel to complete the forms, save it to their hard drive and click to send it away... Help!, Please?! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MS Access
I was just checking to see if the connection was working This one lacked a sql statment - Original Message - From: Paul Roberts [EMAIL PROTECTED] To: Todd Barr [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, January 28, 2003 11:57 AM Subject: Re: [PHP] MS Access that means there's an error in your sql, what's the sql your using. Best Wishes Paul Roberts [EMAIL PROTECTED] - Original Message - From: Johannes Schlueter [EMAIL PROTECTED] To: Todd Barr [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, January 28, 2003 7:25 PM Subject: Re: [PHP] MS Access On Tuesday 28 January 2003 23:11, Todd Barr wrote: I have it connected, now I am getting the following error Warning: SQL error: , SQL state 0 in SQLConnect in c:\program files\apache group\apache\htdocs\test.php on line 7 What are you doing on line 7? What did you do on the lines 1-6? Sorry for the question, but my gem is broken... johannes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] getting the size of a quicktime movie or other media files
Hi, I'm writing a php based fileserver/ftp app and I need to be able to display quicktime (and eventually other media) files via the object/embed tags. I've got everything working except for the sizing. I'd like to avoid asking users to specify the size of the file upon upload, if possible. Also, making the size very large to fit anything inside causes major layout problems, so that is not an option. So, I was wondering if anyone knew of a way to get this info from a file. Is there something analogous to getimagesize() for quicktime? I couldn't find anything in the manual. Are there any other ways to deal with this issue? Thank you for your help. -- Daniel Leighton Chief Technology Officer Webolution http://www.webolution.com This email may contain material that is confidential and privileged for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Allowing . in $_POST variable
On Tue, 28 Jan 2003, 1LT John W. Holmes wrote: Basically, what I'd like is to be able to post a form element with id=myvariable.whatever and access it on the next page with $_POST[myvariable.whatever]. // obviously this is some busted garbage $name.Array[first]=Chris; $name.Array[last]=Wesley; $name=$name.Array[first]. .$name.Array[last]; That assumes register_globals is ON, though, which isn't recommended. If you read the questions, the poster talks about using the value such as There aren't two different lexigraphical parsers if you turn register_globals on or off. So, PHP either allows ALL variables to have a . in their name, or disallow it altogether. So, moving outside of the narrow case of POST variable names is what I did *after thoroughly reading and thinking about the question*. (Somebody missed the Lex Yacc hint.) $_POST['name.Array'], which is valid. Since it's encouraged to have register globals OFF, I think they should do aways with this period to underscore thing, also. It will only jack up people's code that rely on register_globals and they should be changing it anyhow. As long as it's possible to turn register_globals on, this will have to be a problem. I'd vote for tearing this bandaid off, getting rid of register_globals altogether, and undo all the idiosyncrasies it causes, but that's just me (and others who think similarly). ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] best way to save form data on user side
I have a rather annoying problem regarding forms. I have built an app that allows the users to fill in a rather large form (much like a claim form) and then have the data pumped into a mysql db. The problem is: the users want to be able to save their forms on their systems as a) backup/proof that they have filled it in and b) for their records for future use and c) the hope is that it would also allow for a reliable method to complete the form off-line and then submit it when online again. Saving the form would be useless because how would you ever know if they really submitted it or not? It seems like the easiest thing to do would be to show them a confirmation page that says your claim has been accepted and here is the data you submitted. Save or print this page for your records like you see on many other systems. Would that work? I guess it wouldn't do anything for option C above, but that option is always present unless you're using some kind of timeout feature? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] best way to save form data on user side
--- Petre Agenbag [EMAIL PROTECTED] wrote: I have a rather annoying problem regarding forms. I have built an app that allows the users to fill in a rather large form (much like a claim form) and then have the data pumped into a mysql db. The problem is: the users want to be able to save their forms on their systems as a) backup/proof that they have filled it in and b) for their records for future use and c) the hope is that it would also allow for a reliable method to complete the form off-line and then submit it when online again. Well, this sounds like a bad idea in general, but if you have no choice in the matter, I suppose cookies can fulfill the need. Anything you implement like this is going to lessen the security of the data, because rather than the client sending it to you once, you are going to expose it over the Internet several times. If this risk is acceptable for whatever reason, then cookies are probably no less secure for this data than anything else. Normally, I would highly recommend *not* storing client data on cookies, because that opens you up to several types of attacks, but you can accomplish what you want to do with this method. Only punish those who want this feature by setting these cookies only for those who choose to save this data locally. You could help the situation by encrypting the data in your cookies, so that only presentation attacks are a concern, but your users wouldn't be able to easily look at their data as verification of anything. My recommendation is to leverage your position as the technical expert to advise a more proper solution, one that you agree to, not them. They should not be consulted regarding application design unless they have experience with it. Rather, they should be describing their needs and let you (or the technical lead / project manager) do the technical design. Good luck to you. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Allowing . in $_POST variable
Basically, what I'd like is to be able to post a form element with id=myvariable.whatever and access it on the next page with $_POST[myvariable.whatever]. // obviously this is some busted garbage $name.Array[first]=Chris; $name.Array[last]=Wesley; $name=$name.Array[first]. .$name.Array[last]; That assumes register_globals is ON, though, which isn't recommended. If you read the questions, the poster talks about using the value such as There aren't two different lexigraphical parsers if you turn register_globals on or off. So, PHP either allows ALL variables to have a . in their name, or disallow it altogether. So, moving outside of the narrow case of POST variable names is what I did *after thoroughly reading and thinking about the question*. (Somebody missed the Lex Yacc hint.) I'm not familar with the core code of PHP at all, but what would happend if this feature was just disabled? For everyone with rg OFF, it wouldn't affect them, right? If rg is ON and you never use a period in a variable name, then it shouldn't affect you either, right? What is someone actually did, though? Would it cause PHP to shit itself or just make a weird variable name? My point was that who cares what it does, because it's only going to affect people with rg ON, anyhow, that try using a period, right? $_POST['name.Array'], which is valid. Since it's encouraged to have register globals OFF, I think they should do aways with this period to underscore thing, also. It will only jack up people's code that rely on register_globals and they should be changing it anyhow. As long as it's possible to turn register_globals on, this will have to be a problem. I'd vote for tearing this bandaid off, getting rid of register_globals altogether, and undo all the idiosyncrasies it causes, but that's just me (and others who think similarly). Yeah, I agree, but we both know that won't happen for a while. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Need help.
Show us your code...we can't read your mind. - Original Message - Thkiat wrote: Can someone tell me what should I do to solve this problem? Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/epcc/public_html/exoops/class/database/mysql.php on line 134 Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/epcc/public_html/exoops/class/database/mysql.php on line 134 Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/epcc/public_html/exoops/class/database/mysql.php on line 134 Warning: chmod failed: Operation not permitted in /home/epcc/public_html/exoops/modules/PP-News/include/admin_envois_mails.php on line 489 Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/epcc/public_html/exoops/class/database/mysql.php on line 134 Warning: chmod failed: Operation not permitted in /home/epcc/public_html/exoops/modules/PP-News/include/admin_envois_mails.php on line 489 Erreur : Directory /home/epcc/public_html/exoops/modules/PP-News/archives/ Directory , aucune archive n'a été crée Newsletter sent to 2 users -- Sebastian Mendel [EMAIL PROTECTED] www.sebastianmendel.de www.tekkno4u.de www.nofetish.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] radius auth and sockets
Hello, I'm wondering if anyone has a php script that can authenticate to a radius server? I've found one, but it seems to only check for a return code of 1 or 2, and I need to to get the whole port message. Also, it keeps giving me this: [28-Jan-2003 12:00:44] PHP Fatal error: Call to undefined function: socket_create() in /home/bryan/php/php-radius-1.2/radius_authentication.inc on line 69 But it was configured with --enable-sockets... Any thoughts? Thanks, Bryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Need help.
- Original Message - Thkiat wrote: Can someone tell me what should I do to solve this problem? Of course... Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/epcc/public_html/exoops/class/database/mysql.php on line 134 Fix your problem on line 134 Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/epcc/public_html/exoops/class/database/mysql.php on line 134 Same thing here... Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/epcc/public_html/exoops/class/database/mysql.php on line 134 and here... Warning: chmod failed: Operation not permitted in /home/epcc/public_html/exoops/modules/PP-News/include/admin_envois_mails.php on line 489 Ah, this is different. Here you'd want to fix your problem on line 489. Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/epcc/public_html/exoops/class/database/mysql.php on line 134 and again back to the line 134 thing that should be fixed by now. Warning: chmod failed: Operation not permitted in /home/epcc/public_html/exoops/modules/PP-News/include/admin_envois_mails.php on line 489 I already covered this one, right? Erreur : Directory /home/epcc/public_html/exoops/modules/PP-News/archives/ Directory , aucune archive n'a été crée Newsletter sent to 2 users ---John Holmes... PS: Your query is failing and you can't do chmod() because you're running as the web server. Post your code if you want more help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] best way to save form data on user side
Hi Chris On Tue, 2003-01-28 at 22:09, Chris Shiflett wrote: --- Petre Agenbag [EMAIL PROTECTED] wrote: I have a rather annoying problem regarding forms. I have built an app that allows the users to fill in a rather large form (much like a claim form) and then have the data pumped into a mysql db. The problem is: the users want to be able to save their forms on their systems as a) backup/proof that they have filled it in and b) for their records for future use and c) the hope is that it would also allow for a reliable method to complete the form off-line and then submit it when online again. Well, this sounds like a bad idea in general, but if you have no choice in the matter, I suppose cookies can fulfill the need. Anything you implement like this is going to lessen the security of the data, because rather than the client sending it to you once, you are going to expose it over the Internet several times. If this risk is acceptable for whatever reason, then cookies are probably no less secure for this data than anything else. Normally, I would highly recommend *not* storing client data on cookies, because that opens you up to several types of attacks, but you can accomplish what you want to do with this method. Only punish those who want this feature by setting these cookies only for those who choose to save this data locally. You could help the situation by encrypting the data in your cookies, so that only presentation attacks are a concern, but your users wouldn't be able to easily look at their data as verification of anything. My recommendation is to leverage your position as the technical expert to advise a more proper solution, one that you agree to, not them. They should not be consulted regarding application design unless they have experience with it. Rather, they should be describing their needs and let you (or the technical lead / project manager) do the technical design. This is exactly what I'm looking to do; but my problem remains: I don't know what the best solution is. The problem is clear: the users actually need an electronic copy of the data they submit; they must revisit certain issues annually, and would need to access the data they submitted the previous year; either for review purposes, or to make the new submission a speedy matter of simply changing the details that are different from last year. It's much like a normal office scenario: each person works on Word docs that need to be shared with others, yet needs to be editable and must be saved etc, BUT the difference here is that the data of all the collective sources must be entered into a central db. So the non technical solution would be for the users to do the forms in word, then fax it to the central office, where you have a temp type the data into the db... we can't have that now... Any ideas? PS, I don't think cookies are going to do this. Remember, the user needs to be able to access and re-submit the form at any stage. Good luck to you. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Displays File Header
Hello everyone, I've upradated to php 4.03, Apache 2, and Zend Server Center 2.5, but now I am getting these strange errors. For some reason, PHP shows the page's (php script only) header content. Ex. a page with phpinfo() will display: Content-type: text/html If I click on any link on that page, then I will fer Content-Type: text/html; CHARSET=ISO-8859-1 Expires: Mon,26,Jul... Pleade advssie. -john =P e p i e D e s i g n s www.pepiedesigns.com Providing Solutions That Increase Productivity Web Developement. Database. Hosting. Multimedia. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Good way to organize code using classes???
On Tue, 28 Jan 2003 16:20:20 +0100, Maxim Maletsky wrote: I use PHP classes extensively and very often use classes within other classes. First off, I would make sure to take advantage of inheritence as much as possible. I have heirarchies up to 4 deep for some of my classes depending on how much specialization I need while at the same time maintaining only one set of code for functionality common to all subclasses. As for using classes within classes, I don't include the classes within a class definition nor within a method def. I include the class def in the class file but outside the actual class {} statement. When I instantiate the class, if I will need the object ref to pass to other classes or to other methods within the calling class, I assign the initial object instantiation to a class variable. That way any class methods can have ready access to that class via the ojbect reference stored in the class variable. Only when I know for sure that the use of a class will be for one purpose do I include and instantiate within a method. as always, YMMV depending on the structure of your project. NOTE: There is a set of new PHP functions that allow a sort of dynamic multiple inheritence. You can look here for info: http://www.php.net/manual/en/ref.objaggregation.php Jeff @ Nilaab [EMAIL PROTECTED] wrote... : Hello everyone, I want to be able to use objects to create my future pages. My goal is to use methods of classes to make the original front-line script easier to read, while all the processing is done with a simple call to the different classes from a single class. Please read futher, as I'll get to a point and to my question... I have many classes that do different tasks, like formValidator.class, stringManipulator.class, db.class, fileManipulation.class, template.class, etc (these are self-explanitory as their names suggest). Then, I might have a class called category.class that adds, deletes, edits, moves, and renames categories within the filesystem and database. But I would have a front-line script called category.php that would call the necessary methods of category.class at certain points, depending on the task being done on a specific step. In other words I want category.class to call the other classes and do something with them, then in turn I want category.php to call objects in category.class for a specific task, such as: ?php // category.php include (category.class); $cat = new category (); $cat-addCategory($new_cat_name); // or $cat-editCategory($cat_name); // or $cat-deleteCategory($cat_name); // or $cat-moveCategory($cat_name); // or $cat-renameCategory($cat_name); ? My question is: How can I call a class within another class and do something with it? Right now I'm doing it the most convenient way I know, which is including other classes using the include() function within the methods of the category.class. There is no multiple-inheritance allowed in PHP, so I can only use inheritance on one class. Including new classes within the existing classes is not such a bad idea as it ensures you to have only the necessary classes called. I am also extremely skeptical about creating too many classes at a time in one script. Do the above examples degrade performance speed of the script when I call too many classes? Also, isn't there a way to use sessions to save created classes and then use them again for other scripts without the need to make a new instance of the same class again and again? yes, you can serialize/unserialize classes into the sessions. This makes it a little more complicated, but can be helpful sometimes. I am really looking for a better way to organize my code while still being able to use these classes whenever I need them and at the same time keeping the category.php file clean and easy to read. Is there a tutorial on how to organize code? I'm not looking for html template tutorials. Just how to get around inheritance limits while still keeping performance and clean-code in mind. You know what I have once done? I created a file with functions that return you the object pointers. It would create (declare) the class whenever it was not declared before or just return the pointer from a global variable if it was declared before. That way, you only load a few functions, and whenever you need a class you assign a variable to the function's return to have the class. This limits you script to only classes you use and no includes within the script itself. A kind of silly method, but can be easy to work with. Also, check out the new Zend 2 engine, it has tons of improvements with classes for PHP5. Currently the code is in CVS (checkout php5 module). Changes are listed here: http://cvs.php.net/co.php/ZendEngine2/ZEND_CHANGES -- Maxim Maletsky [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
RE: [PHP] set_error_handler inside a class
sorry is there a way to do this in php3 ? my work currently only has php3 , where i am upgrading it for them soon, this is a bummer, i soughta wanna catch errors and show the line and file in the error too -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 29, 2003 4:51 AM To: 'electroteque'; [EMAIL PROTECTED] Subject: RE: [PHP] set_error_handler inside a class hi guys how is ti possible to do a set_error_handler within a class so it will trigger the callback function and so will be able to return the line and file in the message ? You'd set it just like you would anywhere else in your code. If you want the callback function to be a method in your class, then you pass an array to set_error_handler(). Details are in the manual on the format of the array. It'll be the same as any other callback function that you can send a classes method to. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] best way to save form data on user side
--- Petre Agenbag [EMAIL PROTECTED] wrote: This is exactly what I'm looking to do; but my problem remains: I don't know what the best solution is. The problem is clear: the users actually need an electronic copy of the data they submit; they must revisit certain issues annually, and would need to access the data they submitted the previous year; either for review purposes, or to make the new submission a speedy matter of simply changing the details that are different from last year. In this case, it sounds like you need to just keep this data on the server in your database like you are already doing, then you simply provide another Web application that uses the same database and allows them to search, modify (?), and display the data for printing. You can generate reports, graphs, and all sorts of things that they will appreciate. Don't restrict yourself to their line of thinking. :-) It's much like a normal office scenario: each person works on Word docs that need to be shared with others, yet needs to be editable and must be saved etc, BUT the difference here is that the data of all the collective sources must be entered into a central db. So the non technical solution would be for the users to do the forms in word, then fax it to the central office, where you have a temp type the data into the db... we can't have that now... The solution is for the users to do the forms in a Web application that you build, and your Web application stores the data in the database. Forget about data entry personnel. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] best way to save form data on user side
On Tue, 2003-01-28 at 22:09, Chris Shiflett wrote: --- Petre Agenbag [EMAIL PROTECTED] wrote: I have a rather annoying problem regarding forms. I have built an app that allows the users to fill in a rather large form (much like a claim form) and then have the data pumped into a mysql db. The problem is: the users want to be able to save their forms on their systems as a) backup/proof that they have filled it in and b) for their records for future use and c) the hope is that it would also allow for a reliable method to complete the form off-line and then submit it when online again. Well, this sounds like a bad idea in general, but if you have no choice in the matter, I suppose cookies can fulfill the need. Anything you implement like this is going to lessen the security of the data, because rather than the client sending it to you once, you are going to expose it over the Internet several times. If this risk is acceptable for whatever reason, then cookies are probably no less secure for this data than anything else. Normally, I would highly recommend *not* storing client data on cookies, because that opens you up to several types of attacks, but you can accomplish what you want to do with this method. Only punish those who want this feature by setting these cookies only for those who choose to save this data locally. You could help the situation by encrypting the data in your cookies, so that only presentation attacks are a concern, but your users wouldn't be able to easily look at their data as verification of anything. My recommendation is to leverage your position as the technical expert to advise a more proper solution, one that you agree to, not them. They should not be consulted regarding application design unless they have experience with it. Rather, they should be describing their needs and let you (or the technical lead / project manager) do the technical design. This is exactly what I'm looking to do; but my problem remains: I don't know what the best solution is. The problem is clear: the users actually need an electronic copy of the data they submit; they must revisit certain issues annually, and would need to access the data they submitted the previous year; either for review purposes, or to make the new submission a speedy matter of simply changing the details that are different from last year. It's much like a normal office scenario: each person works on Word docs that need to be shared with others, yet needs to be editable and must be saved etc, BUT the difference here is that the data of all the collective sources must be entered into a central db. So the non technical solution would be for the users to do the forms in word, then fax it to the central office, where you have a temp type the data into the db... we can't have that now... Any ideas? Do they really have to be able to do this offline? You've got the data in the database, why not just program a feature that lets you go in and edit data? Or copy one report to submit as a new one? Wouldn't that be a better solution than some system where you copy everything to the user's computer? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] best way to save form data on user side
Hi Why don't you take the form in many smaller parts, save them away as each part is completed, allowing the user to go back and forth between the parts. This would give the advantage of securing the data which as already been submitted. You can then give other functions to review in one page (for printing off) or copying to another form which could be used for next years data Regards Adam White -Original Message- From: Petre Agenbag [mailto:[EMAIL PROTECTED]] Sent: 28 January 2003 20:17 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] best way to save form data on user side Hi Chris On Tue, 2003-01-28 at 22:09, Chris Shiflett wrote: --- Petre Agenbag [EMAIL PROTECTED] wrote: I have a rather annoying problem regarding forms. I have built an app that allows the users to fill in a rather large form (much like a claim form) and then have the data pumped into a mysql db. The problem is: the users want to be able to save their forms on their systems as a) backup/proof that they have filled it in and b) for their records for future use and c) the hope is that it would also allow for a reliable method to complete the form off-line and then submit it when online again. Well, this sounds like a bad idea in general, but if you have no choice in the matter, I suppose cookies can fulfill the need. Anything you implement like this is going to lessen the security of the data, because rather than the client sending it to you once, you are going to expose it over the Internet several times. If this risk is acceptable for whatever reason, then cookies are probably no less secure for this data than anything else. Normally, I would highly recommend *not* storing client data on cookies, because that opens you up to several types of attacks, but you can accomplish what you want to do with this method. Only punish those who want this feature by setting these cookies only for those who choose to save this data locally. You could help the situation by encrypting the data in your cookies, so that only presentation attacks are a concern, but your users wouldn't be able to easily look at their data as verification of anything. My recommendation is to leverage your position as the technical expert to advise a more proper solution, one that you agree to, not them. They should not be consulted regarding application design unless they have experience with it. Rather, they should be describing their needs and let you (or the technical lead / project manager) do the technical design. This is exactly what I'm looking to do; but my problem remains: I don't know what the best solution is. The problem is clear: the users actually need an electronic copy of the data they submit; they must revisit certain issues annually, and would need to access the data they submitted the previous year; either for review purposes, or to make the new submission a speedy matter of simply changing the details that are different from last year. It's much like a normal office scenario: each person works on Word docs that need to be shared with others, yet needs to be editable and must be saved etc, BUT the difference here is that the data of all the collective sources must be entered into a central db. So the non technical solution would be for the users to do the forms in word, then fax it to the central office, where you have a temp type the data into the db... we can't have that now... Any ideas? PS, I don't think cookies are going to do this. Remember, the user needs to be able to access and re-submit the form at any stage. Good luck to you. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] best way to save form data on user side
On Wednesday 29 January 2003 04:17, Petre Agenbag wrote: save their forms on their systems as a) backup/proof that they have filled it in and b) for their records for future use and c) the hope is that it would also allow for a reliable method to complete the form off-line and then submit it when online again. This is exactly what I'm looking to do; but my problem remains: I don't know what the best solution is. The problem is clear: the users actually need an electronic copy of the data they submit; they must revisit certain issues annually, and would need to access the data they submitted the previous year; either for review purposes, or to make the new submission a speedy matter of simply changing the details that are different from last year. It's much like a normal office scenario: each person works on Word docs that need to be shared with others, yet needs to be editable and must be saved etc, BUT the difference here is that the data of all the collective sources must be entered into a central db. So the non technical solution would be for the users to do the forms in word, then fax it to the central office, where you have a temp type the data into the db... we can't have that now... Any ideas? PS, I don't think cookies are going to do this. Remember, the user needs to be able to access and re-submit the form at any stage. As has already been pointed out, saving the form data on the user's computer is a _bad_ idea and provides no assurance to either party. There is no way to prove that the data saved is what the user submitted. So to satisfy (a), you can do this: after the user has submitted the data, write them out to a textfile and GPG/PGP sign it, then let the user download that signed file. You can do something similar using md5() as well (don't forget to add a secret). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Riches cover a multitude of woes. -- Menander */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] set_error_handler inside a class
sorry is there a way to do this in php3 ? my work currently only has php3 , where i am upgrading it for them soon, this is a bummer, i soughta wanna catch errors and show the line and file in the error too Nope... it's 4.0.1 and higher only. UPGRADE!! :) ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting a value back from POST (not the built-in return)
Okay, some clarification. I do indeed want to read what I get back from the socket. Using fgets($fp, 1024) on the sending side (where the socket is opened and the data sent) and return = $variable on the other end (oh yes, the variable has a value as of the return), all I ever get back is 'HTTP 1.1' exactly, or nothing at all in the return value. Can you fill me in on the syntax here? How would you write the fgets statement and how would you define and populate the return value on the other end? Chris wrote: --- Paul [EMAIL PROTECTED] wrote: Using a fairly simple fsockopen and POST I'm sending form data to a script which populates fields in a database. Everything works fine, however I've been trying to figure out how to send a value set on the other machine (database) back through the open socket (note: not the return value usually retrieved by fgets($fp etc...) which is then available to the sending machine. Searching via Google hasn't given me an answer. Is it possible? Can somebody help? Syntax would be very nice, I'm not a PHP guru. Anything that the receiving Web server outputs is sent back to you just as it would be a Web browser. So, you can read this data just as if from a file (which is why fsockopen is so convenient). Thus, just echo whatever you want to send back. You make a statement that is very conflicting: I've been trying to figure out how to send a value set on the other machine (database) back through the open socket (note: not the return value usually retrieved by fgets($fp etc...) So, you want to send data back through the open socket, but you do not want read this data from the socket. I think you have a misunderstanding here somewhere that will make things difficult for you. What fgets() gives you *is* the data sent from the remote server. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] radius auth and sockets
Hello, I'm wondering if anyone has a php script that can authenticate to a radius server? I've found one, but it seems to only check for a return code of 1 or 2, and I need to to get the whole port message. Also, it keeps giving me this: [28-Jan-2003 12:00:44] PHP Fatal error: Call to undefined function: socket_create() in /home/bryan/php/php-radius-1.2/radius_authentication.inc on line 69 But it was configured with --enable-sockets... Any thoughts? Thanks, Bryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting a value back from POST (not the built-in return)
--- Paul [EMAIL PROTECTED] wrote: Can you fill me in on the syntax here? How would you write the fgets statement and how would you define and populate the return value on the other end? Maybe this example will help. This searches PHP's site for curl, outputting the HTTP content to the screen. When you are making a socket connection like this, you get the whole HTTP response, not just the content. This example uses an explode() to separate headers from content, which isn't very safe (if the content contains \r\n somewhere, it screws up), but it will probably work for you: base href=http://www.php.net/; ? $content = php_post(www.php.net, /search.php, lang=en_USpattern=curlshow=manual); echo $content; function php_post($host, $path, $data) { $http_response=; $fp=fsockopen($host, 80); fputs($fp, POST $path HTTP/1.1\r\n); fputs($fp, Host: $host\r\n); fputs($fp, Content-Type: application/x-www-form-urlencoded\r\n); fputs($fp, Content-Length: . strlen($data).\r\n); fputs($fp, Connection: close\r\n\r\n); fputs($fp, $data); while(!feof($fp)) { $http_response.=fgets($fp, 128); } fclose($fp); list($http_headers, $http_content) = explode(\r\n\r\n, $http_response); # This only returns the content - modify if you want to also return the headers return $http_content; } ? Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ayuda help
Tengo este herros y no se de q esWarning: MySQL Connection Failed: Access denied for user: 'fullweb@localhost' (Using password: YES) in /home/sites/site22/web/45/connect_database.php on line 8 Error in connecting to MySQL. _ Registra gratis tu cuenta email en http://www.exploraiquique.cl _ Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, POP more! http://www.everyone.net/selectmail?campaign=tag -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Allowing . in $_POST variable
Regarding keeping . as . and not _ in variables: This isn't going to happen as it seriously breaks BC. This also would affect functions such as import_request_variables() and extract(). There is no worthy benefit here, this will never happen. Regards, Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get command line output
On Thu, 23 Jan 2003 00:14:07 +0800, Jason Wong wrote: either use PHP to parse out the entirety of the output or make your command pipe its output to other commands such as sed awk before it gets to PHP. w | tail +3 | awk '{print $1,$3,$5}' Jeff On Thursday 23 January 2003 00:10, Greg Chagnon wrote: Does anyone know how to get certain parts of the output from an exec of a certain command? For example...if I run w I get this output: [root@Lunar]:~ w 11:02am up 56 days, 17:39, 1 user, load average: 0.07, 0.02, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root pts/0brpt-sh6-port214 11:01am 0.00s 0.27s 0.06s w Now what if I just want the infor on the 3rd line, and info about anyone else who is logged in, such as the username, the host, and the time without getting all the uptime and the header info? Thanks! exec() 'returns' the output of the command in an array. Just extract from the array whatever line(s) you need. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Good XML/XSLT mailing list?
On Wed, 22 Jan 2003 10:21:36 -0600, Chris Boget wrote: This is a good QA site: http://www.dpawson.co.uk/xsl/sect2/sect21.html and XSLT-list here: http://www.dpawson.co.uk/xsl/list.html Jeff Sorry for the OT post but I know many of you use the above. I subscribed the the PHP-XML mailing list but alas, haven't seen activity on it since the middle of last year. Could you guys recommend a good (quality over quantity) XML/XSLT mailing list? If it's a list geared more towards newbies, all the better but that wouldn't be a requirement. Thanks for any assistance you can provide. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] best way to save form data on user side
I agree on leveraging your position to guide this thing. Here you've added the requirement of being able to revisit the data in a year. Why not simply have them fill out the form, put it in the database and then use another page with queries to draw the data into a similar template and change it as needed? Simple forms should handle this just fine, and you can require passwords to the data. As far as filling it out online, let them pull up the form, fill it out and reconnect, then press submit. Wouldn't this cover what you want? Petre Agenbag [EMAIL PROTECTED]To: [EMAIL PROTECTED] za cc: [EMAIL PROTECTED] Subject: Re: [PHP] best way to save form data on user side 01/28/2003 03:17 PM Hi Chris On Tue, 2003-01-28 at 22:09, Chris Shiflett wrote: --- Petre Agenbag [EMAIL PROTECTED] wrote: I have a rather annoying problem regarding forms. I have built an app that allows the users to fill in a rather large form (much like a claim form) and then have the data pumped into a mysql db. The problem is: the users want to be able to save their forms on their systems as a) backup/proof that they have filled it in and b) for their records for future use and c) the hope is that it would also allow for a reliable method to complete the form off-line and then submit it when online again. Well, this sounds like a bad idea in general, but if you have no choice in the matter, I suppose cookies can fulfill the need. Anything you implement like this is going to lessen the security of the data, because rather than the client sending it to you once, you are going to expose it over the Internet several times. If this risk is acceptable for whatever reason, then cookies are probably no less secure for this data than anything else. Normally, I would highly recommend *not* storing client data on cookies, because that opens you up to several types of attacks, but you can accomplish what you want to do with this method. Only punish those who want this feature by setting these cookies only for those who choose to save this data locally. You could help the situation by encrypting the data in your cookies, so that only presentation attacks are a concern, but your users wouldn't be able to easily look at their data as verification of anything. My recommendation is to leverage your position as the technical expert to advise a more proper solution, one that you agree to, not them. They should not be consulted regarding application design unless they have experience with it. Rather, they should be describing their needs and let you (or the technical lead / project manager) do the technical design. This is exactly what I'm looking to do; but my problem remains: I don't know what the best solution is. The problem is clear: the users actually need an electronic copy of the data they submit; they must revisit certain issues annually, and would need to access the data they submitted the previous year; either for review purposes, or to make the new submission a speedy matter of simply changing the details that are different from last year. It's much like a normal office scenario: each person works on Word docs that need to be shared with others, yet needs to be editable and must be saved etc, BUT the difference here is that the data of all the collective sources must be entered into a central db. So the non technical solution would be for the users to do the forms in word, then fax it to the central office, where you have a temp type the data into the db... we can't have that now... Any ideas? PS, I don't think cookies are going to do this. Remember, the user needs to be able to access and re-submit the form at any stage. Good luck to you. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
Re: [PHP] best way to save form data on user side
on 29/01/03 6:35 AM, Petre Agenbag ([EMAIL PROTECTED]) wrote: Hi I have a rather annoying problem regarding forms. I have built an app that allows the users to fill in a rather large form (much like a claim form) and then have the data pumped into a mysql db. The problem is: the users want to be able to save their forms on their systems as a) backup/proof that they have filled it in and b) for their records for future use and c) the hope is that it would also allow for a reliable method to complete the form off-line and then submit it when online again. So, I'm not sure what the best way is to tackle this situation. My gutt says it would need some kind of client stand alone app, but I wouldn't want to go there unless I am proven beyond reasonable doubt that it is the only way. There are different issues here If they want to save a half-completed form, you *could* save that data server side in either a table, temporary table, or file, and have them log-in to continue using it. I have done this many times. You could also save the data client-side with cookies, but there's no guarantee that cookies will work on a specific client. If they want back-up/proof of doing it, then they can print the browser screen as they fill it in, AND, you can give them a confirmation page which prints all the form values back to the browser as a printable HTML page which they can either print or save as TEXT or HTML. Writing something that works offline for completion online later sounds like you're trying to make the web do something it wasn't designed for. The only solution I can think of is client-side javascript saving the form information as a browser cookie, but there's no way I'd bother, because it would require the user to have both javascript and cookies enabled, and I think there's also issues with the issuing domain of the cookie. The users are mostly in computer limbo, and if they had their way, they would want to use Word or Excel to complete the forms, save it to their hard drive and click to send it away... You can create a form inside a PDF document, and it can POST the completed data to a URL. So they could complete the form offline, print it, whatever, then connect, and hit submit. It would open a browser window with a URL like http://yourdomain.com/parseThePDFForm.php and then you would have your submitted data. Whilst not as a elegant, they COULD fill in an excel file, and upload it via a browser. Same with word. I'm not sure if wither excel or word has any method of POSTing data. With all these client-side options, there's zero hope of getting them to correct missing fields though :) Decide if this is something you want to achieve on the web, or offline. If on the web, keep it basic, with perhaps a save to server option and a printable thankyou/proof page. If offline, I think PDF forms are the best of a bad bunch. Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] register_globals
on 29/01/03 6:41 AM, Kiswa ([EMAIL PROTECTED]) wrote: change If($id==1){ to If($_GET['id']==1){ or put this line near the top of your script: $id = $_GET['id']; or, a little more anal: if(isset($_GET['id'])) { $id = $_GET['id']; } Justin font size=2a href=left.php?id=1 target=_selfFinansiering/aBR ? If($id==1){ echo a href=info/leas.htm target=\mainFrame\font color=\#00\Leasing/font/aBR a href=info/avb.htm target=\mainFrame\font color=\#00\Räntefri avbet./font/aBR a href=info/stul.htm target=\mainFrame\font color=\#00\Studentlån/font/aBR; }; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Advice on uploaded files
I writting a php program for a small insurance company and they want to receive uploaded digital photos. Should I store the photos in a mysql database or in a directory on the hard drive? If you have experience with this any advice would be appreciated.
Re: [PHP] Advice on uploaded files
on 29/01/03 11:16 AM, Manuel Ochoa ([EMAIL PROTECTED]) wrote: I writting a php program for a small insurance company and they want to receive uploaded digital photos. Should I store the photos in a mysql database or in a directory on the hard drive? If you have experience with this any advice would be appreciated. I prefer storing them in the filesystem, and using the MySQL database to keep track of WHERE they are (link). There of course are SOME problems with that... mainly because the two are not joined at the hip... someone could accidently trash the file, or the MYSQL record, without deleting the other. Storing the image directly in MySQL has never appealed to me, because you have to do a little more work to get the image out (sending headers, having an image script, etc), and mainly because the size of the DB increases dramatically... which makes backing up more difficult/time consuming. Each to their own though :) Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] htpasswd question
I am currently trying to create a .htpasswd file for apache using PHP and the crypt() on Win2k. I can generate the file alright but it does not work. I have looked into some classes as well and all use the crypt() function. The reason for this not working is probably the algorithm used because the passwords within a .htpasswd created with apache looks a hell lot different using something like $apr1$rB2.$8iUWArWEsTQ2553kjk22NS1 (not a real password by the way) anyone having experience with that? Something up because I use windows? Dominik Wittenbeck E-Mail: [EMAIL PROTECTED] URL:http://www.developaz.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-WIN] htpasswd question
I would try something like this instead: $params = escapeshellarg($params); $output = system(c:\path\to\htpasswd $params); //check for output errors or what not There very well could be a better solution (especially since I have not tried the above code...). I remember seeing somewhere that the crypt algorithms are different for Apache and PHP on Win32. -Dash Cleanliness is next to impossible. On Tue, 28 Jan 2003, Dominik Wittenbeck wrote: I am currently trying to create a .htpasswd file for apache using PHP and the crypt() on Win2k. I can generate the file alright but it does not work. I have looked into some classes as well and all use the crypt() function. The reason for this not working is probably the algorithm used because the passwords within a .htpasswd created with apache looks a hell lot different using something like $apr1$rB2.$8iUWArWEsTQ2553kjk22NS1 (not a real password by the way) anyone having experience with that? Something up because I use windows? Dominik Wittenbeck E-Mail: [EMAIL PROTECTED] URL:http://www.developaz.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php