RE: [PHP] Confused a little with = to and grater than ...
I think this is what you mean ?php // This looks cleaner, and is a lot easyer to read! $siteAccessLevel = 2; $gAccessLevel = 1; switch ($siteAccessLevel) { case level-1: $slevel = 0; break; case level-2: $slevel = 1; break; case level-3: $slevel = 2; break; } switch ($gAccessLevel) { case level-1: $glevel = 1; break; case level-2: $glevel = 2; break; case level-3: $glevel = 3; break; } if ($slevel $glevel) { echo Access Granted; }else{ echo You don't belong; } ? -Original Message- From: Philip J. Newman [mailto:[EMAIL PROTECTED] Sent: Saturday, March 15, 2003 8:29 PM To: [EMAIL PROTECTED] Subject: [PHP] Confused a little with = to and grater than ... Importance: Low Well i thought about changeing access levels into numbers so that only LARGER numbers can access lower numbers and Lower numbers can't access anything higher ... if that makes sence ... So 3 can access 2 and 1, 2 can't access 3, but can access 2 and 1 and one can't access 2 or 3, but can 1 ... assuming that $siteAccessLevel is = to eather level-1, level-2 or level-3 ... if ($slevel = $glevel) { is the line i can't seem to get right. *GRIN* any help? code below. if ($siteAccessLevel == level-1) { $slevel = 1; } else if ($siteAccessLevel == level-2) { $slevel = 2; } else if ($siteAccessLevel == level-3) { $slevel = 3; } if ($gAccessLevel == level-1) { $glevel = 1; } else if ($gAccessLevel == level-2) { $glevel = 2; } else if ($gAccessLevel == level-3) { $glevel = 3; } if ($slevel = $glevel) { //LOAD PAGE }else { // ERROR MESSAGE HERE. { -- Philip J. Newman. Head Developer [EMAIL PROTECTED] +64 (9) 576 9491 +64 021-048-3999 -- Friends are like stars You can't allways see them, but they are always there. -- Websites: PhilipNZ.com - Design. http://www.philipnz.com/ [EMAIL PROTECTED] Philip's Domain // Internet Project. http://www.philipsdomain.com/ [EMAIL PROTECTED] Vital Kiwi / NEWMAN.NET.NZ. http://www.newman.net.nz/ [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Hacker problem
If you are really that strict about it coming from you site, have your form page create an image with five letter of number on it - like 4Y6O7. Have it create a new one each time. Then use crypt to encrypt it and put the encrypted one into a form value, have the person that is submitting the form type that into a form box. After they submit it, crypt what they entered and check it against the hidden variable. This is almost full proof - using Mcrypt would be better. This is sorta what you have to do when registering eith slashdot. -Original Message- From: Mirek Novak [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 9:43 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Hacker problem Importance: Low [EMAIL PROTECTED] wrote: Swear filtering is easy, I want to know how to make sure the data is coming from MY formI'm just picky like that. :-) Hi, I've done it via a ticket system - into my form I've added field input type=hidden name=ticket_to_ride value=32-byte long generated ticket - store the ticket number in database (optionally) with TimeToLive - when POST comes, check ticket number with this stored in db - if found and (optionally) within TTL, then you've got POST from your FORM - then delete it from db - attacker must get fresh form with new ticket and must do it within TTL - ticket can be generated via MD5 another way is to add into your page JavaScript (I've seen somewhere) version of MD5 routine and into hidden field add checksum of fields and on arrival revalidate it. of course this is not bullet-proof, but this is way how to make it hard for anybody to fake POST. You can make variations of this for example interleave your form with different tickets and into db store only checksum (MD5) of them, then it becomes nearly impossible to fake form. HTH -- Mirek Novak jabber:[EMAIL PROTECTED] ICQ:119499448 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] sessions terminating randomly please help
Make sure that the url is always the same. For example if a user is at a page http://mysite.com/phpscript.php and you link to http://www.mysite.com/phpscript.php (notice the www) the session might not follow because the url is different. -Original Message- From: freaky deaky [mailto:[EMAIL PROTECTED] Sent: Monday, March 10, 2003 3:26 PM To: [EMAIL PROTECTED] Subject: [PHP] sessions terminating randomly please help Importance: Low hi i am experiencing a major problem with sessions expiring randomly in some of my apps. i will log in and start clicking around and then i will eventually arrive at a page that tells me that i'm not logged in anymore. this happens apparently randomly. i have seen it on ie6, ie for mac, netscape 4.7 for pc, and mozilla the apps are hosted on freebsd 4.7-release p2 apache 1.3.27 php version 4.2.3 compiled with --enable-trans-sid i can't go into production if there's the possibility that users will be randomly logged off. i went through all of my code over the weekend, and i don't think i can attribute this to a miscoding: when a user logs in, i create a session with session_start(); $valid_user=$_POST['username']; session_register(valid_user); i have the following code at the top of each page to check to see if the session is valid: session_start(); $valid_user=$_SESSION['valid_user']; global $valid_user; if (session_is_registered(valid_user) {...function to spit out an error message if the session is not valid...;} i have a logout page that destroys the session session_start(); session_destroy(); i also have a javascript timer in the header of every page that redirects to the logout page if the user has been inactive for 20 minutes. i have played around with session.gc_probability, setting it to 100, but that doesn't seem to have fixed the problem. this is a huge problem. if anyone can give some advice, i'd really appreciate it. thanks -- __ http://www.linuxmail.org/ Now with e-mail forwarding for only US$5.95/yr Powered by Outblaze -- 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: sessions terminating randomly please help
Assuming that php is configued to rewrite the url tags, try turning off cokkies in the browser and let the Session if carry over. This might help you debugg it. -Original Message- From: David Chamberlin [mailto:[EMAIL PROTECTED] Sent: Monday, March 10, 2003 3:41 PM To: [EMAIL PROTECTED]; Freaky Deaky Cc: [EMAIL PROTECTED] Subject: [PHP] Re: sessions terminating randomly please help Importance: Low It's possible you're being afflicted with the same problem I am. See the message just one or two above this about Sessions problem. What I found in my debugging is that it had to do with how I was mix-and-matching the way I specified links. Short version of the problem is that http://mysite.org/ has one session and http://www.mysite.org/ has another. In my code, I sometimes have the links as a href=/page and sometimes it's explicit, as a href=http://www.mysite.org/;. So if a user went to the site as http://mysite.org - the pages that used the explicit www.mysite.org would fail. So if there's anything in your pages/links that may change how the link is referred, you may be have different sessions occuring. I would imagine it should be pretty easy for you to debug whether or not this is the problem. Have each of your pages echo out the current session id (echo 'session is '.session_id().'br';) and see if it changes at any point, and especially on the pages that fail. -Dave Freaky Deaky wrote: hi i am experiencing a major problem with sessions expiring randomly in some of my apps. i will log in and start clicking around and then i will eventually arrive at a page that tells me that i'm not logged in anymore. this happens apparently randomly. i have seen it on ie6, ie for mac, netscape 4.7 for pc, and mozilla the apps are hosted on freebsd 4.7-release p2 apache 1.3.27 php version 4.2.3 compiled with --enable-trans-sid i can't go into production if there's the possibility that users will be randomly logged off. i went through all of my code over the weekend, and i don't think i can attribute this to a miscoding: when a user logs in, i create a session with session_start(); $valid_user=$_POST['username']; session_register(valid_user); i have the following code at the top of each page to check to see if the session is valid: session_start(); $valid_user=$_SESSION['valid_user']; global $valid_user; if (session_is_registered(valid_user) {...function to spit out an error message if the session is not valid...;} i have a logout page that destroys the session session_start(); session_destroy(); i also have a javascript timer in the header of every page that redirects to the logout page if the user has been inactive for 20 minutes. i have played around with session.gc_probability, setting it to 100, but that doesn't seem to have fixed the problem. this is a huge problem. if anyone can give some advice, i'd really appreciate it. thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: [PHP-DB] RE: [PHP] Random not working?
You might try getting the random number before the query. -Original Message- From: Rich Gray [mailto:[EMAIL PROTECTED] Sent: Saturday, March 01, 2003 8:37 PM To: Frank Keessen; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DB] RE: [PHP] Random not working? Hi All, I'm trying to get a random record each time this script runs; Only it's giving me everytime the first record back.. No random at all.. // generate and execute query $query = SELECT stedenid, naamstad, stadomschrijvk FROM steden ORDER BY RAND() LIMIT 1; $result = mysql_query($query) or die (Error in query: $query. . mysql_error()); $row = mysql_fetch_object($result); echo $row-naamstad; Version info; PHP 4.3.1 Mysql 3.23.54 When i'm trying to excute the SELECT statement in phpmyadmin; i'm only getting the first record back and when i'm taking off the LIMIT 1 it will display all the records in ascending order so also not in random.. Regards, Frank Frank This really belongs on the MySQL list but there was a known issue with RAND() on 3.23.54 - can you upgrade? If your table has an auto_increment ID column then a workaround would be to use rand() in PHP to generate a random ID then use that with a 'where id = '.$id in your query... HTH Rich -- PHP Database 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] Output Numerical Month as String?
[code] date (F, mktime(0,0,0,6,1,2000)); [\code] Replace 6 with the month number and your on your way -Original Message- From: CF High [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 25, 2003 5:54 PM To: [EMAIL PROTECTED] Subject: [PHP] Output Numerical Month as String? Hey all. Easy question here (can't find the answer in php manual) In Cold Fusion I'm able to format a given numerical month value, say the third month, as #MonthAsString(3)# and it returns March What's the equivalent in PHP? Thanks for any ideas.. --Noah -- -- 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] session_start
Not to be nosey or anything but usually session data will always be saved or not. How come one would want to check to see if is was or not. -Original Message- From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED] Sent: Monday, February 24, 2003 7:49 AM To: Mr Percival Cc: [EMAIL PROTECTED] Subject: Re: [PHP] session_start At 13:36 24.02.2003, Mr Percival said: [snip] So how do I check if the session write failed? I thought perhaps if(session_id() == ){ echo error; } but if all session_start does is basically assign a session ID then session_id will never be empty even when the write fails. [snip] You can't check since session write happens _after_ the execution of your script. You could check if ini_get('session.save_path') is writable, or if you are able to create a temp file with some contents on it, but that won't tell you exactly if session writing will be successful - too many different parameters: - what will the size of your session file be? - after your check, how many session files will be written by other instances until it's your turn? - the complete disk usage may change, since you're in a multi-user multi-session environment... Better: make a check if there's enough space left on the session.save_path, on a regular basis (hint: cron job). Make this job either send you an email, or delete orphaned session files (generate a listing and walk it by last access date). -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- 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] Zend Encoder
There is not a way to encrypt something so that is is totaly, positivly, iriversable. As for someone at zend looking at them, there probably is, but they have a duty not to do anything with them. -Original Message- From: Thomas Johnsson [mailto:[EMAIL PROTECTED] Sent: Monday, February 24, 2003 11:51 AM To: [EMAIL PROTECTED] Subject: [PHP] Zend Encoder This might sound a bit paranoid, but since I don't know how it works, i'll ask anyway. If I encrypt a file using the Zend Encoder, is there anyone at zend who can view it, or it it an unreversable encryption? // Thomas -- 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] table width problems
You can use the code below to trim a string to a specified number of charecters. Change 64 to how long you want the string to be. This won't cut words in half. wordwrap( $text, 64, Br, 0); -Original Message- From: Adriaan Nel [mailto:[EMAIL PROTECTED] Sent: Sunday, February 23, 2003 10:27 AM To: [EMAIL PROTECTED] Subject: [PHP] table width problems Hi, I've got a table that gets it's contents from a database, the problem is that even though I specify the width of the table, it is still wider than it's supposed to be, cause some of the info from the table doesn't wrap.my question is if there is a way to force td wrapping when it exceeds the allowed width?? Please help thanks Adriaan -- 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] TO JOSH
Please do not send the same message over and over! And use more descriptive titles! Your code is right, It problem only a problem with your form, browser, or a platform specific platform. Please read http://www.thickbook.com/extra/php_email.phtml Dennis -Original Message- From: Luis A [mailto:[EMAIL PROTECTED] Sent: Sunday, February 23, 2003 3:38 PM To: [EMAIL PROTECTED] Subject: [PHP] TO JOSH what du u think about that ?? look form action=http://www2/LUIS/mai.php3; method=POST INPUT TYPE=text NAME=emailBR INPUT TYPE=text NAME=subjectBR INPUT TYPE=text NAME=senderBR TEXTAREA NAME=message ROWS= COLS=mensage/TEXTAREA INPUT TYPE=submit name =enviar form *** an this is the php script his name is mai.php3 *** ?php mail ([EMAIL PROTECTED], $subject, $message, From: $sender\n. Reply-To: $sender\n); ? whereís the error ERROR IN mai.php3 on line 1 ANY SUBJEST? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] session_start
The manual is right, session_start should always return true. For example using this code: ?php $sess = session_start(); if ($sess = 1){ echo Session start returned TRUE;} ? PHP is set to save to C:\tmp which does not exist. But, because session data is not saved at the beginning of the page where the session_start is called, but at the end there the script is through executing, the session_start still worked. The saving did not. This script would put out the following: - Warning: open(/tmp\sess_01ef33d269ce2ea08b2b8c8899375152, O_RDWR) failed: m (2) in C:\apache\htdocs\blog\test.php on line 2 *** The above is PHP trying to obtain previous session data which it cannot find. Session start returned TRUE Warning: open(/tmp\sess_01ef33d269ce2ea08b2b8c8899375152, O_RDWR) failed: m (2) in Unknown on line 0 Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0 --- Dennis Cole DCW Productions.us -Original Message- From: Mr Percival [mailto:[EMAIL PROTECTED] Sent: Sunday, February 23, 2003 11:52 PM To: [EMAIL PROTECTED] Subject: [PHP] session_start Hi, According to the PHP manual session_start always returns true. Ther are times (like when there is a disk full error on the server) that the sesison_start will fail because its unable to write the session tmp file. So shouldnt session_start be able to return false if the file write fails? Or does it return false but the manual doesnt say so? -- __ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup -- 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] table border colors in html/xml
rant This isn't a PHP thing. /rant And you should use bordercolor=#FF -Original Message- From: Sunfire [mailto:[EMAIL PROTECTED] Sent: Monday, February 24, 2003 1:24 AM To: [EMAIL PROTECTED] Subject: [PHP] table border colors in html/xml hi my client just told me that he wants his table borders shown on his web page to be a darker blue than the default color of html web page tables.. does anybody know how to set the color for the table border color? would it be something like: table bordercolor=x or is it something different... --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 1/11/2003 -- 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] radio buttons
Using a case statment would be the easyest way to tell which one was checked, but technicly one could check all three unless the value of name is changed the same like ... input type=radio name=priority value=this is a general statement?this is a general post input type=radio name=priority value=this is an urgent messagethis is an urgent post input type=radio name=priority value=this is bothering methis is a message i need to post because it bothers me -Original Message- From: Sunfire [mailto:[EMAIL PROTECTED] Sent: Monday, February 24, 2003 1:30 AM To: [EMAIL PROTECTED] Subject: [PHP] radio buttons oh sorry i forgot in the last message too.. he wants 3 radio buttons on a form .. something to the affect of: input type=radio name=general value=this is a general statement?this is a general post input type=radio name=urgent value=this is an urgent messagethis is an urgent post input type=radio name=concern value=this is bothering methis is a message i need to post because it bothers me would this be the right setup for radio buttons and if so what is the best way to tell what one of them is checked without using lots of if else statements or is that unavoidable? or is there even a better way to set up radio buttons altogether... i havent worked with radio buttons all that much and dont know that much about them as far as php goes... --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 1/11/2003 -- 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] Which function?
Use this http://www.php.net/manual/en/function.strstr.php -Original Message- From: John Taylor-Johnston [mailto:[EMAIL PROTECTED] Sent: Monday, February 24, 2003 2:21 AM To: [EMAIL PROTECTED] Subject: [PHP] Which function? Instead of doing this: ?php if ($HTTP_HOST == ccl.flsh.usherbrooke.ca){ ? Which function am I looking for to see if $HTTP_HOST contains compcanlit? This is not what I am looking for: http://www.php.net/manual/en/function.similar-text.php John -- 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] sending results by email
A subjestion would be to use the mail() function to. You can find the mail fuction at http://www.php.net/manual/en/function.mail.php. -Original Message- From: Luis A [mailto:[EMAIL PROTECTED] Sent: Saturday, February 22, 2003 5:42 PM To: [EMAIL PROTECTED] Subject: [PHP] sending results by email how can i make the server email me the results of this form __ form name=form1 method=post action= TEXTAREA NAME= ROWS=10 COLS=26 width =15 /TEXTAREA input type=submit name=Submit value=Enviar table width=100% border=0 height=27 tr tdinput type=checkbox name=checkbox2 value=checkbox no /td /tr /table any subjestion -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Correct number format (curency)
This should also work, without any problems. - Php Code -- ? $total = 1.000,00; $total = str_replace(',','',$total); echo number_format($total, 2, '.', ''); ? - End PHP Code -- - Original Message - From: Bas Jobsen [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 10:05 AM To: Robert Mena; php mailing list Subject: Re: [PHP] Correct number format (curency) Example 1.000,00 1000.00 1,000.00 I would like to convert those to a single format 1000.00 ? function money($money) { /* written by [EMAIL PROTECTED] */ $money=str_replace(array(',','.'),'',$money); $money=substr($money,0,strlen($money)-2).'.'.substr($money,-2); } $money='1.000,00'; money($money); echo $money.\n; $money='1000.00'; money($money); echo $money.\n; $money='1,000.00'; money($money); echo $money.\n; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP][PHP] Money Decimals
I am writing a script that will take amount out of a database then display them on the page. But, some of these are like 46.0 or 46 or 46.005, and they all need to look like 46.00. Is there an easy way to do this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] limiting characters
$words = All I want for Christmas is my two front teeth ; $newwords = trim($words); $pieces = explode( , $words); echo $pieces[0] $pieces[1] $pieces[2] $pieces[3]...; // Retures All I want for... -Original Message- From: Michael P. Carel [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 18, 2003 6:19 PM To: Justin French; [EMAIL PROTECTED] Subject: Re: [PHP] limiting characters it would be better if it will be chopped by words and not by characters. Any idea how? - Original Message - From: Justin French [EMAIL PROTECTED] To: Michael P. Carel [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, February 19, 2003 7:26 AM Subject: Re: [PHP] limiting characters Do you want it chopped at a certain number of words, or characters? Justin French on 19/02/03 10:00 AM, Michael P. Carel ([EMAIL PROTECTED]) wrote: Hi to all, How could i limit the character output that is being displayed in the html page. Is there a function or a php classes that perfectly support it? Example: $myoutput = This is my sample output.; Required Output: This is my Any idea? Thanks in advance for the replies mike -- 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] ASCII/UNICODE Character Translation Comparison in Strings
$txt = björk; $txt = strtr($txt, ÁÉÍÓÚÑÀÈÌÒÙÄËÏÖÜÂÊÎÔÛáéíóúñàèìòùäëïöüâêîôûç, aeiounaeiouaeiouaeiouaeiounaeiouaeiouaeiouc); echo $txt; // Returns bjork -Original Message- From: Chris McCluskey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 18, 2003 7:03 PM To: [EMAIL PROTECTED] Cc: Flint Doungchak; Ethan Nelson Subject: [PHP] ASCII/UNICODE Character Translation Comparison in Strings Hello, I was wondering if there are any native PHP functions that will acomplish what I have set out to do here: I have an issue where I would need to compare international characters, for instance i would want björk to match bjork, i would want ô,ö, and ò to match o; ñ, Ñ to match n. etc... I could just create a function that would do this, and I already have ideas about how to go about this, but before i start coding, i want to make sure there isn't something that PHP does already that could replace what i'm trying to do here. Thanks (yes, i googled already) ;-) -Chris --- _ _ _ _ |'|(_)|_)(_)|_(_)`-, * * * Chris McCluskeyWeb Applications Engineer Modulus, LLC 1720 Willow Creek Circle, Suite 520 Eugene, OR 97402 Email: [EMAIL PROTECTED] Voice: +1 (541) 434-1024 Web..: http://www.modulusgroup.com http://www.modulusgroup.com/ The contents of this transmission may be confidential in nature and should be directed only to the person to whom it is addressed. Do not read, copy, or disseminate this material unless you are the intended recipient. If this transmission reached you in error, please forward the e-mail to the sender to advise, then destroy the transmission you received. Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SQL Query
There is a nice piece of software that you should get, http://ems-hitech.com/mymanager/! It's not free, but you can download a trial. (I would get it) It is great for building querys across tables. -Original Message- From: Zydox [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 11:18 PM To: [EMAIL PROTECTED] Subject: [PHP] SQL Query I have a problem writing a query that can select a Interest for a specific user... There are tvo tables, IList and IIndex... IList contains this : ID SubID Interest Valid Edit Delete 1 0 Datorer 0 Edit Delete 2 1 Spel 0 Edit Delete 3 2 Strategi 0 Edit Delete 4 3 Star Craft 1 Edit Delete 5 3 Star Wars: Gallactic Battelinggrounds 1 Edit Delete 6 2 Shoot-Em-Up 0 Edit Delete 7 6 Half-Life 0 Edit Delete 8 7 Team Fortress 1 Edit Delete 9 7 Counter-Strike 1 And IIndex contains a UserID And InterestID... this query : SELECT DISTINCTROW InterestsList.ID, InterestsList.SubID, InterestsList.Interest, InterestsList.Valid FROM InterestsList AS II RIGHT JOIN InterestsList ON InterestsList.ID=II.SubID LEFT JOIN InterestsIndex ON InterestsList.ID=InterestsIndex.InterestID AND InterestsIndex.UserID='1' Selects all rows from IList... even if there Is'nt any instans in IIndex... this thougt is that a User can choose a Valid Interest and then the query should select all SubInterests... anyone know how to do that ? // Regards Zydox -- 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] File upload problem
MAX_FILE_SIZE only tells the browser how large the file should be. This is why the PHP manual page also says, The MAX_FILE_SIZE is advisory to the browser. It is easy to circumvent this maximum. So don't count on it that the browser obeys your wish! The PHP-settings for maximum-size, however, cannot be fooled. -Original Message- From: Gurhan Ozen [mailto:[EMAIL PROTECTED]] Sent: Monday, February 10, 2003 9:50 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] File upload problem On Sun, 2003-02-09 at 19:43, Jason Wong wrote: On Monday 10 February 2003 05:56, Gurhan Ozen wrote: You need to specifye the MAX_FILE_SIZE value as a hidden argument to the form.. See: http://www.php.net/manual/en/features.file-upload.php You don't. If you can show otherwise please post details to the list. Hi Jason, I remember reading it on the book PHP and MySQL Web development book by Luke Welling and Laura Thompson. I just checked the book again, on page 353, when explaining file upload it reads You must have a form field that sets the maximum size file that can be uploaded. Then it says The name of this form field must be MAX_FILE_SIZE. Also in the PHP manual which can be seen at: http://www.php.net/manual/en/features.file-upload.php, it reads: The _URL_ should point to a PHP file. The MAX_FILE_SIZE hidden field must precede the file input field and its value is the maximum filesize accepted. The value is in bytes. Which sounds like it has to be there to me? I just checked a working file upload form without MAX_FILE_SIZE field, and it worked.. I guess i misunderstood what was on the tutorials ? Or i wonder if this was a must in the earlier versions of PHP? Anyone? And thanks for correcting me.. Gurhan -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* To keep your friends treat them kindly; to kill them, treat them often. */ -- 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] Avoiding several windows with the same session
If you are using cookies the new window will pick it up. Have the original page change a variable to say that it has loaded then when the new window loads have it check that variable first. -Original Message- From: Roman Sanchez [mailto:[EMAIL PROTECTED]] Sent: Friday, February 07, 2003 1:57 PM To: [EMAIL PROTECTED] Subject: [PHP] Avoiding several windows with the same session I place session_start(); if (!session_is_registered('somevar')) { header('location: login.php'); exit(); } at the top of all my pages to prevent people to view pages before they log in. However, once thay have logged in succesfully, they can ctrl-U in IE to open a new window. This new window 'inherits' the session id and hence it does not redirects to the login page. Is there any way to avoid this situation so that people cannot have several windows with the same session open? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail() and sendmail path
You can find this here - http://www.php.net/manual/en/ref.mail.php -Original Message- From: micah lamb [mailto:[EMAIL PROTECTED]] Sent: Friday, February 07, 2003 5:29 PM To: [EMAIL PROTECTED] Subject: [PHP] mail() and sendmail path Is there any way to declare the path to sendmail locally (on the page that has the mail() function) ? I need to use mail() but do not have access to the php.ini file. Micah -- 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