php-windows Digest 19 Mar 2003 19:24:10 -0000 Issue 1642

Topics (messages 19057 through 19066):

Re: Re:Subject: multiple selections and checkboxes
        19057 by: RT
        19058 by: toby z
        19061 by: toby z

Re: Subject: software for Linux
        19059 by: Neil Smith

Re: php-windows Digest 19 Mar 2003 06:43:00 -0000 Issue 1641
        19060 by: Neil Smith

Re: RE:[newbie]session problem
        19062 by: Uttam
        19063 by: Uttam

Re: Excel Spreadsheet as a datasource
        19064 by: Warren \"Zeebon\" Parks

Re: [PHP] Sessions on win32, PHP and IIS
        19065 by: Diego Fulgueira

- IIS  - More info
        19066 by: Diego Fulgueira

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]


----------------------------------------------------------------------
--- Begin Message ---
Sorry. I missed the original message but if I understand it right
you want to send multiple selections from a select box to PHP.
If you add [] after the name it will create an array with the data
that's sent to the server
ie 
<select name="foo[]">
<option value="1">selection 1</option>
etc
</select>

The variable $foo[0] or $_POST['foo'] would have the first value
selected and so on.
Hope it helps

On Wed, 2003-03-19 at 01:42, toby z wrote:
> thnx a mill guyz for ur replys
> 
> but im still stuck
> 
> nuthing seem to be working n im closing-in on my ded line
> 
> id be eterrnally gratefull if anyone could suggess an alternative to
> allow multi-selection of values fetched from the db
> 
> the only prob is the values are aorund 40 outta which a user has to
> select as many as he likes n i HAVE to fetch them all from the db
> 
> 
> guyz hlp plz
> thnx a mill
> 
> doomed .....
> toby
> 
>  --- Neil Smith <[EMAIL PROTECTED]> wrote: > Hi Toby - I
> can't actually fllw yr frm cs t hs n vwls n t !
> > 
> > However, I notice you are not closing the </option> tag. Maybe that
> > would 
> > help ?
> > AFAIK, HTML requires <option> tags to be close.
> > 
> > HTH - My 2c
> > 
> > Cheers,
> > Neil Smith.
> > 
> > At 09:51 18/03/2003 +0000, you wrote:
> > >/*      echo("<select id=qlf_opt name=rq_qlf width='15'
> > >style=\"font-family: $font\" multiple>
> > >
> > >         <optgroup label=select qualifications> ");
> > >
> > >
> > >for ($count = 1; $qlfz_id =
> > >mysql_fetch_row($rq_qlfz_ftch_qry_rzlt_hndlr); ++$count)//,
> > $fmly_nme
> > >= mysql_fetch_row ($fmly_nme_ftch_qry_rzlt_hndlr)
> > >         {
> > >                 $qlf_id = $qlfz_id[1];
> > >                 $qlf_nme = $qlfz_id[0];
> > >                 $sq = $qlfz_id[2];
> > >
> > >                 echo ("<option value=$qlf_id>$qlf_nme");
> > >
> > >                 //echo($skll_id.$sq);
> > >
> > >         }
> > >
> > >echo("</optgroup>
> > >         </select>
> > 
> > 
> > -- 
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >  
> 
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



--- End Message ---
--- Begin Message ---
thnx rt for the reply 

heres my latest try at it


multi_select.php

$rq_skllz_ftch_qry = "select skll, skll_id, sq from
tbl_lookup_skllz_qlf where sq='s' or sq='n'";
                $rq_skllz_ftch_qry_rzlt_hndlr = mysql_query($rq_skllz_ftch_qry)
        or die("qry failed ! da tbl must xixt in da db 2 b played vid ! ! !
!");


echo("<form action=multi_lst_proc.php  method=get>");

                        


echo("<select id=skllz_opt name=skl_id[] width='15'
style=\"font-family: $font\" multiple>
                        
<optgroup label=select skills> ");


                for ($count = 1; $skllz_id =
mysql_fetch_row($rq_skllz_ftch_qry_rzlt_hndlr); ++$count)//,
$fmly_nme = mysql_fetch_row ($fmly_nme_ftch_qry_rzlt_hndlr)
{

        


        $skll_id = $skllz_id[1];
        $skll_nme = $skllz_id[0];
        $sq = $skllz_id[2];
        
        echo ("<option value=$skll_id>$skll_nme");
                        
        //echo($skll_id.$sq);           
                
        //echo("</option>");             
                
}
echo("</optgroup>
        </select>
<input type=submit value=try>


                
</form> ");
        


-----------------------------------
multi_lst_proc.php  
-----------------------------------


$rq_skllz_ftch_qry = "select skll, skll_id, sq from
tbl_lookup_skllz_qlf where sq='s' or sq='n'";
$rq_skllz_ftch_qry_rzlt_hndlr = mysql_query($rq_skllz_ftch_qry)
                                or die("qry failed ! da tbl must xixt in da db 2 b 
played vid ! !
! !");
                                
                                
                                
                        
for ($count = 1; $qlfz_id =
mysql_fetch_row($rq_skllz_ftch_qry_rzlt_hndlr); ++$count)//,
$fmly_nme = mysql_fetch_row ($fmly_nme_ftch_qry_rzlt_hndlr)
        {
                        //      for ($count; $count<=$_GET['$qlf']; ++$count){
$skl_id = $skllz_id[1];
$skll_nme = $skllz_id[0];
$sq = $skllz_id[2];
                
        echo($_GET[$skl_id]."<br>");
        echo($skl_id."<br>");
        //echo($nme);
        }
        

but what i get is


http://localhost/multi_lst_proc.php?skl_id%5B%5D=vc&skl_id%5B%5D=ln 

i no im being the dumbo of all timez but i cant figure out what on
earth iz it with this code ?????



thnx a billion guyz

toby .....


--- RT <[EMAIL PROTECTED]> wrote: > Sorry. I missed the original
message but if I understand it right
> you want to send multiple selections from a select box to PHP.
> If you add [] after the name it will create an array with the data
> that's sent to the server
> ie 
> <select name="foo[]">
> <option value="1">selection 1</option>
> etc
> </select>
> 
> The variable $foo[0] or $_POST['foo'] would have the first value
> selected and so on.
> Hope it helps
> 
> On Wed, 2003-03-19 at 01:42, toby z wrote:
> > thnx a mill guyz for ur replys
> > 
> > but im still stuck
> > 
> > nuthing seem to be working n im closing-in on my ded line
> > 
> > id be eterrnally gratefull if anyone could suggess an alternative
> to
> > allow multi-selection of values fetched from the db
> > 
> > the only prob is the values are aorund 40 outta which a user has
> to
> > select as many as he likes n i HAVE to fetch them all from the db
> > 
> > 
> > guyz hlp plz
> > thnx a mill
> > 
> > doomed .....
> > toby
> > 
> >  --- Neil Smith <[EMAIL PROTECTED]> wrote: > Hi Toby -
> I
> > can't actually fllw yr frm cs t hs n vwls n t !
> > > 
> > > However, I notice you are not closing the </option> tag. Maybe
> that
> > > would 
> > > help ?
> > > AFAIK, HTML requires <option> tags to be close.
> > > 
> > > HTH - My 2c
> > > 
> > > Cheers,
> > > Neil Smith.
> > > 
> > > At 09:51 18/03/2003 +0000, you wrote:
> > > >/*      echo("<select id=qlf_opt name=rq_qlf width='15'
> > > >style=\"font-family: $font\" multiple>
> > > >
> > > >         <optgroup label=select qualifications> ");
> > > >
> > > >
> > > >for ($count = 1; $qlfz_id =
> > > >mysql_fetch_row($rq_qlfz_ftch_qry_rzlt_hndlr); ++$count)//,
> > > $fmly_nme
> > > >= mysql_fetch_row ($fmly_nme_ftch_qry_rzlt_hndlr)
> > > >         {
> > > >                 $qlf_id = $qlfz_id[1];
> > > >                 $qlf_nme = $qlfz_id[0];
> > > >                 $sq = $qlfz_id[2];
> > > >
> > > >                 echo ("<option value=$qlf_id>$qlf_nme");
> > > >
> > > >                 //echo($skll_id.$sq);
> > > >
> > > >         }
> > > >
> > > >echo("</optgroup>
> > > >         </select>
> > > 
> > > 
> > > -- 
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >  
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Everything you'll ever need on one web page
> > from News and Sport to Email and Music Charts
> > http://uk.my.yahoo.com
> > 
> > -- 
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>  

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--- End Message ---
--- Begin Message ---
guyz
thnx a zillion all of u

its all solved n dun

i skrwd my own code up fo my slf

thnx again all of u


eternally grateful
toby ...... 


--- Neil Smith <[EMAIL PROTECTED]> wrote: > One more thing
(dunno if it has been mentioned ) :
> 
> select id=qlf_opt name=rq_qlf
> 
> 
> You have different -id- and -name- identifers in the Select tag.
> These 
> should match. Use one or the other. Both should be qlf_opt or both
> should 
> be rq_qlf
> 
> That way your script knows which one to use as the POST variable -
> else it 
> might decide neither is appropriate :-)
> 
> Cheers
> Neil.
> 
> At 06:42 19/03/2003 +0000, you wrote:
> >thnx a mill guyz for ur replys
> >
> >but im still stuck
> >
> >nuthing seem to be working n im closing-in on my ded line
> >
> >id be eterrnally gratefull if anyone could suggess an alternative
> to
> >allow multi-selection of values fetched from the db
> >
> >the only prob is the values are aorund 40 outta which a user has
> to
> >select as many as he likes n i HAVE to fetch them all from the db
> >
> >
> >guyz hlp plz
> >thnx a mill
> >
> >doomed .....
> >toby
> >
> >  --- Neil Smith <[EMAIL PROTECTED]> wrote: > Hi Toby -
> I
> >can't actually fllw yr frm cs t hs n vwls n t !
> > >
> > > However, I notice you are not closing the </option> tag. Maybe
> that
> > > would
> > > help ?
> > > AFAIK, HTML requires <option> tags to be close.
> > >
> > > HTH - My 2c
> > >
> > > Cheers,
> > > Neil Smith.
> > >
> > > At 09:51 18/03/2003 +0000, you wrote:
> > > >/*      echo("<select id=qlf_opt name=rq_qlf width='15'
> > > >style=\"font-family: $font\" multiple>
> > > >
> > > >         <optgroup label=select qualifications> ");
> > > >
> > > >
> > > >for ($count = 1; $qlfz_id =
> > > >mysql_fetch_row($rq_qlfz_ftch_qry_rzlt_hndlr); ++$count)//,
> > > $fmly_nme
> > > >= mysql_fetch_row ($fmly_nme_ftch_qry_rzlt_hndlr)
> > > >         {
> > > >                 $qlf_id = $qlfz_id[1];
> > > >                 $qlf_nme = $qlfz_id[0];
> > > >                 $sq = $qlfz_id[2];
> > > >
> > > >                 echo ("<option value=$qlf_id>$qlf_nme");
> > > >
> > > >                 //echo($skll_id.$sq);
> > > >
> > > >         }
> > > >
> > > >echo("</optgroup>
> > > >         </select>
> > >
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Everything you'll ever need on one web page
> >from News and Sport to Email and Music Charts
> >http://uk.my.yahoo.com
>  

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--- End Message ---
--- Begin Message --- I quite like "Quanta" as an HTML editor. Comes with mandrake and I suppose most other distros.
Good luck with the move, I suspect your new home will be far more comfortable with nice extras :-)


Neil.

At 06:43 19/03/2003 +0000, you wrote:

Hi guys,
I'm moving from Windows (HomeSite, CuteFTP, Mascon, OutlookExpress...) to Linux and need recommendation for software to use - for easy use of PHP like I had in HomeSite. Some of friends recommended CoffeeCup HTML Editor. Switching to Eudora...


Thanks for any help!

Afan


--- End Message ---
--- Begin Message --- Still, good practice dontcha think ? Same with LI tags - they can be left unclosed, but it won't validate in most HTML validators (and quite rightly).

At 06:43 19/03/2003 +0000, Matt wrote:
Subject: RE: [PHP-WIN] Re:Subject: multiple selections and checkboxes

No, that's XHTML that requires all tags to be closed.


--- End Message ---
--- Begin Message ---
afaik, a session is handled as follows in later versions of php:

1. initiate session i.e. session_start(); this is required only if you do
not have session.auto_start=1 in php.ini.

2. Add session variables to global array $_SESSION[] like
$_SESSION['test']="test variable"

3. Access the session vaiable in subsequent calls as index of global
associative array $_SESSION[];
e.g. echo $_SESSION['test']

4. Finally, destroy the session when its no longer need by session_destroy()
and free the resources allocated to this particular session.


regds,

-----Original Message-----
From: toby z [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 18, 2003 14:36
To: Bobby Rahman; [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] RE:[newbie]session problem


hi
try this

initiate session on proc.php
// init sessn
session_start();

// register session variblez ! ! ! !
session_register("SESSN");




chech for session set on sum_page.php

<?php
// sessn chk ! ! ! !
session_start();
if(!session_is_registered("SESSN"))
{
// sessn chk failed .... invoke error hndlr ! ! ! !
header("Location: /nologn.php");
exit();
}



the rest of ur code .....

?>


hope thid helps

good luck

toby ....


 --- Bobby Rahman <[EMAIL PROTECTED]> wrote: >
>
> Hiya,
>
> Im running php4.2.3 on Win98 and apache 2.0.43.
> I am having troubles passing variables from page to page.
> I try to use:
>
> session_start();
> session_register("test");
>
>
> when echo $test on a different page it seems to be empty
> when not called from within the page originally created.
>
> I have session_start() on every page at the start just under the
> php syntax
> <? and also register the variables which I want global.
>
> I have edited the php.ini to set the session.save_path =
> "C:/windows/temp"
> and also have global variables set on
>
>
> Any suggestions to what it may be as it doesnt seem to produce any
> errors.
>
>
> Thanks
>
> _________________________________________________________________
> Express yourself with cool emoticons http://messenger.msn.co.uk
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


--- End Message ---
--- Begin Message ---
a word of caution right out of manual:

"
Caution
If you are using $_SESSION (or $HTTP_SESSION_VARS), do not use
session_register(), session_is_registered() and session_unregister().
"

another snip from manual:

"
Use of $_SESSION (or $HTTP_SESSION_VARS with PHP 4.0.6 or less) is
recommended for security and code readablity. With $_SESSION or
$HTTP_SESSION_VARS, there is no need to use
session_register()/session_unregister()/session_is_registered() functions.
Users can access session variable like a normal variable.
"

regds,
-----Original Message-----
From: Bobby Rahman [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 18, 2003 17:45
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] RE:[newbie]session problem



Hiya

Futher investigation has lead me to some strange results. I checked
phpinfo() and made sure "register global variables is set=on".

I then used:

//In db api
$num_results =mysql_num_rows($db_result);
$_SESSION['num_results'] = $num_results;

//In second file
session_start();
require_once("db_api.php");
echo "THE num_result from db API is ".$_SESSION['num_results'];

This seems to work....

when I try and use register_session() such as:

//In db api
$db_result = mysql_query($querystring);
$num_results =mysql_num_rows($db_result);
session_register("num_results");

//In second file
if (session_is_registered("num_results"))
echo "NUM RESULTS is $num_results";


I dont seem to get a value echoed. Not sure why?

But hopefully $_SESSION will work now...thanks for all your help
Toby and Janet -much appreciated :)











>From: toby z <[EMAIL PROTECTED]>
>To: Bobby Rahman <[EMAIL PROTECTED]>,
[EMAIL PROTECTED]
>Subject: Re: [PHP-WIN] RE:[newbie]session problem Date: Tue, 18 Mar
2003
>09:05:56 +0000 (GMT)
>
>hi
>try this
>
>initiate session on proc.php
>// init sessn
>session_start();
>
>// register session variblez ! ! ! !
>session_register("SESSN");
>
>
>
>
>chech for session set on sum_page.php
>
><?php
>// sessn chk ! ! ! !
>session_start();
>if(!session_is_registered("SESSN"))
>{
>// sessn chk failed .... invoke error hndlr ! ! ! !
>header("Location: /nologn.php");
>exit();
>}
>
>
>
>the rest of ur code .....
>
>?>
>
>
>hope thid helps
>
>good luck
>
>toby ....
>
>
>  --- Bobby Rahman <[EMAIL PROTECTED]> wrote: >
> >
> > Hiya,
> >
> > Im running php4.2.3 on Win98 and apache 2.0.43.
> > I am having troubles passing variables from page to page.
> > I try to use:
> >
> > session_start();
> > session_register("test");
> >
> >
> > when echo $test on a different page it seems to be empty
> > when not called from within the page originally created.
> >
> > I have session_start() on every page at the start just under the
> > php syntax
> > <? and also register the variables which I want global.
> >
> > I have edited the php.ini to set the session.save_path =
> > "C:/windows/temp"
> > and also have global variables set on
> >
> >
> > Any suggestions to what it may be as it doesnt seem to produce any
> > errors.
> >
> >
> > Thanks
> >
> > _________________________________________________________________
> > Express yourself with cool emoticons http://messenger.msn.co.uk
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>__________________________________________________
>Do You Yahoo!?
>Everything you'll ever need on one web page
>from News and Sport to Email and Music Charts
>http://uk.my.yahoo.com
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>


_________________________________________________________________
MSN Messenger - fast, easy and FREE! http://messenger.msn.co.uk



--- End Message ---
--- Begin Message ---
I've done kind of what your asking quite a few times.  What I do is save
the file as a csv.  Then you can just import it right into mysql.  I do
this for 2 different applications that I wrote.  If you need more help
just ask.

Warren

-----Original Message-----
From: Herhuth, Ron [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 18, 2003 8:57 AM
To: [EMAIL PROTECTED]
Subject: Excel Spreadsheet as a datasource



Has anyone successfully used an Excel spreadsheet as a datasource?  I
realize that it is a flimsy datasource but I have a need to quickly and
dynamically take the information stored in spreadsheets and manipulate
the data and write them to a SQL database.

I would be grateful for any assistance or information on how to do this.

Thanks,
Ron


--- End Message ---
--- Begin Message ---
For session variables to work:

Use the $_SESSION array instead of $HTTP_SESSION_VARS.

Also, check your session_path (defined in php.ini, which should be under
/WINNT). session_path should point to a directory where user IUSR_MYHOST has
writing permissions. There, you should see a file created for each session.
Open this file in notepad and you should find names of session variables and
their values. If all this is correct, check what session cookies is sending
your browser to the server (Netscape is very suitable for doing this).
PHPSESSID should be one of them, if not, you are not registering your
session correctly.

Cheers.


----- Original Message -----
From: "Beauford.2002" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Wednesday, March 19, 2003 10:38 AM
Subject: [PHP] PHP and IIS - More info


> These are some of the errors I am getting
>
> Notice: Undefined index: login in
> C:\Inetpub\wwwroot\xxxx.xxxx.xxxx\login\checklogin.php on line 74
>
> and 75, and other similar errors.
>
> Line 74 is: $login = $HTTP_SESSION_VARS['login'];
> Line 75 is: $password = $HTTP_SESSION_VARS['password'];
>
> Another one is: echo $HTTP_ENV_VARS["QUERY_STRING"];
>
>
> Thanks
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
Did you checked my last message? Was it helpful?
PHP under Apache exposes diferent global variables than PHP under IIS. It
will be impossible for you to correct your errors without changing your
code. Run phpinfo() to see what variables are available under IIS.

About session variables...

I suggest you use the $_SESSION array instead of $HTTP_SESSION_VARS.

Also, check your session_path (defined in php.ini, which should be under
/WINNT). session_path should point to a directory where user IUSR_MYHOST has
writing permissions. There, you should see a file created for each session.
Open this file in notepad and you should find names of session variables and
their values. If all this is correct, check what session cookies is sending
your browser to the server (Netscape is very suitable for doing this).
PHPSESSID should be one of them, if not, you are not registering your
session correctly.

Cheers.



----- Original Message -----
From: "Beauford.2002" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "'PHP General'" <[EMAIL PROTECTED]>
Sent: Wednesday, March 19, 2003 12:44 PM
Subject: Re: [PHP] PHP and IIS - More info


> Further note that it is not just this script, but many PHP scripts that I
> run on IIS - they all work perfectly on Apache (on Windows and Linux)..
>
> ----- Original Message -----
> From: "John W. Holmes" <[EMAIL PROTECTED]>
> To: "'Beauford.2002'" <[EMAIL PROTECTED]>; "'PHP General'"
> <[EMAIL PROTECTED]>
> Sent: Wednesday, March 19, 2003 12:21 PM
> Subject: RE: [PHP] PHP and IIS - More info
>
>
> > > These are some of the errors I am getting
> > >
> > > Notice: Undefined index: login in
> > > C:\Inetpub\wwwroot\xxxx.xxxx.xxxx\login\checklogin.php on line 74
> > >
> > > and 75, and other similar errors.
> > >
> > > Line 74 is: $login = $HTTP_SESSION_VARS['login'];
> > > Line 75 is: $password = $HTTP_SESSION_VARS['password'];
> > >
> > > Another one is: echo $HTTP_ENV_VARS["QUERY_STRING"];
> >
> > There is no 'login' or 'password' index in the $HTTP_SESSION_VARS array.
> > How are you registering these variables? Try using the new method with
> > $_SERVER.
> >
> > ---John W. Holmes...
> >
> > PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> > today. http://www.phparch.com/
> >
> >
> >
> > --
> > 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
>


--- End Message ---

Reply via email to