Re: [PHP] PHP Oficial Certification
* Thus wrote Yann Larrivee: For shure a beginner will benefit from this has it is problably give him a salary increase compared to the guy that is not certified (we all know that php developper are under paid) So this part is good. It will also eliminate some people out of the market for shure at some point. A certifcate most likely wont get you a salary increase, but it will be favored in consideration of equal experience. Yep emplyers will use it to evaluate people, but like i said i you want to get good exprience just work on a open source software if you don't have any work experience. OSS doesn't make a person better programmer, you can easily write an OSS app and still lack any knowledge of proper writting. Now has far has sun certification how it will help you get a php job. Well depends what kind of job you are looking for. A job where you only do php 24/7 or you do other stuff on the side (Java, C++, PHP, ...) I still dont see how sun has anything to do with anything, unless your against OSS philosophy. If so then beeing certified PHP just assure that you know PHP and some principles. Assuring someone that you have *some* is much better than the lack of proof otherwise. If you thake the sun certification it is been there for a far longer time ans since your job requires both in this case the sun certification means more. But certifications are just there to prove your level of understanding. So if I have a certificate of 'ed' that make it better than having a sun certificat since 'ed' has been around longer than sun. And should land me a much better PHP job. Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with front page files downloaded to dev machine OT
On Friday 27 August 2004 09:00, Gunter Sammet wrote: Yes. All my local stuff does work like a charm. I'm working with osCommerce shopping cart and all my local installs work just fine. And as I said, when I compare it with a local install, the files don't show anything unusual. Based on the info you've given so far I suggest that you check that these settings in php.ini: short_open_tag asp_tags are appropriate and/or the same on both servers. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* An eye in a blue face Saw an eye in a green face. That eye is like this eye Said the first eye, But in low place, Not in high place. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with front page files downloaded to dev machine OT
On Friday 27 August 2004 12:40, Curt Zirzow wrote: * Thus wrote John Nichel: John Holmes wrote: Curt Zirzow wrote: Top posting is like this. How about middle posting? Please don't top post. Hehe.. thats pretty good :) Lets see if someone can decipher this top post to a context post to a middle post to a who knows what post ;) Ok children, back to work. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Love your neighbor, but don't get caught -- Murphy's Laws on Sex n28 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Oficial Certification
Again I point out that this certification starts to make PHP valid in the commercial world. I completely agree with everyone that certs usually aren't worth the paper they are printed on when it comes to technical expertise but to a PHB or client who doesn't know any better except buzz words, a certified php developer sounds better. Even I(who would take a seasoned programmer over a certified guy anyday), would probably prefer to hire certified php developers because you know what??? It's an easier sell to potential clients. Granted, you have to hire one or two guys who actually know what their doing to keep the ship floating but nevertheless it's an easier sell if you have certified php developers on board. -Brent - Original Message - From: Curt Zirzow [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Friday, August 27, 2004 1:22 AM Subject: Re: [PHP] PHP Oficial Certification * Thus wrote Yann Larrivee: For shure a beginner will benefit from this has it is problably give him a salary increase compared to the guy that is not certified (we all know that php developper are under paid) So this part is good. It will also eliminate some people out of the market for shure at some point. A certifcate most likely wont get you a salary increase, but it will be favored in consideration of equal experience. Yep emplyers will use it to evaluate people, but like i said i you want to get good exprience just work on a open source software if you don't have any work experience. OSS doesn't make a person better programmer, you can easily write an OSS app and still lack any knowledge of proper writting. Now has far has sun certification how it will help you get a php job. Well depends what kind of job you are looking for. A job where you only do php 24/7 or you do other stuff on the side (Java, C++, PHP, ...) I still dont see how sun has anything to do with anything, unless your against OSS philosophy. If so then beeing certified PHP just assure that you know PHP and some principles. Assuring someone that you have *some* is much better than the lack of proof otherwise. If you thake the sun certification it is been there for a far longer time ans since your job requires both in this case the sun certification means more. But certifications are just there to prove your level of understanding. So if I have a certificate of 'ed' that make it better than having a sun certificat since 'ed' has been around longer than sun. And should land me a much better PHP job. Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- 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] string filtering
John W. Holmes wrote: To detect them: if(preg_match('/[^0-9a-zA-Z]/',$string)) { echo 'bad characters present'; } else { echo 'string okay'; } or (faster): if (!ctype_alnum($string)){ echo 'bad characters present'; } else { echo 'string okay'; } Aaron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Popup with recent IE updates
Jason Wong wrote: On Friday 27 August 2004 01:28, Lester Caine wrote: [yada yada] Loading Mozilla on the problem machines gives a clean page with the correct pop-up's so I simply don't know what to try next. When this sort of thing was happening during development it was usually tracked to faulty PHP, but that is not definitely not the case this time. So why are you asking on the PHP list then? Look to save you looking it up: www.microsoft.com Spent a couple of unpaid hours there yesterday. The only thing that came up was pop-up blocking with SP2, but we have avoided that like the plague - and it is not being supplied for W2k copies of IE anyway. The CODE is designed to work with any browser, and IE is NOT my preferred choice, but I was hoping someone who is not an IE only developer would have come across the same problem! PHP is building the page correctly and a source dump from the problem machines gives an exact match with a source dump from a working machine, so YES the problem is pure IE crap, but I have never had a reply to ANY post to a Microsoft list and I NEED to fix this before the end of the month The customer HAS accepted that we advised that IE may cause problems, but since a number of other sites are running correctly . They have had to hold up a switch to XP because a number of other legacy applications failed :) -- Lester Caine - L.S.Caine Electronic Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Popup with recent IE updates
Miles Thompson wrote: Most likely this is a consequence of Windows XP SP2, one of its side effects is blocking of popups in IE. Strange, like smokers becoming non-smokers. No SP2 stuff added - and unlikely to be added This problem is affecting a couple of W2k machines as well Check Sunbelt Software for some workarounds, they identified the problem about 12 da ago. I'll grasp any straw ... Can't see anything that is related though. Current thinking is corrupt copy of IE that has been used to load the machines, as they do not have a public internet connection, the install and updates are from a local copy. So I have permission to wipe a problem machine and rebuild from scratch to see what happens. I could do without this waste of time ;( -- Lester Caine - L.S.Caine Electronic Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] backslashes
Hi, I have a jump box that sends the following value to the page. option value=?PHP echo 'giftprint.php?passid='.$passid.'sort=WHERE thankyou=\'Not Sent\' ORDER BY cash ASC';?Show Thank You Notes quot;Not Sentquot;/option Then, the below query is run: $query = SELECT name, event, description, cash, action, thankyou FROM gifts WHERE customerID='$passid' $sort; My problem is with the \'Not Sent\'. I need the backslashes for the php statement but the sql query can't handle it and the jump box gives me an error. Any help?
Re: [PHP] backslashes
On Friday 27 August 2004 15:31, Ryan Schefke wrote: First of all: Using unsanitised data from forms and links is a VERY bad thing. option value=?PHP echo 'giftprint.php?passid='.$passid.'sort=WHERE thankyou=\'Not Sent\' ORDER BY cash ASC';?Show Thank You Notes quot;Not Sentquot;/option Two problems here: 1) URLs needs to be urlencode() appropriately 2) But your major problem is you're passing too much superfluous data (technically known as crap). Breaking it down, you want to pass 4 pieces of data: 1) passid 2) thankyou status 3) sort column 4) sort direction NB depending on what you're doing (3) (4) may not be needed (eg if they're supposed to be hard-coded defaults that are not user selectable). Now assuming (3) (4) aren't needed, you would construct your URL something like this: giftprint.php?passid=$passidstatus=$status Then, the below query is run: $query = SELECT name, event, description, cash, action, thankyou FROM gifts WHERE customerID='$passid' $sort; My problem is with the \'Not Sent\'. I need the backslashes for the php statement but the sql query can't handle it and the jump box gives me an error. No, what you should do is assign various codes for the different status, eg 1 - not sent 2 - sent 3 - unknown Then when you receive the data you sanitise and verify that $passid and $status are valid. So for $status it has to be one of 1, 2, or 3. Then finally you can construct your query. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* You are a bundle of energy, always on the go. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] changed number_format function
A copy of php manual I downloaded a year back has the following about the behaviour of number_format function ?php $number = 1234.56; // english notation (default) $english_format_number = number_format($number); // 1,234.56 ? The latest on-line version is changed as below ?php $number = 1234.56; // english notation (default) $english_format_number = number_format($number); // 1,234 In many un-updated sites I could see the old version. I am not successful finding the change log related to this. Does any one know why it is changed thus? What is the best way to format numbers to put only the thousand separator without removing or adding decimal places to the number. For example, 1000 should return 1,000 1000.5 should return 1,000.5 1000.25 should return 1,000.25 so on. I am looking at sprintf now. Thanks and Best regards, Ma SivaKumar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] changed number_format function
On Fri, 27 Aug 2004 14:06:56 +0530, Ma SivaKumar [EMAIL PROTECTED] wrote: The latest on-line version is changed as below ?php $number = 1234.56; // english notation (default) $english_format_number = number_format($number); // 1,234 What is the best way to format numbers to put only the thousand separator without removing or adding decimal places to the number. For example, 1000 should return 1,000 1000.5 should return 1,000.5 1000.25 should return 1,000.25 so on. Ma SivaKumar Thus says http://www.php.net/number_format string number_format ( float number [, int decimals]) string number_format ( float number, int decimals, string dec_point, string thousands_sep) . . . If two parameters are given, number will be formatted with decimals decimals with a dot (.) in front, and a comma (,) between every group of thousands. ramil http://ramil.sagum.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: paste values for one pop-up. And this pop-up is one frame
Andre [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello Someone now how to paste values for one pop-up. And this pop-up is one frame I am doing like this to open pop-up echoa href=\#\ class=\textblack\ onclick=\NewWindow('fact_imprime.php?factura_id=$factura_id','Ficha','700', '300','no','left');return false\ onfocus=\this.blur()\ img src=\images/imprime.gif\ width=\31\ height=\31\ border =\0\/a; And in the pop-up I do like this. echo$_REQUEST[factura_id]; Thanks for the help... Remove the double quotes and put quotes around the array key: echo $_REQUEST['factura_id']; Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: paste values for one pop-up. And this pop-up is one frame
But don't work that's is my problem, And I think this don't work because the pop-up window is a frame Help?? -Original Message- From: Torsten Roehr [mailto:[EMAIL PROTECTED] Sent: quinta-feira, 26 de Agosto de 2004 23:18 To: [EMAIL PROTECTED] Subject: [PHP] Re: paste values for one pop-up. And this pop-up is one frame Andre [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello Someone now how to paste values for one pop-up. And this pop-up is one frame I am doing like this to open pop-up echoa href=\#\ class=\textblack\ onclick=\NewWindow('fact_imprime.php?factura_id=$factura_id','Ficha','700', '300','no','left');return false\ onfocus=\this.blur()\ img src=\images/imprime.gif\ width=\31\ height=\31\ border =\0\/a; And in the pop-up I do like this. echo$_REQUEST[factura_id]; Thanks for the help... What you described should work, so *where* is your problem? Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: paste values for one pop-up. And this pop-up is one frame
Andre [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] But don't work that's is my problem, And I think this don't work because the pop-up window is a frame Help?? Have you seen my other post from two minutes ago? You mean your popup contains a frameset? Then post your frameset code and we might be able to help. Regards, Torsten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] parse_ini_file problem
Hello folks! I have an ini file that looks like this: index.rent=Rent index.faq=FAQ index.contact=Contact index.links=Links then I want to read this file: $english_messages = parse_ini_file('conf/english.ini'); print_r($english_messages); What I see is: Array ( [index.rent] = Rent ) And that's all. Shouldn't parse_ini_file return all the messages I have in ini file but not only the first one? I'm using 4.3.8 on windows XP. TIA. Vladimir -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: paste values for one pop-up. And this pop-up is one frame
Yes and don't work. The code of the frameset html head titleUntitled Document/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head frameset rows=*,80 frameborder=NO border=0 framespacing=0 frame src=imprimir_factura.php name=mainFrame frame src=bot.php name=bottomFrame scrolling=NO noresize /frameset noframesbody /body/noframes /html And I want to see de value of $_REQUEST in imprimir_factura.php -Original Message- From: Torsten Roehr [mailto:[EMAIL PROTECTED] Sent: sexta-feira, 27 de Agosto de 2004 10:31 To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: paste values for one pop-up. And this pop-up is one frame Andre [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] But don't work that's is my problem, And I think this don't work because the pop-up window is a frame Help?? Have you seen my other post from two minutes ago? You mean your popup contains a frameset? Then post your frameset code and we might be able to help. Regards, Torsten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Include if file exists?
Hi! Is there a ready to use PHP function for including ONLY if the file exists? I tried it like this: [main.php] include_once(lib.php); later includeIf(somefile.php); [lib.php] function includeIf($filename) { if (!file_exists($filename)) { include_once($filename); } } You see the problem. The somefile.php seems to be included in the wrong file. It should be included in the main.php instead of lib.php. How can i still have the function in lib.php but the file will be included in main.php Thanx in advance J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Popup with recent IE updates
Lester Caine wrote: Miles Thompson wrote: Most likely this is a consequence of Windows XP SP2, one of its side effects is blocking of popups in IE. Strange, like smokers becoming non-smokers. No SP2 stuff added - and unlikely to be added This problem is affecting a couple of W2k machines as well OK got a handle on this now. The customer had installed XP on the W2k machine that ran Apache and PHP (And not told us ;) ). Switched to the Firebird machine ( which they had not touched and still had W2k ) and the problem goes away. No answers, but Apache+PHP+XP seems to be the problem. We have restored the web server to W2k, and everything works fine again. So don't know what goes wrong, but were running Apache 2.0.50, PHP5.0.0 on XP-SP1 and probably style sheets were going wrong. Switch back to W2k SP3 and all is fine (SP4 screws up various other network apps) so we stay with that until Linux is acceptable :) -- Lester Caine - L.S.Caine Electronic Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with sessions
you sure the cookie is being set? try this header(Location: http://; . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/b.php?'.SID); I had tried this before - no result. The cookie is set in the \temp dir where it is intended. And that's where the other cookie with new session is located too. This really is a strange problem. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with sessions
Hi, Looking at your code, I noticed that either you're missing the closing double quote to close off the Location expression, or you're ending it early with a double quote at http://;. Shouldn't it read: header(Location: http://' . $_SERVER['HTTP_HOST'] ^ . dirname($_SERVER['PHP_SELF']) . '/b.php?'.SID'); ^^ Perhaps that's the problem. I'm no expert . . . Hth, Andre On Friday 27 August 2004 07:47 am, gregosh wrote: you sure the cookie is being set? try this header(Location: http://; . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/b.php?'.SID); I had tried this before - no result. The cookie is set in the \temp dir where it is intended. And that's where the other cookie with new session is located too. This really is a strange problem. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: paste values for one pop-up. And this pop-up is one frame
Andre [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Yes and don't work. The code of the frameset html head titleUntitled Document/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head frameset rows=*,80 frameborder=NO border=0 framespacing=0 frame src=imprimir_factura.php name=mainFrame frame src=bot.php name=bottomFrame scrolling=NO noresize /frameset noframesbody /body/noframes /html You have to pass the variable from the frameset to the page that will be using the variable. Change the first frame line into: frame src=imprimir_factura.php?factura_id?php= $_GET['factura_id']; ? name=mainFrame Then in imprimir_factura.php you can acces the variable via $_GET['factura_id']. This should work. Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include if file exists?
On Fri, 27 Aug 2004 12:16:32 +0200, Jay [EMAIL PROTECTED] wrote: Hi! Is there a ready to use PHP function for including ONLY if the file exists? I tried it like this: [main.php] include_once(lib.php); .later includeIf(somefile.php); [lib.php] function includeIf($filename) { if (!file_exists($filename)) { include_once($filename); } } you sure you dont mean this? function includeIf($filename) { if (file_exists($filename)) /*instead of if (!file_exists($filename))*/ { include_once($filename); } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parse_ini_file problem
On Fri, 27 Aug 2004 12:54:14 +0300, Vladimir [EMAIL PROTECTED] wrote: Hello folks! I have an ini file that looks like this: index.rent=Rent index.faq=FAQ index.contact=Contact index.links=Links then I want to read this file: $english_messages = parse_ini_file('conf/english.ini'); print_r($english_messages); What I see is: Array ( [index.rent] = Rent ) And that's all. Shouldn't parse_ini_file return all the messages I have in ini file but not only the first one? I'm using 4.3.8 on windows XP. TIA. Vladimir I can't seem to replicate your problem (and I copied the code from your email). No warnings? DId you check the log for messages? ramil http://ramil.sagum.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: paste values for one pop-up. And this pop-up is one frame
Thank work. Regards, André Caridade -Original Message- From: Torsten Roehr [mailto:[EMAIL PROTECTED] Sent: sexta-feira, 27 de Agosto de 2004 13:42 To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: paste values for one pop-up. And this pop-up is one frame Andre [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Yes and don't work. The code of the frameset html head titleUntitled Document/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head frameset rows=*,80 frameborder=NO border=0 framespacing=0 frame src=imprimir_factura.php name=mainFrame frame src=bot.php name=bottomFrame scrolling=NO noresize /frameset noframesbody /body/noframes /html You have to pass the variable from the frameset to the page that will be using the variable. Change the first frame line into: frame src=imprimir_factura.php?factura_id?php= $_GET['factura_id']; ? name=mainFrame Then in imprimir_factura.php you can acces the variable via $_GET['factura_id']. This should work. Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include if file exists?
Jay wrote: Hi! Is there a ready to use PHP function for including ONLY if the file exists? I tried it like this: [main.php] include_once(lib.php); later includeIf(somefile.php); [lib.php] function includeIf($filename) { if (!file_exists($filename)) { include_once($filename); } } You see the problem. The somefile.php seems to be included in the wrong file. It should be included in the main.php instead of lib.php. How can i still have the function in lib.php but the file will be included in main.php Don't see why you need an 'includeif' function at all. include() will not stop the script (fatal error) if the file isn't there like require() will. include() will only throw an error which you can supress with '@' @include ( nonexistant.txt ) include() will also return true or false. So if you want to run some code only if the include file is there... if ( @include ( thisfile.txt ) ) { // do this some code; } Your function is working fine, what's confusing you is scope. When you include a file inside of a function, everything in that file has the scope of the local function, not the document itself. -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PID needed to hammer squid
To get the pid id: ?php exec(cat [path to pid file], $pid); echo $pid[0]; ? raditha dissanayake wrote: Mário Gamito wrote: Hi, I need to kill (squid) -D pidof (squid) -D gives an error :( man pidof we have nowed moved to off topic territory. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Oficial Certification
Hmm... there are no practice exams posted... I just saw that: http://www.phparch.com/cert/ -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Oficial Certification
From: Dan Joseph [EMAIL PROTECTED] I just saw that: http://www.phparch.com/cert/ Hmm... there are no practice exams posted... See here: http://www.phparch.com/discuss/index.php/t/710/235/ ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Oficial Certification
Hi, Know what helps me get php jobs? A resume that details almost 6 years of php programming. That's what most employers want. Certifications are a lot of times looked at as watered down, and over-issued. A lot of companies also use them as training pieces with their internal staff, meaning, they send them out for training, they get certified, and the employer sees the training was completed successfully. Its good that there's a PHP Cert, PHP/Zend should endorse one. -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Oficial Certification OT
[snip] ...certification stuff... [/snip] I am certified. So they tell me. And Nichel too. Probably Holmes. Defiinitely Wong, maybe wight. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Oficial Certification
Dan Joseph wrote: Hi, Know what helps me get php jobs? A resume that details almost 6 years of php programming. That's what most employers want. Certifications are a lot of times looked at as watered down, and over-issued. A lot of companies also use them as training pieces with their internal staff, meaning, they send them out for training, they get certified, and the employer sees the training was completed successfully. Its good that there's a PHP Cert, PHP/Zend should endorse one. -Dan Joseph I'm not big on certs myself. How many MCSE's have we seen who can't find the power switch? ;) But what I like about a cert for something like php is that more upper management will take it as a serious language. For some reason, that's their proof. -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Oficial Certification
John Holmes wrote: From: Dan Joseph [EMAIL PROTECTED] I just saw that: http://www.phparch.com/cert/ Hmm... there are no practice exams posted... See here: http://www.phparch.com/discuss/index.php/t/710/235/ ---John Holmes... Cool...I was wondering why we haven't seen him around lately. Congrats John! -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Oficial Certification OT
From: Jay Blanchard [EMAIL PROTECTED] Probably Holmes. Not officially. Might look into it, though, but this is really just a hobby for me. :) I think that if you've been on the list for over a year, you should be certified automatically. heh... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Oficial Certification OT
Jay Blanchard wrote: [snip] ...certification stuff... [/snip] I am certified. So they tell me. And Nichel too. Probably Holmes. Defiinitely Wong, maybe wight. I don't think *THAT* 'cert' will help us in the job market. ;) -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Oficial Certification OT
[snip] Probably Holmes. Not officially. Might look into it, though, but this is really just a hobby for me. :) I think that if you've been on the list for over a year, you should be certified automatically. heh... [/snip] I can see it now If you have replied 'RTFM more than once a week, you might be certified. If you have used the word 'foo' in a sentence, you might be certified. If you think ASP sucks, you might be certified. If you Well, you get the idea... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Setcookie variable use issue after moving php app to di fferent server
Local/master both still show off. I tried using the .htaccess trick, and that did not work either. I have tried now to use the extract($_COOKIE) and extract($_POST) option in the scripts to get around this for now, which seems to be working, but I need to consequently do a lot of testing now to verify everything works. I just don't get what the problem is with this not working. David -Original Message- From: John Holmes [mailto:[EMAIL PROTECTED] Sent: Thursday, August 26, 2004 12:08 PM To: Shapiro, David; [EMAIL PROTECTED] Cc: Perry, Joe (ITCD) Subject: Re: [PHP] Setcookie variable use issue after moving php app to different server From: Shapiro, David [EMAIL PROTECTED] You certainly know your stuff. Unfortunatley, it says that is uses /etc/php.ini, which I did modify, but it also reports register_globals as still off too. It does show a scan dir for additional .ini files (/etc/php.d and additional ini files parsed as ldap.ini, mysql.ini, and odbc.ini too, but I don't think they would have anything to do with it. I'm stumped. Other than adding the entry and stop/starting apache, is there anything else I need to go? That should be all you have to do. Does it say that the local and master values are both OFF, still? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Keep from using cache
Here's the problem... After a deletion, when the question list page is reloaded, the browser uses the cached version of the page and the question which was just deleted is still displayed. If you refresh the page, the question disappears. So, I know that the deletion is working. I just need to know how to force the browser to NOT use the cached version of the page. try these header(Cache-Control: private); header(Pragma: no-cache); There are some bugs in IE5 which require the use of a few extra cache headers, for good measure. For data which I don't want cached, I use this: header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1 header('Cache-Control: post-check=0, pre-check=0'); // damnable IE5 header('Expires: Wed, 16 Nov 1977 10:00:00 CET'); // date in past header('Last-Modified: '.date('r'));// right -now- header('Pragma: no-cache'); // HTTP/1.0 - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Oficial Certification OT
John Holmes wrote: From: Jay Blanchard [EMAIL PROTECTED] Probably Holmes. Not officially. Might look into it, though, but this is really just a hobby for me. :) I think that if you've been on the list for over a year, you should be certified automatically. heh... ---John Holmes... WooHooI found posts from me dating back to 2002 on this list. Funny though, I know I've been posting here since '99 or '00. Might have been under a different email address. Ah, well. -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Setcookie variable use issue after moving php app to di fferent server
Thanks for the info. I checked the file and it does not have much in it. I am working if I am not enabling this in php.ini correctly. I see [Security, Performance] list after the example. To enable, I just copied the example line, removed the [Security, Performance] stuff from the line, and set the value to equal On. Is this [Security, Performance] stuff actuall the name of the section that this option needs to be in--in that, do I need to do the following: [Security] register_globals = On And/or [Performance] register_globals = On -Original Message- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: Thursday, August 26, 2004 7:20 PM To: '[EMAIL PROTECTED]' Subject: Re: [PHP] Setcookie variable use issue after moving php app to di fferent server * Thus wrote Shapiro, David: You certainly know your stuff. Unfortunatley, it says that is uses /etc/php.ini, which I did modify, but it also reports register_globals as still off too. It does show a scan dir for additional .ini files (/etc/php.d and additional ini files parsed as ldap.ini, mysql.ini, and odbc.ini too, but I don't think they would have anything to do with it. I'm stumped. Other than adding the entry and stop/starting apache, is there anything else I need to go? this looks like a RH setup.. take a look in: /etc/httpd/conf.d/php.conf For any directives being set in there. The ini files in php.d/ usually simply have: extension=file.so Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- 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] changed number_format function
On Fri, 27 Aug 2004 14:06:56 +0530, Ma SivaKumar [EMAIL PROTECTED] wrote: A copy of php manual I downloaded a year back has the following about the behaviour of number_format function ?php $number = 1234.56; // english notation (default) $english_format_number = number_format($number); // 1,234.56 ? The latest on-line version is changed as below ?php $number = 1234.56; // english notation (default) $english_format_number = number_format($number); number_format($number, 2); // 1,234 In many un-updated sites I could see the old version. I am not successful finding the change log related to this. Does any one know why it is changed thus? What is the best way to format numbers to put only the thousand separator without removing or adding decimal places to the number. For example, 1000 should return 1,000 1000.5 should return 1,000.5 1000.25 should return 1,000.25 so on. I am looking at sprintf now. Thanks and Best regards, Ma SivaKumar -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Newbie Question: DHTML client Http Post to PHP running under Apache/Win XP
Does the PHP script have to be already running to communicate send a HTTP Post varibale to it (from a DHTML client browser)? Or can it initiate the HTTP Post fron the client that activates the PHP script? I know this must seems simple but I'm having troble receiving these varible from my client. When I find out the value of the vaiable I stick it into a MySQL table. Both client DHTML and server PHP work well alone but I can't seem to et the connection going using localhost. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: crypt()
you can use md5() which will create an encrypted string that cannot be encrypted, or you can use something like base64_encode() which has the inverse base64_decode, that way you have an encrypted string in the database but if for example a user loses their password, instead of setting a new one, you can retrieve the old one. This of course won't be as secure, but anyone that gains access to your db will not be looking at the real password and will have to know to decrypt it using base64_decode(). hope that's informational, -ApexEleven -- -- Jasper Howard :: Database Administration Velocity7 1.530.470.9292 http://www.Velocity7.com/ -- Aaron Todd [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have developed a PHP based site that requires users to login. Their login information is kept in a MYSQL database. Currently, I am using an IF statement to verify what the user enters as their password with what is in the the database. If they are the same a session is created and they have access to the content of the site. As far as I know the password is being sent to the script in clear text and I was wondering what a good way would be to get this to be encrypted. My first thought is to encrypt the password in the database using crypt(). So if I view the table I will see the encrypted characters. Then change the IF statement to encrypt the password that the user enters and then just check if its the same as what is in the database. That sounds like the same as I am doing now only instead of checking a password that is a name, its checking the encrypted characters of the name. So it seems my idea would hide the real characters. Can anyone tell me if this is a bad idea. And maybe point me toward a good one. Thanks, Aaron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] changed number_format function
Justin Patrin wrote: number_format($number, 2); Does not work. Desired results: 1000 should return 1,000 1000.5 should return 1,000.5 1000.25 should return 1,000.25 so on. Actual results: 1000= 1,000.00 1000.5 = 1,000.50 1000.25 = 1,000.25 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: A bit stuck with $$
i found this a bit confusing, why were you putting $$ infront of a variable instead of just $? -- -- Jasper Howard :: Database Administration Velocity7 1.530.470.9292 http://www.Velocity7.com/ -- Neil [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Not sure if its me or the configuration of PHP I am trying to get the value of a variable, a variable variable ie // From Form $name = My Name; --- // from a list of values in a file $var=name; $value=$$var; i// I thought I could do something as simple as this to get the correct value My Name into $value. print $value ; // should print My Name, I zip. I have played around with this bit of code from operators part of the manual and this does not appear to work, well for me at least. $foo = test; $$bar = this is; echo ${$bar} $foo; // prints this is test Note: it is the same as echo $test $foo; // * for me it only prints out test Any Ideas Cheers Neil Regards Chester Cairns - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie Question: DHTML client Http Post to PHP running under Apache/Win XP
From: [EMAIL PROTECTED] Does the PHP script have to be already running to communicate send a HTTP Post varibale to it (from a DHTML client browser)? Or can it initiate the HTTP Post fron the client that activates the PHP script? Just like any other web page, the POST request causes the web server to start the PHP script which receives the posted values. They are then available in the $_POST array. print_r($_POST) is your friend here (and mine!!). Without seeing your code I'll have to resort to my crystal ball for the problems and right now it's leading me to believe your PHP script needs watering around line 45. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: crypt()
Jasper Howard wrote: you can use md5() which will create an encrypted string that's not entirely true, all it will do is compute the md5-hash of that string. Which is *always* a 32-character hexadecimal number (though before PHP5.0.0 it was returned in a different way). The big difference between a hash and an encypted string is the fact that a hash does NOT store the string it was computed of. This means that there are more than 1 possible strings for the same hash. While an encrypted string *always* has only 1 single possible result when decrypted (with the right keys, etc. etc.). For storing passwords in a database you can easily use md5, although this means that you don't store the actual password (you store the HASH), and the user could, in theory, send a completely different string and still gain access to the account. This is not easy however. MD5 is very well known for the fact that a very small change in the initial string makes for a big change in the resulting hash. It's basically infeasible to actually (reverse-)compute a possible initial string which results in the same md5-hash. So basically for storing passwords, it's safe enough. Remember though that you're not storing the password itself! So you'll never be able to get the actual password to check against. You'll need to compute the md5-hash of the provided password and THEN check that against the stored hash. Back to encrypted strings. Encryption is very complex, and can *always* be reverse-engineered. Although it's (in most cases) infeasible to do, it is theoretically possible for all encrypted strings. Another thing to remember is that longer unencrypted strings also make longer encrypted strings. This is because the data inside *CAN* not be lost. So, a quick overview of both: Hashes: fixed-length, but not recoverable Encrypted: variable-length, but recoverable (with a key) You'll need to carefully choose between those two. Also please remember that it is always most efficient to keep a fixed-length string in a database than a variable-length one. that cannot be encrypted, or you can use something like base64_encode() which has the inverse base64_decode, base64 is not an encryption. It is an en*coding*. This means that if someone knows it's 'base 64', that person will always be able to decode it, no matter what. Base64-encoding in particular was created to be able to (safely) send binary data trough non 8-bit-clean layers. that way you have an encrypted string in the database but if for example a user loses their password, instead of setting a new one, you can retrieve the old one. This of course won't be as secure, but anyone that gains access to your db will not be looking at the real password and will have to know to decrypt it using base64_decode(). hope that's informational, -ApexEleven -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Curious problem overloading derived ObjectArray and __toString
hi, I extended ArrayObject (SPL) to a new class. Let's call it ExtObjectArray. ExtArrayObject is quiet tiny, only with some simple functions. One is called getData() and serves some string data. Now I've overloaded the class using __toString() ... public function __toString() { return( $this-getData()); } What I wish to do is, to ... $obj = new ExtArrayObject; print( (string)$obj); ... and it doesn't work. And i've absolutly no idea why. PHP prints instead of the getData() String the object ID, as the __toString isn't called. What actually is true. There are no errors, no warnings, no notices at all. If i invoke __toString() [print( $obj-__toString())] direct, it works fine! First i assumed it's a spelling mistake. But __toString(), including the case, is okay (source: zend2-engine-changes). Then i tried it without access spec. So without public, but that doesn't work either. Replacing the return statement in the __toString() method with a simple print( foo\n), I realized, that the method won't be called. That really sucks! :o) My PHP Version is php 5.0.1 build from source. Btw.: this little example also doesn't work. --- begin ? class foo { function __toString() { return(hallo); } } $a = new foo; echo (string)$a; ? --- end Assigning to another var instead directly output the object doesn't work either as the Zend Changelog (till 2004-07-14) doesn't say anything explaining the problem. anybody have more clue about that? regards, Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: crypt()
good to know -- -- Jasper Howard :: Database Administration Velocity7 1.530.470.9292 http://www.Velocity7.com/ -- M. Sokolewicz [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Jasper Howard wrote: you can use md5() which will create an encrypted string that's not entirely true, all it will do is compute the md5-hash of that string. Which is *always* a 32-character hexadecimal number (though before PHP5.0.0 it was returned in a different way). The big difference between a hash and an encypted string is the fact that a hash does NOT store the string it was computed of. This means that there are more than 1 possible strings for the same hash. While an encrypted string *always* has only 1 single possible result when decrypted (with the right keys, etc. etc.). For storing passwords in a database you can easily use md5, although this means that you don't store the actual password (you store the HASH), and the user could, in theory, send a completely different string and still gain access to the account. This is not easy however. MD5 is very well known for the fact that a very small change in the initial string makes for a big change in the resulting hash. It's basically infeasible to actually (reverse-)compute a possible initial string which results in the same md5-hash. So basically for storing passwords, it's safe enough. Remember though that you're not storing the password itself! So you'll never be able to get the actual password to check against. You'll need to compute the md5-hash of the provided password and THEN check that against the stored hash. Back to encrypted strings. Encryption is very complex, and can *always* be reverse-engineered. Although it's (in most cases) infeasible to do, it is theoretically possible for all encrypted strings. Another thing to remember is that longer unencrypted strings also make longer encrypted strings. This is because the data inside *CAN* not be lost. So, a quick overview of both: Hashes: fixed-length, but not recoverable Encrypted: variable-length, but recoverable (with a key) You'll need to carefully choose between those two. Also please remember that it is always most efficient to keep a fixed-length string in a database than a variable-length one. that cannot be encrypted, or you can use something like base64_encode() which has the inverse base64_decode, base64 is not an encryption. It is an en*coding*. This means that if someone knows it's 'base 64', that person will always be able to decode it, no matter what. Base64-encoding in particular was created to be able to (safely) send binary data trough non 8-bit-clean layers. that way you have an encrypted string in the database but if for example a user loses their password, instead of setting a new one, you can retrieve the old one. This of course won't be as secure, but anyone that gains access to your db will not be looking at the real password and will have to know to decrypt it using base64_decode(). hope that's informational, -ApexEleven -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Solved: Curious problem overloading derived ObjectArray and __toString
m'kay ... already got it. The routine was disabled due some internal problems. It should be reintroduced in PHP 5.1. *wait* http://www.rb21.com/news/index.php/m/115763/0/#msg_115763 Stefan wrote: hi, I extended ArrayObject (SPL) to a new class. Let's call it ExtObjectArray. ExtArrayObject is quiet tiny, only with some simple functions. One is called getData() and serves some string data. Now I've overloaded the class using __toString() ... public function __toString() { return( $this-getData()); } What I wish to do is, to ... $obj = new ExtArrayObject; print( (string)$obj); ... and it doesn't work. And i've absolutly no idea why. PHP prints instead of the getData() String the object ID, as the __toString isn't called. What actually is true. There are no errors, no warnings, no notices at all. If i invoke __toString() [print( $obj-__toString())] direct, it works fine! First i assumed it's a spelling mistake. But __toString(), including the case, is okay (source: zend2-engine-changes). Then i tried it without access spec. So without public, but that doesn't work either. Replacing the return statement in the __toString() method with a simple print( foo\n), I realized, that the method won't be called. That really sucks! :o) My PHP Version is php 5.0.1 build from source. Btw.: this little example also doesn't work. --- begin ? class foo { function __toString() { return(hallo); } } $a = new foo; echo (string)$a; ? --- end Assigning to another var instead directly output the object doesn't work either as the Zend Changelog (till 2004-07-14) doesn't say anything explaining the problem. anybody have more clue about that? regards, Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP: Undefined Variables Error Message
Hello all. I just finished placing a new server in production and PHP is not working. I am getting undefined variable messages when trying to submit php based forms. Register Globals is on in php.ini, but it still does not work. I have even tried copying a known-good php.ini from another server and the same behavior exists. I am running IIS in Windows 2000. Any ideas? Another website dies on line 4 here: ?php $to = [EMAIL PROTECTED]; $subject = Swinos.com Booking Contact - $name; $headers .= MIME-Version: 1.0\r\n; $headers .= '...'; is equivalent to $headers = $headers . '...'; So it's probably complaining that $headers is not defined when you're trying to append something to it. Change that first .= to a =, like the line above, and see if that doesn't help. -- michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Download Script
I've created a download script that works quite nicely. The only issue with it is that when I download a file where the file name is like filename v1.0.2.1.exe there is some extra characters added into the name when it is downloaded. So that file will be filename v1[1].0.2.1.exe. I am wondering if this is my headers that are doing this, but I really dont know. Here is my code: ?php $file = $_GET['file']; $path = $_GET['type']; $rootpath = /home/virtual/site341/fst/var/www/downloads/; $filename = $rootpath$path/$file; if (file_exists($filename)) { header(Content-Description: File Transfer); header(Pragma: no-cache); header(Content-Type: application/force-download); header(Content-Disposition: attachment; filename=.basename($filename)); header(Content-Length: .filesize($filename)); $handle = fopen(($filename), r); print(fread($handle, filesize($filename))); flush(); fclose($handle); } else { header(HTTP/1.0 404 Not Found); } ? If anyone can let me know what is going on I'd appreciate it. Thanks, Aaron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Version for API 20001222
What PHP version had the API number 20001222 ? Thanks Cole -- This message has been scanned for viruses and dangerous content by MailScanner on mail.ashcraftfamily.net, and is believed to be clean. Please report any deviance from this condition immediately to the AFN Administrator at [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with front page files downloaded to dev machine OT
Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Friday 27 August 2004 09:00, Gunter Sammet wrote: Yes. All my local stuff does work like a charm. I'm working with osCommerce shopping cart and all my local installs work just fine. And as I said, when I compare it with a local install, the files don't show anything unusual. Based on the info you've given so far I suggest that you check that these settings in php.ini: short_open_tag asp_tags are appropriate and/or the same on both servers. Thanks for this info. I'll keep it in case I run into the same problem for another reason. It turned out to be a problem with some code my client added in for gzip compression. Somehow it didn't work on my local machine. I commented it out and everything worked like a charm. So it wasn't the FrontPage extensions stuff. If I get around, I might try it with another php version to see if it works then. Anyway. Thanks to all for their input. Cheers, Gunter -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* An eye in a blue face Saw an eye in a green face. That eye is like this eye Said the first eye, But in low place, Not in high place. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Download Script
I am wondering if this is my headers that are doing this, but I really dont know. I think its an IE or Windows behavior and what causes it is the multiple dots in the filename. I resorted to naming our downloads filename-v1_0_2_1.exe -Original Message- From: Aaron Todd [mailto:[EMAIL PROTECTED] Sent: Friday, August 27, 2004 11:35 AM To: [EMAIL PROTECTED] Subject: [PHP] Download Script I've created a download script that works quite nicely. The only issue with it is that when I download a file where the file name is like filename v1.0.2.1.exe there is some extra characters added into the name when it is downloaded. So that file will be filename v1[1].0.2.1.exe. I am wondering if this is my headers that are doing this, but I really dont know. Here is my code: ?php $file = $_GET['file']; $path = $_GET['type']; $rootpath = /home/virtual/site341/fst/var/www/downloads/; $filename = $rootpath$path/$file; if (file_exists($filename)) { header(Content-Description: File Transfer); header(Pragma: no-cache); header(Content-Type: application/force-download); header(Content-Disposition: attachment; filename=.basename($filename)); header(Content-Length: .filesize($filename)); $handle = fopen(($filename), r); print(fread($handle, filesize($filename))); flush(); fclose($handle); } else { header(HTTP/1.0 404 Not Found); } ? If anyone can let me know what is going on I'd appreciate it. Thanks, Aaron -- 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] sharing records with assigned users
Ave, Hey thanks a lot. I'm reading up on those. I appreciate this. Thanks. On 8/26/04 10:07 PM, David Bevan [EMAIL PROTECTED] wrote: On Thu, 2004-08-26 at 13:49, PHP Junkie wrote: Ave, Jay.. Firstly thanks a lot for the tips. I appreciate that and in fact I do try to go methodically in most cases, even using the pen paper to create my flow charts and diagrams of what I'm about to program. I actually love that method of designing an application. In fact, for this Phonebook application as well, right here in front of me is the piece of paper in which I've tried to draw the different modules, their behaviors and the functions which I will need to create in order to make this application work intelligibly. Coming back again to my problem.. If, in the table I'm storing my records, I create a field which stores the Users allowed access to that particular record, then in case of multiple users, that single field will hold multiple user names... Which is a problem for me. And I might be applying a very wrong approach, logically, which is why I came forward for some assistance. Thanks again. On 8/26/04 1:37 PM, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] There is one feature that Admin gets which I'm trying to figure out. When the Admin is adding a record, he gets to decide which users he wants to share the record with. He can choose particular Users by clicking on their name to share that record with. How do I make that happen? Any suggestions? [/snip] I am going to go a little sideways in response to your question because I believe that we should help people to learn and improve. Many people enter the PHP arena and become exposed to the shear power available to them, so they want to accomplish more and more complex apps than they would in the course of normal web site interaction. I believe at this point one makes the leap from web developer to applications developer. One of the first things an applications developer should learn is how to design an application before they write the first line of code. This requires things like flowcharting and UML. Every programming language book has several words on this. So, Junkie, what you should do is break down the the componenets into statements. The statements can then be broken down some more...into processes, decisions, etc. Once done you will know what the code is. It's very zen. 1. Admin adds record. 2. Admin chooses user type(s) that will be allowed access to record. 3. Admin saves information so that application knows. NAME ACCESS_LEVEL bhoover admin pnosehair user etc. [/off soapbox] Very much to what Jay mentioned above, you have to take the time to design, although you may have the logic thought out, you need to look at the way you want to interact with the data and the problems it seems to be presenting to you. An app like you are writing is very straight forward IF you have the data structured properly. aside I used to give a project very similar to this to my students when I used to teach programming and logic and all of my students had the same problem/aside I would advise you to read up on normalization particularly second and third normal forms and that should clear up your difficulties. Have a quick read of: http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html to start. HTH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sharing records with assigned users
Ave, Thanks a ton... And this is exactly what I figured I need to do. Someone else also wrote in something similar which prompted me to go in this direction. It's working out now by creating an additional table that maps the users records through ID and holds information on who is allowed access. Thanks again. On 8/26/04 6:11 PM, Torsten Roehr [EMAIL PROTECTED] wrote: I guess you need to create a table that maps users to records with two columns $userID and $recordID. Then you look up in that table if the user is allowed to edit/see this record. Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Download Script
When I created a download script a couple weeks ago I used readfile($filename) instead of fread() and didn't get anything like what you're getting. [snippet] header(Content-type: $type); header('Content-Disposition: attachment; filename='.$file_name.''); readfile($dfile); [/snippet] NOTE: $dfile = path + file; -- -- Jasper Howard :: Database Administration Velocity7 1.530.470.9292 http://www.Velocity7.com/ -- Aaron Todd [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I've created a download script that works quite nicely. The only issue with it is that when I download a file where the file name is like filename v1.0.2.1.exe there is some extra characters added into the name when it is downloaded. So that file will be filename v1[1].0.2.1.exe. I am wondering if this is my headers that are doing this, but I really dont know. Here is my code: ?php $file = $_GET['file']; $path = $_GET['type']; $rootpath = /home/virtual/site341/fst/var/www/downloads/; $filename = $rootpath$path/$file; if (file_exists($filename)) { header(Content-Description: File Transfer); header(Pragma: no-cache); header(Content-Type: application/force-download); header(Content-Disposition: attachment; filename=.basename($filename)); header(Content-Length: .filesize($filename)); $handle = fopen(($filename), r); print(fread($handle, filesize($filename))); flush(); fclose($handle); } else { header(HTTP/1.0 404 Not Found); } ? If anyone can let me know what is going on I'd appreciate it. Thanks, Aaron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Version for API 20001222
PHP 4.0.6-6.2mdk On Friday 27 August 2004 02:45 pm, Cole S. Ashcraft wrote: What PHP version had the API number 20001222 ? Thanks Cole -- This message has been scanned for viruses and dangerous content by MailScanner on mail.ashcraftfamily.net, and is believed to be clean. Please report any deviance from this condition immediately to the AFN Administrator at [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Version for API 20001222
Thanks! Andre Dubuc wrote: PHP 4.0.6-6.2mdk On Friday 27 August 2004 02:45 pm, Cole S. Ashcraft wrote: What PHP version had the API number 20001222 ? Thanks Cole -- This message has been scanned for viruses and dangerous content by MailScanner on mail.ashcraftfamily.net, and is believed to be clean. Please report any deviance from this condition immediately to the AFN Administrator at [EMAIL PROTECTED] -- This message has been scanned for viruses and dangerous content by MailScanner on mail.ashcraftfamily.net, and is believed to be clean. Please report any deviance from this condition immediately to the AFN Administrator at [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Running system command or exec as differnet Users
Is it possible to run a command on the system using the system() or exec() commands run as a specific user if I have the username and password? i.e. [EMAIL PROTECTED]su userNo1 [EMAIL PROTECTED]/home/server/executeScript all in a php system() or exec() call.. Thanks! -Paul Paul Danko Director of Information Technology Systems Development American Mortgage and Investment, Corp. [EMAIL PROTECTED] 443.677.7279 Mobile 301.883.8881 x 127 Office
[PHP] Re: Download Script
Were you trying to download any files in the format filename v1.0.2.0.exe I just tried using readfile and got the same results. Aaron Jasper Howard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] When I created a download script a couple weeks ago I used readfile($filename) instead of fread() and didn't get anything like what you're getting. [snippet] header(Content-type: $type); header('Content-Disposition: attachment; filename='.$file_name.''); readfile($dfile); [/snippet] NOTE: $dfile = path + file; -- -- Jasper Howard :: Database Administration Velocity7 1.530.470.9292 http://www.Velocity7.com/ -- Aaron Todd [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I've created a download script that works quite nicely. The only issue with it is that when I download a file where the file name is like filename v1.0.2.1.exe there is some extra characters added into the name when it is downloaded. So that file will be filename v1[1].0.2.1.exe. I am wondering if this is my headers that are doing this, but I really dont know. Here is my code: ?php $file = $_GET['file']; $path = $_GET['type']; $rootpath = /home/virtual/site341/fst/var/www/downloads/; $filename = $rootpath$path/$file; if (file_exists($filename)) { header(Content-Description: File Transfer); header(Pragma: no-cache); header(Content-Type: application/force-download); header(Content-Disposition: attachment; filename=.basename($filename)); header(Content-Length: .filesize($filename)); $handle = fopen(($filename), r); print(fread($handle, filesize($filename))); flush(); fclose($handle); } else { header(HTTP/1.0 404 Not Found); } ? If anyone can let me know what is going on I'd appreciate it. Thanks, Aaron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Download Script
yeah, but images with filenames something like this - cool_image v2.5.443.jpg -- -- Jasper Howard :: Database Administration Velocity7 1.530.470.9292 http://www.Velocity7.com/ -- Aaron Todd [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Were you trying to download any files in the format filename v1.0.2.0.exe I just tried using readfile and got the same results. Aaron Jasper Howard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] When I created a download script a couple weeks ago I used readfile($filename) instead of fread() and didn't get anything like what you're getting. [snippet] header(Content-type: $type); header('Content-Disposition: attachment; filename='.$file_name.''); readfile($dfile); [/snippet] NOTE: $dfile = path + file; -- -- Jasper Howard :: Database Administration Velocity7 1.530.470.9292 http://www.Velocity7.com/ -- Aaron Todd [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I've created a download script that works quite nicely. The only issue with it is that when I download a file where the file name is like filename v1.0.2.1.exe there is some extra characters added into the name when it is downloaded. So that file will be filename v1[1].0.2.1.exe. I am wondering if this is my headers that are doing this, but I really dont know. Here is my code: ?php $file = $_GET['file']; $path = $_GET['type']; $rootpath = /home/virtual/site341/fst/var/www/downloads/; $filename = $rootpath$path/$file; if (file_exists($filename)) { header(Content-Description: File Transfer); header(Pragma: no-cache); header(Content-Type: application/force-download); header(Content-Disposition: attachment; filename=.basename($filename)); header(Content-Length: .filesize($filename)); $handle = fopen(($filename), r); print(fread($handle, filesize($filename))); flush(); fclose($handle); } else { header(HTTP/1.0 404 Not Found); } ? If anyone can let me know what is going on I'd appreciate it. Thanks, Aaron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions session_start() my problem
Dears,I have 3 files. k.php : ? session_start(); $S_userk=$HTTP_POST_VARS['u']; $S_pass=$HTTP_POST_VARS['p']; //echo $S_pass; session_register('S_userk'); session_register('S_passk'); include 'http://1.1.1.1/membership/login.php?g=0'; ? login.php: define(HOST,localhost); define(USER,root); define(PASS, ); define(DB,mem); /// session_start(); if ($HTTP_GET_VARS['g']==1) { $username=$S_username; $password=$S_password; //print $username; } else if ($HTTP_GET_VARS['g']==0) { $password=$S_passk; $username=$S_userk; } $S_username=$username; $S_password=$password; if(empty($S_username) empty($S_password) ) { mysql_connect(HOST,USER) or die(connect); mysql_select_db(DB) or die(db); $result=mysql_query(SELECT count(*) as numfound FROM usernames where user='$username' and pass='$password') or die(jjjgar); $result_ar=mysql_fetch_array($result); if($result_ar['numfound'] 1 ) { //echo ffdsfsfsdvfdsfdssc; //curl_exec(curl_init('http://1.1.1.1/membership/index.html')); header('Location: index.html'); exit; } session_register('S_username'); session_register('S_password'); echo Logged in successfully!; But when i loggin in my site,I recv following warnings: Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/html/membership/k.php:2) in /var/www/html/membership/k.php on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/html/membership/k.php:2) in /var/www/html/membership/k.php on line 3 Please explaine me on my warnings. Yours,Mohsen. = -DIGITAL SIGNATURE--- ///Mohsen Pahlevanzadeh Network administrator programmer My work phone is : +98216054096-7 My home phone is: +98213810146 My emails is [EMAIL PROTECTED] My website is: http://webnegar.net __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] schemaValidate()
Hi, I'm trying to design a new validation method for an xml parsing package that will be ported to PHP5. I've gotten schemaValidate() to work successfully, but the error messages are nearly useless. If an extra element is found inside another, I get a message like: Element channel content check failed when the channel element has incorrect content. No information on what the exact failure was seems to be accessible. Is this the state of affairs with libxml2 (I'm using PHP 5.0.1 on windows)? Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sessions session_start() my problem
that was a bit confusing, but it looks like you call session_start() more than once in a script. You only need to call it once, and you need to call it before any headers get sent, at the top of the script is a good place. If you're scripts are already setup like that just ignore me. Oh, also, if you include a file that has session_start() in it you'll get that warning too. -- -- Jasper Howard :: Database Administration Velocity7 1.530.470.9292 http://www.Velocity7.com/ -- Pahlevanzadeh Mohsen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dears,I have 3 files. k.php : ? session_start(); $S_userk=$HTTP_POST_VARS['u']; $S_pass=$HTTP_POST_VARS['p']; //echo $S_pass; session_register('S_userk'); session_register('S_passk'); include 'http://1.1.1.1/membership/login.php?g=0'; ? login.php: define(HOST,localhost); define(USER,root); define(PASS, ); define(DB,mem); /// session_start(); if ($HTTP_GET_VARS['g']==1) { $username=$S_username; $password=$S_password; //print $username; } else if ($HTTP_GET_VARS['g']==0) { $password=$S_passk; $username=$S_userk; } $S_username=$username; $S_password=$password; if(empty($S_username) empty($S_password) ) { mysql_connect(HOST,USER) or die(connect); mysql_select_db(DB) or die(db); $result=mysql_query(SELECT count(*) as numfound FROM usernames where user='$username' and pass='$password') or die(jjjgar); $result_ar=mysql_fetch_array($result); if($result_ar['numfound'] 1 ) { //echo ffdsfsfsdvfdsfdssc; //curl_exec(curl_init('http://1.1.1.1/membership/index.html')); header('Location: index.html'); exit; } session_register('S_username'); session_register('S_password'); echo Logged in successfully!; But when i loggin in my site,I recv following warnings: Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/html/membership/k.php:2) in /var/www/html/membership/k.php on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/html/membership/k.php:2) in /var/www/html/membership/k.php on line 3 Please explaine me on my warnings. Yours,Mohsen. = -DIGITAL SIGNATURE--- ///Mohsen Pahlevanzadeh Network administrator programmer My work phone is : +98216054096-7 My home phone is: +98213810146 My emails is [EMAIL PROTECTED] My website is: http://webnegar.net __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Sessions session_start() my problem
I have deleted session_start() at login.php Thus i have 1 session_start() But i receive them yet. Yours,Mohsen --- Jasper Howard [EMAIL PROTECTED] wrote: that was a bit confusing, but it looks like you call session_start() more than once in a script. You only need to call it once, and you need to call it before any headers get sent, at the top of the script is a good place. If you're scripts are already setup like that just ignore me. Oh, also, if you include a file that has session_start() in it you'll get that warning too. -- -- Jasper Howard :: Database Administration Velocity7 1.530.470.9292 http://www.Velocity7.com/ -- Pahlevanzadeh Mohsen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dears,I have 3 files. k.php : ? session_start(); $S_userk=$HTTP_POST_VARS['u']; $S_pass=$HTTP_POST_VARS['p']; //echo $S_pass; session_register('S_userk'); session_register('S_passk'); include 'http://1.1.1.1/membership/login.php?g=0'; ? login.php: define(HOST,localhost); define(USER,root); define(PASS, ); define(DB,mem); /// session_start(); if ($HTTP_GET_VARS['g']==1) { $username=$S_username; $password=$S_password; //print $username; } else if ($HTTP_GET_VARS['g']==0) { $password=$S_passk; $username=$S_userk; } $S_username=$username; $S_password=$password; if(empty($S_username) empty($S_password) ) { mysql_connect(HOST,USER) or die(connect); mysql_select_db(DB) or die(db); $result=mysql_query(SELECT count(*) as numfound FROM usernames where user='$username' and pass='$password') or die(jjjgar); $result_ar=mysql_fetch_array($result); if($result_ar['numfound'] 1 ) { //echo ffdsfsfsdvfdsfdssc; //curl_exec(curl_init('http://1.1.1.1/membership/index.html')); header('Location: index.html'); exit; } session_register('S_username'); session_register('S_password'); echo Logged in successfully!; But when i loggin in my site,I recv following warnings: Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/html/membership/k.php:2) in /var/www/html/membership/k.php on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/html/membership/k.php:2) in /var/www/html/membership/k.php on line 3 Please explaine me on my warnings. Yours,Mohsen. = -DIGITAL SIGNATURE--- ///Mohsen Pahlevanzadeh Network administrator programmer My work phone is : +98216054096-7 My home phone is: +98213810146 My emails is [EMAIL PROTECTED] My website is: http://webnegar.net __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = -DIGITAL SIGNATURE--- ///Mohsen Pahlevanzadeh Network administrator programmer My home phone is: +98213810146 My email address is m_pahlevanzadeh at yahoo dot com My website is: http://webnegar.net __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Browser back button
Hello, I am sure this has been asked more then a few times but ... I have a web site where almost every page is dynamically created. So if at some point in the site if you hit your browsers back button a popup window occurs and asks if you want to resubmit the data. Upon clicking yes the page is properly displayed. That is a pain in the a$$ and I get many user complaints -- so far I have thought about saving the requested URL and query string in a session variable and loading a back button on every page. This seems to work create if the previous page can be loaded using a GET request but if the previous page was loaded using a HTTP POST it seems I an up the creek with out a paddle :( Any one have any ideas ... Thanks .. -- Michael Gale Network Administrator Utilitran Corporation -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Sessions session_start() my problem
is this php script at the top of the page, there is nothing before it? -- -- Jasper Howard :: Database Administration Velocity7 1.530.470.9292 http://www.Velocity7.com/ -- Pahlevanzadeh Mohsen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have deleted session_start() at login.php Thus i have 1 session_start() But i receive them yet. Yours,Mohsen --- Jasper Howard [EMAIL PROTECTED] wrote: that was a bit confusing, but it looks like you call session_start() more than once in a script. You only need to call it once, and you need to call it before any headers get sent, at the top of the script is a good place. If you're scripts are already setup like that just ignore me. Oh, also, if you include a file that has session_start() in it you'll get that warning too. -- -- Jasper Howard :: Database Administration Velocity7 1.530.470.9292 http://www.Velocity7.com/ -- Pahlevanzadeh Mohsen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dears,I have 3 files. k.php : ? session_start(); $S_userk=$HTTP_POST_VARS['u']; $S_pass=$HTTP_POST_VARS['p']; //echo $S_pass; session_register('S_userk'); session_register('S_passk'); include 'http://1.1.1.1/membership/login.php?g=0'; ? login.php: define(HOST,localhost); define(USER,root); define(PASS, ); define(DB,mem); /// session_start(); if ($HTTP_GET_VARS['g']==1) { $username=$S_username; $password=$S_password; //print $username; } else if ($HTTP_GET_VARS['g']==0) { $password=$S_passk; $username=$S_userk; } $S_username=$username; $S_password=$password; if(empty($S_username) empty($S_password) ) { mysql_connect(HOST,USER) or die(connect); mysql_select_db(DB) or die(db); $result=mysql_query(SELECT count(*) as numfound FROM usernames where user='$username' and pass='$password') or die(jjjgar); $result_ar=mysql_fetch_array($result); if($result_ar['numfound'] 1 ) { //echo ffdsfsfsdvfdsfdssc; //curl_exec(curl_init('http://1.1.1.1/membership/index.html')); header('Location: index.html'); exit; } session_register('S_username'); session_register('S_password'); echo Logged in successfully!; But when i loggin in my site,I recv following warnings: Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/html/membership/k.php:2) in /var/www/html/membership/k.php on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/html/membership/k.php:2) in /var/www/html/membership/k.php on line 3 Please explaine me on my warnings. Yours,Mohsen. = -DIGITAL SIGNATURE--- ///Mohsen Pahlevanzadeh Network administrator programmer My work phone is : +98216054096-7 My home phone is: +98213810146 My emails is [EMAIL PROTECTED] My website is: http://webnegar.net __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = -DIGITAL SIGNATURE--- ///Mohsen Pahlevanzadeh Network administrator programmer My home phone is: +98213810146 My email address is m_pahlevanzadeh at yahoo dot com My website is: http://webnegar.net __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Browser back button
On Fri, 2004-08-27 at 16:20, Michael Gale wrote: Hello, I am sure this has been asked more then a few times but ... So why not search the archives then? :) I have a web site where almost every page is dynamically created. So if at some point in the site if you hit your browsers back button a popup window occurs and asks if you want to resubmit the data. Upon clicking yes the page is properly displayed. That is a pain in the a$$ and I get many user complaints -- so far I have thought about saving the requested URL and query string in a session variable and loading a back button on every page. This seems to work create if the previous page can be loaded using a GET request but if the previous page was loaded using a HTTP POST it seems I an up the creek with out a paddle :( Any one have any ideas ... Some options I've used previously, some kinda yucky I admit. 1) Use the GET method. You can send data this way as long as the url isn't very long. Don't forget to urlencode() if required. 2) Add a 0 second meta refresh on the POST'd-to page. If the user hits back they will go to your intermittent page just after the form, not the form page itself. 3) Use a header() call to send the user to a totally new page after the POST. -- Greg Donald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Browser back button
Hello, I am sure this has been asked more then a few times but ... I have a web site where almost every page is dynamically created. So if at some point in the site if you hit your browsers back button a popup window occurs and asks if you want to resubmit the data. Upon clicking yes the page is properly displayed. That is a pain in the a$$ and I get many user complaints -- so far I have thought about saving the requested URL and query string in a session variable and loading a back button on every page. This seems to work create if the previous page can be loaded using a GET request but if the previous page was loaded using a HTTP POST it seems I an up the creek with out a paddle :( Any one have any ideas ... Thanks .. -- Michael Gale What I usually do is when requesting a new page, I check to see if there are any $_POST data using the isset() function. If so, I assign all $_POST data to $_SESSION vars at the top of the page. Once that's done, I do a header redirect to the same page. That'll clear out all $_POST data and you'll still have your vars sitting in $_SESSION. Web page is index.php: ?php sesson_start; if (isset($_POST[var])) { $_SESSION[var] = $_POST[var]; header(Location: index.php); } ? ...webpage stuff here... -- --Matthew Sims --http://killermookie.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dynamic Function with return?
Sample Code: // ?PHP // version 4.3.6 function testFunction($foo) { return $foo==TEST; } function wrapper($foofunc, $foovar) { return eval(return $foofunc($foovar);); } echo wrapper(testFunction, TEST); ? // This code works. It calls the function and receives the appropriate return value. But, is there a better way of doing this? It seems a bit round-a-bout. Thanks!
Re: [PHP] changed number_format function
On Fri, 27 Aug 2004 18:48:16 +0200, Marek Kilimajer [EMAIL PROTECTED] wrote: Justin Patrin wrote: number_format($number, 2); Does not work. Desired results: 1000 should return 1,000 1000.5 should return 1,000.5 1000.25 should return 1,000.25 so on. Actual results: 1000= 1,000.00 1000.5 = 1,000.50 1000.25 = 1,000.25 OIC. Yep, I don't think you can do that with number_format. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Browser back button
I struggled with this one as well and the solution is quite simple; 1. Every PHP module that is reached via the action field in a form where the method is POST (most of mine are) never outputs any html except a http redirect (it will edit values, update the database, save session data, then does a redirect). header(Location:.); 2. Every PHP module that is reached via a hotlink or redirect (above) is free to output html to the browser, acting on or displaying data from the database, using session data, or data coded in the URL parameter list; Mymodule.php?parm1=parm2=parm3= $a = $_GET[parm1];// like this $b = $_GET[parm2]; $c = $_GET[parm3]; With these two types of modules, you can build your entire application. I believe the cause of this problem is that most browsers don't save POST data in the history stack, when you click the back button and the browser detects that the previous page was entered via a POST is knows it doesn't have enough saved information to reconstruct the page (passed data is missing, and complains). I also believe the browser replaces an entry in the history stack (i.e. your form POST) when it receives a redirect url, effectively removing all url's that had been entered with a POST from the history stack and replacing them with GET requests. Good luck, Warren Vail -Original Message- From: Michael Gale [mailto:[EMAIL PROTECTED] Sent: Friday, August 27, 2004 2:21 PM To: [EMAIL PROTECTED] Subject: [PHP] Browser back button Hello, I am sure this has been asked more then a few times but ... I have a web site where almost every page is dynamically created. So if at some point in the site if you hit your browsers back button a popup window occurs and asks if you want to resubmit the data. Upon clicking yes the page is properly displayed. That is a pain in the a$$ and I get many user complaints -- so far I have thought about saving the requested URL and query string in a session variable and loading a back button on every page. This seems to work create if the previous page can be loaded using a GET request but if the previous page was loaded using a HTTP POST it seems I an up the creek with out a paddle :( Any one have any ideas ... Thanks .. -- Michael Gale Network Administrator Utilitran Corporation -- 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] Dynamic Function with return?
1 way is here.You can use object OOP. --- bskolb [EMAIL PROTECTED] wrote: Sample Code: // ?PHP // version 4.3.6 function testFunction($foo) { return $foo==TEST; } function wrapper($foofunc, $foovar) { return eval(return $foofunc($foovar);); } echo wrapper(testFunction, TEST); ? // This code works. It calls the function and receives the appropriate return value. But, is there a better way of doing this? It seems a bit round-a-bout. Thanks! = -DIGITAL SIGNATURE--- ///Mohsen Pahlevanzadeh Network administrator programmer My home phone is: +98213810146 My email address is m_pahlevanzadeh at yahoo dot com My website is: http://webnegar.net __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SOLVED RE: [PHP] Dynamic Function with return?
Thanks for the quick reply, I wasn't aware that passing a variable for the object would work. New code: class testClass { function testFunction($foo) { return $foo==TEST; } } $testObj = new testClass; $testFunc = testFunction; echo $testObj-$testFunc(TEST); -Original Message- From: Pahlevanzadeh Mohsen [mailto:[EMAIL PROTECTED] Sent: Friday, August 27, 2004 7:24 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Dynamic Function with return? 1 way is here.You can use object OOP. --- bskolb [EMAIL PROTECTED] wrote: Sample Code: // ?PHP // version 4.3.6 function testFunction($foo) { return $foo==TEST; } function wrapper($foofunc, $foovar) { return eval(return $foofunc($foovar);); } echo wrapper(testFunction, TEST); ? // This code works. It calls the function and receives the appropriate return value. But, is there a better way of doing this? It seems a bit round-a-bout. Thanks! = -DIGITAL SIGNATURE--- ///Mohsen Pahlevanzadeh Network administrator programmer My home phone is: +98213810146 My email address is m_pahlevanzadeh at yahoo dot com My website is: http://webnegar.net __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail -- 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] Dynamic Function with return?
-Original Message- From: bskolb [mailto:[EMAIL PROTECTED] Sent: Friday, August 27, 2004 3:59 PM To: [EMAIL PROTECTED] Subject: [PHP] Dynamic Function with return? Sample Code: // ?PHP // version 4.3.6 function testFunction($foo) { return $foo==TEST; } function wrapper($foofunc, $foovar) { return eval(return $foofunc($foovar);); } echo wrapper(testFunction, TEST); ? // This code works. It calls the function and receives the appropriate return value. But, is there a better way of doing this? It seems a bit round-a-bout. Did you already try this? function wrapper($foofunc, $foovar){ return $foofunc($foovar); } http://us3.php.net/manual/en/functions.variable-functions.php Maybe I'm missing something, but I don't see the need for the eval since PHP supports variable function names. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] an error before register a session
Dears,When i run rm -rf /tmp/sess_* ,It are meaning that i clean every session. When i want to my program,I receive following warning : Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 But,When i regist at least 1 session,I don't recv it. Please guide me Yours,Moshen = -DIGITAL SIGNATURE--- ///Mohsen Pahlevanzadeh Network administrator programmer My home phone is: +98213810146 My email address is m_pahlevanzadeh at yahoo dot com My website is: http://webnegar.net ___ Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now. http://promotions.yahoo.com/goldrush -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Need Help for Session
Afzal Hussain ) wrote: Sir, I am afzal hussain from bangladesh. Acually i am getting some problem using session in php. This is the sample code that i have written, session_start(); //$vbl=This variable is registered; //session_register('vbl'); $_SESSION['vb1'] = This variable is registered; //echo $vbl; echo $_SESSION['vb1']; ? it shows this output. Warning: Cannot send session cookie - headers already sent by (output started at c:/program files/abria merlin/apache/htdocs/session.php:3) in c:/program files/abria merlin/apache/htdocs/session.php on line 4 Warning: Cannot send session cache limiter - headers already sent (output started at c:/program files/abria merlin/apache/htdocs/session.php:3) in c:/program files/abria merlin/apache/htdocs/session.php on line 4 Warning: open(/tmp\sess_178d4e9e23a4d7b1f061f93e7f172496, O_RDWR) failed: m (2) in c:/program files/abria merlin/apache/htdocs/session.php on line 4 This variable is registered Finding no other way i am sending this email to u. Could u pls tell me what s\could be the problem. and How i can i solve that problem. thanks you very much. afzal Hussian - Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Need Help for Session
1.You must call session_start before making a HTML for client. 2.Please use if (!session_is_registered('vb1')) session_register('vb1'); --- S. Kang [EMAIL PROTECTED] wrote: Afzal Hussain ) wrote: Sir, I am afzal hussain from bangladesh. Acually i am getting some problem using session in php. This is the sample code that i have written, session_start(); //$vbl=This variable is registered; //session_register('vbl'); $_SESSION['vb1'] = This variable is registered; //echo $vbl; echo $_SESSION['vb1']; ? it shows this output. Warning: Cannot send session cookie - headers already sent by (output started at c:/program files/abria merlin/apache/htdocs/session.php:3) in c:/program files/abria merlin/apache/htdocs/session.php on line 4 Warning: Cannot send session cache limiter - headers already sent (output started at c:/program files/abria merlin/apache/htdocs/session.php:3) in c:/program files/abria merlin/apache/htdocs/session.php on line 4 Warning: open(/tmp\sess_178d4e9e23a4d7b1f061f93e7f172496, O_RDWR) failed: m (2) in c:/program files/abria merlin/apache/htdocs/session.php on line 4 This variable is registered Finding no other way i am sending this email to u. Could u pls tell me what s\could be the problem. and How i can i solve that problem. thanks you very much. afzal Hussian - Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = -DIGITAL SIGNATURE--- ///Mohsen Pahlevanzadeh Network administrator programmer My home phone is: +98213810146 My email address is m_pahlevanzadeh at yahoo dot com My website is: http://webnegar.net __ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP/MySQL fatal error
Hi all, I'm Gene Candelaria and I'm a PHP and MySQL newbie. I have a feeling a lot of you have seen this before. I'm teaching myself PHP/MySQL trying to setup a guestbook. I'm running latest versions of Apache, PHP and MySql on my WIN2k machine. I have them working, except, I get the messages: Fatal error: Call to undefined function mysql_connect() Fatal error: Call to undefined function mysql_pconnect() when serving two of my php docs (code snippets below). I've been reading and searching and trying all sorts of things to fix this and nothing works. I've removed the comment from the line extension=php_mysql.dll in php.ini. (Below is the MySQL section of php.ini. It's pretty standard, I'm using defaults.) I edited my Apache config file with the needed lines: ### Section 4: PHP 5 Module # ScriptAlias /cgi-bin/ C:/Program Files/Apache Group/Apache2/cgi-bin/ LoadModule php5_module php/php5apache2.dll AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps PHPIniDir C:/Program Files/Apache Group/Apache2/PHP When I run my test.php doc, MySQL is not listed. Do I need to enable it in the configure command? How do I edit the configure command. Per my test.php, It now reads: Configure Command cscript /nologo configure.js --with-gd=shared --enable-snapshot-build Online I read these comments: Ok, your php.ini file is set to 'on' for mysql.allow_persistent, but is mysql really enabled? Does your configure command look something like this? './configure' '--with-mysql=/usr/local/mysql' If you don't have --with-mysql it means that you cannot use mysql functions, so compile PHP again with this option. How do I edit that pesky configure command. I searched, but couldn't find an answer. So, where am I going wrong? Thanks for reading and big thanks for any help. gene [EMAIL PROTECTED] php.ini snippet (comments removed for easier reading: [MySQL] mysql.allow_persistent = On mysql.max_persistent = -1 mysql.max_links = -1 mysql.default_port = mysql.default_socket = mysql.default_host = mysql.default_user = mysql.default_password = mysql.connect_timeout = 60 mysql.trace_mode = Off guest.php code snippet: //connect // change localhost to your db host name mysql_pconnect( http://aulon.dyndns.org/;, $username, $password) or die( Unable to connect to SQL server); mysql_select_db( $db_name) or die( Unable to select database); guestbook.php code snippet: // Connect to DB $li = mysql_connect($dbHost, $dbUser, $dbPass) or die(Could not connect); mysql_select_db($dbDatabase, $li) or die (could not select DB); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] attach an ICO file to a text file...then downloading to the user
is it possible to add a custom icon to a text file on the server side..and then download the completed file to the user's desktop would you put some type of AddType into the htacccess folder to do this ? like AddType image/x-icon .ico can php do something like this ? many thanks g
Re: [PHP] PHP Oficial Certification OT
* Thus wrote John Nichel: John Holmes wrote: From: Jay Blanchard [EMAIL PROTECTED] Probably Holmes. Not officially. Might look into it, though, but this is really just a hobby for me. :) I think that if you've been on the list for over a year, you should be certified automatically. heh... ---John Holmes... WooHooI found posts from me dating back to 2002 on this list. Funny though, I know I've been posting here since '99 or '00. Might have been under a different email address. Ah, well. did you look in the php.version4 list? it was the interum list for the transition between php3 and php4 dated from May 1999 to Jun 2000, this list was started in Jan of 2000. http://zirzow.dyndns.org/html/mlists/ ps. the layout is totally under construction ;) Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php