php-general Digest 28 Jul 2009 03:15:25 -0000 Issue 6253

Topics (messages 295888 through 295906):

Re: Imposing  a range on what is stored in a session variable
        295888 by: Shawn McKenzie
        295889 by: Jim Lucas
        295890 by: Bastien Koert

Re: How to pull window to the foreground - Window Focus
        295891 by: WebPat
        295892 by: Bastien Koert
        295893 by: Andrew Ballard
        295896 by: WebPat
        295898 by: Richard Heyes
        295902 by: WebPat

Single Quotes in Form Inputs
        295894 by: Ben Miller
        295895 by: Mari Masuda
        295897 by: Bastien Koert
        295899 by: Michael A. Peters
        295900 by: Jim Lucas
        295903 by: Yuri Yarlei
        295904 by: Bob McConnell

Re: open source forum
        295901 by: mrfroasty

Re: More on "JS alert that links to file"
        295905 by: tony mount

newbie: problem with $_Post[]
        295906 by: A.a.k

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
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 snippet so far
>>
>> -----------------------
>>                                             // Process all results into 
>> $_SESSION array                                                              
>>          $position = 1;                                                      
>>                       while ($row = mysql_fetch_array($result))              
>>                         {                                      
>> $_SESSION['fullRestaurantList'][$position] = $row;                           
>>            $position++;                                                      
>>                        foreach(range('1','1000') as $c){                     
>>                               ($position == $c)
>>                                                     
>> $_SESSION['totalNumberOfRestaurants'] = $c;                                  
>>     }                                                                        
>>                                                                             }
>>
> 
> Use the mysql function for this called LIMIT.  It LIMITs the amount of
> data returned.
> 
> SELECT * FROM table_name LIMIT 1000
> 
> 1. it will make your SQL calls much faster
> 2. it will use less memory
> 
> 
> 
> 
> But that limits results right, if a query generated more then 1000 records 
> how would a user be able to access 1001 ..put the query in a loop?

Bastien gave you all the info:

You should look at paging the data here with the OFFSET portion of the
limit clause

Select * from restaurant [where clause]limit 1000, $offset

where the $offset value can tell you where to start in the 17K rows of
data so that in effect you show records 1-1000, 1001-2000,
2001-3000...then on the page, just provide a set of links of navigate
the recordset by the user  [ << < 1-1000 1001-2000 2001-3000 > >> ]

***

So you would generate page that had the first 1000 records and a Next >
link that linked maybe to the same page with ?start=1001.  Then use the
$_GET['start'] to generate the next set of results staring at 1001.


-- 
Thanks!
-Shawn
http://www.spidean.com

--- End Message ---
--- Begin Message ---
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 snippet so far
>>
>> -----------------------
>>                                             // Process all results into 
>> $_SESSION array                                                              
>>          $position = 1;                                                      
>>                       while ($row = mysql_fetch_array($result))              
>>                         {                                      
>> $_SESSION['fullRestaurantList'][$position] = $row;                           
>>            $position++;                                                      
>>                        foreach(range('1','1000') as $c){                     
>>                               ($position == $c)
>>                                                     
>> $_SESSION['totalNumberOfRestaurants'] = $c;                                  
>>     }                                                                        
>>                                                                             }
>>
> 
> Use the mysql function for this called LIMIT.  It LIMITs the amount of
> data returned.
> 
> SELECT * FROM table_name LIMIT 1000
> 
> 1. it will make your SQL calls much faster
> 2. it will use less memory
> 
> 
> 
> 
> But that limits results right, if a query generated more then 1000 records 
> how would a user be able to access 1001 ..put the query in a loop?

Why don't you read the docs on it and find out.

http://dev.mysql.com/doc/refman/5.1/en/select.html


--- End Message ---
--- Begin Message ---
On Mon, Jul 27, 2009 at 11:25 AM, Shawn McKenzie<nos...@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 would you do this, store the first 1000 , then the second on refresh etc
>>>
>>> My snippet so far
>>>
>>> -----------------------
>>>                                             // Process all results into 
>>> $_SESSION array                                                             
>>>           $position = 1;                                                    
>>>                         while ($row = mysql_fetch_array($result))           
>>>                            {                                      
>>> $_SESSION['fullRestaurantList'][$position] = $row;                          
>>>             $position++;                                                    
>>>                          foreach(range('1','1000') as $c){                  
>>>                                  ($position == $c)
>>>                                                     
>>> $_SESSION['totalNumberOfRestaurants'] = $c;                                 
>>>      }                                                                      
>>>                                                                             
>>>   }
>>>
>>
>> Use the mysql function for this called LIMIT.  It LIMITs the amount of
>> data returned.
>>
>> SELECT * FROM table_name LIMIT 1000
>>
>> 1. it will make your SQL calls much faster
>> 2. it will use less memory
>>
>>
>>
>>
>> But that limits results right, if a query generated more then 1000 records 
>> how would a user be able to access 1001 ..put the query in a loop?
>
> Bastien gave you all the info:
>
> You should look at paging the data here with the OFFSET portion of the
> limit clause
>
> Select * from restaurant [where clause]limit 1000, $offset
>
> where the $offset value can tell you where to start in the 17K rows of
> data so that in effect you show records 1-1000, 1001-2000,
> 2001-3000...then on the page, just provide a set of links of navigate
> the recordset by the user  [ << < 1-1000 1001-2000 2001-3000 > >> ]
>
> ***
>
> So you would generate page that had the first 1000 records and a Next >
> link that linked maybe to the same page with ?start=1001.  Then use the
> $_GET['start'] to generate the next set of results staring at 1001.
>
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

correct

-- 

Bastien

Cat, the other other white meat

--- End Message ---
--- Begin Message ---
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, they will always
either stay on top of the other page elements or else they will
automatically close (whichever effect is desired).

3) They are not actual pop-up windows, so they won't be blocked by
pop-up blockers.


Granted, they depend on JavaScript, but then so did your other approach.


http://www.google.com/search?q=div+popup+window


Andrew

Thanks, I hadn't thought about that approach. It's certainly an alternative.
I think I have come across some of them on various sites, but I've found them to be quite disagreeable. As you scroll, they often scroll down, then float back to their assigned position. Weird. And they are usually blocking something that I want to see.

I don't know if what I'm doing is javascript or not. I never have that identifier on my web page. I do call the Window.Open (function?), so, if that counts then yeah. But I like the separate window better. The user can more easily move it out of the way - even off the browser window - and continue reading the main page while referring to the popup window. I'd actually like to allow the user to create multiple popup windows, which I create from buttons on my webpage, but right now they all go to the same window, and I've had enough trouble trying to get that to work. I'm there now with that last Window.Focus detail - except that Firefox seems to be having a problem with that. But, I'm not going to worry about that. So, for now I'm good.
--- End Message ---
--- Begin Message ---
On Mon, Jul 27, 2009 at 11:39 AM, WebPat<webpa...@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 your browser.
>>
>> 2) Since they are actually part of the page itself, they will always
>> either stay on top of the other page elements or else they will
>> automatically close (whichever effect is desired).
>>
>> 3) They are not actual pop-up windows, so they won't be blocked by
>> pop-up blockers.
>>
>>
>> Granted, they depend on JavaScript, but then so did your other approach.
>>
>>
>> http://www.google.com/search?q=div+popup+window
>>
>>
>> Andrew
>
> Thanks, I hadn't thought about that approach. It's certainly an alternative.
> I think I have come across some of them on various sites, but I've found
> them to be quite disagreeable. As you scroll, they often scroll down, then
> float back to their assigned position. Weird. And they are usually blocking
> something that I want to see.
>
> I don't know if what I'm doing is javascript or not. I never have that
> identifier on my web page. I do call the Window.Open (function?), so, if
>  that counts then yeah. But I like the separate window better. The user can
> more easily move it out of the way - even off the browser window - and
> continue reading the main page while referring to the popup window.
> I'd actually like to allow the user to create multiple popup windows, which
> I create from buttons on my webpage, but right now they all go to the same
> window, and I've had enough trouble trying to get that to work.  I'm there
> now with that last Window.Focus detail - except that Firefox seems to be
> having a problem with that. But, I'm not going to worry about that. So, for
> now I'm good.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

If they are all going to the same window, its likely that you have a
window.open function that names the window. When the window has a
name/id, then any subsequent calls to the window open command will
re-use the same window. if you remove the id attribute (the call is
usually window.open(url,id,parameters) and substitute an empty string
( '' ) then it should open new windows.

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

Cat, the other other white meat

--- End Message ---
--- Begin Message ---
On Mon, Jul 27, 2009 at 11:46 AM, Bastien Koert<phps...@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 other
software, you just have to take some time to try out different
versions and find the one that has the features that you want for the
price you're willing to pay, or else try your hand at writing your
own.

Andrew

--- End Message ---
--- Begin Message ---
Bastien Koert wrote:
On Mon, Jul 27, 2009 at 11:39 AM, WebPat<webpa...@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 your browser.

2) Since they are actually part of the page itself, they will always
either stay on top of the other page elements or else they will
automatically close (whichever effect is desired).

3) They are not actual pop-up windows, so they won't be blocked by
pop-up blockers.


Granted, they depend on JavaScript, but then so did your other approach.


http://www.google.com/search?q=div+popup+window


Andrew
Thanks, I hadn't thought about that approach. It's certainly an alternative.
I think I have come across some of them on various sites, but I've found
them to be quite disagreeable. As you scroll, they often scroll down, then
float back to their assigned position. Weird. And they are usually blocking
something that I want to see.

I don't know if what I'm doing is javascript or not. I never have that
identifier on my web page. I do call the Window.Open (function?), so, if
 that counts then yeah. But I like the separate window better. The user can
more easily move it out of the way - even off the browser window - and
continue reading the main page while referring to the popup window.
I'd actually like to allow the user to create multiple popup windows, which
I create from buttons on my webpage, but right now they all go to the same
window, and I've had enough trouble trying to get that to work.  I'm there
now with that last Window.Focus detail - except that Firefox seems to be
having a problem with that. But, I'm not going to worry about that. So, for
now I'm good.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



If they are all going to the same window, its likely that you have a
window.open function that names the window. When the window has a
name/id, then any subsequent calls to the window open command will
re-use the same window. if you remove the id attribute (the call is
usually window.open(url,id,parameters) and substitute an empty string
( '' ) then it should open new windows.

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


You are correct, the Open names the window. That is done in the Onclick of the button and becomes the Target for an <A>. I need a name for the Target. This works pretty good. I'm not sure many users would open more than one anyway - at least not without getting even more confused. Probably better.

I've tried to build this with Html and CSS, and just a little PHP.

--- End Message ---
--- Begin Message ---
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
itself (the modal part). It beats the crappy confirm() dialogs. The
older version is here:

http://www.phpguru.org/static/Modal-Dialog.html

-- 
Richard Heyes
HTML5 graphing: RGraph - www.rgraph.net (updated 25th July)
Lots of PHP and Javascript code - http://www.phpguru.org

--- End Message ---
--- Begin Message ---
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
itself (the modal part). It beats the crappy confirm() dialogs. The
older version is here:

http://www.phpguru.org/static/Modal-Dialog.html


But why are we moving to commercial software to do something as simple as I'm trying to do here? I'm not against commercial software in general - I own my own commercial software business full-time. Your dialog might be great and really useful in some situations, with plenty of benefits. But, it's a big decision to include ANY software package into any project. There are learning curves, questions about who will be skilled to support it in the future, cost (?), versions, upgrades, survival etc. And I have to say, as a user, I am very disappointed with many sites that have obviously included all the latest and greatest technology.

Perhaps there is a need for change. And maybe the development of these alternate solutions will encourage the standards powers that be to take a new look at the need for a solution within standards.
--- End Message ---
--- Begin Message ---
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 something similar, to
change the single quote, but I still can't seem to get the syntax right.
Any help would be appreciated.  For what it's worth, here is a shortened
version of what I have:

 

$ firstName = "$_POST[form_firstName]";

$ lastname = "$_POST[form_lastName]";

 

$query = mysql_query("INSERT INTO customers (`cust_first`,`cust_last`)
VALUES ('$firstName','$lastName')");

 

Ben Miller

 


--- End Message ---
--- Begin Message --- 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 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 something similar, to change the single quote, but I still can't seem to get the syntax right. Any help would be appreciated. For what it's worth, here is a shortened
version of what I have:



$ firstName = "$_POST[form_firstName]";

$ lastname = "$_POST[form_lastName]";



$query = mysql_query("INSERT INTO customers (`cust_first`,`cust_last`)
VALUES ('$firstName','$lastName')");



Ben Miller





--- End Message ---
--- Begin Message ---
On Mon, Jul 27, 2009 at 12:41 PM, Mari Masuda<mbmas...@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:
>
>> 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 something similar, to
>> change the single quote, but I still can't seem to get the syntax right.
>> Any help would be appreciated.  For what it's worth, here is a shortened
>> version of what I have:
>>
>>
>>
>> $ firstName = "$_POST[form_firstName]";
>>
>> $ lastname = "$_POST[form_lastName]";
>>
>>
>>
>> $query = mysql_query("INSERT INTO customers (`cust_first`,`cust_last`)
>> VALUES ('$firstName','$lastName')");
>>
>>
>>
>> Ben Miller
>>
>>
>>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

I like to use http://ca3.php.net/manual/en/function.htmlentities.php

-- 

Bastien

Cat, the other other white meat

--- End Message ---
--- Begin Message ---
Bastien Koert wrote:
On Mon, Jul 27, 2009 at 12:41 PM, Mari Masuda<mbmas...@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:

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 something similar, to
change the single quote, but I still can't seem to get the syntax right.
Any help would be appreciated.  For what it's worth, here is a shortened
version of what I have:



$ firstName = "$_POST[form_firstName]";

$ lastname = "$_POST[form_lastName]";



$query = mysql_query("INSERT INTO customers (`cust_first`,`cust_last`)
VALUES ('$firstName','$lastName')");



Ben Miller




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



I like to use http://ca3.php.net/manual/en/function.htmlentities.php


htmlentities should not be used on the data before it goes into the database. If used it should be used on data coming out of the database.
--- End Message ---
--- Begin Message ---
Michael A. Peters wrote:
> Bastien Koert wrote:
>> On Mon, Jul 27, 2009 at 12:41 PM, Mari Masuda<mbmas...@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:
>>>
>>>> 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 something
>>>> similar, to
>>>> change the single quote, but I still can't seem to get the syntax
>>>> right.
>>>> Any help would be appreciated.  For what it's worth, here is a
>>>> shortened
>>>> version of what I have:
>>>>
>>>>
>>>>
>>>> $ firstName = "$_POST[form_firstName]";
>>>>
>>>> $ lastname = "$_POST[form_lastName]";
>>>>
>>>>
>>>>
>>>> $query = mysql_query("INSERT INTO customers (`cust_first`,`cust_last`)
>>>> VALUES ('$firstName','$lastName')");
>>>>
>>>>
>>>>
>>>> Ben Miller
>>>>
>>>>
>>>>
>>>
>>> -- 
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>
>> I like to use http://ca3.php.net/manual/en/function.htmlentities.php
>>
> 
> htmlentities should not be used on the data before it goes into the
> database. If used it should be used on data coming out of the database.
> 

To summarize:

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.

htmlentities() is a presentation sanitizing/cleaning tool.  But, it
should only be used for output to the browser, etc...  Same thing with
htmlspecialchars() and all other related function.



--- End Message ---
--- Begin Message ---
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 Java, after the world.
Kyou wa PHP, ashita wa Java, sono ato sekai desu.


 
> Date: Mon, 27 Jul 2009 11:10:08 -0700
> From: li...@cmsws.com
> To: mpet...@mac.com
> CC: phps...@gmail.com; mbmas...@stanford.edu; biprel...@gmail.com; 
> php-gene...@lists.php.net
> Subject: Re: [PHP] Single Quotes in Form Inputs
> 
> Michael A. Peters wrote:
> > Bastien Koert wrote:
> >> On Mon, Jul 27, 2009 at 12:41 PM, Mari Masuda<mbmas...@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:
> >>>
> >>>> 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 something
> >>>> similar, to
> >>>> change the single quote, but I still can't seem to get the syntax
> >>>> right.
> >>>> Any help would be appreciated. For what it's worth, here is a
> >>>> shortened
> >>>> version of what I have:
> >>>>
> >>>>
> >>>>
> >>>> $ firstName = "$_POST[form_firstName]";
> >>>>
> >>>> $ lastname = "$_POST[form_lastName]";
> >>>>
> >>>>
> >>>>
> >>>> $query = mysql_query("INSERT INTO customers (`cust_first`,`cust_last`)
> >>>> VALUES ('$firstName','$lastName')");
> >>>>
> >>>>
> >>>>
> >>>> Ben Miller
> >>>>
> >>>>
> >>>>
> >>>
> >>> -- 
> >>> PHP General Mailing List (http://www.php.net/)
> >>> To unsubscribe, visit: http://www.php.net/unsub.php
> >>>
> >>>
> >>
> >> I like to use http://ca3.php.net/manual/en/function.htmlentities.php
> >>
> > 
> > htmlentities should not be used on the data before it goes into the
> > database. If used it should be used on data coming out of the database.
> > 
> 
> To summarize:
> 
> 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.
> 
> htmlentities() is a presentation sanitizing/cleaning tool. But, it
> should only be used for output to the browser, etc... Same thing with
> htmlspecialchars() and all other related function.
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

_________________________________________________________________
Descubra todas as novidades do novo Internet Explorer 8
http://brasil.microsoft.com.br/IE8/mergulhe/?utm_source=MSN%3BHotmail&utm_medium=Tagline&utm_campaign=IE8

--- End Message ---
--- Begin Message ---
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 escape is a
single quote character. Some database managers accept either, but using
slashes can cause more problems than they solve. Find the correct
escape_string function for your database and use it.

Bob McConnell

--- End Message ---
--- Begin Message ---
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 software to do the job.

I really appreciate the input....

Cheers.

GR
Mrfroasty



Bob McConnell wrote:
> 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 we set up Dokuwiki as a grass roots effort in the
> development group. In just over a year we had 1100 pages created. It was
> so popular that management got into the act and decided to replace it
> with an officially supported Confluence server. Very few of us
> considered that an upgrade, but that's what happens when the PHB's get
> involved.
>
> I maintained the Dokuwiki server on a Red Hat system. It took about 30
> minutes a week to keep up. It's all PHP, with numerous add-on features
> and capabilities.
>
> Bob McConnell
>
>   


-- 
Extra details:
OSS:Gentoo Linux
profile:x86
Hardware:msi geforce 8600GT asus p5k-se
location:/home/muhsin
language(s):C/C++,VB,VHDL,bash,PHP,SQL,HTML,CSS
Typo:40WPM
url:http://www.mzalendo.net


--- End Message ---
--- Begin Message ---
Thanks very much to all the he's and any she's who answered this.
Tony


--- End Message ---
--- Begin Message ---
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="go"><p>
</form>

<?php
$user=$_POST['user'];
$pass=$_POST['pass'];
if(($user=="myname")&&($pass="mypass"))
echo "access granted";
else
echo "access denied";
?>

getting "Notice: Undefined index: user" and "Notice: Undefined index: pass".
changing form action to another page will solve the problem but i want to be able to use $_POST array on the same page, how can i do it?
thanks in advance

/Arash


--- End Message ---

Reply via email to