RE: [PHP] help with query
Thanks Jim, worked like a charm. -Original Message- From: Jim Lucas [mailto:li...@cmsws.com] Sent: Thursday, June 07, 2012 4:08 PM To: Jack Cc: PHP Subject: Re: [PHP] help with query On 06/07/2012 09:37 AM, Jack wrote: $query = select a.startdate, a.articleid, c.name, a.title, a.intro, a.datecreated from articles as a, categories as c where (a.startdate = -1 or a.startdate= {$now}) and (a.enddate = -1 or a.enddate= {$now}) and a.categoryid = c.categoryid order by a.startdate DESC; $query = SELECT a.startdate, a.articleid, c.name, a.title, a.intro, a.datecreated FROMarticles as a, categories as c WHERE ( a.startdate = -1 OR a.startdate = {$now} ) AND ( a.enddate = -1 OR a.enddate = {$now} ) -- This line must stay, it is limiting the combination of the data from -- both tables AND a.categoryid = c.categoryid -- You need to add this line to make it work, but keep the previous line AND a.categoryid = 1 ORDER BY a.startdate DESC ; -- Jim Lucas http://www.cmsws.com/ http://www.cmsws.com/examples/ http://www.bendsource.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem with date
How about a little debugging here (and possibly elsewhere): if (isset($pubdate) ($pubdate 0)) { $pubdate=strtotime($pubdate); } else { die(Barf. Can't run a string to time conversion on 0 or -1.); } Thanks Kevin, This bombs and gives me the BARF! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] munge / obfuscate ?
-Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2008 10:02 PM To: Joey Cc: PHP Subject: RE: [PHP] munge / obfuscate ? Hi Joey, Please keep responses on the list so others can also benefit from the learning process. Comments below... On Thu, 2008-03-27 at 21:46 -0400, Joey wrote: -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2008 9:28 PM To: Joey Cc: PHP Subject: Re: [PHP] munge / obfuscate ? On Thu, 2008-03-27 at 21:10 -0400, Joey wrote: Hi All, I have written an app to allow a person to go online and see a picture we take of them. When we link to the picture I don't want it to be obvious that the URL is Domain.Com/Pix/123.jpg because the next person we take a picture of may be 123.jpg, so I am trying to munge/obfuscate the URL to make it less obvious. ?php $sekret = 'the brown cow stomped on the wittle bug'; $id = isset( $_GET['id'] ) ? (int)$_GET['id'] : 0; $key = isset( $_GET['key'] ) ? (string)$_GET['key'] : ''; if( $key == sha1( $key.':'.$sekret ) ) That should have been: if( $key == sha1( $id.':'.$sekret ) ) { header( 'Content-Type: image/jpg' ); readfile( /images/not/in/web/path/$id.jpg ) exit(); } // // Failure... tell them to bugger off :) // header( 'Content-Type: image/jpg' ); readfile( '/images/wherever/you/please/buggerOff.jpg' ); exit(); ? Sorry to be such a newbie... I basically would call this function lets say like: munge( $url ); end in the end be returned the munged url, however, I don't understand the values you have like the readfile with that url -vs- failure? I didn't munge... I provided code for a script that sends the requested image if it was requested with the appropriate key (presumably set wherever the image was linked). If the key doesn't validate then another image is presented. It can say bugger off, it can say not found, it can say whatever you please. By placing the images outside the web root and using a script like this you are virtually guaranteed the visitor can't just request images by making a lucky guess. Let's say the above script was called: getUserImage.php Then you might have the following in your HTML: img src=getUserImage.php?id=123amp;key=4fad1fea72565105d84cb187d1a3ed3bfb9 aba3b / I understand what is happening here, however I really want something simple like: $link =http://www.whataver.com/whateverpath/;; $image = 123456; new_image = munge($image); new_link = $link . $new_image; or maybe new_link = munge($link . $image); Which would encode the whole link. Either way this is what would go into the email message we send out. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OT PHP Programmers
Not sure where to post this, but my company is looking to hire an inhouse PHP programmer. This could be part or full time depending on details. We are not looking to contract an outside company ( doesn't work for us) or to get headhunters etc to call us. If you are a good PHP/MySQL/HTML programmer then drop me an email. You would HAVE to work in our Miami Office ( not to far from 826 Bird Road ). Thanks! Joey
Re: [PHP] Need a function to calculate time difference.
datetime. Thanks Jim Lucas wrote: what type of format does your column take? date time datetime ?? Jim Lucas - Original Message - From: Jack Sasportas [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Wednesday, July 02, 2003 2:11 PM Subject: [PHP] Need a function to calculate time difference. I am trying to find a function or information on how to properly take a start time and an end time from mysql timestamps in order to calculate time taken. So in theory $endtime-$starttime = timespent. It would be great if this understood that 11:55 pm til 12:10am one day apart only equals 15 minutes. Links, example code etc would be great! 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] Need a function to calculate time difference.
I am trying to find a function or information on how to properly take a start time and an end time from mysql timestamps in order to calculate time taken. So in theory $endtime-$starttime = timespent. It would be great if this understood that 11:55 pm til 12:10am one day apart only equals 15 minutes. Links, example code etc would be great! Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help w/ 4.2.3 Problem
I have been running 4.1.2 fine, but decided to compile in the latest version 4.2.3. When I run some existing code that works perfect under 4.1.2, not only does the code not run properly, but there are no error messages in the error_log ( apache file ). also in php.ini I added log_errors = On, and error_log = php_log, but I never see any error messages. Running on RedHat 7.2 with apache_1.3.27, mod_ssl-2.8.12-1.3.27, openssl-0.9.6g, php-4.2.3. ( Again this all ran fine with php-4.1.2 ). Any ideas on where to start ? Thanks -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cookie error after 4.2.3 upgrade
I get the following error when using a previously working cookie function: expects parameter 3 to be long Code is below... I just don't see the difference then the way the doc uses: time() - 3600 -vs- the way I did it below... Thanks ! function f_put_cookie($user_name,$user_email,$account_type,$company_name) { global $HTTP_COOKIE_VARS; global $s_c_url; $l_url = ..$s_c_url; $l_cookie_expireN = date('r', time() - 4000 ); $l_cookie_expire = date('r', time() + 400 ); $l_cookie_expire2 = date('r', time() + 400*30*12 ); setcookie(c_user_email,,$l_cookie_expireN); setcookie(c_user_email,$user_email,$l_cookie_expire2,'/',$l_url,0); setcookie(c_user_name,$user_name,$l_cookie_expire,'/',$l_url,0); setcookie(c_account_type,$account_type,$l_cookie_expire,'/',$l_url,0); setcookie(c_company_name,$company_name,$l_cookie_expire,'/',$l_url,0); setcookie(c_uas_time, GREEN,$l_cookie_expire,'/',$l_url,0); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help w/passing a search parameter that includes space and ,
I have never passed a search value with a space or a comma , in it, but here is the first time. What happens is that IE puts in the space and takes the whole value as the parameter and correctly finds the result we are looking for from the search request, but in Netscape it only sees up to where there is a space or where there is a comma. Here is how the search value looks from the command line in the browser display_products.php?search_value=Toilet Tissue, 2-Ply Within the application it returns there is no match for Toilet which basically tells me that php thinks that's the end of the string being passed to it. Any ideas on how I should get around this ? This is what the db search string looks like: $db_result = mysql_query(select * from $db_tablename where category='$value'); Thanks ! ___ Jack Sasportas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie Question: Converting PHP3 files to PHP4?
One thing I noticed when I did some updates to a few of our programs, is that certain comment lines caused strange errors, and really nothing else. I basically made a backup copy removed comments, and then added them back in which made everything work...not sure if somehow the older box ( using pico ) caused some strange errors that the new version of php spotted, but just in case you are getting things you are not expecting. Good Luck! Michelle Marcicki wrote: Hi there, I have recently taken over the webmaster responsibility for an educational website. It is using PHP3 and MySQL. We had to move it to a new server, that as it turns out only supports PHP4. I have been looking through all the FAQs, resource sites, manuals and documentation, but all I can find as a solution is to change all my current file extensions .php3 to just .php ! Can anyone tell me if this will work before I start converting probably close to several hundred files?? I am going to change and test some files, but would like some advice on this! The type of errors that I get with the current file setup are when clicking on any of the links that lead to files in PHP3 are: You have started to download a file of type application/x-httpd-php3, etc. Any other tips or info would be appreciated. This is a bit urgent, as I have just found out that the site director/owner wants it as functional as possible for the start of school this week... so no pressure really... lol. Thanks in advance. Michelle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] HELP! Frustrating Cookie Problem....
OK I have been using the *same* cookie function to place cookies on the surfers pc and it works for a few hundred people just fine. Now I have a few people that it just won't work for. After extensive testing the only thing I can see is that it is not writing the cookies, we do see it writing the c_user_email cookie, but not others, we even added code to erase the cookie first, and still no luck. Any ideas would be appreciated... function f_put_cookie($user_name,$user_email,$account_type,$company_name) { global $HTTP_COOKIE_VARS; global $s_c_url; $l_url = ..$s_c_url; setcookie(c_user_email,$user_email,(time()+400*30*12),'/',$l_url,0); setcookie(c_user_name,$user_name,(time()+400),'/',$l_url,0); setcookie(c_account_type,$account_type,(time()+400),'/',$l_url,0); setcookie(c_company_name,$company_name,(time()+400),'/',$l_url,0); setcookie(c_uas_time, GREEN,(time()+400),'/',$l_url,0); } ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re:[PHP] IF ELSEIF ELSE??
First you should manage your code nicer so that it is easier to read and troubleshoot. Go through this to find my notes... if (!$HTTP_POST_VARS) { exit();} elseif ($HTTP_POST_VARS) { if (!$Age) { echo Please enter your age.br\n; } if Why would you use elseif above ? you are asking the full question in the first line if (!$HTTP_POST_VARS) { exit();} if it's NOT then why say elseif, it's else, it's either one or the other...that's one thing. so lets change it to this: if (!$HTTP_POST_VARS) { exit(); } else { if (!$Age) { echo Please enter your age.br\n; } if (!$Email) { echo Please enter your email.br\n; } if (!$State) { echo Please enter your Location.br\n; } (MARK) } else ( RIGHT HERE YOU DID NOT OPEN THE REST OF THE ELSE ) echo Thanks for your submission.; ( RIGHT HERE YOU DID NOT CLSE THEN END OF THE CONDITION ) so the last lines replacing after (MARK) should look like this } else { echo Thanks for your submission.; } As you can see keeping the code in this format makes it a lot easier to see what is being exectued within the condition, allows you to see the open closes of the brackets, and should have easily let you see you were missing something. Hope that explains it
Re: [PHP] Re:[PHP] IF ELSEIF ELSE??
Yes, I see what you mean... In showing why the last section didn't work, I messed up the actual overall logic of the code. I should have noticed that...nice catch so for clarification where it says (MARK) should be echo Thanks for your submission.; } Thanks... Jack Sasportas wrote: Yes, I see what you mean... In showing why the last section didn't work, I messed up the actual overall logic of the code. I should have noticed that...nice catch so for clarification where it says (MARK) should be echo Thanks for your submission.; } Thanks... Richard Baskett wrote: Just curious but that last else you told him to put in... what is that referring to? There is already an else statement, you can't have another. Unless you're putting the else statement after the if (!$State) which you would need to subtract the } before the else, but this would give you undesired results since this is just an else for the !$State statement. I could be missing what you were getting at.. it's definitely possible :) Rick First you should manage your code nicer so that it is easier to read and troubleshoot. Go through this to find my notes... if (!$HTTP_POST_VARS) { exit();} elseif ($HTTP_POST_VARS) { if (!$Age) { echo Please enter your age.br\n; } if Why would you use elseif above ? you are asking the full question in the first line if (!$HTTP_POST_VARS) { exit();} if it's NOT then why say elseif, it's else, it's either one or the other...that's one thing. so lets change it to this: if (!$HTTP_POST_VARS) { exit(); } else { if (!$Age) { echo Please enter your age.br\n; } if (!$Email) { echo Please enter your email.br\n; } if (!$State) { echo Please enter your Location.br\n; } (MARK) } else ( RIGHT HERE YOU DID NOT OPEN THE REST OF THE ELSE ) echo Thanks for your submission.; ( RIGHT HERE YOU DID NOT CLSE THEN END OF THE CONDITION ) so the last lines replacing after (MARK) should look like this } else { echo Thanks for your submission.; } As you can see keeping the code in this format makes it a lot easier to see what is being exectued within the condition, allows you to see the open closes of the brackets, and should have easily let you see you were missing something. Hope that explains it -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net
Re: [PHP] templates
Your web browser should have a history option, and you can sift through the list of domains you surfed that approximate time frame ago...Also you can search in some applications like netscape the history file, and look for key things like templates... Good Luck Kurth Bemis wrote: i've been looking for a template site that i used and never bookmarked. I'll tell you what i remember about the site and hopefully someone will know what site i'm talking about. I've spend the last 5 hours looking for this siteso this is my final stab in the dark. The site had 4 categories of templates. one was business templates and the other was user templates. most of the designs were linkware. and most of the templates were in plain html. the site had a lot of templates...150+? does anybody remember a free template site like that? I'm pulling my hair out because ti was a good template site...not one of those cheezy one design 50 different color template sites. ~kurth -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] templates
For future purposes you should set your history to expire some ridiculous time in the future. I still reference sites from as far back as 2 years ago... It's really nice to be able to do that. I use netscape and my setting is 999 days.. Jack Kurth Bemis wrote: At 11:29 AM 7/23/2001, Jack Sasportas wrote: I last visited this site about 2 months ago...too long for any history :-( Your web browser should have a history option, and you can sift through the list of domains you surfed that approximate time frame ago...Also you can search in some applications like netscape the history file, and look for key things like templates... Good Luck Kurth Bemis wrote: i've been looking for a template site that i used and never bookmarked. I'll tell you what i remember about the site and hopefully someone will know what site i'm talking about. I've spend the last 5 hours looking for this siteso this is my final stab in the dark. The site had 4 categories of templates. one was business templates and the other was user templates. most of the designs were linkware. and most of the templates were in plain html. the site had a lot of templates...150+? does anybody remember a free template site like that? I'm pulling my hair out because ti was a good template site...not one of those cheezy one design 50 different color template sites. ~kurth -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP SSI in armony?
The answer is up to you. You make the shtml generate the php, OR the php generate the shtml... My guess is probably php generates the shtml, and the reference to it... I think that should work... Seb Frost wrote: I want to use both PHP and SSI on the same page. My server requires that SSI files are .shtml. If I set it to also treat .shtml files as php files (like I have done with .htm) then what will happen? Will it get parsed first for php and then for ssi, or the other way round? Or puke completely? Or is there a way of doing this that I've overlooked. - seb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Help..Parse error
Actually that is the default setting under 4, and the rest of the code works with the short tags, it's definately something code related... I don;t think it likes that code, but can't find anything to help me resolve the problem. I was hoping not to re-write the code just yet... Thanks Steve Edberg wrote: My guess is that you have the short_open_tags option on in your PHP3 config, but off in your PHP4 config. If it's off, PHP will only recognize the ?php...? tags, not ?...?. PHP config params can be set in php.ini, .htaccess, and/or Apache httpd.conf files. Scroll down to short_open_tag in http://www.php.net/manual/en/configuration.php#configuration.file for more info. You can also check your config via the phpinfo() function. - steve At 1:45 AM -0400 7/20/01, Jack Sasportas wrote: I have some code that runs under php3, but under 4 I get a parse error on this specific line, can't figure out how to resolve it. the code looks like this html stuff ? } ? more html stuff the error is in the middle line which is the end of a condition... Thanks in advance... -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- +-- Factoid: Of the 100 largest economies in the world, 51 are --+ | Steve Edberg University of California, Davis | | [EMAIL PROTECTED] Computer Consultant | | http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ | +--- corporations -- http://www.ips-dc.org/reports/top200text.htm ---+ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Help! Parse error.....
I have some code that runs under php3 perfectly, but now under 4 I get a parse error on this specific line, can't figure out how to resolve it. the code looks like this html stuff ? } ? more html stuff the error is in the middle line which is the end of a condition... Thanks in advance... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Help! Parse error.....
Tried the alternative stuff with no luck... Looking for any crazy ideas that might work... Thanks ! Paul Strange wrote: On Friday 20 July 2001 06:16, Jack Sasportas wrote: I have some code that runs under php3 perfectly, but now under 4 I get a parse error on this specific line, can't figure out how to resolve it. the code looks like this html stuff ? } ? more html stuff the error is in the middle line which is the end of a condition... Thanks in advance... Have you tried using the alternative syntax capabilities? More here: http://www.php.net/manual/en/control-structures.alternative-syntax.php -- Paul Strange Lead Programmer Level 67 LC --- eMail: [EMAIL PROTECTED] Office: 801.486.4686 Fax: 801.994.0467 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Help..Parse error
I have some code that runs under php3, but under 4 I get a parse error on this specific line, can't figure out how to resolve it. the code looks like this html stuff ? } ? more html stuff the error is in the middle line which is the end of a condition... Thanks in advance... -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Troubleshooting syntax ?
OK I'm sure we've all run into this fun problem. Sometimes we forget a /table etc, from our html, and our friend Netscape doesn't display anything if the syntax is wrong or missing. IE on the other hand assumes what you are doing and displays it fine. Can anyone suggest a tool / web site etc, that helps you check the html code for the missing / wrong syntax so that it is spotted quickly like making it red or something, instead of reading through hundreds of lines of code, hopefully catching the problem? Thanks -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] reading records alphebetically
Since you only have a few records, creating a second index with the first letter doesn't apply to you, but is a good idea in a huge db scheme. The simplest fastest way is to take the suggestions a few people made which is SELECT * FROM table WHERE name LIKE '$letter%' I would not suggest this $result = mysql_query(SELECT * FROM table order by name); while ($row = mysql_fetch_array($result)) { extract($row); $first_letter = strtolower($name[0]); } NOT that it won't work, but you should consider CPU in your design, and you don't want to make the computer go through all the records sequentially to display the valid records. This would take a lot longer to deliver the results in a large file, and would consume more resources... Jack Ethan Schroeder wrote: You can either select the letter you want through mysql with SELECT * FROM table WHERE name LIKE '$letter%' Or you can select everything: $result = mysql_query(SELECT * FROM table order by name); while ($row = mysql_fetch_array($result)) { extract($row); $first_letter = strtolower($name[0]); } lets say $name = Fred; then $name[0] is set to F; $name[1] is set to r; $name[2] is set toe; and so on... - Original Message - From: Jamie Saunders [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, June 30, 2001 9:29 AM Subject: [PHP] reading records alphebetically Hi, I have a MySQL database set-up containing a few hundred records. I'm trying to make a script that reads the 'name' field of the records and displays only the records of which the name field begins with a specific letter: if ($letter = A) { display all records of which field 'name' beings with A } else if ($letter = B) { ... I'm just starting out on this, so please excuse my ignorance :) Jamie Saunders [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Cookie ?
I wanted to do something like set the cookie for 5 minutes, then as the user uses the system each page would refresh so to speak the timeout always setting it back to 5 minutes as long as he was using it. I beleive this is not really working. Any Ideas on how I can accomplish this ?? Thanks Here is the function I was using to set the cookies... function f_put_cookie($user_name,$user_email,$account_type) { global $HTTP_COOKIE_VARS; if(isset($c_user_name)) { setcookie(c_uas_time,GREEN,(time()+400),'/','website.com',0); } else { setcookie(c_user_name,$user_name,(time()+400*30*12),'/','.website.com',0); setcookie(c_user_email,$user_email,(time()+400*30*12),'/','.website.com',0); setcookie(c_account_type,$account_type,(time()+400*30*12),'/','.website.com',0); setcookie(c_uas_time, GREEN,(time()+400),'/','.website.com',0); } } ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] security
I realize this is old, but I was just reading through it and noticed there were not many suggestions. My idea would be to have a directory which is in a non-publically viewable place that you can refer to in an include, like include /home/nobodyseesthisfolder/secret file It should bomb when it can't find the file. Now that's not the only thing you can do, because anybody with total server access to their own box can put that file in place, and possibly work around the issue. So I suggest putting some of your core functions in a file in the same folder, that way the program really can't run without that file. Good Luck Randy Johnson wrote: In PHP how do I make it so a script cannot be called from somewhere else other than from my server. Example http://domain.com/mail.php is my mail script that is called by http://domain.com/signup.html How do I make it so http://somebodyelsesdomain.com/signup.html cannot call the mail.php script. thanks Randy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Help..Date Format
OK I have asked the question before and not really gotten the answer, so I will re-word what I am trying to do. First I figured out that part of my problem may be how I am storing the date into mysql from php. Currently we are using the now() function to store the date in one field and the time in another. I know understand what is physically being stored in the db. I am trying to retreive the date value from the mysql db, and display it on the screen in a standard format like 05/08/01. What I get right now is 2001-05-09. Also the time comes out like so: 227:08:22 I have tried this: $t_data_array[1]=date(m/d/y,mysql_result($db_result,$db_record,'date')); and the result is: 12/31/69 formatted nicely but that date is 5/9/2001 not 1969. I have tried several suggestions and other things, but I am not being successful. Here is what I am trying to do: I would like the result of the date to be formatted as 05/01/01 and the time as 18:51 Please give me some very specific instructions, this is a silly thing to be stuck on... $t_data_array[1]=mysql_result($db_result,$db_record,'date'); $t_data_array[2]=mysql_result($db_result,$db_record,'time'); THANKS ! ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MYSQL Password
pass the parameter -p and it will ask you for the password Andreas Pucko wrote: Hello, I am trying to get mysql running and connect via php to it. how can I set the password in a unixshell to get access to it? When I try to access the db I get: Warning: MySQL Connection Failed: Access denied for user: 'root@localhost' (Using password: NO) in /psr/mysqladmin/lib.inc.php on line 255 Error Andy suggestions? Cheers Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Date Time Formatting ??
OK I have read many examples, old posts etc, but I am looking for a detailed explanation as to how to do this. First is when I write to a mysql database using the now() function, the time stamp looks like so when I display the time back to the browser. 204:24:06 ( This should have been 12:24pm ) Also the Date Display like so: 2001-05-08 The Goal is to have the Time stamp looking like 12:24 (military time OK) and the date 05-08-2001 or even 05-08-01. The MySQL db looks like so: date -00-00 time 00:00:00 I don't seem to really be able to vary the DB format. Any examples or links to good docs appreciated Thanks... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Date Time Formatting ??
Here is what I am trying to do, but I get the wrong date: $t_data_array[1]=date(m/d/y,mysql_result($db_result,$db_record,'date')); Then I simply print the value in the arraythis date instead of 05/08/01 comes out 12/31/69 Thanks! Jon Haworth wrote: I think the best way to handle this is not to care what it looks like in the database. Store your dates as UNIX timestamps, and then they are easy to do calculations on and/or convert to any date format you like for displaying in your pages. Read up on date() and mktime() for more info (there are loads of examples in the user notes). HTH Jon -Original Message- From: Jack Sasportas [mailto:[EMAIL PROTECTED]] Sent: 08 May 2001 17:28 To: php Subject: [PHP] Date Time Formatting ?? OK I have read many examples, old posts etc, but I am looking for a detailed explanation as to how to do this. First is when I write to a mysql database using the now() function, the time stamp looks like so when I display the time back to the browser. 204:24:06 ( This should have been 12:24pm ) Also the Date Display like so: 2001-05-08 The Goal is to have the Time stamp looking like 12:24 (military time OK) and the date 05-08-2001 or even 05-08-01. The MySQL db looks like so: date -00-00 time 00:00:00 I don't seem to really be able to vary the DB format. Any examples or links to good docs appreciated Thanks... ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP Java ?
While working on some web sites which contain mouse over java, and then adding in some db stuff via php/mysql, the java seems to break. Is there something special I need to do to prevent that break? Is this a common problem? Does using templates get around that problem ? Thanks ! ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP Java ?
I am echoing the javascript and other html, and at this point *not* putting values into the javascript. I take a string like so: $string= JavaCode HTMLStuff ; I make sure that *everything* in the quotes has only sinlge quotes no double quotes so that PHP doesn't think its the end of the string, then I echo $string; Somehow the java mouseover breaks, then I tried taking the java mouseover single quotes and putting them back to double quotes preceeded by a \ to tell php to ignore that quote, but that didn't work either. Is it the way I am echoing or something ? Thanks ! Peter Dudley wrote: If it's javascript, then be careful about echoing PHP variables into Javascript strings. If you have something like (in Javascript) var myString = '?php echo $phpString; ?'; and $phpString contains any apostrophes, then the javascript will break because Javascript thinks the string has ended prematurely. E.g, if $phpString is My cat's pajamas then the javascript would be sent to the browser thus: var myString = 'My cat's pajamas'; and you can see that there are too many single quotes, which will, of course, cause Javascript's high-powered debugging utilities to kick in and give you a highly useful error report. Pete. While working on some web sites which contain mouse over java, and then adding in some db stuff via php/mysql, the java seems to break. Is there something special I need to do to prevent that break? Is this a common problem? Does using templates get around that problem ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Javascript issue
I am doing a basic mouseiver on a page where some php code also resides. I basically dump the top of the web page through a function page_top() which is just passing all the html java through a string, then pull some db stuff out, and finally call the page_bottom() which pulls in the rest of the html. The problem is that the mouseover doesn't work within the php page which puts the whole thing together. Any ideas on how to work around this ? Thanks -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Passing Parameter
I have called from html a php form and passwd a value, but how can I from PHP pass the value to an html for, without using php ? Scenario After searching a db, a list of valid part numbers gets displayd from the Mysql db, the client picks part#2 and then that click would call the html form which needs the value being passed to it, in this case part_no then I would take other input information and pass all if it along with part_no to a cgi script. Can someone give me a good sample ? Thanks ! -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] setcookie().. how to retrieve data afterward?
If you just echo $userid you will get the results. do this setcookie ("cookie_variable", "chocalate chip", 1, "", "", 1); echo $cookie_variable You can name the cookie_variable whatever you want and that will be referenced as the variable to store "chocalate chip". Now if you want to see the value from within a function you will need to also do this: global $HTTP_COOKIE_VARS; this will enable you to see the values stored in the cookies. Andrew Rose wrote: Ive been playing with setcookie() and am stuck with trying to re-pull the infomation I set, I use: setcookie ("user_id", $userid, 1, "", "", 1); to set the cookie and: if(isset( $user_id )){ echo " cookie 'user_id': $user_id\n"; } else echo" no cookie set ...\n"; } to see if its there.. now this is the closest Ive seen anyone else do it and to me it dosnt make much sense at all the code for retrieving.. also it dosnt work.. suprise suprise.. so anyone know how to do this? thanks in advance -Andrew Rose -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Only 5 lines (now with the right script :/ )
I'm guessing you are getting an extra blank If you get a result back in $headlines = sizeof($content) of 5, then you have 5 lines, but in your script you have the value of $i as ZERO ($i = 0; $i $headlines; $i++) meaning 0,1,2,3,4,5 which is 6 lines, simply set your $i=1 and it should be correct. Let me know. I did execute your script off of my server and resulted in only 1 line printing the value of "1" nothing else Jack Dennis Haller wrote: The question I asked before was for this script: ? $open = fopen("http://nu.nl/deeplink_html", "r"); $read = fread($open, 1000); fclose($open); $search = eregi("DIVBnieuws.hoofd/BULLI(.*)/UL/DIVDIVBnieuws.overig /BULLI", $read, $printing); $printing[1] = str_replace("LI", "", $printing[1]); $printing[1] = str_replace("/LI", "br", $printing[1]); $printing[1] = str_replace("A HREF=", "A target=quot;_blankquot; HREF=", $printing[1]); $content = $printing[1]; $content = explode("#183;", $content); $headlines = sizeof($content); for ($i = 0; $i $headlines; $i++) { print "$content[$i] $headlines[$i]"; } ? So is it posible to get only 5 lines out of this script? Thx again -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] need help with cookies
I would suggest for you to take all the complicated stuff out of a simple text script and try something like this: % setcookie("TestValue","Working",600) % Make sure that nothing is being sent prior to setting the cookie, and see if IE prompts you... Good Luck! [EMAIL PROTECTED] wrote: Hi, I am trying to set a cookie and it doesn't work. I am running IE 5. I have IE set to prompt before setting cookies but I never get a prompt. Here is my code - basically, if someone logs in, it is to set a cookie. What am I missing? Kris if($success==1){ $loginid="$id"; NewSessionID($id); GetProfile($id); $page_title="LTT: $loginid Index"; include("html-head.php3"); if($id==""){ include("ln/ln_ln_dna.php3"); exit; } include("ms/rg1/index.php3"); exit; } function NewSessionID($id){ $sid=""; $length=16; srand((double)microtime()*100); $SessPool = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; $SessPool .= "abcdefghijklmnopqrstuvwxyz"; $SessPool .= "0123456789"; for($tempslime=0; $tempslime $length; $tempslime++) { $sid .= substr($SessPool, (rand()%(strlen($SessPool))), 1); } setcookie("LoginAuth", $sid,time()+3600); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Optional Parameter ?
Is it possible to have a function that looks something like function print_this( $value1, $value2, $maybe3) { do whatever; } that would expect $value1, $value2 BUT would not care if $maybe3 came in or not ? and not give an error message that there is a missing paramter ? I know I can do a condition within the function, but just want to see if there is a more technical approach as in from php to ignore that optional per say variable. I did look in my PHP book by wrox, but no luck. Thanks !!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Post -vs- Get
I have written a system with authentication to gain access to individual data. Since I am using the post method the command line has something like abc.com?client_no=5 Now even though if that person emails you that url, you won't gain access to it bascause of authentication that is needed, what can happen is an authorized user could change the 5 in the url to 8, and then see the information that is there which belongs to client 8. Because of this I am thinking in this case I should be using the post method instead of the get method. Does anyone have a link to a doc that has a good example in both methods along with a good explanation so that I can make sure I understand what it's doing? Thanks for your help! Jack -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] can you have two sql statements on the same page.
The simple answer would be 2 while statements, but are you trying to mix the results or are you keeping them seperate? By mix there are 2 options value_db1 Value_db2 Value_db1 or value_db1 value_db1 value_db2 value_db1 by the simple answer above it would result in something like Category #1 value_db1 value_db1 value_db1 value_db1 value_db1 Category #2 value_db2 value_db2 value_db2 value_db2 value_db2 or a side by side thing Also how many records (approx) are you dealing with ? you could bring the value from each table into an array and then dump the values stored in the array. Hope this helps... Jack Matt Davis wrote: I want to extract 2 sets of data each from different tables in the same db but display the results on the same page at the same time. Can I just have two sql statements like this or do I need to do something else. //sql statement 1 $sql1 = "select club_full_name from clubs where club_name = '$id' "; //sql statement 2 $sql2 = "select message,message_title from noticeboard where club_name = '$id' "; //execute sql1 query and get results $sql_result1 = mysql_query($sql1); //execute sql2 query and get results $sql_result2 = mysql_query($sql2); /*results variables for data to be displayed*/ while ($row = mysql_fetch_array($sql_result1)) { $name = $row["club_full_name"]; } How can I put both sets of results in the while statement. Any help would be kindly appreciated Matt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Pre-Written Script ?
Has anyone found a good prewritten (gpl) script that helps you to create the php code to add/edit/modify based on selecting a table that you want to put data into ? I want to use this both to get some data in the computer as well as to learn other coding techniques. Thanks ! ___ Jack Sasportas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] include php3 -vs- 4
Is there a workaround under php3 for include_once ? Thanks ___ Jack Sasportas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] managing image files with PHP/Mysql
Don't know how to do this, but basically I beleive Java will be the only way to execute on the fly and load the image in question so it can be approved so to speak which is what I beleive you are trying to do Good Luck... Mig wrote: Hello, I want to thank Kathleen and other people for ideas about uploading / displaying images using PHP and Mysql. I checked these ideas and they work very well, so I will use them into my program. For storing and retrieving image streams, I used addslashes and stripslashes PHP functions. The only problem still remaining is on client-side point of view. When somebody going to upload file, browsers open little box to let user choose file (input type="FILE"...). I wish user to know somewhat is the image he/she is going to upload, so I want to display this image before user uploading. For this action, I would be able to control the 'BROWSE' button that appears on form. Since this button doesn't apply to POST method, nor it will execute function on Form command, how can I control this action? Is there some doc explaining features of these objects? Thanks Miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ___ Jack Sasportas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] RE: [PHP-DB] Login System with access levels
Just a note...you can hash the password in the database. Rick Emery wrote: First, I would NOT store passwords in a database. Rather, I'd store a hash based upon the password and username. Storing a password is dangerous as regards security. Second, if you're asking for syntax on how to add the security level column: ALTER TABLE mytable ADD access tinyint unsigned not null default "0"; This will allow you to assigned security levels from 0 to 255. You would set 0 as the lowest level and 255 (admin) as the highest. While you're at it, add the has security hash entry (discussed above): ALTER TABLE mytable ADD md5hash char(32) not null default ""; Hashes are always 32 characters. Finally, as far as a query: SELECT * FROM mytable WHERE access = $level; This will permit the searcher to locate anything whereby the level is at $level or lower. -Original Message- From: Jordan Elver [mailto:[EMAIL PROTECTED]] Sent: Friday, March 16, 2001 1:28 PM To: PHP General Mailing List; PHP DB Mailing List Subject: [PHP-DB] Login System with access levels Hi, I've got a db with a username and password in it. I can let people log in, like SELECT * FROM table WHERE username = username AND password = password. But how can I add an access level column so that I can have different levels of security. So admin's can read everything, but users can only read certain sections. How could I add to my db and structure a query? Any ideas would be good, Cheers, Jord -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Help! Can't redeclare already declared function in
I just finished coding everything on a project it was working (all nighter), and now something I just changed is causing this error "Can't redeclare already declared function in " There is no duplication of functions declarations. The thing is it is basically saying that no matter what functions are in the file, you will get the error on whatever function is 1st function in the file of functions, and the line it always points to is the closing "}" of the function itself... Tried to get help on php.net, but didn't find anything. Any Ideas ? ___ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] multiple query in 1 select ?
lets say we have a database with the State Names and cities, and I wanted to select all the cities in FL I would execute something like this mysql_query("SELECT * FROM cities WHERE state='FL'"); and lets say there are 50 records returned I want to be able to get all the cities in FL GA instead of just FL and display the results together as if it was 1 restult. Then the resul would be 100 records ( 50 FL 50 GA ). Thanks! I did look on php.net and in a php book I have, but could not find anything... ___ Jack Sasportas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]