[PHP] Checking Client's Cipher Strength with IIS
Hello, I have a question who's answer has been bugging me for a while. What I need to do is write a script that detects if a browser is using 128-bit encryption when connecting to our website. While this is easy for most (I have the script working for them), a real problem for me has come up with clients that run IE on Windows 2K without 128-bit support (ie 40-bit or 56 instead). Do any of you fine ladies and gentlemen know how to detect a browser's cipher strength using PHP (or any other web language)? I am running PHP 4.3.1 on IIS 5.0 on a Windows 2000 server. I have tried using some server vars (namely HTTPS_KEYSIZE) but that reports incorrect data with the win2k/IE/56-bit configuration I mentioned above. Any help is appreciated and thanks in advance, Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php session not persisting
Do you have cookies enabled on your browser? If not then you will need to make sure that you compile or change your php.ini to reflect that (ie with trans-sid). ed -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 03, 2003 3:42 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] php session not persisting On Tuesday 03 June 2003 12:28, Eric D. wrote: > I have two very simple php scripts and the second srcipt is not seeing the > variables session_registered by the first script. > I'm running the latest version of php. And have both "register_globals" and > "track_vars" set to "ON". It's best to state the specific version of PHP you're using rather than just 'latest' (as it could mean different things to different people at different times). > Well, the first script prints out the session var fine, but not the second > one. What is wrong? Is there something else I overlooked? Thanks for your > help! If you're using PHP > 4.1.0 then you ought to be using $_SESSION for all your session needs -- see manual for examples. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I have a map of the United States. It's actual size. I spent last summer folding it. People ask me where I live, and I say, "E6". -- Steven Wright */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] problems?
Couple of clarifications Dale: Is this an internal intranet server? Can it be? Do you have admin rights to the server? What's OS and Server are you running? ~Ed -Original Message- From: Dale [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 03, 2003 1:21 PM To: [EMAIL PROTECTED] Subject: [PHP] problems? I have the following scenario: I have this timeclock program that my employees access by logging into and the program pretty much allows them to clock-in and clock-out. The problem is that I noticed some of the employees were clocking-in and clocking-out from their home. The main problem is that the machine at work that the employees use to access this program does not have a static ip address. Is there any way to access the mac address in php. Any ideas? thanks, Dale -- 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] Registered sessions.
You need to append the session name and id to the header location everytime you redirect that way. So your header redirect should read: header('Location: researchpapers2.php?'.session_name().'='.session_id()); When you have normal links to other pages you don't have to do this but on header redirects like the one above you do. Hope this helps, ed -Original Message- From: Angelo Zanetti [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 5:44 AM To: [EMAIL PROTECTED] Subject: [PHP] Registered sessions. Hi, I have a php page that validates if a username and password are valid. if they are the php page registers and assignes a session variable a value. Then straight after that it automatically calls then next php page using the header("Location: researchpapers2.php"); command. My question is: does the session variable still get passed to the researchpapers2.php page, with the header command? because it doesnt seem to receive a session variable. any advice as to where i am going wrong??? thanx Angelo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions and headers
Well you are partly right Chris. But the client automatically sends the cookie with the HTTP request. IE your request for a cookie doesn't send a separate request header to the client. You might want to check to see if you are accidentally outputting something else after you call session_start() (or before). I did something similar to what you are describing. I have the user log on, the php creates a file and prompts them to download. On the download page I check the session before I output anything and it works fine for me. Can you paste a bit of the non-functioning source code so that we can see the problem more clearly? ed -Original Message- From: Chris Boget [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 9:52 AM To: PHP General Subject: [PHP] Sessions and headers When using PHP sessions, if the user's browser supports cookies, PHP sets the session id as a cookie (so far as I understand it). So when trying to use the session ID in a script, a cookie request is sent to the browser to get the ID and assigns it to the internal variable $PHPSESSID (again, so far as I understand it). My problem is this and I'm hoping someone has come up with a workaround... When I try to use the Header() function call (which I do alot to set the content type such as PDF, doc, xl, etc), I'm getting errors opening up the file due to previous headers already having been sent - namely, the header call to get the cookie value. This problem prevents me from using sessions in scripts I write to output and open up Word, Acrobat, Excel, etc. and I am finding that to be an increasing problem as it requires that I come up with a different way to access the session data and open the script up to vulnerabilities. I've tried using ob_start() and ob_end_clean() before and after the session calls hoping that it might somehow solve my problem but it doesn't. Has anyone else come up against this problem? Have you found a workaround other than come up with a different way to do the same thing as code you already have and use to access session data? thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions and headers
Are you downloading these files over HTTPS://? Ed -Original Message- From: Chris Boget [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 10:24 AM To: CPT John W. Holmes; PHP General Subject: Re: [PHP] Sessions and headers > What errors, exactly? Can you show some examples? The errors are not PHP. They are from the browser trying to open the data being sent from the server (the HTML or binary data) in the appropriate program. eg, Acrobat for PDF, Word for DOC, Excel for XL. For this particular case, I'm using the following header call: header( "Content-Type: application/pdf" ); and I'm following it up with PDF binary data. As everyone well knows, this will cause Acrobat to start up and the data displayed therein. Well, if any headers are sent to the browser prior to the above header() call, the app fails to load up and your browser gives you an error. In this case, the error I am getting is as follows: "Internet explorer cannot download YOURFILENAME Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later." The offending function call that causes all this grief is "session_start()". When I comment out the call to session_start(), the PDF opens up just fine. When I leave the function call in, I get the above error. (And a quick note, I have trans-sid enabled) Since you need session_start() to start or resume a session and since that function call messes with any subsequent header() calls, I've not been able to use sessions in scripts that output data to Word, Acrobat, Excel, etc. and I need to do something about that. > I had problems like this with IE over SSL that was solved by changing the > session.cache_limiter. Does it work for other browsers at all or is it a PHP > error you're getting? It's a browser error I'm getting. And I get this problem on all browsers. thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions and headers
Try including "session_cache_limiter('public');" before your session_start(); call at the top of the page. ed -Original Message- From: Chris Boget [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 10:40 AM To: Ed Gorski; 'CPT John W. Holmes'; 'PHP General' Subject: Re: [PHP] Sessions and headers > Are you downloading these files over HTTPS://? Yes. But I just tried to force HTTP:// and that didn't change anything. thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I remove the last character from a one line file?
Try: $string="Jacko"; $string=substr($string,0,(strlen($string)-1)); echo $string; ed At 09:35 AM 5/28/2002 -0400, [EMAIL PROTECTED] wrote: >Hi all, > > How can I remove the last character from a one line file? > i.e. I need to change Jacko to Jack > > >I would really appreciate a response on this! > >Thank you! >Dave > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php Edmund Gorski Programmer / Analyst WWW Coordinator Dept. @ District Office 727-341-3181 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Efficient PHP
Anyone know any good links on papers/articles/reports on creating efficient PHP scripts (ie functions to stay away from, good practices, etc). As a C programmer, I am a nut on efficiency and speed and I have been trying to read up on efficient PHP coding practices (besides obvious general coding practices). So can anyone offer any links or experiences? ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Efficient PHP
Yeah I've heard that they've made improvements in the oo code but I usually stay away from them on principle. Thanks for the reply, Ed At 02:54 PM 5/28/2002 +0100, Richard Black wrote: >One thing that springs to mind was something Sterling Hughes said at the PHP >Conference in Frankfurt last year: If speed is an issue don't use objects, >cos at the moment the oo implementation isn't particularly efficient, >although it was something that would be addressed soon. > >Actually, for all I know this may have been addressed already... > >Richy >== >Richard Black >Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com >Tel: 0141 435 3504 >Email: [EMAIL PROTECTED] > >-Original Message- >From: Ed Gorski [mailto:[EMAIL PROTECTED]] >Sent: 28 May 2002 14:46 >To: [EMAIL PROTECTED] >Subject: [PHP] Efficient PHP > > >Anyone know any good links on papers/articles/reports on creating efficient >PHP scripts (ie functions to stay away from, good practices, etc). As a C >programmer, I am a nut on efficiency and speed and I have been trying to >read up on efficient PHP coding practices (besides obvious general coding >practices). So can anyone offer any links or experiences? > >ed > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Previous Discussions
You want to try to stay away from storing anything so large in a DB like a file or an image (if the option exists). I am not aware of the previous discussion but if you send me a few details maybe I can offer an opinion.. ed At 07:54 AM 5/28/2002 -0600, Dan Vande More wrote: >Is anyone aware of previous discussions with php/mysql with using file >inside the db (BLOBs) and integrating php to serve these files? In my >opinion, I'm sure there's a better way than store to a temp file and send >user the hyperlink, then deleting the temp file. Perhaps something with >output buffering, etc. > >I'm sure this topic has come up before, but I have been unable to find any >relevant information. > >Thank you for your help > >Dan VandeMore > > >-- >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] Efficient PHP
Well I work for a college with some 49,000+ students so my primary concern with all those users is efficient memory and processor usage. You'd be surprised how easily a few ten's of thousands of users can bring an application server to it's knees if you have a bottleneck or two that you can avoid.. ed At 12:32 PM 5/28/2002 -0400, Scott Hurring wrote: > > -Original Message- > > From: Ed Gorski [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, May 28, 2002 9:46 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP] Efficient PHP > > > > > > Anyone know any good links on papers/articles/reports on > > creating efficient > > PHP scripts (ie functions to stay away from, good practices, > > etc). As a C > > programmer, I am a nut on efficiency and speed and I have > > been trying to > > read up on efficient PHP coding practices (besides obvious > > general coding > > practices). So can anyone offer any links or experiences? > > > > ed > >Depends what kind of efficiency you are looking for, and >the type of application you're writing. > >Personally, i've always taken the view that my time is >worth a lot more than the CPU's time (unless i'm writing >a speed-critical app, which is not very often :), so i >code for human efficiency and ease of maintenence, even >if the code is a little bit slower than heavily optimized >code. > >--- >Scott Hurring >Systems Programmer >EAC Corporation >[EMAIL PROTECTED] >Voice: 201-462-2149 >Fax: 201-288-1515 > >-- >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] Efficient PHP
Yeah I saw thatbut it did make some good pointsthanks SP. ed At 02:27 PM 5/28/2002 -0500, Miguel Cruz wrote: >But I wouldn't bet my children on advice found there. I just glanced at it >quickly but it was riddled with errors large and small. > >miguel > >On Tue, 28 May 2002, SP wrote: > > Here's an article you might want to read > > http://phplens.com/lens/php-book/optimizing-debugging-php.php > > > > > > -Original Message- > > From: Ed Gorski [mailto:[EMAIL PROTECTED]] > > Sent: May 28, 2002 9:46 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP] Efficient PHP > > > > > > Anyone know any good links on > > papers/articles/reports on creating efficient > > PHP scripts (ie functions to stay away from, good > > practices, etc). As a C > > programmer, I am a nut on efficiency and speed and > > I have been trying to > > read up on efficient PHP coding practices (besides > > obvious general coding > > practices). So can anyone offer any links or > > experiences? > > > > ed > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: > > http://www.php.net/unsub.php > > > > > > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] comment followed by ?> fails to parse
No the parser sees the ?> after a // because it needs to see when to quit out (unlike traditional, compiled languages) but it won't have this same effect in a string literal. ed At 04:40 PM 5/28/2002 -0400, Leotta, Natalie (NCI/IMS) wrote: >But why wouldn't the parser skip right over a // line? it shouldn't even >see anything in it. > >-Original Message- >From: Jonathan Rosenberg [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, May 28, 2002 4:46 PM >To: Johnson, Kirk; [EMAIL PROTECTED] >Subject: RE: [PHP] comment followed by ?> fails to parse > > >BTW: if my last message was correct, this means that an occurrence of ?> >embedded in a string literal will also cause problems. > > > -Original Message- > > From: Johnson, Kirk [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, May 28, 2002 4:08 PM > > To: [EMAIL PROTECTED] > > Subject: RE: [PHP] comment followed by ?> fails to parse > > > > > > I have wondered for some time if this is a bug or just > > an interesting design > > choice ;) I agree with you, I was surprised when I > > first encountered this. > > But it is what it is, so code accordingly. > > > > Kirk > > > > > -Original Message- > > > From: Thalis A. Kalfigopoulos [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, May 28, 2002 1:21 PM > > > To: [EMAIL PROTECTED] > > > Subject: [PHP] comment followed by ?> fails to parse > > > > > > > > > If I write a comment line with // and I include in > > it ?> then > > > it fails to parse the rest of the page because (i'm > > guessing) > > > the parser gets confused and goes off PHP mode. > > > Is this normal? Shouldn't I be able to write literally ANYTHING on a > > > comment line? > > > > > > Sample Code: > > > > > > > > //bla bla ?> > > > $var=1; > > > ?> > > > > > > Output: > > > > > > $var=1; ?> > > > > > > > > > cheers, > > > thalis > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] comment followed by ?> fails to parse
No, if you use /* ? */ as a comment the parser will skip right over it.if you want to use sample code in your script just use: /* */ that'll work fine ed At 02:48 PM 5/28/2002 -0600, Kevin Stone wrote: >I've run into this before as well. Pain in the ass when you want to put >example code in your header. It's gotta be a deisgn flaw. > >// literal.. legal >$tmp = '?>'; > >// reg ex.. legal >ereg('?>', $tmp); > >// Comment.. illegal. Why? Makes no sense. >/*?>*/ > >-Kevin > > >- Original Message - >From: "Jonathan Rosenberg" <[EMAIL PROTECTED]> >To: "Johnson, Kirk" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> >Sent: Tuesday, May 28, 2002 2:46 PM >Subject: RE: [PHP] comment followed by ?> fails to parse > > > > BTW: if my last message was correct, this means that an > > occurrence of ?> embedded in a string literal will also cause > > problems. > > > > > -Original Message- > > > From: Johnson, Kirk [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, May 28, 2002 4:08 PM > > > To: [EMAIL PROTECTED] > > > Subject: RE: [PHP] comment followed by ?> fails to parse > > > > > > > > > I have wondered for some time if this is a bug or just > > > an interesting design > > > choice ;) I agree with you, I was surprised when I > > > first encountered this. > > > But it is what it is, so code accordingly. > > > > > > Kirk > > > > > > > -Original Message- > > > > From: Thalis A. Kalfigopoulos [mailto:[EMAIL PROTECTED]] > > > > Sent: Tuesday, May 28, 2002 1:21 PM > > > > To: [EMAIL PROTECTED] > > > > Subject: [PHP] comment followed by ?> fails to parse > > > > > > > > > > > > If I write a comment line with // and I include in > > > it ?> then > > > > it fails to parse the rest of the page because (i'm > > > guessing) > > > > the parser gets confused and goes off PHP mode. > > > > Is this normal? Shouldn't I be able to write literally > > > > ANYTHING on a comment line? > > > > > > > > Sample Code: > > > > > > > > > > > //bla bla ?> > > > > $var=1; > > > > ?> > > > > > > > > Output: > > > > > > > > $var=1; ?> > > > > > > > > > > > > cheers, > > > > thalis > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] comment followed by ?> fails to parse
What version of php are you using? I just pasted that code in test script and it came out fine with 4.2.1.maybe it wasn't the case in earlier versions... ed At 02:57 PM 5/28/2002 -0600, Kevin Stone wrote: >OH NO IT WON'T.It'll comment out the and give you a >parse error. > >/**/ > >echo "hello"; >?> > > >- Original Message - >From: "Ed Gorski" <[EMAIL PROTECTED]> >To: "Kevin Stone" <[EMAIL PROTECTED]>; "Jonathan Rosenberg" ><[EMAIL PROTECTED]>; "Johnson Kirk" <[EMAIL PROTECTED]>; ><[EMAIL PROTECTED]> >Sent: Tuesday, May 28, 2002 2:52 PM >Subject: Re: [PHP] comment followed by ?> fails to parse > > > > No, if you use /* ? */ as a comment the parser will skip right over > > it.if you want to use sample code in your script just use: > > > > /* > > > code here > > ?> > > */ > > > > that'll work fine > > > > ed > > > > At 02:48 PM 5/28/2002 -0600, Kevin Stone wrote: > > >I've run into this before as well. Pain in the ass when you want to put > > >example code in your header. It's gotta be a deisgn flaw. > > > > > >// literal.. legal > > >$tmp = '?>'; > > > > > >// reg ex.. legal > > >ereg('?>', $tmp); > > > > > >// Comment.. illegal. Why? Makes no sense. > > >/*?>*/ > > > > > >-Kevin > > > > > > > > >- Original Message - > > >From: "Jonathan Rosenberg" <[EMAIL PROTECTED]> > > >To: "Johnson, Kirk" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > > >Sent: Tuesday, May 28, 2002 2:46 PM > > >Subject: RE: [PHP] comment followed by ?> fails to parse > > > > > > > > > > BTW: if my last message was correct, this means that an > > > > occurrence of ?> embedded in a string literal will also cause > > > > problems. > > > > > > > > > -Original Message- > > > > > From: Johnson, Kirk [mailto:[EMAIL PROTECTED]] > > > > > Sent: Tuesday, May 28, 2002 4:08 PM > > > > > To: [EMAIL PROTECTED] > > > > > Subject: RE: [PHP] comment followed by ?> fails to parse > > > > > > > > > > > > > > > I have wondered for some time if this is a bug or just > > > > > an interesting design > > > > > choice ;) I agree with you, I was surprised when I > > > > > first encountered this. > > > > > But it is what it is, so code accordingly. > > > > > > > > > > Kirk > > > > > > > > > > > -Original Message- > > > > > > From: Thalis A. Kalfigopoulos [mailto:[EMAIL PROTECTED]] > > > > > > Sent: Tuesday, May 28, 2002 1:21 PM > > > > > > To: [EMAIL PROTECTED] > > > > > > Subject: [PHP] comment followed by ?> fails to parse > > > > > > > > > > > > > > > > > > If I write a comment line with // and I include in > > > > > it ?> then > > > > > > it fails to parse the rest of the page because (i'm > > > > > guessing) > > > > > > the parser gets confused and goes off PHP mode. > > > > > > Is this normal? Shouldn't I be able to write literally > > > > > > ANYTHING on a comment line? > > > > > > > > > > > > Sample Code: > > > > > > > > > > > > > > > > > //bla bla ?> > > > > > > $var=1; > > > > > > ?> > > > > > > > > > > > > Output: > > > > > > > > > > > > $var=1; ?> > > > > > > > > > > > > > > > > > > cheers, > > > > > > thalis > > > > > > > > > > -- > > > > > PHP General Mailing List (http://www.php.net/) > > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > > > > > >-- > > >PHP General Mailing List (http://www.php.net/) > > >To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > >-- >PHP 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] comment followed by ?> fails to parse
From my experience the PHP parser acts much like the HTML parser in the fact that it doesn't give a damn about carriage returns ed At 03:01 PM 5/28/2002 -0600, Kevin Stone wrote: >Exactly.. it doesn't seem to make any sense. Esspecially since it's such as >absolutely incredibly undeniably easy thing to check for. :) If the code >doesn't end with an uncommented ?> then just parse the code as text. That's >what it does anyway so why catch commented code at all? > >- Original Message - >From: "Johnson, Kirk" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Tuesday, May 28, 2002 2:55 PM >Subject: RE: [PHP] comment followed by ?> fails to parse > > > > Which begs the question, why does PHP see a '?>' in a '//' comment line, >but > > not in a multi-line comment, e.g., /* ?> */ ? > > > > > -Original Message- > > > From: Ed Gorski [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, May 28, 2002 2:46 PM > > > To: Leotta Natalie (NCI/IMS); 'Jonathan Rosenberg'; Johnson, Kirk; > > > [EMAIL PROTECTED] > > > Subject: RE: [PHP] comment followed by ?> fails to parse > > > > > > > > > No the parser sees the ?> after a // because it needs to see > > > when to quit > > > out (unlike traditional, compiled languages) but it won't > > > have this same > > > effect in a string literal. > > > > > > ed > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] comment followed by ?> fails to parse
Well it looks like they got half of it right by changing the /* */ issue ed At 03:06 PM 5/28/2002 -0600, Johnson, Kirk wrote: >Well, one thing I know for sure is that there are members of the PHP >develpment team that monitor this list. Maybe one of them will clear this up >for us ;) > >Kirk > > > -Original Message- > > From: Ed Gorski [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, May 28, 2002 3:04 PM > > To: Kevin Stone; [EMAIL PROTECTED] > > Subject: Re: [PHP] comment followed by ?> fails to parse > > > > > > From my experience the PHP parser acts much like the HTML > > parser in the > > fact that it doesn't give a damn about carriage returns > > > > ed > > > > At 03:01 PM 5/28/2002 -0600, Kevin Stone wrote: > > >Exactly.. it doesn't seem to make any sense. Esspecially > > since it's such as > > >absolutely incredibly undeniably easy thing to check for. > > :) If the code > > >doesn't end with an uncommented ?> then just parse the code > > as text. That's > > >what it does anyway so why catch commented code at all? > > > > > >- Original Message - > > >From: "Johnson, Kirk" <[EMAIL PROTECTED]> > > >To: <[EMAIL PROTECTED]> > > >Sent: Tuesday, May 28, 2002 2:55 PM > > >Subject: RE: [PHP] comment followed by ?> fails to parse > > > > > > > > > > Which begs the question, why does PHP see a '?>' in a > > '//' comment line, > > >but > > > > not in a multi-line comment, e.g., /* ?> */ ? > > > > > > > > > -Original Message- > > > > > From: Ed Gorski [mailto:[EMAIL PROTECTED]] > > > > > Sent: Tuesday, May 28, 2002 2:46 PM > > > > > To: Leotta Natalie (NCI/IMS); 'Jonathan Rosenberg'; > > Johnson, Kirk; > > > > > [EMAIL PROTECTED] > > > > > Subject: RE: [PHP] comment followed by ?> fails to parse > > > > > > > > > > > > > > > No the parser sees the ?> after a // because it needs to see > > > > > when to quit > > > > > out (unlike traditional, compiled languages) but it won't > > > > > have this same > > > > > effect in a string literal. > > > > > > > > > > ed > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > > > > > >-- > > >PHP General Mailing List (http://www.php.net/) > > >To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > >-- >PHP 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] Intermediate "Searching..." screen.
Well if you just wanted to do a simple redirect like the one you describe just use meta tags in the If you use the method that Scott details (I would try to avoid that one though), create an HTML "Searching..." page with this meta tag. In the "searchPage.php" file have a redirect to another page after the search is completethis technique is REALLY useful if you have a page call a script that takes a long time to execute but doesn't really return anything to the page (ie send a bunch of e-mails, calculate averages and store in a db, etc). ed At 10:10 AM 5/29/2002 +1000, Scott Reismanis wrote: >The way vbulliten does it, is they take a users search query, and find >out which threads match i.e. (2000, 5000, 2310, etc...). This is then >inserted into a database along with a search ID. From here once the >search is completed you are forwarded to a page like search.php? >search_id=7 that way urls are kept neat and everyone is happy. To >return the search resultset a query like "SELECT * FROM threads WHERE >thread_id IN $result_set" Unfortunatly there are extra overheads using >this method, however for my site I had to mimic such a search otherwise >my URLS got excessivly huge :) > >Anyhow that does not really answer the question as it does not explain >how to create the 'searching' screen however I know it definatly >involves a javascript redirect... I will explore that tonight and tell >you what I find. > > Regards, > > > Scott > >- Original Message - >From "SP" <[EMAIL PROTECTED]> >Date Tue, 28 May 2002 14:48:32 -0400 >To "Kevin Stone" <[EMAIL PROTECTED]>, "Jeff Bearer" ><[EMAIL PROTECTED]>, "Php-General \(E-mail\)" [EMAIL PROTECTED]> >Subject RE: [PHP] Intermediate "Searching..." screen. > > >Vbulletin does this for their search. Anyone know >how they do it? > >http://www.vbulletin.com/forum/search.php > > > > >-Original Message- >From: Kevin Stone [mailto:[EMAIL PROTECTED]] >Sent: May 28, 2002 2:36 PM >To: Jeff Bearer; Php-General (E-mail) >Subject: Re: [PHP] Intermediate "Searching..." >screen. > > >Search screens are a tricky prospect and none seem >to work very well. >However you could try one of the following >techniques... > >Instead of the submit button initiating a search >it initiates another script >that displays the 'searching...' message and only >after it has outputted >that to the screen does it initiate the search. >The last line in that >script would be a redirect back to your results >page. > >Another way to do it would be to set up a couple >of Javascript functions. >Echo one to open the 'searching...' screen prior >to initiating the search. >Then at the end of the script echo the other >javascript function to close >the 'searching.. ' screen. But I've implimted a >version of this for an >upload script and it didn't work so hot. > >Er.. umm.. anyone got any other bright ideas? > >-Kevin > >- Original Message - >From: "Jeff Bearer" <[EMAIL PROTECTED]> >To: "Php-General (E-mail)" ><[EMAIL PROTECTED]> >Sent: Tuesday, May 28, 2002 12:23 PM >Subject: [PHP] Intermediate "Searching..." screen. > > > > I have a part of my site that searches a large >database and sometimes it > > takes more than a few seconds to return the >results. When searches take > > longer, people get antsy and search again. To >let them know that the > > search is working so they don't double efforts >I'd like to have an > > intermediate "Searching..." screen. > > > > I don't have a good idea on how to do this and >I'm looking for some > > ideas or directions. How do I show one thing >while the search is running > > and another when the search is complete and also >not loose the returned > > record set? > > > > -- > > Jeff Bearer, RHCE > > Webmaster > > PittsburghLIVE.com > > 2002 EPpy Award, Best Online U.S. Newspaper > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: >http://www.php.net/unsub.php > > > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: >http://www.php.net/unsub.php > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Thread safe
Yeah but if you get a higher load of users that can get REALLY uglyif it is strictly an update (editing of an already existing element) then locking that record should be fine but if it's an insert or delete you shouldn't lock the table. ed At 07:15 PM 5/28/2002 -0500, Miguel Cruz wrote: >If you use the database mechanism to lock the table during the >transaction, then the second simultaneous invocation of your PHP program >will wait (a tiny fraction of a second) until the first one is done. > >miguel > >On Wed, 29 May 2002, r wrote: > > since only my one program was accessing the table the database was safe, > > My question stands at what happens if 2 or more people access > > "enterdetails.php", click on the submit button to enter info into the same > > table at the same time? > > since I will be returning a valid ID no for each of them...Its > basically > > the old chopsticks puzzle and would like to know how does PHP handle it? > > -Ryan. > > > > - Original Message - > > From: "Miguel Cruz" <[EMAIL PROTECTED]> > > To: "r" <[EMAIL PROTECTED]> > > Sent: Tuesday, May 28, 2002 12:52 PM > > Subject: Re: [PHP] Thread safe > > > > > > > Well, that's not a thread safety issue if you're trying to lock a record > > > in a database. If it was handled entirely within Java, then there was no > > > guarantee of database referential integrity. Only the database can do > > > that. > > > > > > miguel > > > > > > On Wed, 29 May 2002, r wrote: > > > > Nope its not more like a database issue as this was clearly > addressed in > > > > java and so the "synchronised" keyword was made and you have to > > implement a > > > > "synchronised block" of code to make it thread safe. > > > > is this possible in PHP or does PHP itself take care to make all > scripts > > > > thread safe? > > > > > > > > Cheers, > > > > -Ryan. > > > > > > > > - Original Message - > > > > From: "Miguel Cruz" <[EMAIL PROTECTED]> > > > > To: <[EMAIL PROTECTED]> > > > > Sent: Tuesday, May 28, 2002 11:44 AM > > > > Subject: Re: [PHP] Thread safe > > > > > > > > > > > > > On Mon, 27 May 2002, r wrote: > > > > > > In java servlets I used to use a "synchronised" block of code to > > make > > > > sure > > > > > > it was thread safe...how do i do this in PHP? > > > > > > > > > > > > Heres what should be thread safe > > > > > > > > > > > > { > > > > > > $r=select max(cno)+1 from MyTable; > > > > > > (then i insert into the table the new cno plus my name) > > > > > > insert into mytable ($r,'myname'); > > > > > > } > > > > > > How to do this and make sure its thread safe? > > > > > > > > > > More of a database issue. "select ... for update" is a good starting > > point > > > > > as you search the manual of your particular database platform. > > > > > > > > > > miguel > > > > > > > > > > > > > > > -- > > > > > PHP General Mailing List (http://www.php.net/) > > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > > > > > > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] .php extension
Yeah one of the simple tricks to mask that you use php is to make the extention that the PHP Parser looks for (ie name it page.foo) or whatever and have: AddType application/x-httpd-php .foo At 07:27 PM 5/28/2002 -0500, Miguel Cruz wrote: >On Tue, 28 May 2002, Luis Miguel N. Tavora wrote: > > As far as I understood it, for a server process the php > > code, the file must have the extension .php > > > > But then, the apache server (for example) requires a file > > index.html to be placed in the directory public_html/ ... > >Wrong on both counts (sorry, but really it's good news for you). > >1) You can have the server send any files you want through the PHP parser. >The easiest thing is to edit the line that looks like this in your >httpd.conf file: > >AddType application/x-httpd-php .php > >Just add extra extensions: > >AddType application/x-httpd-php .php .html > >2) You can have the server use and file(s) you want as the "default" when >a user requests a directory. Find the httpd.conf line that looks like >this: > >DirectoryIndex index.html > >And add as many other file names as you want: > >DirectoryIndex index.html index.php > >So you can solve your problem in either of two ways (actually there are >plenty of others but these are the most straightforward). > >miguel > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP new super globals or something else??
Well you should be using $_GET, $_POST and $_SESSION and turn register-globlals off as of PHP 4.2.1.I think you need to keep track-vars on for these arrays to be initialized. ed At 10:48 AM 5/29/2002 +1000, Martin Towell wrote: >code snippets would be good, if possible > >-Original Message- >From: Gerard Samuel [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, May 29, 2002 10:46 AM >To: PHP >Subject: [PHP] PHP new super globals or something else?? > > >I hope this makes sense to someone > >Im converting a script over to work with 4.1.x +. >Im running php 4.1.2 on FreeBSD/Apache and I have 4.2.0 on w2k/IIS/Apache. >I sent the script to a friend of mine who is running w2k/Apache with 4.2.0. >He told me that the script isn't working for him but it was for me. >Upon closer inspection, I found out why it wasn't working for him, but >Im wondering why it is for me. >I have register global turned off on both machines. >In the initial load of the page, I used $_GET to grab some variables >from the url and pass it to hidden fields in the form. >$_GET['foo'] >$_GET['bar'] >Then the form is submitted to itself to insert into the database. When >its submitted, the script is looking for 'foo' and 'bar', but >they are now in the $_POST, and this is where it breaks for the other >guy, because the script is still looking for 'foo' and 'bar' in >the $_GET array. So in my case, it seems as if php is not behaving as >it should. >So, my question is, are there any other php options that I should be >looking for/using, to use the new variables in its strictest form. > >If you need more info, dont hesitate to ask. >Thanks > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] DNS-less Connections With PHP?
Yes you really need to indicate what version of php you are using, what server you are using and what db you are using if you ever need to ask for help. Go to www.php.net and read up on: SQL SERVER mssql_connect() MYSQL mysql_connect() MOST obdc_connect() ORACLE ora_plogon() ed At 06:45 AM 5/29/2002 -0500, Jay Blanchard wrote: >[snip] >Could anybody explain to me (or even give me a link to a place explaining) >the creation of "DSN-less" connections? I've extensivly searched Google with >this, but I couldn't find anything that was of any help to me. I know how to >do this in ASP, though... >[/snip] > >PHP does not use the concept of DSN-less connections as it supports many >database types with native functions. Even ODBC uses a set of native PHP >functions for connections with databases. You don't say what type of >database you are using, but it is likely that PHP has support for it. > >Jay Blanchard > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP doubt
You really need to put in more of the code as it ACTUALLY appears... ed At 05:39 PM 5/29/2002 -0700, r wrote: >Hey guys, > >I have written a program and being a newbie I dont know if this is good or >will give me problems in the future, so will appreciate it if you could just >have a look at the function and give me your "esteemed opinion" ;-) >This is just a snip from the program...its pretty easy so your guru's should >have no problem figuring it out. > > >// connected to the database successfully and running this query: >{ >mysql_query.etc >$r=select max(cno)+1 from customer; >insert into customer values($r,'$name'); >} >print("Your customer number is: $r"); > >what do you think? And will this return the correct values if 2 people >submitted the form at the same time? > > >Cheers, >-Ryan. > > >-- >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] Relative beginner in dire need of help! (Scratch my last message, sorry... )
Are you sure the permissions on the directory are set up correctly? The user that the db is run as (usually nobody in apache/linux) needs read and write privileges on that directory ed At 04:30 AM 5/29/2002 -0400, [EMAIL PROTECTED] wrote: >I really hope someone can help me here!! LOL!! > >I'm in the process of moving a site that utilises PHP and MySQL to another >server. The move has gone well, and I have successfully edited most of the >scripts, or rewritten them to work in their new location... however... I am >having a problem with this one... > >It's a script (written by someone else) to upload special offers to a DB. >Simple so far... well, it includes an image upload section. The script seems >to automatically grab and store the name, height, width, etc of the image. >I'm getting two major errors: > >Warning: Unable to create '../specialoffer_images/specoffpicone.jpg': >Permission denied in >/home/virtual/loverskey/home/httpd/html/specialoffer_admin/special_offers_chan > > >ged.php on line 45 > >Warning: Cannot add header information - headers already sent by (output >started at >/home/virtual/loverskey/home/httpd/html/specialoffer_admin/special_offers_chan > > >ged.php:45) in >/home/virtual/loverskey/home/httpd/html/specialoffer_admin/special_offers_chan > >ged.php on line 82 > >The directories are permissiond correctly, and I've tried so many different >ways to point the the locations... Here's the sections that I seem to have >probs with: > >if($specoffpicone != "none"){ >copy($specoffpicone, $complete_image_one); >} >if($specoffpictwo != "none"){ >copy($specoffpictwo, $complete_image_two); >} >if($specoffpicthree != "none"){ >copy($specoffpicthree, $complete_image_three); >} > >and > >header("Location: ../special_offers.php"); > >The directory is referenced like this: > >$dir = "../specialoffer_images/"; > >I know this is a long mail, but I've been trying all sorts, and searching all > >over for clues, and I'm extremely tired, frsutrated, and very stuck. I need a > >helping hand, please!! If you need/want to see the whole script, just ask, >it's not too big. > >Regards, > >Greg Watson > > > >-- >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] Avoid escaping
Inside php.ini there is a setting to turn "Magic Quotes" on or off.turn them off and you won't have this problem. If you don't have access to the php.ini file or your administrator will not turn them off use echo stripslashes($test); ed At 11:36 AM 5/29/2002 +0200, Jose Jeria wrote: >i have some html that i submit using html >example > > Perro > > >When i submit this and retrieve it on the target page the value looks like >this: >Perro > >Can I somehow avoid that somehow? > > > >-- >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] comment followed by ?> fails to parse
Bah quit complaining, you should be using /* comments */ anyway. ed At 09:16 PM 5/29/2002 +0800, Jason Wong wrote: >On Wednesday 29 May 2002 21:10, Brinkman, Theodore wrote: > > It really should ignore anything in any sort of comment. The whole point > > of a comment is that it provides the programmer with information and is > > ignored by the compiler/interpreter. If // is supposed to comment until > > the end of the line, then by god, it should comment until the end of the > > line, not until the end of the line unless it finds ?> buried in the line > > somewhere. Even VB gets this right! > >As someone has already pointed out that is documented behaviour. Personally I >agree with you in that the whole line should be commented. > >-- >Jason Wong -> Gremlins Associates -> www.gremlins.com.hk >Open Source Software Systems Integrators >* Web Design & Hosting * Internet & Intranet Applications Development * > >/* >"Life is too important to take seriously." > -- Corky Siegel >*/ > > >-- >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] sessions and 'normal practice'
1. This is done for users that don't use cookies. Believe it or not but there are people out there that are afraid of cookies and automatically turn them off. Without appending the sessionid to the end of the URL, sessions won't work for these people. Now how does your host append to the end of each URL? Do they do it manually in the code or do they use the SID? An easy way to test for this is to fire up a browser with cookies enabled and see if the sessionid gets appended to each url. If so tell them to use the SID constant. Let me know and I can help you further ed At 03:27 PM 5/29/2002 +0200, Nick Wilson wrote: >-BEGIN PGP SIGNED MESSAGE- >Hash: SHA1 > >Hi all >I have 2 questions relating to how session id's are passed from page to >page: > >1: My host uses the 'append to url and hidden fields' method. I dislike >this as it makes my urls untidy and my pages won't validate. So, is it >considered normal practice to do it this way? > >2. I spent some time pouring over the manual and must be missing the >point somewhere ;-) How can I explain/use the alternative to the above >and if you believe I shouldn't, why? > > >Hope someone will be kind enough to put this in simple terms for me, I >just got a little lost in the manual and need a few facts before >confronting my host. > >Many thanks.. >- -- >Nick Wilson // www.tioka.com > > > >-BEGIN PGP SIGNATURE- >Version: GnuPG v1.0.6 (GNU/Linux) > >iD8DBQE89Nc7HpvrrTa6L5oRAt0KAJ9TfQv2a5j52D7VfCANZvRC6tfB5gCghqCU >SXuXMzllAOq0GY19UK4mE0g= >=EsWR >-END PGP SIGNATURE- > >-- >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] sessions and 'normal practice'
Well that must mean that they are using session_name() and session_id(). I really don't know why they are using that (considering it'll add unnecessary overhead of calling session_name(),session_id() twice). My guess is that they don't have a clue about the SID constant that automatically gets generated as "PHPSESSIONID=dsfgsdgsdfgsgsdfg" if the browser does not accept cookies and is empty otherwise. I bet they are a bunch of asp developers ;-) ed At 03:39 PM 5/29/2002 +0200, Nick Wilson wrote: >-BEGIN PGP SIGNED MESSAGE- >Hash: SHA1 > > >* and then Ed Gorski declared > > 1. This is done for users that don't use cookies. Believe it or not but > > there are people out there that are afraid of cookies and automatically > > turn them off. Without appending the sessionid to the end of the URL, > > sessions won't work for these people. Now how does your host append to > > the end of each URL? Do they do it manually in the code or do they use > > the SID? An easy way to test for this is to fire up a browser with > > cookies enabled and see if the sessionid gets appended to each url. If > > so tell them to use the SID constant. Let me know and I can help you > > further > >Thanks ed, I knew most of that. >My browser has cookies *on* and I see PHPSESSID=sdkfldsdslkj in the urls >and in my markup. > >Does that help? >- -- >Nick Wilson // www.tioka.com > > > >-BEGIN PGP SIGNATURE- >Version: GnuPG v1.0.6 (GNU/Linux) > >iD8DBQE89NoqHpvrrTa6L5oRAi49AJ4rv0/3lXIMvtT1WI4ZFbRrD/6YcgCeKE7T >hMyaCC/w6A/NClStvvb7Sww= >=93f9 >-END PGP SIGNATURE- > >-- >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] Advantages of php
Maybe he's still mulling over the "Hello World" solution 3. htmlspecialchars() is a very nice function as welland you can't beat the regular expression functions for validating data ed At 08:41 AM 5/29/2002 -0500, Jay Blanchard wrote: >[snip] >Hmm...point number 1 would be time management, for you! Maybe you should've >started researching this more than a day before hand. >[/snip] > >+1 John > >[snip] > > I'am a php programer, >[/snip] >And GET & POST you don't know? > >[snip] >I have got an seminar on 31st of May(hardly > > one day left) on PHP, I have to expose its advantages and advantage of > > PHP's security >[/snip] > >Outstanding ability to handle sessions. >Built-in encryption functions such as crypt() and a whole host of mcrypt() >functions. > >That's 2 on PHP security advantages. > >HTH! > >Jay > > > >-- >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] mail() function
lol.what does that return? At 09:08 PM 5/29/2002 -0700, r wrote: >That may and may not work, I would suggest you add the RTFM() function, then >it WILL work. >Cheers, >-Ryan >- Original Message - >From: "Phil Schwarzmann" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Wednesday, May 29, 2002 7:57 AM >Subject: [PHP] mail() function > > > > I want to write a simple script that sends an e-mail message using PHP. > > > > I'm assuming that my web-host has the mail function hooked up to the > > e-mail server (should I be assuming this or should I assume that it's > > NOT hooked up?). > > > > What is the syntax for this command? > > > > something like this... ? (assuming that the variables contain the > > proper data) > > > > mail($contactemail, $subject, $message, $headers); > > > > THANKS!! > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail() function
you mean return str_replace('ignorance','knowledge'); At 04:34 PM 5/29/2002 +0100, James Holden wrote: >knowledge > >-Original Message- >From: Ed Gorski [mailto:[EMAIL PROTECTED]] >Sent: 29 May 2002 16:26 >To: r; [EMAIL PROTECTED] >Subject: Re: [PHP] mail() function > > >lol.what does that return? > >At 09:08 PM 5/29/2002 -0700, r wrote: > >That may and may not work, I would suggest you add the RTFM() function, >then > >it WILL work. > >Cheers, > >-Ryan > >- Original Message - > >From: "Phil Schwarzmann" <[EMAIL PROTECTED]> > >To: <[EMAIL PROTECTED]> > >Sent: Wednesday, May 29, 2002 7:57 AM > >Subject: [PHP] mail() function > > > > > > > I want to write a simple script that sends an e-mail message using PHP. > > > > > > I'm assuming that my web-host has the mail function hooked up to the > > > e-mail server (should I be assuming this or should I assume that it's > > > NOT hooked up?). > > > > > > What is the syntax for this command? > > > > > > something like this... ? (assuming that the variables contain the > > > proper data) > > > > > > mail($contactemail, $subject, $message, $headers); > > > > > > THANKS!! > > > > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > >-- >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] determining where the computer is that posts to a db
Getting the mac address of a machine would be a BIG security holeso I really doubt there is. ed At 10:58 AM 5/29/2002 -0700, Tom Beidler wrote: >I have a time billing application and I need to determine where people are >logging in from to make sure they are signing in at work and not at home. > >Currently I'm logging the IP address and hostname but I don't think that's >the totally sano way to do it. The work sites are using local ISP's that >register dynamic IP addresses. If one of the workers has the same ISP I >can't tell whether they are at home or work. > >Any ideas? Is there a var that could get the MAC address of the machine? > >Thanks, >Tom > > >-- >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] Why is there no OPTION EXPLICIT equivalent?
Go to your php.ini and turn on full error reporting.you'll get warning message if you do not initialize varsas of php4.2.1 ed At 08:11 PM 5/29/2002 +0100, Andy Arbon wrote: >Hello, > >In general I find PHP great to work with, but the number one thing that >causes bugs for me is the fact that the interpreter doesn't throw an error >if I use an undeclared variable. > >I have looked and I can't find any information that suggests you can make >PHP force you to declare variables before use - does such a facility exist? > >Assuming it doesn't, why is that the case? I can't be the only one who has >problems with this; are there any plans to add such a feature in the >future? It doesn't have to be compulsory, but a facility like VB's (not >that I like that language in general) Option Explicit statement would be a >great help. > >I know nothing about language design, but I can't see how this can be more >difficult to do than forcing static types, which it seems you can do in >PHP.. can anyone tell me the reasoning behind this? > >Hope the above doesn't sound too critical - in general I love PHP, but >this one omission has cost me so many hours of debugging time over the >years I had to ask :) > >Cheers, > >Andy > > >-- >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] ******************* Secure product download *******************
ugh a software pay site written in php.it makes me feel dirty... At 04:56 PM 5/29/2002 -0400, 1LT John W. Holmes wrote: >session_start(); >if(!isset($_SESSION["did_pay"])) >{ header("Location: http://www.example.com/pay_first.php";); } >//show download code > >Obviously you set $_SESSION['did_pay'] to a value once they, umm, pay. > >---John Holmes... > >- Original Message - >From: "Ron Stagg" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Wednesday, May 29, 2002 4:47 PM >Subject: [PHP] *** Secure product download >*** > > >I am building a site where visitors can purchase and download software. >To purchase a software product, the visitor must submit credit card >info. Once the purchase has been approved, the user is given a link >from which he/she may download the requested software. This link MUST >only be accessible to those who have paid. I have tried a number of >different and creative methods, but none give me the security I need. I >don't want the user to be able bookmark the URL or email the URL to >friends so that they can download the software as well. I am using PHP >sessions combined with MySQL user accounts to authenticate users >throughout the rest of the site. How can I get this to work for >downloads? > >Is this even possible within the open realm of the browser? Have any of >you solved a similar problem? I welcome any ideas. > >Ron Stagg > > > >-- >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] Warning: Cannot add header information - headers already sent by
You need to put line 6 ahead of all the HTML, ie make it line 0. ed At 04:10 AM 5/30/2002 -0700, Anton Heryato wrote: >this script below is delete.inc >and the lagi.php is .. >1::PHp >2: >3:hahahahha >4:5:require 'delete.inc'; >6:deleteCookies(); >7:printf("can do it`"); >8: >9:?> >10: >11: > >so, which one in line 4 have send anything first >please help me to fixed > >regards >anton > >-Original Message- >From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, May 29, 2002 1:37 PM >To: Anton Heryato; [EMAIL PROTECTED] >Subject: Re: [PHP] Warning: Cannot add header information - headers >already sent by > > >You can't send anything to the browser before you send a header or cookie. >Apparently, lagi.php has sent something, though, on line 4. Fix that and you >will be fine. > >---John Holmes... > >- Original Message - >From: "Anton Heryato" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Thursday, May 30, 2002 6:37 AM >Subject: [PHP] Warning: Cannot add header information - headers already sent >by > > > > i have one function name deleteCookees that have this error message > > > > Warning: Cannot add header information - headers already sent by (output > > started at /home/reymond/html/phpreport/lagi.php:4) in > > /home/reymond/html/phpreport/delete.inc on line 10 > > the script > > > > > function deleteCookies() > > { > > for ($i=0; $i<$total_items; $i++) > > { > > setcookie("items_tray[$i]",""); > > setcookie("quantity[$i]",""); > > } > > > > setcookie("items_tray",""); > > setcookie("total_items",""); > > setcookie("quantity",""); > > > > } > > ?> > > > > could anybody tell me why this happen and howto fixed > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Global variables
use a database ed At 04:35 PM 5/29/2002 +0300, serge gedeon wrote: >Dear sir, > >I would like to know if I could create using PHP, global variables that I >could use in diferrent files. I don't want to use http_get_vars or post or >cookies is there an other way? > >Thank you. >Serge GEDEON > > > > >_ >Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. > > >-- >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] Variable Variables
use isset($$key); ed At 09:29 AM 5/30/2002 +1000, David Freeman wrote: >Hi All, > >I've been trying to figure this out based on stuff on php.net but can't >seem to get a result I need. > >I have an array: > >$formarray = array ("form1" => "var1", "form2" => "var2"); > >And now I'm using that array to create a form (fairly abbreviated): > >while (list($key, $val) = each($formarray)) >{ > echo "$val:"; > echo " >} > >What I'm looking to do is set a value in my input tag if a value has >been set. That is, if this form has been submitted then the variable >$form1 will contain a value (well, $POST[$form1] will but you get the >idea). > >I want to test if $form1 has a value and if it does then I can add a >value= arg in my input tag. > >I've got as far as working out that $$key will give me the equivalent of >$form1 but how do I then work out if $form1 has a value? > >CYA, Dave > > > >-- >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] your philosophy on php-design
well just have the "add to basket" link on index.php call add_to_basket.php which doesn't print out anything and redirect back to index.php?type=itemAdded when finished. On index.php you can check for $_GET['type'] and generate the appropriate table. ed At 09:50 AM 5/30/2002 +0200, Wilbert Enserink wrote: >Hi all, > > >I'm busy building a website. I cannot use frames. >Every page can be divided in a table with 3x3 cells. > >The row will be my main menu. >The first column wil be submenu. >The middel cell will display the actual content. > > > || > <--main menu--> >|-- |--- > sub | main |sub content > menu | content | > || >|-- |-- > <--footer--> > || > > >the main menu will always be the same, same as the footer --> includes >the main content cell depends on which submenu function is choosen. > >Some submenu items are: > >login >search in database >add to your favourite items >add to basket > > >Now I was wondering how to build my site. How should I deal with a >function like 'add to basket'. I mean, when a certain item is displayed >and the customer wants to add it to their basket I have call the script >add_to_basket.php or something like that. However I don't want to leave >the page where the item is displayed, cause that's confusing to the >visitor. Even more..In the 'sub-content' cell I want to display data about >ordering info, like there are so many items in the basket. > >So I have to call upon a script which stores the info about add_to_basket, >load a total new page where 1 table cell changes, namely the sub-content >cell, but still displayes the original product. > >So, If I were to use frames It could be done, but now I'm not thinking of >frames but of displaying content dynamically in a tabe cell. > >I would very much appreciate your expert opinion on this matter, I'm sure >every idea helps me form my own ideas which I can use. >maybe there are people out there who have done this kind of thing, or know >about large sites which use this same concept > >Any philosophies are much appreciated! > >Wilbert Enserink > > > > > > > > > > > > > > > >- >Pas de Deux >Van Mierisstraat 25 >2526 NM Den Haag >tel 070 4450855 >fax 070 4450852 >http://www.pdd.nl >[EMAIL PROTECTED] >- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] arrays and same index
Well what exactly are you trying to do? You can't name an index of an array the same thing and expect different values ed At 03:36 PM 5/30/2002 +0200, Victor SpÄng Arthursson wrote: >Hi! > >I want to create an array that looks like follows: > >$array["untitled_1.jpg"][] = 0 >$array["untitled_1.jpg"][] = 3 >$array["untitled_1.jpg"][] = 4 >$array["untitled_2.jpg"][] = 0 >$array["untitled_3.jpg"][] = 1 > >What I'm thinking about is accessing all "untitled_1.jpg" values by doing >the following: > >$newarray = $array["untitled_1.jpg"]; > >and receive an array with 3 indexes which has the values 0,3,4... > >This doesn't works... > >$array["untitled_1.jpg"][] = 3 seems to overwrite >$array["untitled_1.jpg"][] = 0 and then $array["untitled_1.jpg"][] = 4 >overwrites $array["untitled_1.jpg"][] = 3... > >How should I solve this? > >Sincerely > >Victor > > >-- >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:[PHP] Help with mail
You know why he barks? Tell me! At 08:06 PM 5/30/2002 -0700, r wrote: >What is this? magicians day? >I have a dog, can you tell me why he barks sometimes? > >Show us some code dude, or is it "code red" classified? >There could be a dozen possible reasons but if you show the code you stand a >better chance of finding out what the problem is, from me or the other dudes >on the listmore likely from the other dudes...:-) > >Cheers, >-Ryan. > > >-- >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] fdup & Pipes?
Yeah that's like me going to the bigwigs and asking if we can dump the windows servers.I At 11:00 AM 5/30/2002 -0400, Leotta, Natalie (NCI/IMS) wrote: >Like we have much of a choice - I'm sure my bosses would love it if I went >to them and asked for a "real" email client. > >-Original Message- >From: Jonathan Rosenberg [mailto:[EMAIL PROTECTED]] >Sent: Thursday, May 30, 2002 11:06 AM >To: Rasmus Lerdorf >Cc: [EMAIL PROTECTED] >Subject: RE: [PHP] fdup & Pipes? > > >Yes, I realized this after I sent my reply. > >And, please try hard to forgive those of us who do not use the "real" >software approved by you & the other gods. We beg your forgiveness, oh >lord. > > > -Original Message- > > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, May 30, 2002 10:45 AM > > To: Jonathan Rosenberg > > Cc: [EMAIL PROTECTED] > > Subject: RE: [PHP] fdup & Pipes? > > > > > > Yes it was. In your message you had this header: > > > > In-Reply-To: > > <[EMAIL PROTECTED]> > > > > Which means you hit 'Reply' in your crappy Outlook > > program, deleted the > > Subject line and posted your message that way. Please > > don't do that. > > Those of us with real email clients see your "new" > > message inside a thread > > on a completely different topic. > > > > -Rasmus > > > > On Thu, 30 May 2002, Jonathan Rosenberg wrote: > > > I have no idea what you are talking about. My > > message was NOT a > > > reply to a previous post. > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I want a script to run after a page already loads.
well what does the script do? Is it integral to the page? ed At 02:42 PM 5/30/2002 -0400, Phil Schwarzmann wrote: >I have a script that takes a VERY long time to run. So the page just >kinda hangs for a minute if not longer before the script is complete. > >I want a page to fully load, then I want this script to run. Is this >possible? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hi all & Help :D
hehI laugh but it's not past the realm of what people do... JH>For all we know, the problem is because you actually wrote the program in Pascal, but thought it was PHP because you renamed your computer to PHP and you are trying to load the code up in MS Word on Windows 3.11. ed At 02:47 PM 5/30/2002 -0400, 1LT John W. Holmes wrote: >Two things you should learn: > >1. Use a informative Subject. Give a description of the problem instead of >Hi and Help... > >2. We can't help you if you don't give us code and error messages. For all >we know, the problem is because you actually wrote the program in Pascal, >but thought it was PHP because you renamed your computer to PHP and you >are trying to load the code up in MS Word on Windows 3.11. > >---John Holmes... > >"Anthony" <[EMAIL PROTECTED]> wrote in message >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Hi all, this is my first post on the php news groups, and im sure it > wont be > > my last so I will first introduce my self, because im sure there are some > > regualar posters ;) > > > > My name is Anthony.. Im 14 years old and live in england, anything else you > > want to know ask :) > > > > Im working on a FTP uploader in php, but not for my own site, I want to > > offer it was a service to so over people can upload to there sites using my > > FTP script... but when you put the destonation (once they have > connected) to > > / it trys to upload to a path in my site.. can any one explain why this is > > and how to correct it, It would be aprechiated a lot, thanks > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Posting to a form - When user hits BACK button all the data is gone
The posted data on which page? The one submitted to? ed At 02:43 PM 5/30/2002 -0400, Phil Schwarzmann wrote: >When a user is posting data to a form and hits SUBMIT the user is taken >to another page. But when the user hits the BACK button on his browser, >all the posted data is gone. > >How can I get this data to remain there when a user hits BACK ? > >Thanks!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php