[PHP] Correct code ?? PHP Basic pw athentication with mysql

2009-07-27 Thread Jason Guritz
I cant seem to get this to work. Any ideas?? And If I have post this to the wrong area.. My sincere apologies! Thank you in advance! Jason ?php if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm=My realm'); header(HTTP/1.0 401 Unauthorized); echo

Re: [PHP] JS alert that links to a file

2009-07-27 Thread Jim Lucas
Skip Evans wrote: LinuxManMikeC wrote: ?php header('Content-type: text/csv'); header('Content-Disposition: attachment; filename=file.csv'); echo 'field1,field2,field3,field4'; ? Okay, right, I remember this. But it has to be in it's own file, otherwise you get the 'headers already sent

Re: [PHP] Correct code ?? PHP Basic pw athentication with mysql

2009-07-27 Thread Jim Lucas
Jason Guritz wrote: I cant seem to get this to work. Any ideas?? And If I have post this to the wrong area.. My sincere apologies! Thank you in advance! Jason ?php if ( !isset($_SERVER['PHP_AUTH_USER']) ) { header('WWW-Authenticate: Basic realm=My realm'); header(HTTP/1.0

Re: [PHP] Saving server side file to local machine with JS

2009-07-27 Thread Thijs Lensselink
Skip Evans wrote: Sorry, I should have been clearer. When PHP finishes creating the file I need one of the JS alert type windows to appear that says.. Your file has completed, would you like to save it to your machine? Like you get when you download a file. If I knew the JS code to

Re: [PHP] open source forum

2009-07-27 Thread mrfroasty
Thanks for the input, after playing around the choicesI think I might go for SMF. Looks pretty cool software, So far I have checked Phorum, phpBB and SMF only. The only negative thing I can tell so far is there is no gettext infrastructure on SMF or phorum...but atleast there is a means to

RE: [PHP] open source forum

2009-07-27 Thread Bob McConnell
From: mrfroasty I need some advice in picking a PHP forum for a group of people, I know there are couple of them but could somebody from here give advice on which one to choose. Your request is a bit open ended. Are you looking for blogs, wiki, message based, or what? A couple of years ago

[PHP] More on JS alert that links to file

2009-07-27 Thread tony mount
I have a question that follows on from this discussion. I have a loop which creates a number of files. It first write each file to a server location then sets up the headers and asks the Save As question. This works OK once, but after the first download it exits without any errors or messages. If

Re: [PHP] More on JS alert that links to file

2009-07-27 Thread Ashley Sheridan
I assume you want to force the files to the user as a series of files to download? Have you considered just offering a page of links to each file? You can actually have the links go to a PHP script which can stream the file as a forced download, and the user can then download the files one-by-one

[PHP] How to pull window to the foreground - Window Focus

2009-07-27 Thread WebPat
I have a web page with a button that displays additional information for the user. It does a Window.Open to create a popup window, then populates it. If the user goes back to the web page without closing the window, it often goes behind the browser and is not visible (which is not the

Re: [PHP] JS alert that links to a file

2009-07-27 Thread Skip Evans
Hey all, With LinuxMan's help I got this working. It was a bit tricky as it's an AJAX environment, but what I did was create a separate page with code similar to what he has below and then call it from the JS side and it works great. Thanks all, and especially LinuxManMikeC for the key!

Re: [PHP] Question on code profiling

2009-07-27 Thread Andrew Ballard
On Sat, Jul 25, 2009 at 1:31 AM, Daniel Kolbokolb0...@umn.edu wrote: Andrew Ballard wrote: On Thu, Jul 23, 2009 at 11:31 PM, Andrew Ballardaball...@gmail.com wrote: From what I can tell, the numbers I see in WinCacheGrind look like they are off by about a factor of 10 pretty uniformly.

Re: [PHP] How to pull window to the foreground - Window Focus

2009-07-27 Thread Bastien Koert
On Mon, Jul 27, 2009 at 8:31 AM, WebPatwebpa...@gmail.com wrote: I have a web page with a button that displays additional information for the user. It does a Window.Open to create a popup window, then populates it. If the user goes back to the web page without closing the window, it often

Re: [PHP] How to pull window to the foreground - Window Focus

2009-07-27 Thread WebPat
Bastien Koert wrote: On Mon, Jul 27, 2009 at 8:31 AM, WebPatwebpa...@gmail.com wrote: I have a web page with a button that displays additional information for the user. It does a Window.Open to create a popup window, then populates it. If the user goes back to the web page without closing the

[PHP] Imposing a range on what is stored in a session variable

2009-07-27 Thread Miller, Terion
I want to store only 1000 records at a time in the session variable thought I could use a range(1,1000 How would you do this, store the first 1000 , then the second on refresh etc My snippet so far --- // Process all results

RE: [PHP] More on JS alert that links to file

2009-07-27 Thread kyle.smith
You really can't send multiple files in a single response, and you certainly can't send multiple headers after data has gone through. Zipping would be a nice approach. Another would be to use AJAX calls to sequenctially download the files. HTH, - Kyle -Original Message- From: Ashley

Re: [PHP] Imposing a range on what is stored in a session variable

2009-07-27 Thread Bastien Koert
On Mon, Jul 27, 2009 at 10:30 AM, Miller, Teriontmil...@springfi.gannett.com wrote: I want to store only 1000 records at a time in the session variable thought I could use a range(1,1000 How would you do this, store the first 1000 , then the second on refresh etc My snippet so far

Re: [PHP] More on JS alert that links to file

2009-07-27 Thread Jim Lucas
tony mount wrote: I have a question that follows on from this discussion. I have a loop which creates a number of files. It first write each file to a server location then sets up the headers and asks the Save As question. This works OK once, but after the first download it exits without any

Re: [PHP] How to pull window to the foreground - Window Focus

2009-07-27 Thread Andrew Ballard
On Mon, Jul 27, 2009 at 10:26 AM, WebPatwebpa...@gmail.com wrote: Bastien Koert wrote: On Mon, Jul 27, 2009 at 8:31 AM, WebPatwebpa...@gmail.com wrote: I have a web page with a button that displays additional information for the user. It does a Window.Open to create a popup window, then

RE: [PHP] More on JS alert that links to file

2009-07-27 Thread Ashley Sheridan
On Mon, 2009-07-27 at 10:30 -0400, kyle.smith wrote: You really can't send multiple files in a single response, and you certainly can't send multiple headers after data has gone through. Zipping would be a nice approach. Another would be to use AJAX calls to sequenctially download the

Re: [PHP] More on JS alert that links to file

2009-07-27 Thread Ashley Sheridan
On Mon, 2009-07-27 at 07:34 -0700, Jim Lucas wrote: tony mount wrote: I have a question that follows on from this discussion. I have a loop which creates a number of files. It first write each file to a server location then sets up the headers and asks the Save As question. This works OK

Re: [PHP] More on JS alert that links to file

2009-07-27 Thread Andrew Ballard
On Mon, Jul 27, 2009 at 10:34 AM, Jim Lucasli...@cmsws.com wrote: Ashley's answer is correct.  But the one thing she ... He. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Imposing a range on what is stored in a session variable

2009-07-27 Thread Jim Lucas
Miller, Terion wrote: I want to store only 1000 records at a time in the session variable thought I could use a range(1,1000 How would you do this, store the first 1000 , then the second on refresh etc My snippet so far ---

Re: [PHP] More on JS alert that links to file

2009-07-27 Thread Jim Lucas
Ashley Sheridan wrote: On Mon, 2009-07-27 at 07:34 -0700, Jim Lucas wrote: tony mount wrote: I have a question that follows on from this discussion. I have a loop which creates a number of files. It first write each file to a server location then sets up the headers and asks the Save As

Re: [PHP] More on JS alert that links to file

2009-07-27 Thread Ashley Sheridan
On Mon, 2009-07-27 at 07:43 -0700, Jim Lucas wrote: Ashley Sheridan wrote: On Mon, 2009-07-27 at 07:34 -0700, Jim Lucas wrote: tony mount wrote: I have a question that follows on from this discussion. I have a loop which creates a number of files. It first write each file to a server

Re: [PHP] Imposing a range on what is stored in a session variable

2009-07-27 Thread Miller, Terion
Well there are currently about 17000 records in the db, and my manager wants to have it only pulling in 1000 at a time as a session range And why do my code snippets always look so messed up , I put them in using the rich text or html settings in my Entourage mail... They look fine when I send

Re: [PHP] Imposing a range on what is stored in a session variable

2009-07-27 Thread Miller, Terion
On 7/27/09 9:40 AM, Jim Lucas li...@cmsws.com wrote: Miller, Terion wrote: I want to store only 1000 records at a time in the session variable thought I could use a range(1,1000 How would you do this, store the first 1000 , then the second on refresh etc My snippet so far

Re: [PHP] Imposing a range on what is stored in a session variable

2009-07-27 Thread Bastien Koert
On Mon, Jul 27, 2009 at 10:44 AM, Miller, Teriontmil...@springfi.gannett.com wrote: Well there are currently about 17000 records in the db, and my manager wants to have it only pulling in 1000 at a time as a session range And why do my code snippets always look so messed up , I put them in

Re: [PHP] Imposing a range on what is stored in a session variable

2009-07-27 Thread Ashley Sheridan
On Mon, 2009-07-27 at 07:44 -0700, Miller, Terion wrote: Well there are currently about 17000 records in the db, and my manager wants to have it only pulling in 1000 at a time as a session range And why do my code snippets always look so messed up , I put them in using the rich text or html

Re: [PHP] Imposing a range on what is stored in a session variable

2009-07-27 Thread Miller, Terion
=snipped I would page the data with the LIMIT call as Jim suggested. What is the user doing with 1K records and how are they getting 1K records? -- Bastien Cat, the other other white meat Here is a link to the code at PasteBin It's a db full of the town's restaurant inspections

Re: [PHP] Imposing a range on what is stored in a session variable

2009-07-27 Thread Bastien Koert
On Mon, Jul 27, 2009 at 10:54 AM, Miller, Teriontmil...@springfi.gannett.com wrote: =snipped I would page the data with the LIMIT call as Jim suggested. What is the user doing with 1K records and how are they getting 1K records? -- Bastien Cat, the other other white meat

Re: [PHP] Imposing a range on what is stored in a session variable

2009-07-27 Thread Shawn McKenzie
Miller, Terion wrote: On 7/27/09 9:40 AM, Jim Lucas li...@cmsws.com wrote: Miller, Terion wrote: I want to store only 1000 records at a time in the session variable thought I could use a range(1,1000 How would you do this, store the first 1000 , then the second on refresh etc My

Re: [PHP] Imposing a range on what is stored in a session variable

2009-07-27 Thread Jim Lucas
Miller, Terion wrote: On 7/27/09 9:40 AM, Jim Lucas li...@cmsws.com wrote: Miller, Terion wrote: I want to store only 1000 records at a time in the session variable thought I could use a range(1,1000 How would you do this, store the first 1000 , then the second on refresh etc My

Re: [PHP] Imposing a range on what is stored in a session variable

2009-07-27 Thread Bastien Koert
On Mon, Jul 27, 2009 at 11:25 AM, Shawn McKenzienos...@mckenzies.net wrote: Miller, Terion wrote: On 7/27/09 9:40 AM, Jim Lucas li...@cmsws.com wrote: Miller, Terion wrote: I want to store only 1000 records at a time in the session variable thought I could use a range(1,1000 How

Re: [PHP] How to pull window to the foreground - Window Focus

2009-07-27 Thread WebPat
Andrew Ballard wrote: A lot of sites are moving to simulated dialog windows inside the page. They have a few nice benefits: 1) Since they aren't real windows, they do not interfere with other tabs or windows you have open in your browser. 2) Since they are actually part of the page itself,

Re: [PHP] How to pull window to the foreground - Window Focus

2009-07-27 Thread Bastien Koert
On Mon, Jul 27, 2009 at 11:39 AM, WebPatwebpa...@gmail.com wrote: Andrew Ballard wrote: A lot of sites are moving to simulated dialog windows inside the page. They have a few nice benefits: 1) Since they aren't real windows, they do not interfere with other tabs or windows you have open in

Re: [PHP] How to pull window to the foreground - Window Focus

2009-07-27 Thread Andrew Ballard
On Mon, Jul 27, 2009 at 11:46 AM, Bastien Koertphps...@gmail.com wrote: Back to the DIVs option, you can write js controls that make the window dragable, hidable etc to improve the users enjoyment of the page -- Bastien Some implementations are definitely better than others. Like any

[PHP] Single Quotes in Form Inputs

2009-07-27 Thread Ben Miller
Hi, I have a form in which my sales reps can add new clients into the database, but I'm running into a problem if the client's name includes a single quote, such as O'Henry, when it comes time to input the form data into the database table. I'm guessing I need to use ereg_replace, or

Re: [PHP] Single Quotes in Form Inputs

2009-07-27 Thread Mari Masuda
You need to sanitize and escape the input before inserting it into the db. You can use http://us.php.net/mysql_real_escape_string to escape the input. On Jul 27, 2009, at 09:35, Ben Miller wrote: Hi, I have a form in which my sales reps can add new clients into the database, but I'm

Re: [PHP] Single Quotes in Form Inputs

2009-07-27 Thread Michael A. Peters
Bastien Koert wrote: On Mon, Jul 27, 2009 at 12:41 PM, Mari Masudambmas...@stanford.edu wrote: You need to sanitize and escape the input before inserting it into the db. You can use http://us.php.net/mysql_real_escape_string to escape the input. On Jul 27, 2009, at 09:35, Ben Miller wrote:

Re: [PHP] Single Quotes in Form Inputs

2009-07-27 Thread Jim Lucas
Michael A. Peters wrote: Bastien Koert wrote: On Mon, Jul 27, 2009 at 12:41 PM, Mari Masudambmas...@stanford.edu wrote: You need to sanitize and escape the input before inserting it into the db. You can use http://us.php.net/mysql_real_escape_string to escape the input. On Jul 27, 2009,

Re: [PHP] open source forum

2009-07-27 Thread mrfroasty
Sorry if I wasnt clear enough, but I was looking for forum or may be the way you called it message board for people to discuss topics. Mostly its going to be a political Forum where people discuss major political topics/news about their country. So basically my search ended up with SMF as a

Re: [PHP] How to pull window to the foreground - Window Focus

2009-07-27 Thread WebPat
Richard Heyes wrote: Hi, A lot of sites are moving to simulated dialog windows inside the page. There's an updated version of my ModalDialog included in RGraph which does just this: http://www.rgraph.net/docs/external.html It covers the page in a semi transparent DIV to bring attention to

RE: [PHP] Single Quotes in Form Inputs

2009-07-27 Thread Yuri Yarlei
I think mysql_real_escape_string() is work well, but if you are use mysql db, if you are using another db, the best function is addslashes but for another special charactes you will need treat them with another ways Yuri Yarlei. Programmer PHP, CSS, Java, PostregreSQL; Today PHP, tomorrow

RE: [PHP] Single Quotes in Form Inputs

2009-07-27 Thread Bob McConnell
From: Yuri Yarlei I think mysql_real_escape_string() is work well, but if you are use mysql db, if you are using another db, the best function is addslashes but for another special charactes you will need treat them with another ways Slashes are the wrong character to use. The official SQL

Re: [PHP] More on JS alert that links to file

2009-07-27 Thread tony mount
Thanks very much to all the he's and any she's who answered this. Tony -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] newbie: problem with $_Post[]

2009-07-27 Thread A.a.k
Hello I have a very simple test form named pass.php : form action=pass.php method=POST username : input type=text name=user br / password : input type=password name=pass br / input type=submit value=gop /form ?php $user=$_POST['user']; $pass=$_POST['pass']; if(($user==myname)($pass=mypass))

Re: [PHP] newbie: problem with $_Post[]

2009-07-27 Thread Bastien Koert
On Mon, Jul 27, 2009 at 10:31 PM, A.a.kblue...@gmail.com wrote: Hello I have a very simple test form named pass.php  : form action=pass.php method=POST username : input type=text name=user br / password : input type=password name=pass br / input type=submit value=gop /form ?php

Fwd: [PHP] newbie: problem with $_Post[]

2009-07-27 Thread Richard S. Crawford
form action=pass.php method=POST username : input type=text name=user br / password : input type=password name=pass br / input type=submit value=gop /form ?php $user=$_POST['user']; $pass=$_POST['pass']; if(($user==myname)($pass=mypass)) echo access granted; else echo access denied;

Re: Fwd: [PHP] newbie: problem with $_Post[]

2009-07-27 Thread Paul M Foster
On Mon, Jul 27, 2009 at 09:01:16PM -0700, Richard S. Crawford wrote: form action=pass.php method=POST username : input type=text name=user br / password : input type=password name=pass br / input type=submit value=gop /form ?php $user=$_POST['user']; $pass=$_POST['pass'];

Re: [PHP] Single Quotes in Form Inputs

2009-07-27 Thread Ben Dunlap
You can use http://us.php.net/mysql_real_escape_string to escape the input. [8] You should prep your data for insertion into the data by using a tool that formats it strictly for the database. In the ops case mysql_real_escape_string() is the correct tool for the job. What about using