Re: [PHP] Use of Objects in PHP
On Fri, 2003-10-17 at 01:43, Nagib Abi Fadel wrote: Hi, i have been using php for 1 year till now, and i never felt the need to use an object. Can some one tell me where and why should i use the object oriented coding in PHP ? I meen i have been able to do all the things i want without using any object (I know that objects could make my code more structured). I have read the php docs, there's no inheritance (as far as i've read) ... I would really appreciate any advice. - There is inheritance. - There is polymorphism - There is encapsulation These things are often a matter of preference and can to some degree or another be cooked without objects, albeit not as elegantly. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dynamic tables
Hi all, Having a slight problem with dynamic tables here. I am trying to create a timetable using PHP, HTML, and MySQL, where all the cells in the table are coloured and that the colour of the cells can be changed using a drop down menu. Here's a snip of the code that I have done: td bgcolor=? echo$_POST[colour]? class=Devi width=15% align=center valign=middlea href=select1.php2PE1012/a/td select name=colour class=textarea align=center option name= Grey value=#dededeGrey/option option name=Pink value=#FFB6C1Pink/option option name=Blue value=#87CEEBBlue/option option name=Yellow value=#00Yellow/option option name=Cyan value=#AFCyan/option /select Right now, I am able to change the colour of cells using a drop down menu, and when I clicked on Reload it still remains the colour that I have changed, but when I open the page in another browser, as I echoed the value colour, the browser displayed a mixture of the colour code :grey, pink, blue, etc How can I do it in the way that when I opened up a new browser it will display only the colour that I have changed to earlier on?Hope to get some help soon...thanks for all help given. Regards, Irin. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 'Return values' from links
First of all, Hi! I just started getting into php a week ago, but already ran into a problem I can't seem to solve. The issue is this : I code 2 different websites, each has it's own mySQL-DB. Website A has a login-section, each time you successfully log in, a key is generated which stays only valid for a certain period of time (done via database). Now, I have a link from the login section on website A to a sign-up-form on website B. This sign-up is supposed to only be accessible if you have a valid key from website A, which qualifies you as a member. Website B lets you fill out the form no matter what key you offer it, but when you have finished, right before I insert the data into my DB, I want it to check back with website A whether the key is valid or not. That's where I'm stuck right now. I have a php file in website A's directory, which, when given a key value, will check whether it is valid or not. Is there any way I can treat this website like a function and have it give me a return value after it has run through ? I tried it by putting a header from B to validate.php on A, and have that only call the 'exit;' when a valid key is provided, but it seems to proceed with website B's code no matter what the header to website A does. Is there any other way or workaround that I can accomplish this ? I just need a link to that validation page, and after the link the code should proceed or not based on the return value from that link. By the way, I work with php3, so I hope there's a solution for that version ;) Thanks in advance for any help, I hope my english wasn't too bad for you to understand what I meant. -- NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien... Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService Jetzt kostenlos anmelden unter http://www.gmx.net +++ GMX - die erste Adresse für Mail, Message, More! +++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] intercepting URLs in a control-system
Hello If you are using PHP as an Apachemodule you also have the option of using a url like http://example.com/index.php/test/test.html Apache will see that test.html is not available and will travel down the directory path til it gets to the index.php (which should exist BTW) and call that script. This seems to work on most default installation of apache using php as apachemodule. (Don't know if this is true for all apache installations and if this still works on apache2) In index.php you can parse the requesturi and decode it appropriatly. Be aware this only works on apache with php as a module and it might not be as fast as mod_rewrite ( and as clean) but it can be used on servers that don't have mod_rewrite installed or where you don't have access to the config or htaccess. Regards Stefan Langer
[PHP] Back option using php
Hello, Is there any way to restrict the user not to go back once he submitted the html form ?? Regards, Uma -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 'Return values' from links
On Fri, 17 Oct 2003 08:54:23 +0200 (MEST), you wrote: I have a php file in website A's directory, which, when given a key value, will check whether it is valid or not. Is there any way I can treat this website like a function and have it give me a return value after it has run through ? Yes; some kind of Remote Procedure Call protocol (eg SOAP) is designed for this. But the lightweight way would be something like: function get_token_validity ($token) { $token = 'token=' . rawurlencode ($token); // armour message for sending $host = 'www.webserverA.com'; if (($sp = fsockopen ($host, 80)) == FALSE) { return (NULL); } fputs ($sp, POST /path/to/script.php HTTP/1.0\r\n); fputs ($sp, Host: $host\r\n); fputs ($sp, Content-type: application/x-www-form-urlencoded\r\n); fputs ($sp, Content-length: . strlen ($token) . \r\n\r\n); fputs ($sp, $token\r\n); $result = NULL; while (!feof ($sp)) { $a = fgets ($sp); if (is_numeric ($a)) { if ($a == FALSE) { $result = FALSE; } else { $result = TRUE; } } } fclose ($sp); return ($result); } Untested, but it should be pretty close. Returns TRUE on a valid result, FALSE on invalid and NULL on error. The paired script on www.webserverA.com should just echo(1) or echo(0) for a good or bad result. By the way, I work with php3, so I hope there's a solution for that version ;) /Ah/. I have to ask... why? I have no idea whether the above code will run on PHP 3. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Back option using php
There may be, but it would almost certainly be handled client-side. Try looking into Javascript stuff that clears the browser cache or otherwise prohibits back navigation. Edward Dudlik Those who say it cannot be done should not interrupt the person doing it. wishy washy | www.amazon.com/o/registry/EGDXEBBWTYUU - Original Message - From: Uma Shankari T. [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Friday, 17 October, 2003 05:20 Subject: [PHP] Back option using php Hello, Is there any way to restrict the user not to go back once he submitted the html form ?? Regards, Uma -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Back option using php
On Fri, 17 Oct 2003 14:50:21 +0530 (IST), you wrote: Is there any way to restrict the user not to go back once he submitted the html form ?? Javascript, but that can't be relied on. Are you're trying to avoid the This page has expired, resubmit? warning in IE? Use header (Location:) to redirect the user after processing the form: ? if (isset ($artist) isset ($album)) { $fp = fopen ('list.txt', 'a'); fputs ($fp, trtd$artist/tdtd$album/td/tr\r\n); header (Location: $PHP_SELF); exit(); } ? html body table border=1 cellspacing=2 trtdArtist/tdtdAlbum/td/tr ? readfile ('list.txt'); ? /table brbr form method=post action=? echo ($PHP_SELF); ? pArtist: input type=text name=artist/p pAlbum: input type=text name=album/p pinput type=submit name=Add value=Add/p /form /body /html (It would also be best-practice to send a unique token as a hidden field in each form, so you can reject it if the form gets posted more than once). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session cookie issue...
Jake McHenry wrote: John W. Holmes wrote: I think just upgrading PHP and still using Apache2 will fix this bug, though, and it should still work (it'll be dependent upon what extensions you use and whether they are supported with Apache2). Extensions.. As in file name extensions? No, John means php modules. Run phpinfo() to see what modules are installed. Everything so far I have converted over from 1.3 has worked fine in apache2... The ONLY difference that I can see visually is that they added a global this is a test page and more customized error messages. All of my file extensions work the same, and virtual hosts, access files, etc. This is why I thought it was something I did wrong setting up the sessions... Which no one ever answered that question... Can I still use my javascript cookie scripting, or should I just use the session? Or both? Depends on what you want to do. Thanks, Jake McHenry Nittany Travel MIS Coordinator http://www.nittanytravel.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing values dynamically
Hi, I am getting a one column table as a result for a select statement. Now I want to pass obtained values dynamically to invoke another query in a new page. I tried to pass the values with sessions. But every time I get the last value of the previous result. Any suggestions as how I could pass the value that I click on the current page ? (One of the row values in the one column table I got as the previous result) Thank You. Rashini -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: 'Return values' from links
Some XML would do the trick pete [EMAIL PROTECTED] wrote: First of all, Hi! I just started getting into php a week ago, but already ran into a problem I can't seem to solve. The issue is this : I code 2 different websites, each has it's own mySQL-DB. Website A has a login-section, each time you successfully log in, a key is generated which stays only valid for a certain period of time (done via database). Now, I have a link from the login section on website A to a sign-up-form on website B. This sign-up is supposed to only be accessible if you have a valid key from website A, which qualifies you as a member. Website B lets you fill out the form no matter what key you offer it, but when you have finished, right before I insert the data into my DB, I want it to check back with website A whether the key is valid or not. That's where I'm stuck right now. I have a php file in website A's directory, which, when given a key value, will check whether it is valid or not. Is there any way I can treat this website like a function and have it give me a return value after it has run through ? I tried it by putting a header from B to validate.php on A, and have that only call the 'exit;' when a valid key is provided, but it seems to proceed with website B's code no matter what the header to website A does. Is there any other way or workaround that I can accomplish this ? I just need a link to that validation page, and after the link the code should proceed or not based on the return value from that link. By the way, I work with php3, so I hope there's a solution for that version ;) Thanks in advance for any help, I hope my english wasn't too bad for you to understand what I meant. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing values dynamically
You need to create an array in the session and assign the values: $_SESSION['values']=array(); while( $v=/* get single value */ ) { $_SESSION['values'][]=$v; // notice the [] } Then on the other page loop the array. Rashini Jayasinghe wrote: Hi, I am getting a one column table as a result for a select statement. Now I want to pass obtained values dynamically to invoke another query in a new page. I tried to pass the values with sessions. But every time I get the last value of the previous result. Any suggestions as how I could pass the value that I click on the current page ? (One of the row values in the one column table I got as the previous result) Thank You. Rashini -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing values dynamically
i guess, it would be better to use loops, if i understand your problem, the way it is. Nitin - Original Message - From: Rashini Jayasinghe [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 17, 2003 3:12 PM Subject: [PHP] Passing values dynamically Hi, I am getting a one column table as a result for a select statement. Now I want to pass obtained values dynamically to invoke another query in a new page. I tried to pass the values with sessions. But every time I get the last value of the previous result. Any suggestions as how I could pass the value that I click on the current page ? (One of the row values in the one column table I got as the previous result) Thank You. Rashini -- 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] credit card gateway
Hi there, quote I would like to implement direct credit card payment on my site with a gateway (SET). Can somebody recommend low price gateway companies. It seems to me that prices verry a lot. PayQuake has the best rates I've seen. They can be a PITA when setting up, but otherwise they're good. http://www.payquake.com /quote You are right, the prices are really great. However they only go for US accounts. If you are located outside you have to pay 399$US setup fee! Does anybody know a good credit card gateway company for German cusomors? Thank you for any hint, Merlin Becoming Digital wrote: PayQuake has the best rates I've seen. They can be a PITA when setting up, but otherwise they're good. http://www.payquake.com Edward Dudlik Those who say it cannot be done should not interrupt the person doing it. wishy washy | www.amazon.com/o/registry/EGDXEBBWTYUU - Original Message - From: Merlin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, 15 October, 2003 16:02 Subject: [PHP] credit card gateway Hi there, I would like to implement direct credit card payment on my site with a gateway (SET). Can somebody recommend low price gateway companies. It seems to me that prices verry a lot. Any suggest is appreciated. regards Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie question about Class
I was afraid that was the case. You've nothing to fear but fear itself. Sessions are your friend. Edward Dudlik Those who say it cannot be done should not interrupt the person doing it. wishy washy | www.amazon.com/o/registry/EGDXEBBWTYUU - Original Message - From: Al [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, 15 October, 2003 14:15 Subject: Re: [PHP] Newbie question about Class I was afraid that was the case. Tom Rogers wrote: Hi, Thursday, October 16, 2003, 3:35:56 AM, you wrote: A My question seems fundamental. I want to set a variable in one function A in a class and then want to use the value in a second function. A However, the functions are called a html page with two passes. Submit A reloads the page and an if(...) calls the second function in the class. A If I declare on the first run: A $get_data = new edit_tag_file(); A $edit_args= $get_data- edit_prep(); A The on the second pass, I'm stuck. I can't declare a new instance of A edit_tag_data. A And, it appears the object is gone after I leave the page. A Will the class structure do this for me or must I save the values in A $GLOBAL or something? A Thanks You need to pass the values to the next page or save them in a session -- 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] Creating local vars from HTTP Post Array
I'm re-coding a fairly large multi step form which was written with PHP's register globals turned on. Since upgrading PHP this form has stopped working and needs editting. Rather than manually changing each var - $foo to$_POST['foo'] (there are simply too many) i'd like to do something like this - while(list($key, $val) = each($_POST)) eval(\$.$key = stripslashes($value)); using a loop to create local variables for each variable in the HTTP Post array. I'm having trouble getting this to work. Anyone help? Cheers, Javier _ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie question about Class
Hi Al Sessions and objects are quite easy to use in the latest version of PHP, and would be my personal recommendation. I have a coupleof test scripts that I regularly mangle when trying to see if something is doable...if you like, you can contact me offlist and I will mail these to you and you can try it out for yourself. Regards Rory McKinley Nebula Solutions +27 82 857 2391 [EMAIL PROTECTED] There are 10 kinds of people in this world, those who understand binary and those who don't (Unknown) - Original Message - From: Al [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 15, 2003 8:15 PM Subject: Re: [PHP] Newbie question about Class I was afraid that was the case. Tom Rogers wrote: Hi, Thursday, October 16, 2003, 3:35:56 AM, you wrote: A My question seems fundamental. I want to set a variable in one function A in a class and then want to use the value in a second function. A However, the functions are called a html page with two passes. Submit A reloads the page and an if(...) calls the second function in the class. A If I declare on the first run: A $get_data = new edit_tag_file(); A $edit_args= $get_data- edit_prep(); A The on the second pass, I'm stuck. I can't declare a new instance of A edit_tag_data. A And, it appears the object is gone after I leave the page. A Will the class structure do this for me or must I save the values in A $GLOBAL or something? A Thanks You need to pass the values to the next page or save them in a session -- 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] Creating local vars from HTTP Post Array
Rather than manually changing each var - $foo to$_POST['foo'] (there are simply too many) Why not simply use Find and Replace in a text editor, if you only need to change one form? Nick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Looking for a programmer designer to hire
Joseph -- ...and then Joseph Bannon said... % % Are there any sites I can post a bid request for programmers and graphic designers? While I'm happy to hear of the sites mentioned by others (though itmoonlighter has never gotten anything for me), I agree that a post here describing what sort of coder you need to then follow up off-list is fine. I know I'm looking for those so that I can answer them :-) % % J. HTH HAND whatcha need? :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] Dynamic tables
On Fri, 17 Oct 2003 14:42:34 +0800, you wrote: Right now, I am able to change the colour of cells using a drop down menu, and when I clicked on Reload it still remains the colour that I have changed, but when I open the page in another browser, as I echoed the value colour, the browser displayed a mixture of the colour code :grey, pink, blue, etc How can I do it in the way that when I opened up a new browser it will display only the colour that I have changed to earlier on?Hope to get some help soon...thanks for all help given. You're trying to hold state. To do this, you need to use a cookie or a session. There are also several problems with the script you seem to be using (for example, it's open to code injection). Hopefully, you'll be able to tease some sense out of this: ? $valid_colours = array ('Grey' = '#dedede', 'Pink' = '#ffb6c1', 'Blue' = '#87ceeb', 'Yellow' = '#00', 'Cyan' = '#af'); /* valid responses */ session_start(); if (isset ($_POST['textcolour'])) { /* check that incoming textcolour is one of the permitted values */ if (in_array ($_POST['textcolour'], $valid_colours)) { $_SESSION['textcolour'] = $_POST['textcolour']; header (Location: $PHP_SELF); exit (); } } /* if we don't have a colour, default to grey */ if (isset ($_SESSION['textcolour']) == FALSE) { $_SESSION['textcolour'] = $valid_colours['Grey']; } ? html body table bgcolor=? echo ($_SESSION['textcolour']); ? trtdTest/td/tr /table form method=post action=? echo ($PHP_SELF); ? select name=textcolour ? foreach ($valid_colours as $colour = $value) { if ($value == $_SESSION['textcolour']) { echo (option value=\$value\ selected$colour/option); } else { echo (option value=\$value\$colour/option); } } ? /select input type=submit name=change value=Change /form /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session not getting destroyed !
Hi all, My session is not getting destroyed once i close the browser. Problem is only in IE 5 as IE 6+ its getting destroyed. I don't know what is the problem. I looked at the session settings parameters in php.ini file but couldn't figure it out. I am using php 4.2.3 and session.cookie_lifetime is set to 0 also. Please help me out. Thanks in advance Binay
Re: [PHP] SQL injection
Hi i read many thing on sql injection but i just cant sumarize all the information. Most site (PHPadvisory.com, phpsecure.info, other found on google) dont talk to mutch on how to prevent SQL injection. One of the things I tend to do to limit any damage is tell the backend SQL server to not let the web user execute things like drop table. Ie, limit the allowed commands to select, insert, update, delete. Yes, data can be messed with, but it's just another layer of protection. Combined with proper quoting of input, and making sure that numeric input is numeric etc, life is reasonably sane. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating local vars from HTTP Post Array
On Fri, 17 Oct 2003 10:11:57 +, you wrote: I'm re-coding a fairly large multi step form which was written with PHP's register globals turned on. Since upgrading PHP this form has stopped working and needs editting. Rather than manually changing each var - $foo to$_POST['foo'] (there are simply too many) i'd like to do something like this - while(list($key, $val) = each($_POST)) eval(\$.$key = stripslashes($value)); using a loop to create local variables for each variable in the HTTP Post array. foreach ($_POST as $key = $value) { $$key = $value; } Something like that should work. But it's equivalent to turning RG on, so why not just do that? Nothing's going to explode, it's just a language feature. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session not getting destroyed !
On Fri, 17 Oct 2003 15:58:36 +0530, you wrote: My session is not getting destroyed once i close the browser. Problem is only in IE 5 as IE 6+ its getting destroyed. I don't know what is the problem. I looked at the session settings parameters in php.ini file but couldn't figure it out. I am using php 4.2.3 and session.cookie_lifetime is set to 0 also. Are you certain cookie_lifetime is set to 0? print_r (session_get_cookie_params ()); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Count lines or chars
Hi PHP-gurus :-) I'd like to count the lines within a file and store the result within a variable. Every line begins with the char %. Would it be easier to count these chars and how could I do that? Thanks for your help. markus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Count lines or chars
I guess you could do something like : ?php function countLines($filename) { if(file_exists($filename)) { $linecount=0; $fs = file($filename); while (list ($linenum, $linec) = each($fs)) { $linecount++; } return $linecount; } } $local_file = /path/to/testfile.txt; $lines = countLines($local_file); ? That would count all the lines in the file. /Morten -Original Message- From: Markus [mailto:[EMAIL PROTECTED] Sent: 17. oktober 2003 11:25 To: [EMAIL PROTECTED] Subject: [PHP] Count lines or chars Hi PHP-gurus :-) I'd like to count the lines within a file and store the result within a variable. Every line begins with the char %. Would it be easier to count these chars and how could I do that? Thanks for your help. markus -- 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] Count lines or chars
Markus wrote: Hi PHP-gurus :-) I'd like to count the lines within a file and store the result within a variable. Every line begins with the char %. Would it be easier to count these chars and how could I do that? Thanks for your help. markus Maybe this way: $file = file( '/some/file.ext' ); $lines_count = count( $file ); -- Pavel a.k.a. Papi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session not getting destroyed !
Yes its showing 0 only.. Its a weird kind of problem for me .. - Original Message - From: David Otton [EMAIL PROTECTED] To: Binay [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, October 17, 2003 4:16 PM Subject: Re: [PHP] Session not getting destroyed ! On Fri, 17 Oct 2003 15:58:36 +0530, you wrote: My session is not getting destroyed once i close the browser. Problem is only in IE 5 as IE 6+ its getting destroyed. I don't know what is the problem. I looked at the session settings parameters in php.ini file but couldn't figure it out. I am using php 4.2.3 and session.cookie_lifetime is set to 0 also. Are you certain cookie_lifetime is set to 0? print_r (session_get_cookie_params ()); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Offering files from below the webroot
?header('Content-Disposition:attachment; filename=nnn.txt')? Ryan A [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, this has been discussed before on the list but am unable to find it on http://marc.theaimsgroup.com/?l=php-general If anybody can point me to the correct URL or tell me how you did it I would really appreciate it. Problems simple: offer downloads from below the webroot, something like: somsite.co/getFile.php?user=apas=bfil=a.something (a)check if $user with $pas of b is allowed to download a.something (because i dont know if its zip,pdf or what) if yes (b)open a file save dialog, give him the file I can do (a)...how to do (b)? I have checked up fpassthru and readfile...got confused and came here :-D, any pointers? I have also seen some places where the script gives the browser a gibberish url and opens up a save dialog box...this too would help eg: somsite.co/getFile.php?hshgkhsgk9asds223tgsa Thanks in advance. Cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session not getting destroyed !
Binay [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Yes its showing 0 only.. Its a weird kind of problem for me .. - Original Message - From: David Otton [EMAIL PROTECTED] To: Binay [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, October 17, 2003 4:16 PM Subject: Re: [PHP] Session not getting destroyed ! On Fri, 17 Oct 2003 15:58:36 +0530, you wrote: My session is not getting destroyed once i close the browser. Problem is only in IE 5 as IE 6+ its getting destroyed. I don't know what is the problem. I looked at the session settings parameters in php.ini file but couldn't figure it out. I am using php 4.2.3 and session.cookie_lifetime is set to 0 also. Are you certain cookie_lifetime is set to 0? print_r (session_get_cookie_params ()); Do you have a logout page? Something that uses session_destroy() ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 'Return values' from links
fputs ($sp, POST /path/to/script.php HTTP/1.0\r\n); fputs ($sp, Host: $host\r\n); Sorry. That should be HTTP/1.1, of course. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session not getting destroyed !
On Fri, 17 Oct 2003 16:46:45 +0530, you wrote: Yes its showing 0 only.. Its a weird kind of problem for me .. Is the browser really being closed? SID caught in a bookmark? Broken cache? Try starting from bare - delete all IE cookies and run the tests again. Check the cookie on the client side, to make sure it's really set to expire on close: http://www.bykeyword.com/pages/detail3/download-3691.html Sorry I can't offer anything concrete. If the cookie is set to expire, it's probably a problem with your IE install, rather than PHP. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session not getting destroyed !
Don't you have an old cookie in your IE 5? Try clearing all cookies. Binay wrote: Hi all, My session is not getting destroyed once i close the browser. Problem is only in IE 5 as IE 6+ its getting destroyed. I don't know what is the problem. I looked at the session settings parameters in php.ini file but couldn't figure it out. I am using php 4.2.3 and session.cookie_lifetime is set to 0 also. Please help me out. Thanks in advance Binay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] using ImageGIF
Louie Miranda [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] And here's the error [Fri Oct 17 10:52:20 2003] [error] PHP Fatal error: Call to undefined function: imagegif() in /Volumes/WWW_Root/louie/test.php on line 6 -- - Louie Miranda http://www.axishift.com - Original Message - From: Louie Miranda [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 17, 2003 10:46 AM Subject: [PHP] using ImageGIF Im trying to show gif images on a browser, since on my work. Not all are using Internet explorer on windows. One of my test shows on a Mac OS X 10.1 IE 5.5 the jpeg and png files are not supported and only gif images. I tried this syntax to generate gif files.. --php code-- $im = ImageCreate(200, 200); $white = ImageColorAllocate($im, 0xFF, 0xFF, 0xFF); $black = ImageColorAllocate($im, 0x00, 0x00, 0x00); ImageFilledRectangle($im, 50, 50, 150, 150, $black); header(Content-Type: image/gif); ImageGIF($im); --php code-- but the browser returns an error on the image.. (The image http://url cannot be displayed, because it contains errors.) And how would you know that gif is supported? PNG and JPEG is shown on phpinfo(); -- - Louie Miranda http://www.axishift.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php [Fri Oct 17 10:52:20 2003] [error] PHP Fatal error: Call to undefined function: imagegif() in /Volumes/WWW_Root/louie/test.php on line 6 That message confirms that imagegif() is not compiled into PHP. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Creating local vars from HTTP Post Array
try extract($_POST) pete Javier . wrote: I'm re-coding a fairly large multi step form which was written with PHP's register globals turned on. Since upgrading PHP this form has stopped working and needs editting. Rather than manually changing each var - $foo to$_POST['foo'] (there are simply too many) i'd like to do something like this - while(list($key, $val) = each($_POST)) eval(\$.$key = stripslashes($value)); using a loop to create local variables for each variable in the HTTP Post array. I'm having trouble getting this to work. Anyone help? Cheers, Javier _ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Yes!!! BTML v1.0 is here!!!
That tags? It should not be used anyway... Comex [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [EMAIL PROTECTED] Comex: [EMAIL PROTECTED] Bas: Yes, thanx. I always wanted to make a version where you can use multiple tags of one type. And, what do you find of it? Please rate it 1 to 10 Comex [EMAIL PROTECTED] wrote in message I don't know... lol... BTW, what should happen to text not in any tags? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can i print out the files in a directory?
How can i print out all of the files in a directory? I want some output as this: index.php login.php image1.gif image2.jpg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How can i print out the files in a directory?[Scanned]
Bas, I think the following should work though it might need some tweaking as it's some weeks since I did: $dir = directoryname; $dp = opendir($dir); $filenames = array(); while($file = readdir($dp)) { array_push($filenames, $file); } // Compile an array of the files for($i = 0; $i count($filenames); $i ++) { if(!(is_dir($dir/$filenames[$i]))) { echo $filenames[$i].br; } } You can probably print out the filenames at the first stage - I think there was a reason why I was passing them into a separate array but I've forgotten what it was!! Regards, Michael Egan -Original Message- From: Bas [mailto:[EMAIL PROTECTED] Sent: 17 October 2003 13:42 To: [EMAIL PROTECTED] Subject: [PHP] How can i print out the files in a directory?[Scanned] How can i print out all of the files in a directory? I want some output as this: index.php login.php image1.gif image2.jpg -- 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] date for mysql
how can I format the current date and time so that I can insert it into a mysql table with an insert query? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with session management
Hi, I have discovered a very strange thing. The problem is that session management fails when I stop the browser while a PHP page is loading. As soon as the browser requests a file with a session_start or session_register command the browser gets in a kinda endless loop and the session file stay open. The browser keeps waiting and waiting and nothing happens (nothing appears on the screen). I'm using PHP4.3.2 / Debian 3.0 Linux 2.4.20 / Apache 1.3.28 My configure command: './configure' '--with-mysql=../mysql/mysql-standard-4.0.12-pc-linux-i686' '--with-apache=../../apache/build_deb/deb2/apache-1.3.28' '--enable-track-vars' '--disable-debug' '--with-gd' '--enable-ftp' '--enable-inline-optimization' '--enable-sockets' '--with-zlib' Has anyone here have had the same problem and can help me? With regards, Catia Crepaldi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can i print out the files in a directory?
hi please see if this is what you need: http://www.raditha.com/php/dir.php Bas wrote: How can i print out all of the files in a directory? I want some output as this: index.php login.php image1.gif image2.jpg -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] date for mysql[Scanned]
Diana, Have a look at the getdate() function. This will return an associative array of a time which you can then use to create the date in the format you wish. Regards, Michael Egan -Original Message- From: Diana Castillo [mailto:[EMAIL PROTECTED] Sent: 17 October 2003 14:29 To: [EMAIL PROTECTED] Subject: [PHP] date for mysql[Scanned] how can I format the current date and time so that I can insert it into a mysql table with an insert query? -- 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] Re: date for mysql
insert into table (date_created) values( now() ) ;-) pete Diana Castillo wrote: how can I format the current date and time so that I can insert it into a mysql table with an insert query? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date for mysql
On Fri, Oct 17, 2003 at 03:28:50PM +0200, Diana Castillo wrote: : : how can I format the current date and time so that I can insert it into a : mysql table with an insert query? That depends on the column type of your MySQL table. Is it a DATETIME? DATE? TIMESTAMP? TIME? Or just a YEAR? http://www.mysql.com/doc/en/Date_and_time_types.html Once you know the column type and its format, you can use PHP's date() function to do the correcting formatting for MySQL. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] variable in e-mail
I would like to use a form in a html page to pass the variables to a php page, which sends an mail including these variables. All I get in the mail though is a 1 rather than the string that I put into the form??? Can anyone help please! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: variable in e-mail
Hi, Sorry, but we are not able to help you without any code from you. Greetz Kristin Schesonka Christian Tischler [EMAIL PROTECTED] schrieb in im Newsbeitrag: [EMAIL PROTECTED] I would like to use a form in a html page to pass the variables to a php page, which sends an mail including these variables. All I get in the mail though is a 1 rather than the string that I put into the form??? Can anyone help please! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] variable in e-mail
Post some code. christian tischler wrote: I would like to use a form in a html page to pass the variables to a php page, which sends an mail including these variables. All I get in the mail though is a 1 rather than the string that I put into the form??? Can anyone help please! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] variable in e-mail
On Fri, 17 Oct 2003 14:51:54 +0100, you wrote: I would like to use a form in a html page to pass the variables to a php page, which sends an mail including these variables. All I get in the mail though is a 1 rather than the string that I put into the form??? Can anyone help please! Reduce your code to a short example that shows your problem, and post it. We can't even begin to help you without that. http://perl.plover.com/Questions.html - most of what's said applies here, too. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] variables in e-mail 2nd
I would like to use a form in a html page to pass the variables to a php page, which sends an mail including these variables. All I get in the mail though is a 1 rather than the string that I put into the form??? Can anyone help please! Some code I use . . . $messagepart1 = ' html head titleFree Subscription/title /head body pSomebody would like to have a free subscription!!!/p '; $messagepart2 = (echo $salutation); $messagepart3 = ' /body /html '; $message = $messagepart1.$messagepart2.$messagepart3; . . . mail([EMAIL PROTECTED], Free Subscription Application, $message, $headers); . . . The $salutation comes from the form and is handed over correctly, but the syntax for to display the value of the variable in the html e-mail seems to be the problem... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] variables in e-mail 2nd
On Fri, 17 Oct 2003 15:09:48 +0100, you wrote: I would like to use a form in a html page to pass the variables to a php page, which sends an mail including these variables. All I get in the mail though is a 1 rather than the string that I put into the form??? Can anyone help please! Some code I use . . . $messagepart1 = ' html head titleFree Subscription/title /head body pSomebody would like to have a free subscription!!!/p '; $messagepart2 = (echo $salutation); $messagepart3 = ' /body /html '; $message = $messagepart1.$messagepart2.$messagepart3; . . . mail([EMAIL PROTECTED], Free Subscription Application, $message, $headers); Missing quotes around the email address. Echo the $message string as you send it, to make sure it contains what you think it contains. $messagepart2 = (echo $salutation); is probably not what you meant. Try $messagepart2 = $salutation; instead. What additional headers are you sending? BTW, if the email address is coming from the outside world (your text implies that), then your form can be used as part of a DoS attack. The $salutation comes from the form and is handed over correctly, but the syntax for to display the value of the variable in the html e-mail seems to be the problem... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] variables in e-mail 2nd
christian tischler wrote: $messagepart2 = (echo $salutation); $messagepart2 = $salutation; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Filemanager v1.0
I have my second program: Filemanager!!! It contains 2 files(this files are in the admin directory of the folder meant in the showindex.php file($dir)): showindex.php --- ?php $dir = /pub/publicfiles/; // Change this to your situation $dp = opendir($dir); $filenames = array(); while($file = readdir($dp)) { array_push($filenames, $file); } // Compile an array of the files for($i = 0; $i count($filenames); $i ++) { if(!(is_dir($dir/$filenames[$i]))) { //echo $filenames[$i].br; echo A HREF=\filemanager.php?pid=openfile=.$filenames[$i].\.$filenames[$i]. /abr; } } ? --- filemanager.php --- ?php /* Filemanager v1.0 v1.0 First Release */ $filename = $_GET['file']; // Read filename from url if ($_GET['pid'] == 'open') { echo HTMLHEADTITLE.$filename./title/head; // echo HTML-code echo bodyh1Contents of $filename/h1br; / more code $filecontents = nl2br(file_get_contents('../'.$filename)); // Read contents of file echo $filecontents; echo bra href=\filemanager.php?pid=editfile=$filename\Edit/a; } if ($_GET['pid'] == 'edit') { echo HTMLHEADTITLEEdit .$filename./title/head; $filecontents = file_get_contents('../'.$filename); echo bodyh1Edit $filename/h1br; echo form name=form action=\filemanager.php?pid=edit2file=$filename\ method=post; echo textarea name=file cols=60 rows=30$filecontents/textarea; echo input type=submit value=Submit; echo /form; } if ($_GET['pid'] == 'edit2') { $newcontent = $_POST['file']; echo HTMLHEADTITLE$filename/title/head; $file = fopen(../.$filename, w+); $result = fwrite($file, $newcontent); echo bodyResultaat.$result; echo bra href=\filemanager.php?pid=openfile=$filename\Open/a; fclose($file); } echo brbrbrsmallCopyright Bas/small/body/html; ? --- Change $dir to your dir / is the root dir of your harddisk If you have any improvements(not deleting files, i have planned that already), Post or mail me!!! You can run it with showindex.php and from there it runs filemanager.php. I would like it if you make a p[osibbility to add files(with the same structure) Regards, Bas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SQL security
Hello list, I was just sitting here thinking how to secure my php code and thought I would run it by the pros. I don't know what the standard practice is to secure against sql injection and malformed information passed from forms. This probably has been done several times I just would like to know if I should do it this way or if there is a better way. What I though to do is create a function that simply went through a variable and removed the quotes. Something that could be used when pulling the variables from the form right of the bat. i.e. $form_var = secure($_POST['var']; after that just do everything else as normal. So I just really looking for advice on securing my web app. BTW: any body heard of or use Cisco's VMPS? Jeremy Russell Network Administrator, CNI 580.235.2377 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] intercepting URLs in a control-system
If you are using PHP as an Apachemodule you also have the option of using a url like http://example.com/index.php/test/test.html Apache will see that test.html is not available and will travel down the directory path til it gets to the index.php (which should exist BTW) and call that script. This seems to work on most default installation of apache using php as apachemodule. (Don't know if this is true for all apache installations and if this still works on apache2) This came up here a week or so ago - it will work with Apache 2.0 if the AcceptPathInfo directive is set correctly: http://httpd.apache.org/docs-2.0/mod/core.html#acceptpathinfo - 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] error reporting
Heh yes umm i know this. But how i could i catch this before is spits out to an ugly error page so i can send to a custom error page. Why would anyone but you ever see a parse error? It's the sort of thing you fix before setting up custom error handling. :) - 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] Use include function (newbie)
I make a site where I list data from a mysql database. I want to divide the task into 2 parts. The 1. php is the logic.php an the 2. is the html table (html.php) with field values. I plan that the form action in the html.php file call the logic.php but the logic.php includes the html.php. I mean: html.php form action=logic.php ... logic.php ... include('html.php'); On the html.php user can view data and use last, first, next,... buttons to see the whole table. Question: Is it a right way to do this task or this reqursive calls overloads the server? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SQL security
--- Jeremy Russell [EMAIL PROTECTED] wrote: I was just sitting here thinking how to secure my php code and thought I would run it by the pros. I don't know what the standard practice is to secure against sql injection and malformed information passed from forms. This probably has been done several times I just would like to know if I should do it this way or if there is a better way. What I though to do is create a function that simply went through a variable and removed the quotes. Something that could be used when pulling the variables from the form right of the bat. i.e. $form_var = secure($_POST['var']; Watch that closing paren. :-) I am aware of a project that I believe attempts to do what you are wanting: http://linux.duke.edu/projects/mini/htmlfilter/ Basically, it tries to help you out by eliminating some common attacks. While this is certainly better than nothing, it shouldn't be used as an excuse to not filter your data. This filter uses a blacklist approach, where bad stuff is filtered. You should add another layer of data filtering that follows a whitelist approach, where you only allow good stuff. Doing otherwise makes your application as secure as a Windows workstation with a virus scanner - you might be protected against known attacks, but as soon as someone comes up with something new, your defenses are irrelevant. Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How can i print out the files in a directory?
This has been working for me... just pass the function the path to the directory you want the listing for. function getDirFiles($dirPath){ if ($handle = opendir($dirPath)) { while (false !== ($file = readdir($handle))) { if ($file != . $file != ..) { $filesArr[] = trim($file); } } closedir($handle); } return $filesArr; } hth, Craig -Original Message- From: Bas [mailto:[EMAIL PROTECTED] Sent: October 17, 2003 6:42 AM To: [EMAIL PROTECTED] Subject: [PHP] How can i print out the files in a directory? How can i print out all of the files in a directory? I want some output as this: index.php login.php image1.gif image2.jpg -- 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] Filemanager v1.0
Bas wrote: I have my second program: Filemanager!!! It contains 2 files(this files are in the admin directory of the folder meant in the showindex.php file($dir)): showindex.php --- ?php $dir = /pub/publicfiles/; // Change this to your situation $dp = opendir($dir); $filenames = array(); while($file = readdir($dp)) { array_push($filenames, $file); } // Compile an array of the files for($i = 0; $i count($filenames); $i ++) { if(!(is_dir($dir/$filenames[$i]))) { //echo $filenames[$i].br; echo A HREF=\filemanager.php?pid=openfile=.$filenames[$i].\.$f ilenames[$i]. /abr; } } --- filemanager.php --- ?php /* Filemanager v1.0 v1.0 First Release */ $filename = $_GET['file']; // Read filename from url if ($_GET['pid'] == 'open') { echo HTMLHEADTITLE.$filename./title/head; // echo HTML-code echo bodyh1Contents of $filename/h1br; / more code $filecontents = nl2br(file_get_contents('../'.$filename)); // Read contents of file echo $filecontents; echo bra href=\filemanager.php?pid=editfile=$filename\Edit/a; } if ($_GET['pid'] == 'edit') { echo HTMLHEADTITLEEdit .$filename./title/head; $filecontents = file_get_contents('../'.$filename); echo bodyh1Edit $filename/h1br; echo form name=form action=\filemanager.php?pid=edit2file=$filename\ method=post; echo textarea name=file cols=60 rows=30$filecontents/textarea; echo input type=submit value=Submit; echo /form; } if ($_GET['pid'] == 'edit2') { $newcontent = $_POST['file']; echo HTMLHEADTITLE$filename/title/head; $file = fopen(../.$filename, w+); $result = fwrite($file, $newcontent); echo bodyResultaat.$result; echo bra href=\filemanager.php?pid=openfile=$filename\Open/a; fclose($file); } echo brbrbrsmallCopyright Bas/small/body/html; ? --- Change $dir to your dir / is the root dir of your harddisk If you have any improvements(not deleting files, i have planned that already), Post or mail me!!! You can run it with showindex.php and from there it runs filemanager.php. I would like it if you make a p[osibbility to add files(with the same structure) Regards, Bas Just my experience... I had a very nice program like this.. Had it protected with htaccess... Someone got into it somehow.. I don't know if it was on the inside or outside, but they really messed up my machine.. Had to reload Redhat :-( Jake McHenry Nittany Travel MIS Coordinator http://www.nittanytravel.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SQL security
On Fri, Oct 17, 2003 at 09:38:12AM -0500, Jeremy Russell wrote: : :I was just sitting here thinking how to secure my php code and : thought I would run it by the pros. I don't know what the standard : practice is to secure against sql injection and malformed information : passed from forms. This probably has been done several times I just : would like to know if I should do it this way or if there is a better : way. If you're using MySQL, you can use mysql_real_escape_string(). If you're using another database, hopefully there is a similar function. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Shouldn't script errors show in my browser?
I hope this question is not too stupid! When I have an error in my script, it seems to me that the web server, or in my case the php CGI module I am using for testing, should send something back to my browser displaying an error message. Instead, I can write any garbage I would like in my php script and the browser just shows me a blank page. Is this because I am running php as a CGI module? Thanks, Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Shouldn't script errors show in my browser?
On Fri, 17 Oct 2003 11:29:41 -0400, you wrote: I hope this question is not too stupid! When I have an error in my script, it seems to me that the web server, or in my case the php CGI module I am using for testing, should send something back to my browser displaying an error message. Instead, I can write any garbage I would like in my php script and the browser just shows me a blank page. Is this because I am running php as a CGI module? Try cranking your error reporting level up in php.ini http://uk2.php.net/manual/en/ref.errorfunc.php#ini.error-reporting Check the display_errors directive while you're at it. Don't forget to restart the webserver. Also, sometimes errors don't show because they're embedded in HTML. Eg font face=? echo($fake_variable); ? would return font face=br /bNotice/b: Undefined variable: fake_variable in bfile.php/b on line b1/bbr / And you'll have to examine the un-parsed HTML to find the error. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: SQL security
take a look at this http://phpinsider.com/php/code/SafeSQL/ pete Jeremy Russell wrote: Hello list, I was just sitting here thinking how to secure my php code and thought I would run it by the pros. I don't know what the standard practice is to secure against sql injection and malformed information passed from forms. This probably has been done several times I just would like to know if I should do it this way or if there is a better way. What I though to do is create a function that simply went through a variable and removed the quotes. Something that could be used when pulling the variables from the form right of the bat. i.e. $form_var = secure($_POST['var']; after that just do everything else as normal. So I just really looking for advice on securing my web app. BTW: any body heard of or use Cisco's VMPS? Jeremy Russell Network Administrator, CNI 580.235.2377 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Use include function (newbie)
Karina S mailto:[EMAIL PROTECTED] on Friday, October 17, 2003 8:02 AM said: Question: Is it a right way to do this task or this reqursive calls overloads the server? Maybe I'm misunderstanding you but I didn't see anything wrong with the example you gave. Maybe someone else will understand better, or you could try rephrasing your question. HTH, Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can i print out the files in a directory?
you can use simply exec(ls -l 21;, $output) : if on linux OR exec(dir 21;, $output): if on windows Enjoy Nitin - Original Message - From: Craig Lonsbury [EMAIL PROTECTED] To: Bas [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, October 17, 2003 8:40 PM Subject: RE: [PHP] How can i print out the files in a directory? This has been working for me... just pass the function the path to the directory you want the listing for. function getDirFiles($dirPath){ if ($handle = opendir($dirPath)) { while (false !== ($file = readdir($handle))) { if ($file != . $file != ..) { $filesArr[] = trim($file); } } closedir($handle); } return $filesArr; } hth, Craig -Original Message- From: Bas [mailto:[EMAIL PROTECTED] Sent: October 17, 2003 6:42 AM To: [EMAIL PROTECTED] Subject: [PHP] How can i print out the files in a directory? How can i print out all of the files in a directory? I want some output as this: index.php login.php image1.gif image2.jpg -- 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] Shouldn't script errors show in my browser?
Yeah, that did it, thanks David Otton [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Fri, 17 Oct 2003 11:29:41 -0400, you wrote: I hope this question is not too stupid! When I have an error in my script, it seems to me that the web server, or in my case the php CGI module I am using for testing, should send something back to my browser displaying an error message. Instead, I can write any garbage I would like in my php script and the browser just shows me a blank page. Is this because I am running php as a CGI module? Try cranking your error reporting level up in php.ini http://uk2.php.net/manual/en/ref.errorfunc.php#ini.error-reporting Check the display_errors directive while you're at it. Don't forget to restart the webserver. Also, sometimes errors don't show because they're embedded in HTML. Eg font face=? echo($fake_variable); ? would return font face=br /bNotice/b: Undefined variable: fake_variable in bfile.php/b on line b1/bbr / And you'll have to examine the un-parsed HTML to find the error. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Hanmir I'm gonna kill you, you son of a..........
Ryan A mailto:[EMAIL PROTECTED] on Thursday, October 16, 2003 6:35 PM said: Has this crap from hanmir started again? Yes. Am I the only one who is getting these damn messages? And no. One thing that's strange though is that my sendmail /etc/mail/access rule does not work for these emails. Anyone know why? I've set it up so that [EMAIL PROTECTED] is REJECT'd. But for some reason the emails still come through. All my other REJECT rules work, but just not this one. I can only imagine that the reason is because the address sendmail is checking does not end up being hanmir.com. BUT I looked through the email headers and the hanmir.com domain is plastered all over the place! Anyone know what's up? Chris. p.s. I didn't start a new thread since we might as well keep all the OT hanmir stuff in one place. kthxbye! -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Use include function (newbie)
But *why* does logic.php need html.php? There is no recursion issue, or endless nesting of includes, because html.php refers to logic.php as an action for a form... this does not include the logic.php code into the html.php page. Rich Karina S [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I make a site where I list data from a mysql database. I want to divide the task into 2 parts. The 1. php is the logic.php an the 2. is the html table (html.php) with field values. I plan that the form action in the html.php file call the logic.php but the logic.php includes the html.php. I mean: html.php form action=logic.php ... logic.php ... include('html.php'); On the html.php user can view data and use last, first, next,... buttons to see the whole table. Question: Is it a right way to do this task or this reqursive calls overloads the server? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SQL security
Eugene Lee mailto:[EMAIL PROTECTED] on Friday, October 17, 2003 8:20 AM said: If you're using MySQL, you can use mysql_real_escape_string(). If you're using another database, hopefully there is a similar function. Doesn't MySQL automatically protect against attacks like SQL injection? Or maybe it's that it automatically applies addslashes()? I can't remember exactly. c. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SQL security
--- Chris W. Parker [EMAIL PROTECTED] wrote: Doesn't MySQL automatically protect against attacks like SQL injection? Or maybe it's that it automatically applies addslashes()? Nope and nope. What you might be thinking of is that mysql_query() only allows a single query to be executed. This helps, but it doesn't prevent everything. It only prevents SQL injection attacks that attempt to terminate the current query and execute another one. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SQL security
If you're using MySQL, you can use mysql_real_escape_string(). If you're using another database, hopefully there is a similar function. Doesn't MySQL automatically protect against attacks like SQL injection? Or maybe it's that it automatically applies addslashes()? I can't remember exactly. No - I don't think any database could automatically protect against SQL injection, since the basis of that attack is the malformation of queries before they even hit the DB. There is a magic quotes feature, which adds slashes to request variable. You may be thinking of that: http://php.net/manual/en/ref.info.php#ini.magic-quotes-gpc - 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] (ANNOUNCE) codeSECURE 1.0 released - - Protecting PHP code
Greetings everyone, We have just launched a new product called codeSECURE and would like you to check it out. codeSECURE is a PHP obfuscator. Basically codeSecure is a small collection of scripts to obfuscate or garble up php code so that PHP developers can protect their intellectual property, distribute locked php scripts, time expiring scripts etc. While making it nearly impossible for a human to understand or read your code/scripts, they will cause no problem for the computer to decipher and run. E.g. $a=Hello world; will become something like $23sfaAST3s=v4Mwuz?24fz{(2{w; For details, check us out at http://www.secureCents.com If you have any questions...fire away, I and my partner will try our best to answer all questions/suggestions/criticisms etc. Regards, JB. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SQL security
Mike Migurski mailto:[EMAIL PROTECTED] on Friday, October 17, 2003 9:15 AM said: There is a magic quotes feature, which adds slashes to request variable. You may be thinking of that: Whoops! Yeah, that's what I'm talking about. Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] (ANNOUNCE) codeSECURE 1.0 released - - Protecting PHP code
You announced this already on Wednesday. So re-announcing the same version seems kinda redundant. Cheers, Rob. On Fri, 2003-10-17 at 12:19, John Black wrote: Greetings everyone, We have just launched a new product called codeSECURE and would like you to check it out. [--CLIPITTY CLIP CLIP--] -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] (ANNOUNCE) codeSECURE 1.0 released - - Protecting PHP code
oops sorry. We had a small problem, we sent this to most of the php lists like SMART,announce etc and we made the mistake of BCCing it there, php.net sent it back to us as BCCing is not allowed to the list/s so we were unsure if we posted it here. Our apologies to everyone. -JB You announced this already on Wednesday. So re-announcing the same version seems kinda redundant. Cheers, Rob. On Fri, 2003-10-17 at 12:19, John Black wrote: Greetings everyone, We have just launched a new product called codeSECURE and would like you to check it out. [--CLIPITTY CLIP CLIP--] -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- 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: Weird results for 2 lines of damn code
Don't mention it =) -- Jon Kriek http://phpfreaks.com Hey, Thanks, it works!! Replace %G _with_ %Y cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Weird results for 2 lines of damn code
Don't mention it =) -- Jon Kriek http://phpfreaks.com Hey, Thanks, it works!! Replace %G _with_ %Y cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Login system
I want a login system with sessions and without mysql. I have tried to make one but that one is without sessions(i don't know anything about sessions) and with mysql... Regards, Bas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login system
On Fri, 2003-10-17 at 12:57, Bas wrote: I want a login system with sessions and without mysql. I have tried to make one but that one is without sessions(i don't know anything about sessions) and with mysql... InterJinn supports file based sessions, but you'll hafta write your own login since that's generally trivial to do and everyone has a different way they'd like to do it. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login system
Yes sorry, but i don't use such things like your interjin... Robert Cummings [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Fri, 2003-10-17 at 12:57, Bas wrote: I want a login system with sessions and without mysql. I have tried to make one but that one is without sessions(i don't know anything about sessions) and with mysql... InterJinn supports file based sessions, but you'll hafta write your own login since that's generally trivial to do and everyone has a different way they'd like to do it. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login system
That's seems contradictory. It's pre-written code and you appear to be requesting pre-written code. *shrug*. I think silently ignoring my post would have sufficed, but you appear to be making a statement :/ Cheers, Rob. On Fri, 2003-10-17 at 13:04, Bas wrote: Yes sorry, but i don't use such things like your interjin... Robert Cummings [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Fri, 2003-10-17 at 12:57, Bas wrote: I want a login system with sessions and without mysql. I have tried to make one but that one is without sessions(i don't know anything about sessions) and with mysql... InterJinn supports file based sessions, but you'll hafta write your own login since that's generally trivial to do and everyone has a different way they'd like to do it. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login system
On Fri, Oct 17, 2003 at 07:04:27PM +0200, Bas wrote: : Robert Cummings [EMAIL PROTECTED] wrote: : On Fri, 2003-10-17 at 12:57, Bas wrote: : : I want a login system with sessions and without mysql. : : I have tried to make one but that one is without sessions (i don't : know anything about sessions) and with mysql... : : InterJinn supports file based sessions, but you'll hafta write your : own login since that's generally trivial to do and everyone has a : different way they'd like to do it. : : Yes sorry, but i don't use such things like your interjin... InterJinn is one solution. There are others. Since you don't explain your reasons for thinking that InterJinn is not a reasonable solution, you've made it that much more difficult for people to try to help you when you don't provide any additional specifics. But you are certainly free to write your own session manager. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login system
Okay, what are the very very basic functions to make a session? Eugene Lee [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Fri, Oct 17, 2003 at 07:04:27PM +0200, Bas wrote: : Robert Cummings [EMAIL PROTECTED] wrote: : On Fri, 2003-10-17 at 12:57, Bas wrote: : : I want a login system with sessions and without mysql. : : I have tried to make one but that one is without sessions (i don't : know anything about sessions) and with mysql... : : InterJinn supports file based sessions, but you'll hafta write your : own login since that's generally trivial to do and everyone has a : different way they'd like to do it. : : Yes sorry, but i don't use such things like your interjin... InterJinn is one solution. There are others. Since you don't explain your reasons for thinking that InterJinn is not a reasonable solution, you've made it that much more difficult for people to try to help you when you don't provide any additional specifics. But you are certainly free to write your own session manager. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login system
Okay, here is what i want: * Login system * No mysql * Sessions * Easy adjustable register page(copy generic files to dir of user) Eugene Lee [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Fri, Oct 17, 2003 at 07:04:27PM +0200, Bas wrote: : Robert Cummings [EMAIL PROTECTED] wrote: : On Fri, 2003-10-17 at 12:57, Bas wrote: : : I want a login system with sessions and without mysql. : : I have tried to make one but that one is without sessions (i don't : know anything about sessions) and with mysql... : : InterJinn supports file based sessions, but you'll hafta write your : own login since that's generally trivial to do and everyone has a : different way they'd like to do it. : : Yes sorry, but i don't use such things like your interjin... InterJinn is one solution. There are others. Since you don't explain your reasons for thinking that InterJinn is not a reasonable solution, you've made it that much more difficult for people to try to help you when you don't provide any additional specifics. But you are certainly free to write your own session manager. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login system
I want to try that InterJinn out but... is it free? Robert Cummings [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] That's seems contradictory. It's pre-written code and you appear to be requesting pre-written code. *shrug*. I think silently ignoring my post would have sufficed, but you appear to be making a statement :/ Cheers, Rob. On Fri, 2003-10-17 at 13:04, Bas wrote: Yes sorry, but i don't use such things like your interjin... Robert Cummings [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Fri, 2003-10-17 at 12:57, Bas wrote: I want a login system with sessions and without mysql. I have tried to make one but that one is without sessions(i don't know anything about sessions) and with mysql... InterJinn supports file based sessions, but you'll hafta write your own login since that's generally trivial to do and everyone has a different way they'd like to do it. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login system
On Fri, 2003-10-17 at 13:31, Bas wrote: I want to try that InterJinn out but... is it free? It is free for non-revenue generating purposes. http://www.interjinn.com/licenses/public.phtml Otherwise there's an inexpensive license. Cheers, Rob. Robert Cummings [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] That's seems contradictory. It's pre-written code and you appear to be requesting pre-written code. *shrug*. I think silently ignoring my post would have sufficed, but you appear to be making a statement :/ Cheers, Rob. On Fri, 2003-10-17 at 13:04, Bas wrote: Yes sorry, but i don't use such things like your interjin... Robert Cummings [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Fri, 2003-10-17 at 12:57, Bas wrote: I want a login system with sessions and without mysql. I have tried to make one but that one is without sessions(i don't know anything about sessions) and with mysql... InterJinn supports file based sessions, but you'll hafta write your own login since that's generally trivial to do and everyone has a different way they'd like to do it. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login system
Do you mean non-commercial? i plan to use it at home to test some websites and showing them to my friends Robert Cummings [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Fri, 2003-10-17 at 13:31, Bas wrote: I want to try that InterJinn out but... is it free? It is free for non-revenue generating purposes. http://www.interjinn.com/licenses/public.phtml Otherwise there's an inexpensive license. Cheers, Rob. Robert Cummings [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] That's seems contradictory. It's pre-written code and you appear to be requesting pre-written code. *shrug*. I think silently ignoring my post would have sufficed, but you appear to be making a statement :/ Cheers, Rob. On Fri, 2003-10-17 at 13:04, Bas wrote: Yes sorry, but i don't use such things like your interjin... Robert Cummings [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Fri, 2003-10-17 at 12:57, Bas wrote: I want a login system with sessions and without mysql. I have tried to make one but that one is without sessions(i don't know anything about sessions) and with mysql... InterJinn supports file based sessions, but you'll hafta write your own login since that's generally trivial to do and everyone has a different way they'd like to do it. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login system
Bas, I think a suggested reading would be www.php.net/man. It's the PHP manual and can answer many, if not all, of your questions related to sessions. Yes, even questions like what are the basic functions to make a session. I am usually not one of the people that get uptight about certain types of questions this list, but it is unbelievably easy to find the answer to your question. For instance, simply typing something like http://www.php.net/session will bring up a page titled Session handling functions. You don't even need to know if that's a real website because the PHP site will automatically help you find what you're looking for, to a certain extent, when you enter keywords in after the /. Over the past few days there was an e-mail sent around with helpful PHP links. It probably wouldn't hurt to check there as well, as I'm guessing all the sites cover the very basic concepts and code you are requesting. - Chris Wanstrath On Fri, 2003-10-17 at 13:21, Bas wrote: Okay, what are the very very basic functions to make a session? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login system
Okay, here is what i want: [snip!] Forget about what you want. Here's what you need: http://www.php.net/manual/en/ref.session.php http://www.phpclasses.org/goto/browse.html/class/21.html http://www.devarticles.com/art/1/639 Almost everyone needs to use sessions and user authentication eventually. That's precisely why there are so many articles, tutorials, and classes available. Edward Dudlik Those who say it cannot be done should not interfere with the person doing it. wishy washy | www.amazon.com/o/registry/EGDXEBBWTYUU - Original Message - From: Bas [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, 17 October, 2003 13:23 Subject: Re: [PHP] Login system Okay, here is what i want: * Login system * No mysql * Sessions * Easy adjustable register page(copy generic files to dir of user) Eugene Lee [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Fri, Oct 17, 2003 at 07:04:27PM +0200, Bas wrote: : Robert Cummings [EMAIL PROTECTED] wrote: : On Fri, 2003-10-17 at 12:57, Bas wrote: : : I want a login system with sessions and without mysql. : : I have tried to make one but that one is without sessions (i don't : know anything about sessions) and with mysql... : : InterJinn supports file based sessions, but you'll hafta write your : own login since that's generally trivial to do and everyone has a : different way they'd like to do it. : : Yes sorry, but i don't use such things like your interjin... InterJinn is one solution. There are others. Since you don't explain your reasons for thinking that InterJinn is not a reasonable solution, you've made it that much more difficult for people to try to help you when you don't provide any additional specifics. But you are certainly free to write your own session manager. -- 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] Login system
[snip] Okay, here is what i want: * Login system * No mysql * Sessions * Easy adjustable register page(copy generic files to dir of user) [/snip] Let's see, bas releases not one, but two applications this week and then condemns another'swhoa. Bas, RTFM at http://us4.php.net/session -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login system
On Fri, 2003-10-17 at 13:39, Bas wrote: Do you mean non-commercial? i plan to use it at home to test some websites and showing them to my friends The term non-commercial was purposefully not used in the license because it is too narrow of a definition. The license should be quite clear on what constitutes free-use. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login system
Which one does not use mysql and is free? [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Okay, here is what i want: [snip!] Forget about what you want. Here's what you need: http://www.php.net/manual/en/ref.session.php http://www.phpclasses.org/goto/browse.html/class/21.html http://www.devarticles.com/art/1/639 Almost everyone needs to use sessions and user authentication eventually. That's precisely why there are so many articles, tutorials, and classes available. Edward Dudlik Those who say it cannot be done should not interfere with the person doing it. wishy washy | www.amazon.com/o/registry/EGDXEBBWTYUU - Original Message - From: Bas [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, 17 October, 2003 13:23 Subject: Re: [PHP] Login system Okay, here is what i want: * Login system * No mysql * Sessions * Easy adjustable register page(copy generic files to dir of user) Eugene Lee [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Fri, Oct 17, 2003 at 07:04:27PM +0200, Bas wrote: : Robert Cummings [EMAIL PROTECTED] wrote: : On Fri, 2003-10-17 at 12:57, Bas wrote: : : I want a login system with sessions and without mysql. : : I have tried to make one but that one is without sessions (i don't : know anything about sessions) and with mysql... : : InterJinn supports file based sessions, but you'll hafta write your : own login since that's generally trivial to do and everyone has a : different way they'd like to do it. : : Yes sorry, but i don't use such things like your interjin... InterJinn is one solution. There are others. Since you don't explain your reasons for thinking that InterJinn is not a reasonable solution, you've made it that much more difficult for people to try to help you when you don't provide any additional specifics. But you are certainly free to write your own session manager. -- 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] variables in e-mail 2nd
What I do is make a PHP page/template with php variables in place. Then do something like this... $report = path/to/mytemp.php; $today = date(); ob_start(); include($report); $message = ob_get_contents(); ob_end_clean(); //echo $message; $to = Daevid Vincent [EMAIL PROTECTED]; //$to .= , .Daevid Vincent [EMAIL PROTECTED]; // note the comma $headers = MIME-Version: 1.0\r\n; //$headers .= Content-type: text/plain; charset=iso-8859-1\r\n; $headers .= Content-type: text/html; charset=iso-8859-1\r\n; $headers .= From: CRiMson .WEBMASTER.\r\n; //$headers .= Cc: [EMAIL PROTECTED]; //$headers .= Bcc: [EMAIL PROTECTED]; //$headers .= Reply-To: .$myname. .$myreplyemail.\r\n; //$headers .= X-Priority: 1\r\n; //$headers .= X-MSMail-Priority: High\r\n; $headers .= X-Mailer: CRiMson Server; $subject = my report; // echo $message; mail($to, $subject, $message, $headers); That's the slick as shit solution. Then PHP will pull in your 'template' page and any variables or whatever are executed in the template $report, plus any that you have in your program (such as $today) are passed in to $message as well... Daevid Vincent http://daevid.com -Original Message- From: christian tischler [mailto:[EMAIL PROTECTED] Sent: Friday, October 17, 2003 7:10 AM To: [EMAIL PROTECTED] Subject: [PHP] variables in e-mail 2nd I would like to use a form in a html page to pass the variables to a php page, which sends an mail including these variables. All I get in the mail though is a 1 rather than the string that I put into the form??? Can anyone help please! Some code I use . . . $messagepart1 = ' html head titleFree Subscription/title /head body pSomebody would like to have a free subscription!!!/p '; $messagepart2 = (echo $salutation); $messagepart3 = ' /body /html '; $message = $messagepart1.$messagepart2.$messagepart3; . . . mail([EMAIL PROTECTED], Free Subscription Application, $message, $headers); . . . The $salutation comes from the form and is handed over correctly, but the syntax for to display the value of the variable in the html e-mail seems to be the problem... -- 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] Login system
[snip] Which one does not use mysql and is free? Forget about what you want. Here's what you need: http://www.php.net/manual/en/ref.session.php http://www.phpclasses.org/goto/browse.html/class/21.html http://www.devarticles.com/art/1/639 [/snip] **slaps forehead** All of them. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RESOLVED, sort of -- Re: [PHP] where is my session data on my new server?
Hi, all -- It appears that the change from 4.2.3 to 4.3.4rc1 was not something that got broken but instead something that got fixed. Oh, yay. But what do I do now? Hmmm... The code ?php session_name('name') ; session_start ; session_register('pw') ; $pwc = realpass ; if ( $pw != $pwc ) { if ( $pw != ) { print Invalid password!br\n ; session_unregister('pw') ; } print form method='post'\n ; print Password:brinput teyp='password' name='pw'br\n ; print input type='submit' value='ENTER'\n/form\n ; session_write_close() ; exit ; } // protected page body here ? used to work but now does not, apparently because now one cannot register a session variable unless a regular var of the same name has already been defined. That is, ?php if ( $_GET['stop'] ) { session_start() ; print pw is .$pw.\n ; exit ; } $pw = pass ; session_register('pw') ; header(Location: ?stop=1) ; ? *does* work. Of course, I have to turn my code inside out or worse to do this (I don't really know where I'm going to go, either; that code is a direct copy of an example shown to me, so I don't yet see how to turn my code inside out to match it). I still don't know what the bug was or how it was fixed or if I can return to the old behavior (which certainly would put me back in business quickly and let me fix all of my code on a reasonable schedule), but at least I think I have it pinned down to 1) not a mis-setting in php.ini and 2) probably not something I can fix quickly. If, based on this, anyone has any more info or pointers, I sure would love them :-) Thanks HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
RE: [PHP] Login system
[snip] Which one does not use mysql and is free? Forget about what you want. Here's what you need: http://www.php.net/manual/en/ref.session.php http://www.phpclasses.org/goto/browse.html/class/21.html http://www.devarticles.com/art/1/639 [/snip] **slaps forehead** All of them, with modification -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strange MySQL result problem
Hey peeps. Let me be quick (or try to at least). Here is a snippet of my db class. function query($sql, $current_line) { $this-Result = mysql_query($sql) or die($this-stop($current_line)); // the following two lines work if they are in the next // method get_query_results() but not when they are in // this method. $this-Result_total_fields = mysql_num_fields($this-Result); $this-Result_total_rows = mysql_num_rows($this-Result); } function get_query_results() { $this-Result_Arr = array(); if($this-Result_total_rows 0) { // initialize counter while($line = mysql_fetch_array($this-Result, MYSQL_BOTH)) { $this-Result_Arr[] = $line; } } mysql_free_result($this-Result); return $this-Result_Arr; } Ok. As the comments in the first method state, those two lines of code do not work* when they are used in the first method. If I put them down into the get_query_results() method they work fine. I can't figure out why this is happening since my code is syntactically correct. Chris. * By do not work I mean it throws the error supplied argument is not a valid MySQL result resource. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] best way to use session vars?
Hi, all -- Well, now that I have to change my code around, I suppose I should learn the best way, if there is one in particular, to manage sessions. Should I use $_SESSION for everything or should I use session_start and session_register and friends instead? Is there a clear win with either one? For my needs right now, I need session vars as a password to access protected pages, as a login basically like a password for other private pages, and to remember a variable's value. It should be pretty simple stuff, but I'd love to plan ahead now for one day when I want to be a bit more fancy. TIA HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
RE: [PHP] Login system
On Fri, 2003-10-17 at 14:02, Jay Blanchard wrote: [snip] Which one does not use mysql and is free? Forget about what you want. Here's what you need: http://www.php.net/manual/en/ref.session.php http://www.phpclasses.org/goto/browse.html/class/21.html http://www.devarticles.com/art/1/639 [/snip] **slaps forehead** All of them, with modification *ROFL* -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Login system
Bas, Based on your (somewhat limited) requirements, I recommend that you look at using Uma. http://sourceforge.net/projects/uma/ It's easy to use, and you can drop it into your application without any trouble. Chris -Original Message- From: Bas [mailto:[EMAIL PROTECTED] Sent: Friday, October 17, 2003 8:58 AM To: [EMAIL PROTECTED] Subject: [PHP] Login system I want a login system with sessions and without mysql. I have tried to make one but that one is without sessions(i don't know anything about sessions) and with mysql... Regards, Bas -- 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