[PHP] running php with .html files?
Hi All, I'm sure I saw a posting on this subject a month ago so please excuse me for not paying attention the first time ;-| I have a php script that I wish to execute but I want to put it in index.html (not index.php) I know there is a solution involving configuration files in either the directory wher the file is held or specifically for the server. (Unfortunately I don't have access to the conf files for the server because I'm currently using a shared serever from an ISP). Any help is greatly appreciated. Even pointers in the right direction would be useful. TIA Henry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: setcookie question
If the different applications are on the same domain/ip you should use this: (myCookie,$cookie_value,$timeToExpire); note the missing parameter at the end -- JJ Harrison [EMAIL PROTECTED] www.tececo.com Gaylen Fraley [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I need to create a cookie that is accessible from more than 1 application, but on the same server. What would be the proper syntax? What I tried was setcookie (myCookie,$cookie_value,$timeToExpire,'/'); Right or wrong or impossible? Should I not have used the /? Thanks. -- Gaylen PHP KISGB v4.0.5 Guest Book http://www.gaylenandmargie.com/phpwebsite/ PHP KISSQ v1.0 Stock Quote http://www.gaylenandmargie.com/phpwebsite -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Site Search
I'm wondering what is a good general approach to enabling site-wide searches on any topic on a 100% PHP-powered portal-type site for a tertiary institution (yet to be built). Most if not all content will be contained in a database, spread across potentially many different tables. How can all this stuff be searched efficiently and effectively to hopefully find the punter what they're looking for? Searching the sometimes lengthy main content fields (eg. an academic paper) in every table of the entire database for every search doesn't seem like the way to go. But apart from attempting to add some kind of subjective search term fields to the data, I can't see how else it can be done. TIA MICHAEL HALL Web Development Officer Batchelor Institute of Indigenous Tertiary Education Work: [EMAIL PROTECTED] (08) 8951 8314 Home: [EMAIL PROTECTED] (08) 8953 1442 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] High Resolution Images
on 28/07/02 1:48 AM, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: Justin, I did what you said, just uploaded the file and downloaded it again, and the weirdest thing is happening. When I Form-Upload/FTP-Download it, I can see it on my local computer, it opens everywhere. Now, when I try to see it from the web site it is uploaded (http://ebsite/file.jpg), it does not display. mmm Any suggestions? Is the JPEG in CMYK or RGB format as you upload? Pretty sure only RGB images work on browsers, whereas JPEGs work as CMYK as well... If you can FTP download it AND open it in Photoshop et al, then the issue is the file compatibility with the browser, probably due to CMYK, resolution, or something else. Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Speed issues.
Greetings, I am new to PHP and trying to implement some PHP and MySQL on my website. My website has a lot of tables and inside some of those tables, I want to display information that is drawn out of the MySQL database using PHP. I was wondering what goes faster: (A). Building the whole page normally up in HTML, doing the usual table td and so forth, and then inside the td calling up the PHP in order to display the information. For example: td ?php .. ? /td (B). Doing everything in the PHP document, also the 'building' of the tables, and then including the PHP script in the main page. For example using printf(trtd and so forth. Thanks, Yves Vrancken -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Extra spacing with br in HTML
I *think* you've got a typo -- you've said ln2br instead of nl2br i think. Aaaannny way, you can't modify WHAT php does in nl2br, but you can do something to the resulting code, like replacing /libr / with /li: ? $original = ulliBlar/li/ul; $new = nl2br($original); $new = str_replace('/libr /', '/li', $new); ? Either that, or write your own version of nl2br which ignores /li (*no way* I'd both doing this) Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Extra spacing with br in HTML
on 28/07/02 12:53 PM, Jason Stechschulte ([EMAIL PROTECTED]) wrote: There might be an easier way, but you might just have to write your own code for this. Something along the lines of: (completely untested) ?php $line = ereg_replace((^li|^ul|^ol)\n, br /\n, $line); ? Definately an easier way (IMHO) -- just let nl2br() do what it does, then replace the problematic /libr / with just a br /: ? $original = ulliBlar/li/ul; $new = nl2br($original); $new = str_replace('/libr /', '/li', $new); ? Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Speed issues.
I haven't noticed ANY performance hit by skipping in and out of PHP and HTML when it suits me. I imagine there *might* be a slight performance hit if you were building a LOT of table information with print or echo or printf, but the general answer to your question is usually whatever suits you better. You could run some comparison tests with a microtimer to see what happens... I doubt on a 50-100K HTML page that you could notice the difference, unless the site or server got S**TLOADS of hits. Justin French on 28/07/02 5:56 PM, Yves Vrancken ([EMAIL PROTECTED]) wrote: Greetings, I am new to PHP and trying to implement some PHP and MySQL on my website. My website has a lot of tables and inside some of those tables, I want to display information that is drawn out of the MySQL database using PHP. I was wondering what goes faster: (A). Building the whole page normally up in HTML, doing the usual table td and so forth, and then inside the td calling up the PHP in order to display the information. For example: td ?php .. ? /td (B). Doing everything in the PHP document, also the 'building' of the tables, and then including the PHP script in the main page. For example using printf(trtd and so forth. Thanks, Yves Vrancken -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Speed issues.
I didn't expect it to make too much of a difference. Thank you for your answer. Yves Vrancken Justin French [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I haven't noticed ANY performance hit by skipping in and out of PHP and HTML when it suits me. I imagine there *might* be a slight performance hit if you were building a LOT of table information with print or echo or printf, but the general answer to your question is usually whatever suits you better. You could run some comparison tests with a microtimer to see what happens... I doubt on a 50-100K HTML page that you could notice the difference, unless the site or server got S**TLOADS of hits. Justin French on 28/07/02 5:56 PM, Yves Vrancken ([EMAIL PROTECTED]) wrote: Greetings, I am new to PHP and trying to implement some PHP and MySQL on my website. My website has a lot of tables and inside some of those tables, I want to display information that is drawn out of the MySQL database using PHP. I was wondering what goes faster: (A). Building the whole page normally up in HTML, doing the usual table td and so forth, and then inside the td calling up the PHP in order to display the information. For example: td ?php .. ? /td (B). Doing everything in the PHP document, also the 'building' of the tables, and then including the PHP script in the main page. For example using printf(trtd and so forth. Thanks, Yves Vrancken -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need help reg. User Accounts
Hi Gurus, I am using PHP-4.1.1 on Linux, I wanted to know the difference between "nobody" user and normal user of operating system. This question just came to mind when, neither nobody's directory nor any entry was not found in /home or elsewhere. Thanking you all in anticipation. Regards Umesh. * Umesh A. Deshmukh. Manas Solutions Pvt. Ltd. [EMAIL PROTECTED] http://www.manas-solutions.com Ph. : 91+020+4006358,4223991/92 *
[PHP] file_name
I'm using php 4.21 on WIN xp. I 'm trying to work with file upload, I already read several sites who refer that php will set the variable file_name automaticly,. I made 2 tries one on line 6 and other on line 7 of the atached code, but both does not work. Why I receive the folowing errors, and how can I correct Notice: Undefined index: file_name in d:\inetpub\wwwroot\impac\php\upfile.php on line 6 Successfully uploaded Notice: Undefined variable: file_name in d:\inetpub\wwwroot\impac\php\upfile.php on line 7 HTML BODY ?php if (isset($_POST['file'])){ echo Successfully uploaded ,$_POST['file'], BR\n; echo Successfully uploaded ,$_POST['file_name'], BR\n; echo Successfully uploaded ,$file_name, BR\n; } else echo unccessfully uploaded , BR\n; phpinfo(); ? FORM METHOD=POST ACTION=upfile.php enctype='multipart/form-data' input type=hidden name='MAX_FILE_SIZE' value=20 INPUT TYPE=FILE NAME=fileBR INPUT TYPE=SUBMIT /FORM /BODY /HTML -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Speed issues.
Hello, You can also find something about your questions on: http://www.php9.com/index.php/section/articles/name/PHP%20Guidelines I had tested out by printing (repeated times): 1) echo 'br'.$k.': hallo '.$string.', dit is hetbr'.\n; 2) echo br$k: hallo $string, dit is hetbr.\n; 3) ?br?=$k?: hallo ?=$string?, dit is hetbr?=\n?? $k=1; $string='test'; I found: The fastest way to print was 3) Second came 1) (no much difference) and the slowest way 2) (about 2 times slower). I haven't tested printf(trtd Best regards, Bas Jobsen Op zondag 28 juli 2002 09:56, schreef Yves Vrancken: Greetings, I am new to PHP and trying to implement some PHP and MySQL on my website. My website has a lot of tables and inside some of those tables, I want to display information that is drawn out of the MySQL database using PHP. I was wondering what goes faster: (A). Building the whole page normally up in HTML, doing the usual table td and so forth, and then inside the td calling up the PHP in order to display the information. For example: td ?php .. ? /td (B). Doing everything in the PHP document, also the 'building' of the tables, and then including the PHP script in the main page. For example using printf(trtd and so forth. Thanks, Yves Vrancken -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] cant send data from a website to another
Hi newsgroup friends, my name is mike and im qite new to php. i have one problem: i cant send date via a form action=example.php method=post. so in the the php file called example, i write echo $nameofthefield, but the data isnt send, so nothing is written in the browser! what can i do? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Self Answer for file upload
The help other's with the same problem I made that self answer. The tip here is to use $_FILES instead of $_POST HTML BODY ?php if (isset($_FILES['file'])){ echo Successfully uploaded , BR\n; echo File Name ,$_FILES['file']['name'], BR\n; echo File Type ,$_FILES['file']['type'], BR\n; echo File tmp ,$_FILES['file']['tmp_name'], BR\n; echo File errors ,$_FILES['file']['error'], BR\n; echo File size ,$_FILES['file']['size'], BR\n; } else echo unccessfully uploaded , BR\n; ? FORM METHOD=POST ACTION=upfile.php enctype='multipart/form-data' input type=hidden name='MAX_FILE_SIZE' value=20 INPUT TYPE=FILE NAME=fileBR INPUT TYPE=SUBMIT /FORM /BODY /HTML -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cant send data from a website to another
Try echo $_POST['nameofthefield']; If this works, it's to do with register_globals directive in your php.ini file. You can set it to on, which will solve your problem, or you can choose to be more secure, and write better scripts, by choosing to keep it off, as with the above line of code. Search the archives of this list for regisiter globals and new global variables, because this has been discussed over and over and over and over. Justin on 28/07/02 8:04 PM, kju ([EMAIL PROTECTED]) wrote: Hi newsgroup friends, my name is mike and im qite new to php. i have one problem: i cant send date via a form action=example.php method=post. so in the the php file called example, i write echo $nameofthefield, but the data isnt send, so nothing is written in the browser! what can i do? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How do I show the sourse code?
research the php function htmlspecialchars(). I replaces with lt; and with gt; etc. -- JJ Harrison [EMAIL PROTECTED] www.tececo.com I often get confused with lt; and gt; so they may be in the wrong order but I am sure you get the idea. ØYstein HåLand [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have seen on some of the script-sites around some nice ways of presenting the source code. Often in nice colors. So, the natural question is: how is that done (cause I don't think anyone has the patience to put lt; and gt; around all the ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Checking Insert to Postgre, whats wrong?
Hello. I use this code-snip similar to this to check if the inserted tuppel in my database was successfull: --- snip --- $OID = pg_last_oid($resultat); if($OID0) { echo $errormessage; exit; } $query = SELECT * FROM medlemmer WHERE oid = '$OID';; $resultat = pg_query($dbconnection, $query); if (!$resultat) { echo $errormessage; exit; } else { $i = 0; $medlem_id[$i] = pg_fetch_result($resultat, $i, medlem_id); $fornavn[$i] = pg_fetch_result($resultat, $i, fornavn); } pg_free_result($resultat); if (!$medlem_id[$i]) { echo $errormessage; exit; } else { $i = 0; echo $medlem_id[$i].$fornavn[$i]; } --- snip --- But when I print the result from pg_fetch_result() to the browser (last lines above), I only get the first letter in the string $fornavn[$i] and similar strings not listed above, not the whole string. What is the reason for this? Has it something to do with the pg_last_oid()? I can't see how since this only identify the inserted row (or am I wrong?) which I select afterwards. Thanks for answer. Bård Magnus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Checking Insert to Postgre, whats wrong?
Bård Magnus Fauske wrote: But when I print the result from pg_fetch_result() to the browser (last lines above), I only get the first letter in the string $fornavn[$i] and similar strings not listed above, not the whole string. What is the reason for this? Has it something to do with the pg_last_oid()? I can't see how since this only identify the inserted row (or am I wrong?) which I select afterwards. Thanks for answer. This is not a direct answer. Since you are using 4.2.0 or later, you are better to use pg_status() or pg_result_status() to check these things. i.e. You don't have to select row just to make sure row is inserted or not. It wastes lots of resource. -- Yasuo Ohgaki -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help reg. create user and allocate space
Hi Gurus, I am using PHP-4.1.1, postgresql on Linux. I want the following functionality, I dont know how to implement it. Each time a new user registeres, I want to create mail account by the name he specifies and allocate him some space of the server, say 2mb. How this is incorporated ? Please help. Thanking you all in anticipation. Regards Umesh. * Umesh A. Deshmukh. Manas Solutions Pvt. Ltd. [EMAIL PROTECTED] http://www.manas-solutions.com Ph. : 91+020+4006358,4223991/92 *
Re: [PHP] running php with .html files?
On Sun, 28 Jul 2002 08:18:40 +0100, you wrote: Hi All, [...] I have a php script that I wish to execute but I want to put it in index.html (not index.php) I know there is a solution involving configuration files in either the directory wher the file is held or specifically for the server. (Unfortunately I don't have access to the conf files for the server because I'm currently using a shared serever from an ISP). [...] You didn't say what web server you are using, so I will assume it's Apache. If your server is configured to allow .htaccess files to override global settings, you should be able to create one in your directory and add: AddType application/x-httpd-php .html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Extra spacing with br in HTML
On Sun, 2002-07-28 at 04:04, Justin French wrote: I *think* you've got a typo -- you've said ln2br instead of nl2br i think. Doh! You got that right. Aaaannny way, you can't modify WHAT php does in nl2br, but you can do something to the resulting code, like replacing /libr / with /li: ? $original = ulliBlar/li/ul; $new = nl2br($original); $new = str_replace('/libr /', '/li', $new); ? Hmmm..you've got it backwards, but I see what you mean. I'll tool around with it tonight. Thanks for the suggestion. Kevin -- Kevin Breit [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Extra spacing with br in HTML
on 29/07/02 12:02 AM, Kevin Breit ([EMAIL PROTECTED]) wrote: Aaaannny way, you can't modify WHAT php does in nl2br, but you can do something to the resulting code, like replacing /libr / with /li: ? $original = ulliBlar/li/ul; $new = nl2br($original); $new = str_replace('/libr /', '/li', $new); ? Hmmm..you've got it backwards, but I see what you mean. I'll tool around with it tonight. I don't think I did Manual Quote: Description mixed str_replace ( mixed search, mixed replace, mixed subject) So, we search for /libr / (the problem being the unnecessary br /, and replace it with /li. Unless I'm misunderstanding the question/problem. Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 28 Jul 2002 14:15:01 -0000 Issue 1491
php-general Digest 28 Jul 2002 14:15:01 - Issue 1491 Topics (messages 110019 through 110051): PHP/MySQL Search Engine Query Question 110019 by: Paul Maine 110026 by: Naintara Jain How do I show the sourse code? 110020 by: Øystein Håland 110022 by: Bob Lockie 110027 by: Michael Sims 110045 by: JJ Harrison Re: php 'mail()' security 110021 by: Bob Lockie 110025 by: Dennis Gearon 110036 by: Justin French Re: Extra spacing with br in HTML 110023 by: Jason Stechschulte 110034 by: Justin French 110035 by: Justin French 110050 by: Kevin Breit 110051 by: Justin French setcookie question 110024 by: Gaylen Fraley 110029 by: JJ Harrison running php with .html files? 110028 by: Henry 110049 by: Michael Sims Site Search 110030 by: Michael Hall Re: High Resolution Images 110031 by: Justin French Re: failure notice 110032 by: Justin French Speed issues. 110033 by: Yves Vrancken 110037 by: Justin French 110038 by: Yves Vrancken 110041 by: Bas Jobsen need help reg. User Accounts 110039 by: umesh file_name 110040 by: Saci cant send data from a website to another 110042 by: kju 110044 by: Justin French Self Answer for file upload 110043 by: Saci Checking Insert to Postgre, whats wrong? 110046 by: Bård Magnus Fauske 110047 by: Yasuo Ohgaki Help reg. create user and allocate space 110048 by: umesh Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- I am currently working on a website that is implemented using PHP and MySQL. The site currently has a simple search engine that allows a shopper to type in a search string that is stored in $search. For example, if a shopper types in 1972 Ford Mustang $string =1972 Ford Mustang Using the following SQL statement: SELECT * FROM whatevertable WHERE whatevercolumn LIKE '%$search% Records are returned that have this exact string and in this exact order (I'm aware a wild card character is included on the front and back of the string). My desire is to be able to logically AND each token of the search together independent or the order of the tokens. I want to return all records that have Mustang AND 1972 AND Ford. Since a shopper inputs the search string in advance I don't know how many tokens will be used. I would appreciate any suggestions. Regards, Paul ---End Message--- ---BeginMessage--- You can use explode/split functions on the search parameters - that will give u an array with each search token indexed individually. Suppose the search input was 'abc xyz' $strsearch = abc xyz; $search=explode( ,$strsearch); your array search will contain $search[0]=abc $search[1]=xyz Now, you can iterate through the array members and create a SQL string out of it, join the elements with LIKE and AND. so that you have something like SELECT * FROM whatevertable WHERE whatevercolumn LIKE '%$search[0]% AND whatevercolumn LIKE '%$search[1]% Since you won't know how many search input 'tokens' will be searched on: Use a loop to create the SQL statement. You can also use the implode() function to create the SQL. Textual searches can be optimised somewhat by creating the appropriate indexes (refer to the MySQL manual). -Naintara -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] t]On Behalf Of Paul Maine Sent: Sunday, July 28, 2002 8:02 AM To: PHP PHP Subject: [PHP] PHP/MySQL Search Engine Query Question I am currently working on a website that is implemented using PHP and MySQL. The site currently has a simple search engine that allows a shopper to type in a search string that is stored in $search. For example, if a shopper types in 1972 Ford Mustang $string =1972 Ford Mustang Using the following SQL statement: SELECT * FROM whatevertable WHERE whatevercolumn LIKE '%$search% Records are returned that have this exact string and in this exact order (I'm aware a wild card character is included on the front and back of the string). My desire is to be able to logically AND each token of the search together independent or the order of the tokens. I want to return all records that have Mustang AND 1972 AND Ford. Since a shopper inputs the search string in advance I don't know how many tokens will be used. I would appreciate any suggestions. Regards, Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- I have seen on some of the script-sites around some nice ways of presenting the source code. Often in nice colors. So, the natural question is:
Re: [PHP] Extra spacing with br in HTML
On Sun, 2002-07-28 at 10:14, Justin French wrote: on 29/07/02 12:02 AM, Kevin Breit ([EMAIL PROTECTED]) wrote: Aaaannny way, you can't modify WHAT php does in nl2br, but you can do something to the resulting code, like replacing /libr / with /li: ? $original = ulliBlar/li/ul; $new = nl2br($original); $new = str_replace('/libr /', '/li', $new); ? Hmmm..you've got it backwards, but I see what you mean. I'll tool around with it tonight. I don't think I did Manual Quote: Description mixed str_replace ( mixed search, mixed replace, mixed subject) So, we search for /libr / (the problem being the unnecessary br /, and replace it with /li. Unless I'm misunderstanding the question/problem. Oh wait, you're right! Kevin -- Kevin Breit [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help reg. create user and allocate space
Are you asking us how to write an entire online community program??? Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "umesh" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 28, 2002 6:40 AM Subject: [PHP] Help reg. create user and allocate space Hi Gurus, I am using PHP-4.1.1, postgresql on Linux. I want the following functionality, I dont know how to implement it. Each time a new user registeres, I want to create mail account by the name he specifies and allocate him some space of the server, say 2mb. How this is incorporated ? Please help. Thanking you all in anticipation. Regards Umesh. * Umesh A. Deshmukh. Manas Solutions Pvt. Ltd. [EMAIL PROTECTED] http://www.manas-solutions.com Ph. : 91+020+4006358,4223991/92 * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Speed issues.
I am new to PHP and trying to implement some PHP and MySQL on my website. My website has a lot of tables and inside some of those tables, I want to display information that is drawn out of the MySQL database using PHP. I was wondering what goes faster: (A). Building the whole page normally up in HTML, doing the usual table td and so forth, and then inside the td calling up the PHP in order to display the information. For example: td ?php .. ? /td (B). Doing everything in the PHP document, also the 'building' of the tables, and then including the PHP script in the main page. For example using printf(trtd and so forth. (A) will be faster, generally. Plus it's easier to read and find the PHP snippets in the HTML, than it is to read an entire page of print/echo statements. And it'll generally open neatly in a graphical HTML editor, too. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php 'mail()' security
There is no substitute for good data verification such as strip_tags() or some regular expressions to limit valid input. I also would recomend checking the referrer to be sure someone doesn't hijack you form and try to modify it and submit it from a remote location. Here is an example: if (validReferrer() === false) die(invalid referrer); function validReferrer() { $_valid_referrers = array(www.yoursite.com,www2.yoursite.com,yoursite.com); $referer = str_replace('//', '/', $_SERVER['HTTP_REFERER']); $ref = explode('/', $referer); if ( in_array($ref[1], $_valid_referrers) ) return true; else return false; } Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: Dennis Gearon [EMAIL PROTECTED] To: Bob Lockie [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, July 27, 2002 10:54 PM Subject: Re: [PHP] php 'mail()' security What I meant was, how to sanitize the input on the forms so that malicious stuff cannot be put as commands, etc. in the email address, or body, or 'extra' field of the 'mail()' function in PHP. -- - Joy is just a thing (to be).. raised on, Love is just the way to Live and Die, John Denver. - He lost a friend, but kept his Memory (also John Denver), Thank you...John Corones...my friend always. - Look lovingly upon the present, for it holds the only things that are forever true. - Sincerely, Dennis Gearon (Kegley) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php 'mail()' security
HTTP_REFERRER can be spoofed quite easily with some browsers. The best way to handle this is to provide as much of your own data as possible, and validate anything you do end up using from the user. For instance, use your own subject, make sure the To: address comes from you (a file or database, whatever), etc... Make sure anything coming from the user, that you put into the headers, subject, from, reply-to, etc... do not have any line breaks. A simple str_replace or something to remove them, or pop up an error if they are there, will work. The less user data you can use the better. It gives them less of a chance to insert extra headers, which is pretty much the only threat. If there's a possibility of the email not being shown as plain text, then you'll want to use striptags() like others mentioned. ---John Holmes... -Original Message- From: Tech Support [mailto:[EMAIL PROTECTED]] Sent: Sunday, July 28, 2002 10:57 AM To: Dennis Gearon; Bob Lockie Cc: [EMAIL PROTECTED] Subject: Re: [PHP] php 'mail()' security There is no substitute for good data verification such as strip_tags() or some regular expressions to limit valid input. I also would recomend checking the referrer to be sure someone doesn't hijack you form and try to modify it and submit it from a remote location. Here is an example: if (validReferrer() === false) die(invalid referrer); function validReferrer() { $_valid_referrers = array(www.yoursite.com,www2.yoursite.com,yoursite.com); $referer = str_replace('//', '/', $_SERVER['HTTP_REFERER']); $ref = explode('/', $referer); if ( in_array($ref[1], $_valid_referrers) ) return true; else return false; } Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: Dennis Gearon [EMAIL PROTECTED] To: Bob Lockie [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, July 27, 2002 10:54 PM Subject: Re: [PHP] php 'mail()' security What I meant was, how to sanitize the input on the forms so that malicious stuff cannot be put as commands, etc. in the email address, or body, or 'extra' field of the 'mail()' function in PHP. -- - Joy is just a thing (to be).. raised on, Love is just the way to Live and Die, John Denver. - He lost a friend, but kept his Memory (also John Denver), Thank you...John Corones...my friend always. - Look lovingly upon the present, for it holds the only things that are forever true. - Sincerely, Dennis Gearon (Kegley) -- 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] running php with .html files?
That did the trick. Thanks. Henry Michael Sims [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Sun, 28 Jul 2002 08:18:40 +0100, you wrote: Hi All, [...] I have a php script that I wish to execute but I want to put it in index.html (not index.php) I know there is a solution involving configuration files in either the directory wher the file is held or specifically for the server. (Unfortunately I don't have access to the conf files for the server because I'm currently using a shared serever from an ISP). [...] You didn't say what web server you are using, so I will assume it's Apache. If your server is configured to allow .htaccess files to override global settings, you should be able to create one in your directory and add: AddType application/x-httpd-php .html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/MySQL Search Engine Query Question
Here is an idea ? // make array out of words in search string $search_array = explode(' ', $search); // make regexp pattern '.*(this|or|that).*' $string = .*( . implode('|', $search_array) . ).*; $query = SELECT * FROM my_table WHERE body REGEXP '$string'; $result = mysql_query($query, $connection); $res = mysql_num_rows($result); if ($res 1) die(no match for $search); ? using this method car would match car, carwash, scar, scarred, etc. Since this result will contain the entire boy of text you could some more matching or scoring for relevancy ? while ( $row = mysql_fetch_assoc($result) ) { $num = sizeof($search_array); for ($i = 0; $i $num; $i++) { if ( preg_match(/.*\b$search_array[$i]/i, $row[body]) ) { // it was found so score 25 to start $score[$row[page_title_or_something]] += 25; $body_size = strlen($row[body]); // this is the first case-insensitive occurance of the word $temp = @stristr($row[body], $search_array[$i]); $pos = @strlen($row[body])-strlen($temp); if ($pos == $body_size) $pos = 0; // score higher $percent = ( ($pos / $body_size * 1000) / 10 ); $score[$row[page_title_or_something]] += ((100 - number_format($percent)) / 2); // this is the first occurance of the word by it's self preg_match(/[^a-z0-9]?($search_array[$i])([^0-9a-z])?/i, $row[body], $matches); $temp = @stristr($row[body], trim($matches[0])); $pos_clean = @strlen($row[body])-strlen($temp); if ($pos_clean == $body_size) $pos_clean = 0; // score higher $percent = ( ($pos_clean / $body_size * 1000) / 10 ); $score[$row[page_title_or_something]] += (100 - number_format($percent)); // this is how many times it occured in total $reps = substr_count($row[body], $search_array[$i]); // score higher $score[$row[page_title_or_something]] += ($reps * 5); // this is how many times it occured by it's self $rc = preg_grep(/[^a-z0-9]?($search_array[$i])([^0-9a-z])?/i, explode( , $row[body]) ); $reps_clean = sizeof($rc); // score higher $score[$row[page_title_or_something]] += ($reps_clean * 10); } } ? I had that code from a previous working project. I copied it and changed some var names to make it more clear. I did not test it in this format but it is a good example and you could certainly improve it or build on it. Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: Paul Maine [EMAIL PROTECTED] To: PHP PHP [EMAIL PROTECTED] Sent: Saturday, July 27, 2002 9:31 PM Subject: [PHP] PHP/MySQL Search Engine Query Question I am currently working on a website that is implemented using PHP and MySQL. The site currently has a simple search engine that allows a shopper to type in a search string that is stored in $search. For example, if a shopper types in 1972 Ford Mustang $string =1972 Ford Mustang Using the following SQL statement: SELECT * FROM whatevertable WHERE whatevercolumn LIKE '%$search% Records are returned that have this exact string and in this exact order (I'm aware a wild card character is included on the front and back of the string). My desire is to be able to logically AND each token of the search together independent or the order of the tokens. I want to return all records that have Mustang AND 1972 AND Ford. Since a shopper inputs the search string in advance I don't know how many tokens will be used. I would appreciate any suggestions. Regards, Paul -- 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] Oracle 8i SQL Problem..
Hi, This really isn't a PHP issue..sorry. I'm having a nightmare with Oracle 8i (pos!). I'm writing common SQL which works for MSSQL 2K and seems correct for Oracle... but keeps giving me a Error.. ORA-00933 SQL command not properly ended on the following query... SELECT grp.grpdescrip, grp.grp, grp.createcust, grp.auth1, grp.auth2, usergrp.userid, users.userdescrip FROM grp LEFT JOIN usergrp ON grp.grp=usergrp.grp LEFT JOIN users ON usergrp.userid=users.userid ORDER BY grp.grp The error keeps pointing at the first LEFT JOIN. Anybody know why? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help reg. create user and allocate space
On Sunday 28 July 2002 19:40, umesh wrote: Hi Gurus, I am using PHP-4.1.1, postgresql on Linux. I want the following functionality, I dont know how to implement it. Each time a new user registeres, I want to create mail account by the name he specifies and allocate him some space of the server, say 2mb. How this is incorporated ? Manual - Program Execution functions These functions would allow PHP to call any system command or program. How you actually create the mail account and set quotas has nothing at all to do with PHP. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Radial Telemetry Infiltration */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need help reg. User Accounts
Hi Gurus, I am using PHP-4.1.1 on Linux, I wanted to know the difference between nobody user and normal user of operating system. This question just came to mind when, neither nobody's directory nor any entry was not found in /home or elsewhere. The web server can be run by any user. The 'nobody' user is usually used since it has no login capabailities. 'nobody' can't login and hence has no home. From the /etc/passwd obody:x:99:99:Nobody:/:/sbin/nologin. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php 'mail()' security
There is no substitute for good data verification such as strip_tags() or some regular expressions to limit valid input. I also would recomend checking the referrer to be sure someone doesn't hijack you form and try to modify it and submit it from a remote location. Here is an example: if (validReferrer() === false) die(invalid referrer); function validReferrer() { $_valid_referrers = array(www.yoursite.com,www2.yoursite.com,yoursite.com); $referer = str_replace('//', '/', $_SERVER['HTTP_REFERER']); $ref = explode('/', $referer); if ( in_array($ref[1], $_valid_referrers) ) return true; else return false; } That is a good idea. $_SERVER['HTTP_REFERER'] is the web server identifier, right? My web server is 10.0.0.5 from the internal LAN. I am hesitant to allow HTTP_REFERERs from 10.0.0.5 because it seems to me that it would be easy enough to configure a strange box to imitate 10.0.0.5. Can I somehow check that the HTTP_REFERER = localhost? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: running php with .html files?
Why can't you just have ?PHP at the top of the page and ? at the bottom? Henry [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi All, I'm sure I saw a posting on this subject a month ago so please excuse me for not paying attention the first time ;-| I have a php script that I wish to execute but I want to put it in index.html (not index.php) I know there is a solution involving configuration files in either the directory wher the file is held or specifically for the server. (Unfortunately I don't have access to the conf files for the server because I'm currently using a shared serever from an ISP). Any help is greatly appreciated. Even pointers in the right direction would be useful. TIA Henry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Speed issues.
Thanks for the help, guys . I appreciate it. And Bas, thanks for that link. Interesting material for a novice PHP-user as myself. Yves Vrancken -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] REGEX for credit card number
Does anyone have a regular expression that works to validate credit card numbers? Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php 'mail()' security
I think you are looking for something different. do this: print pre; print_r($_SERVER); print /pre; You will see a whole bunch of useful globals. As a matter of fact, try this one out too: print pre; print_r($GLOBALS); print /pre; Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: Bob Lockie [EMAIL PROTECTED] To: Dennis Gearon [EMAIL PROTECTED]; Tech Support [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Sunday, July 28, 2002 1:19 PM Subject: Re: [PHP] php 'mail()' security There is no substitute for good data verification such as strip_tags() or some regular expressions to limit valid input. I also would recomend checking the referrer to be sure someone doesn't hijack you form and try to modify it and submit it from a remote location. Here is an example: if (validReferrer() === false) die(invalid referrer); function validReferrer() { $_valid_referrers = array(www.yoursite.com,www2.yoursite.com,yoursite.com); $referer = str_replace('//', '/', $_SERVER['HTTP_REFERER']); $ref = explode('/', $referer); if ( in_array($ref[1], $_valid_referrers) ) return true; else return false; } That is a good idea. $_SERVER['HTTP_REFERER'] is the web server identifier, right? My web server is 10.0.0.5 from the internal LAN. I am hesitant to allow HTTP_REFERERs from 10.0.0.5 because it seems to me that it would be easy enough to configure a strange box to imitate 10.0.0.5. Can I somehow check that the HTTP_REFERER = localhost? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: running php with .html files?
You need to append or create a .htaccess file in the same folder as index.html, and add this line: Files index.html ForceType application/x-httpd-php /Files Then, just treat the index.html file as a php file. HTH, Peter Janett New Media One Web Services New Upgrades Are Now Live!!! Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1 Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25, Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43 PostgreSQL coming soon! http://www.newmediaone.net [EMAIL PROTECTED] (303)828-9882 - Original Message - From: Peter [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 28, 2002 1:16 PM Subject: [PHP] Re: running php with .html files? Why can't you just have ?PHP at the top of the page and ? at the bottom? Henry [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi All, I'm sure I saw a posting on this subject a month ago so please excuse me for not paying attention the first time ;-| I have a php script that I wish to execute but I want to put it in index.html (not index.php) I know there is a solution involving configuration files in either the directory wher the file is held or specifically for the server. (Unfortunately I don't have access to the conf files for the server because I'm currently using a shared serever from an ISP). Any help is greatly appreciated. Even pointers in the right direction would be useful. TIA Henry -- 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] REGEX for phone #
I'm using a regular expression (below) to check phone numbers. I'm getting an error that I can't make sense of. $regex = ^((\(\d{3}(\) -))?*\d{3}(- )\d{4},?*)+$; Output I'm getting = Warning: REG_BADRPT in /home/basemen/public_html/verify_order.php on line 28 Anyone know what this means? I know it's not bitching about the phone number, it's bitching about the expression. But why? Some thing wrong with the expression? It works fine in PERL, which this is supposed to be compatible with. Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need help with uploading images
I'm trying to get an uploader to work, where you check to make sure it's a jpeg file that's being uploaded, and no other files allowed. the server is unix linux using php4.1 Any help would be appreciated. thanks in advance deasdam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Adding slashes when magic quotes is off?
I'm making a website for a friend, and trying to do everything the right way. I want to add slashes to EGPCS values. I know how to use this, but one of the comments on the get_magic_quotes_gpc entry in the manual points out that it wouldn't work with arrays in these values - and they have a point. Does anyone have code that works with arrays in EGPCS values? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need help with uploading images
deadsman, if (($filename_type != image/jpeg) ($filename_type != image/jpg) ($filename_type != image/pjpeg)) { header(Location:submitError.php); exit; //goes to an error page if the file wasnt a jpg } else { $upload_path = /path/of/the/$filename_name; if (is_uploaded_file($filename)) { Exec(cp $filename $upload_path); } else { //do whatever if it wasnt uploaded } The file formfield, is called filename.. just in case... if you call it myFile, you'd have to replace $filename with that. Hope this helps. Oscar.- - Original Message - From: Deadsam [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 28, 2002 5:53 PM Subject: [PHP] need help with uploading images I'm trying to get an uploader to work, where you check to make sure it's a jpeg file that's being uploaded, and no other files allowed. the server is unix linux using php4.1 Any help would be appreciated. thanks in advance deasdam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php 'mail()' security
No, but thanks, the other input is more towards what I was looking for. I want to take in an email address, and various other fields. Then, send an email using 'mail()' with the other fields as the 'body', and the email address as the 'reply_to' address, to someone in my company. That way, they can read the submitted information, and then just hit 'reply' on their mail program when they want to comment on the material. Tech Support [EMAIL PROTECTED] wrote: I think you are looking for something different. do this: print pre; print_r($_SERVER); print /pre; You will see a whole bunch of useful globals. As a matter of fact, try this one out too: print pre; print_r($GLOBALS); print /pre; Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: Bob Lockie [EMAIL PROTECTED] To: Dennis Gearon [EMAIL PROTECTED]; Tech Support [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Sunday, July 28, 2002 1:19 PM Subject: Re: [PHP] php 'mail()' security There is no substitute for good data verification such as strip_tags() or some regular expressions to limit valid input. I also would recomend checking the referrer to be sure someone doesn't hijack you form and try to modify it and submit it from a remote location. Here is an example: if (validReferrer() === false) die(invalid referrer); function validReferrer() { $_valid_referrers = array(www.yoursite.com,www2.yoursite.com,yoursite.com); $referer = str_replace('//', '/', $_SERVER['HTTP_REFERER']); $ref = explode('/', $referer); if ( in_array($ref[1], $_valid_referrers) ) return true; else return false; } That is a good idea. $_SERVER['HTTP_REFERER'] is the web server identifier, right? My web server is 10.0.0.5 from the internal LAN. I am hesitant to allow HTTP_REFERERs from 10.0.0.5 because it seems to me that it would be easy enough to configure a strange box to imitate 10.0.0.5. Can I somehow check that the HTTP_REFERER = localhost? - Joy is just a thing (to be).. raised on, Love is just the way to Live and Die, John Denver. - He lost a friend, but kept his Memory (also John Denver), Thank you...John Corones...my friend always. - Look lovingly upon the present, for it holds the only things that are forever true. - Sincerely, Dennis Gearon (Kegley) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need help with uploading images
Thanks oscar I'll give this a go, I tried just using filetype != image/jpeg so mabey adding the rest will help , I read there was a problem with some browser with uploading hopfully this will solve the problem. much apprecatied Deadsam Oscar F [EMAIL PROTECTED] wrote in message 002001c23684$fc68ba20$bc00a8c0@320jupiter">news:002001c23684$fc68ba20$bc00a8c0@320jupiter... deadsman, if (($filename_type != image/jpeg) ($filename_type != image/jpg) ($filename_type != image/pjpeg)) { header(Location:submitError.php); exit; //goes to an error page if the file wasnt a jpg } else { $upload_path = /path/of/the/$filename_name; if (is_uploaded_file($filename)) { Exec(cp $filename $upload_path); } else { //do whatever if it wasnt uploaded } The file formfield, is called filename.. just in case... if you call it myFile, you'd have to replace $filename with that. Hope this helps. Oscar.- - Original Message - From: Deadsam [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 28, 2002 5:53 PM Subject: [PHP] need help with uploading images I'm trying to get an uploader to work, where you check to make sure it's a jpeg file that's being uploaded, and no other files allowed. the server is unix linux using php4.1 Any help would be appreciated. thanks in advance deasdam -- 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: How do I show the sourse code?
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I have seen on some of the script-sites around some nice ways of presenting the source code. Often in nice colors. So, the natural question is: how is that done (cause I don't think anyone has the patience to put lt; and gt; around all the ) If you are using php v4 you can do this with show_source(), or if using apache, you can configure it to serve source code with syntax highlighting rather than parsing the code. Cheers -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] David Steculorum/MIS/XLGroup is out of the office.
I will be out of the office starting 27/07/2002 and will not return until 04/08/2002. Sorry but I am out of the Office till the 4th of August. Please contact Roger Smith for any emergency. The information contained in this e-mail message may be privileged and confidential information and is intended only for the use of the individual and/or entity identified in the alias address of this message. If the reader of this message is not the intended recipient, or an employee or agent responsible to deliver it to the intended recipient, you are hereby requested not to distribute or copy this communication. If you have received this communication in error, please notify us immediately by telephone or return e-mail and delete the original message from your system. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sessions and https
Do sessions not work when using an https connection? It seems I'm losing my data between pages. Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions and https
Mike, I have used them with https, and they work fine. Make sure you are calling session_start(); on every page you need your session vars. Oscar.- - Original Message - From: Mike Mannakee [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 28, 2002 9:21 PM Subject: [PHP] sessions and https Do sessions not work when using an https connection? It seems I'm losing my data between pages. 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] sessions and https
Hi, Monday, July 29, 2002, 11:21:34 AM, you wrote: MM Do sessions not work when using an https connection? It seems I'm losing my MM data between pages. MM Mike If you are changing domain names when going to https you will lose the session info if relying on cookies. You will have to hard code the session id in the url if this is the case. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions and https
Thank you. This has been driving me up the wall like you wouldn't believe. Mike Tom Rogers [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, Monday, July 29, 2002, 11:21:34 AM, you wrote: MM Do sessions not work when using an https connection? It seems I'm losing my MM data between pages. MM Mike If you are changing domain names when going to https you will lose the session info if relying on cookies. You will have to hard code the session id in the url if this is the case. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Logging out with authentication
I am working on a web site that is using php controled www- authenticate authentication. User ids are specific to users and different pages and different levels of information for a given page will be displayed based on the user id used. The problem is how do you log out without having to quit all browser sessions. Anyone doing this? Care to share code that makes it work? -- Ray Todd Stevens Specialists in Network and Security Consulting Senior ConsultantSoftware audit service available Stevens Services Suite 21 3754 Old State Rd 37 N Bedford, IN 47421 (812) 279-9394 [EMAIL PROTECTED] Thought for the day: Concerto (n): a fight between a piano and a pianist. For PGP public key send message with subject please send PGP key If this message refers to an attachment the attachment may arrive as a seperate mail message depending on the type of mail client and gateway software you are using. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 29 Jul 2002 03:02:09 -0000 Issue 1492
php-general Digest 29 Jul 2002 03:02:09 - Issue 1492 Topics (messages 110052 through 110080): Re: Extra spacing with br in HTML 110052 by: Kevin Breit Re: Help reg. create user and allocate space 110053 by: Tech Support 110060 by: Jason Wong Re: Speed issues. 110054 by: John Holmes 110064 by: Yves Vrancken Re: php 'mail()' security 110055 by: Tech Support 110056 by: John Holmes 110062 by: Bob Lockie 110066 by: Tech Support 110072 by: Dennis Gearon Re: running php with .html files? 110057 by: Henry 110063 by: Peter 110067 by: Peter Janett Re: PHP/MySQL Search Engine Query Question 110058 by: Tech Support Oracle 8i SQL Problem.. 110059 by: Frank S. Kicenko Re: need help reg. User Accounts 110061 by: Bob Lockie REGEX for credit card number 110065 by: Mike Mannakee REGEX for phone # 110068 by: Mike Mannakee need help with uploading images 110069 by: Deadsam 110071 by: Oscar F 110073 by: Deadsam Adding slashes when magic quotes is off? 110070 by: Leif K-Brooks Re: How do I show the sourse code? 110074 by: David Robley David Steculorum/MIS/XLGroup is out of the office. 110075 by: DSteculorum.xlserv.com sessions and https 110076 by: Mike Mannakee 110077 by: Oscar F 110078 by: Tom Rogers 110079 by: Mike Mannakee Logging out with authentication 110080 by: Ray Todd Stevens Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- On Sun, 2002-07-28 at 10:14, Justin French wrote: on 29/07/02 12:02 AM, Kevin Breit ([EMAIL PROTECTED]) wrote: Aaaannny way, you can't modify WHAT php does in nl2br, but you can do something to the resulting code, like replacing /libr / with /li: ? $original = ulliBlar/li/ul; $new = nl2br($original); $new = str_replace('/libr /', '/li', $new); ? Hmmm..you've got it backwards, but I see what you mean. I'll tool around with it tonight. I don't think I did Manual Quote: Description mixed str_replace ( mixed search, mixed replace, mixed subject) So, we search for /libr / (the problem being the unnecessary br /, and replace it with /li. Unless I'm misunderstanding the question/problem. Oh wait, you're right! Kevin -- Kevin Breit [EMAIL PROTECTED] ---End Message--- ---BeginMessage--- Are you asking us how to write an entire online community program??? Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "umesh" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 28, 2002 6:40 AM Subject: [PHP] Help reg. create user and allocate space Hi Gurus, I am using PHP-4.1.1, postgresql on Linux. I want the following functionality, I dont know how to implement it. Each time a new user registeres, I want to create mail account by the name he specifies and allocate him some space of the server, say 2mb. How this is incorporated ? Please help. Thanking you all in anticipation. Regards Umesh. * Umesh A. Deshmukh. Manas Solutions Pvt. Ltd. [EMAIL PROTECTED] http://www.manas-solutions.com Ph. : 91+020+4006358,4223991/92 * ---End Message--- ---BeginMessage--- On Sunday 28 July 2002 19:40, umesh wrote: Hi Gurus, I am using PHP-4.1.1, postgresql on Linux. I want the following functionality, I dont know how to implement it. Each time a new user registeres, I want to create mail account by the name he specifies and allocate him some space of the server, say 2mb. How this is incorporated ? Manual - Program Execution functions These functions would allow PHP to call any system command or program. How you actually create the mail account and set quotas has nothing at all to do with PHP. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Radial Telemetry Infiltration */ ---End Message--- ---BeginMessage--- I am new to PHP and trying to implement some PHP and MySQL on my website. My website has a lot of tables and inside some of those tables, I want to display information that is drawn out of the MySQL database using PHP. I was wondering what goes faster: (A). Building the whole page normally up in HTML, doing the usual table td and so forth, and then inside the td calling up the PHP in order to display the information. For example: td ?php .. ? /td (B). Doing everything in the PHP document, also the 'building' of the tables, and then including the PHP script in the main page. For example using
[PHP] mod_php4.c errors on Apache Complie
Howdy, I've successfully complied PHP and the straight cigfiguration of apache 1.3.26 but when i go to configure php as a module in apache using #./configure --enable-module=max --enable-shared=max --activate-module=src/m odules/php4/libmodphp4.a i get the following error mod_php4.c:28:18: zend.h: No such file or directory mod_php4.c:29:17: php.h: No such file or directory mod_php4.c:30:27: php_variables.h: No such file or directory mod_php4.c:47:21: php_ini.h: No such file or directory mod_php4.c:48:25: php_globals.h: No such file or directory mod_php4.c:49:18: SAPI.h: No such file or directory mod_php4.c:50:22: php_main.h: No such file or directory mod_php4.c:52:26: zend_compile.h: No such file or directory mod_php4.c:53:26: zend_execute.h: No such file or directory mod_php4.c:54:28: zend_highlight.h: No such file or directory mod_php4.c:55:25: zend_indent.h: No such file or directory mod_php4.c:57:39: ext/standard/php_standard.h: No such file or directory In file included from mod_php4.c:61: mod_php4.h:34: parse error before zend_bool mod_php4.h:34: warning: no semicolon at end of struct or union mod_php4.h:35: warning: data definition has no type or storage class mod_php4.h:37: parse error before apache_module_entry mod_php4.h:37: warning: data definition has no type or storage class mod_php4.h:43: parse error before php_apache_info mod_php4.h:43: warning: data definition has no type or storage class mod_php4.c:67: parse error before TSRMLS_DC mod_php4.c:70: parse error before TSRMLS_DC mod_php4.c:71: warning: parameter names (without types) in function declaration mod_php4.c:72: parse error before '*' token mod_php4.c:73: parse error before '*' token mod_php4.c:90: parse error before HashTable mod_php4.c:91: parse error before HashTable mod_php4.c:92: parse error before HashTable mod_php4.c:93: parse error before HashTable mod_php4.c:94: parse error before HashTable mod_php4.c:95: parse error before HashTable mod_php4.c:127: parse error before TSRMLS_DC . . . . does any one have any idea's on why it is and what i can do about it? Cheers Peter the only dumb question is the one that wasn't asked -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Table formatting
I like this method a lot. Now, considering I do like FOR looping as a fact, how can I make a loop inside another loop. I mean, if I tell the first loop that $i=0 and then do the comparison and then add 1 to $i, in the inner or second loop should I state that $i=$i or what? Also make it $i=0??? Thanks, C. -Original Message- From: Chris Earle [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 27, 2002 1:54 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Table formatting You can do what he said or just put a separate loop inside the original loop. Depending on how you get the info, you can use either way (his would create less overhead if you are just using the same TD info every row, otherwise they're really the same because his way you'll have to create an array to access later for multiple rows, or just do my way and have the loop access the NEXT *3* (or whatever) items ...). i.e., for (LOOP FOR TR) { for (LOOP FOR TD) {} } César aracena [EMAIL PROTECTED] wrote in message 001a01c234f0$a5e8ad80$28ed0dd1@gateway">news:001a01c234f0$a5e8ad80$28ed0dd1@gateway... Hi all. Last nite I've came across a problem I wasn't able to figure out by my self. It's not difficult to make a loop that will make new *TABLE ROWS* (tr) to show several DB objects in a nice way. what I need to do, is to display 2 or maybe even 3 of this objects stored in a DB per table row, separated in different *TABLE COLUMS* (td). how can I achieve this? What I usually do is: -- // DB QUERY $query = SELECT * FROM table_name; $result = mysql_query($query) or die(mysql_error()); $num_rows = mysql_num_rows($result); // NOW THE LOOP for ($i=0; $i$num_rows; $i++) { $row = mysql_fetch_array($result); echo tr; echo td; echo $row[whatever]; echo /td; echo /tr; } -- but how can I get 2 or 3 columns displaying different db objects? A loop inside a loop? Thanks in advance, mailto:[EMAIL PROTECTED] Cesar Aracena CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621 -- 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] Nope it didn't work :(
I've been trying a few things that should actually work and for some strange reason they aren't. It's a strange one indeed. jpg is not a MIME type though (just thought I'd let you know that) but nevertheless it should work, but for some weird reason it isn't. I'll keep plugging away at it till I figure it out. Thanks Anyhow Deadsam if you come up with another method please let me know :) Oscar F [EMAIL PROTECTED] wrote in message 002001c23684$fc68ba20$bc00a8c0@320jupiter">news:002001c23684$fc68ba20$bc00a8c0@320jupiter... deadsman, if (($filename_type != image/jpeg) ($filename_type != image/jpg) ($filename_type != image/pjpeg)) { header(Location:submitError.php); exit; //goes to an error page if the file wasnt a jpg } else { $upload_path = /path/of/the/$filename_name; if (is_uploaded_file($filename)) { Exec(cp $filename $upload_path); } else { //do whatever if it wasnt uploaded } The file formfield, is called filename.. just in case... if you call it myFile, you'd have to replace $filename with that. Hope this helps. Oscar.- - Original Message - From: Deadsam [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 28, 2002 5:53 PM Subject: [PHP] need help with uploading images I'm trying to get an uploader to work, where you check to make sure it's a jpeg file that's being uploaded, and no other files allowed. the server is unix linux using php4.1 Any help would be appreciated. thanks in advance deasdam -- 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 Acronym: What does it mean to you?http://phpacronym.coolfreepage.com
Visit http://phpacronym.coolfreepage.com http://phpacronym.coolfreepage.com/ and submit what the PHP acronym means to you!
Re: [PHP] Oracle 8i SQL Problem..
I could be wrong on this but I believe that Oracle 8i uses a proprietary join syntax. This support has been added in the latest version of Oracle, but with 8i I believe you're out of luck using the left join keywords. Check out http://certcities.com/certs/oracle/columns/story.asp?EditorialsID=106 for more info on this. At 10:26 AM 7/28/2002 -0500, Frank S. Kicenko wrote: Hi, This really isn't a PHP issue..sorry. I'm having a nightmare with Oracle 8i (pos!). I'm writing common SQL which works for MSSQL 2K and seems correct for Oracle... but keeps giving me a Error.. ORA-00933 SQL command not properly ended on the following query... SELECT grp.grpdescrip, grp.grp, grp.createcust, grp.auth1, grp.auth2, usergrp.userid, users.userdescrip FROM grp LEFT JOIN usergrp ON grp.grp=usergrp.grp LEFT JOIN users ON usergrp.userid=users.userid ORDER BY grp.grp The error keeps pointing at the first LEFT JOIN. Anybody know why? -- 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: Table formatting
On Monday 29 July 2002 11:27, César Aracena wrote: I like this method a lot. Now, considering I do like FOR looping as a fact, how can I make a loop inside another loop. I mean, if I tell the first loop that $i=0 and then do the comparison and then add 1 to $i, in the inner or second loop should I state that $i=$i or what? Also make it $i=0??? Not sure if I understand your question. To nest for-loops you have to use a different counter for each loop. Eg, if you're using $i for the outer-loop you can use $j for the inner-loop. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Some people's mouths work faster than their brains. They say things they haven't even thought of yet. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mod_php4.c errors on Apache Complie
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Howdy, I've successfully complied PHP and the straight cigfiguration of apache 1.3.26 but when i go to configure php as a module in apache using #./configure --enable-module=max --enable-shared=max --activate-module=src/m odules/php4/libmodphp4.a i get the following error mod_php4.c:28:18: zend.h: No such file or directory SNIP more of the same does any one have any idea's on why it is and what i can do about it? I was under the (possibly wrong) understanding that .a libraries are static, not dynamically loadable. The way I usually get apache/php as a DSO is to compile apache first, with --enable-modules=max --enable-shared=max blah blah whatever else you need (but not -activate-module) Then copmile php with whatever config options you need _and_ --with-apxs=/full/path/to/apxs --with-apache-conf=/dir/where/your/apacheconf/files Last config item might be slightly different - can't remember exactly :-) Try ./configure --help |grep apache for the correct syntax. Then when you do make install for php it will install libphp4.so in the correct place and also amend your httpd.conf to activate php as DSO. The nyou just (re)start apache and off you go. Cheers -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Acronym: What does it mean to you?
In article 01c236b2$e5af1350$f5563944@cc1966780a, [EMAIL PROTECTED] says... Visit http://phpacronym.coolfreepage.com http://phpacronym.coolfreepage.com/ and submit what the PHP acronym means to you! Hmm, at least it is 404-compliant :-) -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Table formatting
I know no one in this list like to think we newbie's want the job done for us, so I'm trying to figure out the below question myself, but trust me when I say it's making me nuts... this is my best shot so far: $query = SELECT * FROM saav_arts ORDER BY artid; $result = mysql_query($query) or die(mysql_error()); $num_rows = mysql_num_rows($result); $num_cols = 2; for ($x = 0; $x $num_rows; $x++) { echo tr; for ($i = 0; $i $num_cols; $i++) { $row = mysql_fetch_array($result); echo td align=\center\; echo a href=\details.php?artid=.$row[artid].\img src=\.$CFG-artdir./.$row[artsmall].\ ALT=\.$row[artname].\ BORDER=\0\/a; echo /td; } echo /tr; } The thing is that it shows up two columns as I want, but not the 4 images that I have in DB... it shows 2 rows of 2 images each and antoher 2 rows of 2 *NOT DIPLAYED* images which I don't have... like it was looping again with nothing to fetch from the DB... What is this? Jason: as I wrote this, your tip came over and as you can see I did figure it out (almost melted my brain though)... now, do you know what is going on? Thanx, C. -Original Message- From: César Aracena [mailto:[EMAIL PROTECTED]] Sent: Monday, July 29, 2002 12:27 AM To: 'Chris Earle'; [EMAIL PROTECTED] Subject: RE: [PHP] Re: Table formatting I like this method a lot. Now, considering I do like FOR looping as a fact, how can I make a loop inside another loop. I mean, if I tell the first loop that $i=0 and then do the comparison and then add 1 to $i, in the inner or second loop should I state that $i=$i or what? Also make it $i=0??? Thanks, C. -Original Message- From: Chris Earle [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 27, 2002 1:54 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Table formatting You can do what he said or just put a separate loop inside the original loop. Depending on how you get the info, you can use either way (his would create less overhead if you are just using the same TD info every row, otherwise they're really the same because his way you'll have to create an array to access later for multiple rows, or just do my way and have the loop access the NEXT *3* (or whatever) items ...). i.e., for (LOOP FOR TR) { for (LOOP FOR TD) {} } César aracena [EMAIL PROTECTED] wrote in message 001a01c234f0$a5e8ad80$28ed0dd1@gateway">news:001a01c234f0$a5e8ad80$28ed0dd1@gateway... Hi all. Last nite I've came across a problem I wasn't able to figure out by my self. It's not difficult to make a loop that will make new *TABLE ROWS* (tr) to show several DB objects in a nice way. what I need to do, is to display 2 or maybe even 3 of this objects stored in a DB per table row, separated in different *TABLE COLUMS* (td). how can I achieve this? What I usually do is: -- // DB QUERY $query = SELECT * FROM table_name; $result = mysql_query($query) or die(mysql_error()); $num_rows = mysql_num_rows($result); // NOW THE LOOP for ($i=0; $i$num_rows; $i++) { $row = mysql_fetch_array($result); echo tr; echo td; echo $row[whatever]; echo /td; echo /tr; } -- but how can I get 2 or 3 columns displaying different db objects? A loop inside a loop? Thanks in advance, mailto:[EMAIL PROTECTED] Cesar Aracena CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621 -- 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] Re: mod_php4.c errors on Apache Complie
problem solved!!! thanks for your help Dave :D Cheers Peter -Original Message- From: David Robley [mailto:[EMAIL PROTECTED]] Sent: Monday, 29 July 2002 2:02 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: mod_php4.c errors on Apache Complie In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Howdy, I've successfully complied PHP and the straight cigfiguration of apache 1.3.26 but when i go to configure php as a module in apache using #./configure --enable-module=max --enable-shared=max --activate-module=src/m odules/php4/libmodphp4.a i get the following error mod_php4.c:28:18: zend.h: No such file or directory SNIP more of the same does any one have any idea's on why it is and what i can do about it? I was under the (possibly wrong) understanding that .a libraries are static, not dynamically loadable. The way I usually get apache/php as a DSO is to compile apache first, with --enable-modules=max --enable-shared=max blah blah whatever else you need (but not -activate-module) Then copmile php with whatever config options you need _and_ --with-apxs=/full/path/to/apxs --with-apache-conf=/dir/where/your/apacheconf/files Last config item might be slightly different - can't remember exactly :-) Try ./configure --help |grep apache for the correct syntax. Then when you do make install for php it will install libphp4.so in the correct place and also amend your httpd.conf to activate php as DSO. The nyou just (re)start apache and off you go. Cheers -- David Robley Temporary Kiwi! Quod subigo farinam -- 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] Logging out with authentication
Ray Todd Stevens wrote: I am working on a web site that is using php controled www- authenticate authentication. User ids are specific to users and different pages and different levels of information for a given page will be displayed based on the user id used. The problem is how do you log out without having to quit all browser sessions. HTTP authentication is a protocol-level mechanism that is outside of PHP. Though PHP gives you some control over the HTTP response (the message from the Web server to the Web client), it cannot grant you control of future HTTP requests (messages from the Web client to the Web server), which is what you are wanting to do. You see, there is no such thing as logging out with HTTP authentication (because you are never exactly logged in); every HTTP request must include the authentication credentials. Because most browsers will save this information rather than prompting for it for every request, it can appear as if you are logged in until the browser session is destroyed, but that's not actually how it works. So, in case I did not explain that well, whether the Web browser returns the HTTP authentication credentials in future requests is entirely up to the Web browser and is thus a browser configuration issue. However, I'm not aware (someone feel free to correct me) of any browsers that allow you to turn off this caching behavior with regards to HTTP authentication anyway, so you will have no option other than to end the browser session. That's not the answer you are wanting, but might I suggest you look into writing your own access restriction logic in PHP rather than using HTTP authentication. This is what most developers choose, and it will give you far more flexibility and security. Happy hacking. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Oracle 8i SQL Problem..
You'll prob. need to use the (+) to join like this SELECT grp.grpdescrip, grp.grp, grp.createcust, grp.auth1, grp.auth2, usergrp.userid, users.userdescrip FROM grp, usergrp, users WHERE grp.grp = usergrp.grp (+) AND usergrp.userid=users.userid (+) ORDER BY grp.grp -Original Message- From: Nick Oostveen [mailto:[EMAIL PROTECTED]] Sent: Monday, July 29, 2002 1:47 PM To: Frank S. Kicenko; [EMAIL PROTECTED] Subject: Re: [PHP] Oracle 8i SQL Problem.. I could be wrong on this but I believe that Oracle 8i uses a proprietary join syntax. This support has been added in the latest version of Oracle, but with 8i I believe you're out of luck using the left join keywords. Check out http://certcities.com/certs/oracle/columns/story.asp?EditorialsID=106 for more info on this. At 10:26 AM 7/28/2002 -0500, Frank S. Kicenko wrote: Hi, This really isn't a PHP issue..sorry. I'm having a nightmare with Oracle 8i (pos!). I'm writing common SQL which works for MSSQL 2K and seems correct for Oracle... but keeps giving me a Error.. ORA-00933 SQL command not properly ended on the following query... SELECT grp.grpdescrip, grp.grp, grp.createcust, grp.auth1, grp.auth2, usergrp.userid, users.userdescrip FROM grp LEFT JOIN usergrp ON grp.grp=usergrp.grp LEFT JOIN users ON usergrp.userid=users.userid ORDER BY grp.grp The error keeps pointing at the first LEFT JOIN. Anybody know why? -- 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] Logging out with authentication
I do understand how this works. Yea the browser caches the information and returns it each time. I was tryiung to find a way to clear this cache. (seems to be a failure in current browsers that there is no command for this) Or have a system so that a cookie can be created that forces a change. The problem I have with the cookie solution is that cookies only seem to change if the page is fully loaded. I can rejject the login and make them reinter the userid.password if a cookie is set. But I then can't erase the cookie. Once it is set the user id and password never will work again until the browser exits. Ray Todd Stevens wrote: I am working on a web site that is using php controled www- authenticate authentication. User ids are specific to users and different pages and different levels of information for a given page will be displayed based on the user id used. The problem is how do you log out without having to quit all browser sessions. HTTP authentication is a protocol-level mechanism that is outside of PHP. Though PHP gives you some control over the HTTP response (the message from the Web server to the Web client), it cannot grant you control of future HTTP requests (messages from the Web client to the Web server), which is what you are wanting to do. You see, there is no such thing as logging out with HTTP authentication (because you are never exactly logged in); every HTTP request must include the authentication credentials. Because most browsers will save this information rather than prompting for it for every request, it can appear as if you are logged in until the browser session is destroyed, but that's not actually how it works. So, in case I did not explain that well, whether the Web browser returns the HTTP authentication credentials in future requests is entirely up to the Web browser and is thus a browser configuration issue. However, I'm not aware (someone feel free to correct me) of any browsers that allow you to turn off this caching behavior with regards to HTTP authentication anyway, so you will have no option other than to end the browser session. That's not the answer you are wanting, but might I suggest you look into writing your own access restriction logic in PHP rather than using HTTP authentication. This is what most developers choose, and it will give you far more flexibility and security. Happy hacking. Chris -- Ray Todd Stevens Specialists in Network and Security Consulting Senior ConsultantSoftware audit service available Stevens Services Suite 21 3754 Old State Rd 37 N Bedford, IN 47421 (812) 279-9394 [EMAIL PROTECTED] Thought for the day: Concerto (n): a fight between a piano and a pianist. For PGP public key send message with subject please send PGP key If this message refers to an attachment the attachment may arrive as a seperate mail message depending on the type of mail client and gateway software you are using. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Reg-Vulnerabilities in PHP
Hello Folks, I have applied patch to PHP4.0.6.Any one of you please suggest on how to test the patched version and confirm that the vulnerability is fixed. [Note :Patch is applied for the following Vulnerability. Vulnerabilities in the php_mime_split function may allow an intruder to execute arbitrary code with the privileges of the web server.] Any help is appreciated. Advance thanks and regards, Senthil.
[PHP] PHP + Form + Session Problem. Please help
Hi all, I have been working on an online shopping thingy for quite a while and I have encounter a strange problem which could not be solved. Deeply needed your help. Problem: Its very hard to explain this. So, if you do not quite understand it, please tell me, I will send some screenshots to you personally... I tried send it here but it was rejected. Okay.. here goes... I have a product list, where customers can select which products to buy and enter the quantity they want... Upon clicking on Order button, the customer is brought to his shopping cartwhere there is the product, with price in Per Unit, Qty, and Total Price . In this area, value for Qty column is obtained from the $qty that is passed on from the previous page, where it is also a registered in session_register(qty). (The same goes to the Product, where prod_id is obtained from $prod_id, also a session registered variable.) It worked out fine so far... it could get the product, unit price, qty and the total price. But then, when I continued shopping second time, doing the same thing, first select the product, then enter the quantity and then dump it in the shopping cart, something starts going wrong... the Qty column do not show any value at all.. However, products are still working... which means that the $prod_id session is recorded. How come? Here is the snippet of the script: (took out the HTML font tags to make it more readable) The code I used to create the table in the product list - ?php session_start(); session_register(qty); ? all other normal thingy.. while($query_data = mysql_fetch_array($result)) { $price = $query_data[price_lq] * $rrp * $gst; $RowColor = useColor(); echo TR BGCOLOR=\$RowColor\; echo TD.$query_data[prod_brand]./TD; echo TD.$query_data[prod_code]./TD; echo TD.$query_data[prod_desc]./TD; echo TD$,number_format($price, 2, '.', ''),/TD; echo TDinput name=\qty[.$query_data[prod_id].]\ type=\text\ size=\1\/TD\n; echo TDinput type=\checkbox\ name=\choice[, $query_data[prod_id], ]\ value=\, $query_data[prod_id],\/TD\n; } all other html stuffs. --- This is the code I used for the shopping cart --- ?php session_start(); session_register(qty); ? all other normal thingy.. while (list($key,$prod_id) = each($cart)) { $result = mysql_query(SELECT * FROM products WHERE prod_id = '$prod_id' ORDER BY prod_brand ASC, $link_id); $query_data = mysql_fetch_array($result); $RowColor = useColor(); $index = $query_data[prod_id]; $quantity = $qty[$index]; $price_perunit = $query_data[price_lq] * $rrp * $gst; $total_price = $query_data[price_lq] * $rrp * $gst * $quantity; $grandtotal = $grandtotal + $total_price; echo TR BGCOLOR=\$RowColor\; echo TD.$query_data[prod_brand]./TD; echo TD.$query_data[prod_desc]./TD; echo TD$.number_format($price_perunit, 2, '.', '')./TD; echo TD.$quantity./TD; echo TD$.number_format($total_price, 2, '.', '')./strongBR/FONTnbsp;nbsp;/TD\n; echo \tTDa href=\delete.php?delete=.$query_data[prod_id].\ Onclick=\return confirm('Are you sure?');\; echo [Delete]/a/TD/TR; } other html stuffs. --
RE: [PHP] Re: Table formatting
try changing these two lines $num_rows = mysql_num_rows($result); $num_cols = 2; to this $num_cols = 2; $num_rows = mysql_num_rows($result) / $num_cols; this isn't the full solution, but will help you on your way... HTH Martin -Original Message- From: César Aracena [mailto:[EMAIL PROTECTED]] Sent: Monday, July 29, 2002 2:03 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Re: Table formatting I know no one in this list like to think we newbie's want the job done for us, so I'm trying to figure out the below question myself, but trust me when I say it's making me nuts... this is my best shot so far: $query = SELECT * FROM saav_arts ORDER BY artid; $result = mysql_query($query) or die(mysql_error()); $num_rows = mysql_num_rows($result); $num_cols = 2; for ($x = 0; $x $num_rows; $x++) { echo tr; for ($i = 0; $i $num_cols; $i++) { $row = mysql_fetch_array($result); echo td align=\center\; echo a href=\details.php?artid=.$row[artid].\img src=\.$CFG-artdir./.$row[artsmall].\ ALT=\.$row[artname].\ BORDER=\0\/a; echo /td; } echo /tr; } The thing is that it shows up two columns as I want, but not the 4 images that I have in DB... it shows 2 rows of 2 images each and antoher 2 rows of 2 *NOT DIPLAYED* images which I don't have... like it was looping again with nothing to fetch from the DB... What is this? Jason: as I wrote this, your tip came over and as you can see I did figure it out (almost melted my brain though)... now, do you know what is going on? Thanx, C. -Original Message- From: César Aracena [mailto:[EMAIL PROTECTED]] Sent: Monday, July 29, 2002 12:27 AM To: 'Chris Earle'; [EMAIL PROTECTED] Subject: RE: [PHP] Re: Table formatting I like this method a lot. Now, considering I do like FOR looping as a fact, how can I make a loop inside another loop. I mean, if I tell the first loop that $i=0 and then do the comparison and then add 1 to $i, in the inner or second loop should I state that $i=$i or what? Also make it $i=0??? Thanks, C. -Original Message- From: Chris Earle [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 27, 2002 1:54 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Table formatting You can do what he said or just put a separate loop inside the original loop. Depending on how you get the info, you can use either way (his would create less overhead if you are just using the same TD info every row, otherwise they're really the same because his way you'll have to create an array to access later for multiple rows, or just do my way and have the loop access the NEXT *3* (or whatever) items ...). i.e., for (LOOP FOR TR) { for (LOOP FOR TD) {} } César aracena [EMAIL PROTECTED] wrote in message 001a01c234f0$a5e8ad80$28ed0dd1@gateway">news:001a01c234f0$a5e8ad80$28ed0dd1@gateway... Hi all. Last nite I've came across a problem I wasn't able to figure out by my self. It's not difficult to make a loop that will make new *TABLE ROWS* (tr) to show several DB objects in a nice way. what I need to do, is to display 2 or maybe even 3 of this objects stored in a DB per table row, separated in different *TABLE COLUMS* (td). how can I achieve this? What I usually do is: -- // DB QUERY $query = SELECT * FROM table_name; $result = mysql_query($query) or die(mysql_error()); $num_rows = mysql_num_rows($result); // NOW THE LOOP for ($i=0; $i$num_rows; $i++) { $row = mysql_fetch_array($result); echo tr; echo td; echo $row[whatever]; echo /td; echo /tr; } -- but how can I get 2 or 3 columns displaying different db objects? A loop inside a loop? Thanks in advance, mailto:[EMAIL PROTECTED] Cesar Aracena CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need help with uploading images
Hi, Monday, July 29, 2002, 7:53:30 AM, you wrote: D I'm trying to get an uploader to work, where you check to make sure it's a D jpeg file that's being uploaded, and no other files allowed. the server is D unix linux using php4.1 D Any help would be appreciated. D thanks in advance D deasdam This may work: $im = getimagesize('anchor.jpg'); if($im[2] == 2 $im[0] 0 $im[1] 0) echo 'Found a JPEG br'; or even this; if($fd = fopen('test.jpg', r)): fseek($fd,6); $f = fread($fd,4); if($f == JFIF) echo JPEG br; fclose ($fd); endif; -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] REGEX for credit card number
On Sun, Jul 28, 2002 at 04:02:32PM -0400, Mike Mannakee wrote: Does anyone have a regular expression that works to validate credit card numbers? http://www.analysisandsolutions.com/code/ccvs-ph.htm I just updated it to Version 4.3 LATE Friday night. So, anyone using anything earlier than that should upgrade. Enjoy, --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php