p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: Re: beginning_php digest: December 18, 2001


Message #1 by "Deepak Kumar Vasudevan" <deepak@c...> on Wed, 19 Dec 2001 09:35:01 +0530
Yes! The user by name spiro seems to spread some virus called pwsgen (as

reported by McAfee). I have already forwarded the reply to

Webmaster@W...



deepak

----- Original Message -----

From: "beginning php digest" <beginning_php@p...>

To: "beginning_php digest recipients" <beginning_php@p...>

Sent: Wednesday, December 19, 2001 5:31 AM

Subject: beginning_php digest: December 18, 2001





> -----------------------------------------------

> When replying to the digest, please quote only

> relevant material, and edit the subject line to

> reflect the message you are replying to.

> -----------------------------------------------

>

> The URL for this list is:

> http://p2p.wrox.com/list.asp?list=beginning_php

>

> BEGINNING_PHP Digest for Tuesday, December 18, 2001.

>

> 1. VIRUS!!!!!!!!!!!!

> 2. VIRUS!!!!

> 3. question on page131

> 4. Re: Question on Beginning PHP4 pg. 172

> 5. Re: beginning_php digest: December 17, 2001

> 6. Re: Question on Beginning PHP4 pg. 172

> 7. xml to mysql using php

> 8. Re: Question on Beginning PHP4 pg. 172

> 9. RE: question on page131

> 10. display form function

> 11. RE: question on page131

> 12. RE: question on page131

>

> ----------------------------------------------------------------------

>

> Subject: VIRUS!!!!!!!!!!!!

> From: robert.laframboise@r...

> Date: Tue, 18 Dec 2001 00:29:56

> X-Message-Number: 1

>

> The person using the name 'spiro' OR 'sipro' has either got a virus or is

attempting to spread one.

> WATCH OUT!!!!!

> ----------------------------------------------------------------------

>

> Subject: VIRUS!!!!

> From: robert.laframboise@r...

> Date: Tue, 18 Dec 2001 01:43:59

> X-Message-Number: 2

>

> I received an email from the user going by the name 'spiro' or 'sipro',

this user either has a

> virus or is trying to spread one. WATCHOUT!!!!!!!!!

> ----------------------------------------------------------------------

>

> Subject: question on page131

> From: "Aung" <aunglawt@m...>

> Date: Tue, 18 Dec 2001 01:59:42

> X-Message-Number: 3

>

> As a beginner, I am working with the book beginning PHP4.

> I am stuck at Page No. 131 (holiday.php). I copy the source code from the

download. But when

> ever I unchecked the radio buttons, the following error message appears.

>

> It says:

> Warning: Undefined variable: Grade in C:\Inetpub\wwwroot\php\holiday.php

on line 14

>

> Warning: Undefined variable: Grade in C:\Inetpub\wwwroot\php\holiday.php

on line 39

> You've not entered a value for hotel grade, go back and do it again

>

> I try on both IE and NS browser. Am I doing something wrong?

>

> Excuse my english..

> ----------------------------------------------------------------------

>

> Subject: Re: Question on Beginning PHP4 pg. 172

> From: "enapoleone" <john@e...>

> Date: Mon, 17 Dec 2001 21:05:35 -0500

> X-Message-Number: 4

>

> Hmmm. I don't know if I quite follow you here. Let me see if I understand

> you. You want to iterate through the new associative array and echo each

> state capital as an option to a select element?

>

> Well, unless you indicate a string index value for an array element, PHP

> will assign it an integer value starting with 0(zero). In the first

example

> when the "for loop" iterates through the $StatesOfTheUsa array, the array

is

> an numerically indexed array. But as soon as you make the array an

> associative one, referencing elements using numerical indexes won't work,

> they are now strings. I believe this to be true, perhaps someone can

correct

> me if I am wrong.

>

> Instsead try using the foreach loop to iterate through each element, which

> loops through each element in the array until the length of the array.

>

> foreach($StatesOfTheUsa as $var) echo "<option>$var</option>\n";

> ---- Original Message -----

> From: "Adam Simpson" <adam@g...>

> To: "beginning php" <beginning_php@p...>

> Sent: Monday, December 17, 2001 4:17 PM

> Subject: [beginning_php] Re: Question on Beginning PHP4 pg. 172

>

>

> > > Therefore instead of :

> > > 1. Iterating through one Array: looking for the capital of Arkansas

> > > 2. Finding the index value for the element/value in question: which

> > would be 3 or $StatesOf TheUsa[3]

> > > 3. And comparing the index value with the index value of an Array of

> > > associative data: $StateCapital[3] = Little Rock

> > >

> > > You simply:

> > >

> > > $StatesOfTheUsa["Arkansas"]

> > >

> > > i.e. echo $StatesOfTheUsa["Arkansas"]

> > >

> > > result: Little Rock

> >

> > Thank you so much for replying to my question.  I'm still not quite

sure,

> > though.  For the states.php file I replaced the example's array with the

> > the suggested associative array ("Alabama" => "Montgomery" etc.).

> >

> > I saved this as states2.php but when I open it my HTML pull-down

selector

> > has 50 blank choices.  How do I make this new array work with the

> > echo "<option>$StatesOfTheUSA[$counter]</option>";

> > line?

> >

> > Or should I put the new associative array in the capitals.php file and

> > leave states.php as it was?




> $subst('Email.Unsub').

> >

>

>

> ----------------------------------------------------------------------

>

> Subject: Re: beginning_php digest: December 17, 2001

> From: "Deepak Kumar Vasudevan" <deepak@c...>

> Date: Tue, 18 Dec 2001 09:14:13 +0530

> X-Message-Number: 5

>

> Php Odbc should have more overhead compared to direct MSSQL API.

>

> deepak

> ----- Original Message -----

> From: "beginning php digest" <beginning_php@p...>

> To: "beginning_php digest recipients" <beginning_php@p...>

> Sent: Tuesday, December 18, 2001 5:31 AM

> Subject: beginning_php digest: December 17, 2001

>

>

> > -----------------------------------------------

> > When replying to the digest, please quote only

> > relevant material, and edit the subject line to

> > reflect the message you are replying to.

> > -----------------------------------------------

> >

> > The URL for this list is:

> > http://p2p.wrox.com/list.asp?list=beginning_php

> >

> > BEGINNING_PHP Digest for Monday, December 17, 2001.

> >

> > 1. Question on Beginning PHP4 pg. 172

> > 2. Re: mssql_connect()  - Urgent

> > 3. Re: Question on Beginning PHP4 pg. 172

> > 4. Re: Question on Beginning PHP4 pg. 172

> >

> > ----------------------------------------------------------------------

> >

> > Subject: Question on Beginning PHP4 pg. 172

> > From: "Adam Simpson" <adam@g...>

> > Date: Mon, 17 Dec 2001 09:40:40

> > X-Message-Number: 1

> >

> > I just finished the array example but now I'm stuck.  On page 172

> > under "Improvements to our Program" it talks about using one associative

> > array to make the program simpler.  I can't figure out how to do this,

> > though.  Does anyone know what this improved program would look like?

> > ----------------------------------------------------------------------

> >

> > Subject: Re: mssql_connect()  - Urgent

> > From: kwan pei quen <peiquen@y...>

> > Date: Mon, 17 Dec 2001 03:38:23 -0800 (PST)

> > X-Message-Number: 2

> >

> > hi i am also new in PHP but i have finish my final

> > year project using PHP with MSSQL

> >

> > anyway, i found that odbc connection have more

> > function compare to mssql

> >

> > currently i have no information with me, the next time

> > i online i try to mail it for you

> >

> > happy learning ...

> >

> > __________________________________________________

> > Do You Yahoo!?

> > Check out Yahoo! Shopping and Yahoo! Auctions for all of

> > your unique holiday gifts! Buy at http://shopping.yahoo.com

> > or bid at http://auctions.yahoo.com

> >

> > ----------------------------------------------------------------------

> >

> > Subject: Re: Question on Beginning PHP4 pg. 172

> > From: "enapoleone" <john@e...>

> > Date: Mon, 17 Dec 2001 09:44:28 -0500

> > X-Message-Number: 3

> >

> > What an associate Array does is it simplifies Comparing the elements of

> Two

> > seperate Arrays of associative data  into One Array.

> >

> > Therefore instead of :

> > 1. Iterating through one Array: looking for the capital of Arkansas

> > 2. Finding the index value for the element/value in question: which

would

> be

> > 3 or $StatesOf TheUsa[3]

> > 3. And comparing the index value with the index value of an Array of

> > associative data: $StateCapital[3] = Little Rock

> >

> > You simply:

> >

> > $StatesOfTheUsa["Arkansas"]

> >

> > i.e. echo $StatesOfTheUsa["Arkansas"]

> >

> > result: Little Rock

> >

> > I hope this was if some help.

> >

> >

> > ----- Original Message -----

> > From: "Adam Simpson" <adam@g...>

> > To: "beginning php" <beginning_php@p...>

> > Sent: Monday, December 17, 2001 9:40 AM

> > Subject: [beginning_php] Question on Beginning PHP4 pg. 172

> >

> >

> > > I just finished the array example but now I'm stuck.  On page 172

> > > under "Improvements to our Program" it talks about using one

associative

> > > array to make the program simpler.  I can't figure out how to do this,

> > > though.  Does anyone know what this improved program would look like?




> > $subst('Email.Unsub').

> > >

> >

> >

> > ----------------------------------------------------------------------

> >

> > Subject: Re: Question on Beginning PHP4 pg. 172

> > From: "Adam Simpson" <adam@g...>

> > Date: Mon, 17 Dec 2001 16:17:51

> > X-Message-Number: 4

> >

> > > Therefore instead of :

> > > 1. Iterating through one Array: looking for the capital of Arkansas

> > > 2. Finding the index value for the element/value in question: which

> > would be 3 or $StatesOf TheUsa[3]

> > > 3. And comparing the index value with the index value of an Array of

> > > associative data: $StateCapital[3] = Little Rock

> > >

> > > You simply:

> > >

> > > $StatesOfTheUsa["Arkansas"]

> > >

> > > i.e. echo $StatesOfTheUsa["Arkansas"]

> > >

> > > result: Little Rock

> >

> > Thank you so much for replying to my question.  I'm still not quite

sure,

> > though.  For the states.php file I replaced the example's array with the

> > the suggested associative array ("Alabama" => "Montgomery" etc.).

> >

> > I saved this as states2.php but when I open it my HTML pull-down

selector

> > has 50 blank choices.  How do I make this new array work with the

> > echo "<option>$StatesOfTheUSA[$counter]</option>";

> > line?

> >

> > Or should I put the new associative array in the capitals.php file and

> > leave states.php as it was?

> >

> >

> > ---

> >

> > END OF DIGEST

> >




> $subst('Email.Unsub').

>

>

> ----------------------------------------------------------------------

>

> Subject: Re: Question on Beginning PHP4 pg. 172

> From: "Adam Simpson" <adam@g...>

> Date: Tue, 18 Dec 2001 10:52:22

> X-Message-Number: 6

>

> > Hmmm. I don't know if I quite follow you here. Let me see if I

understand

> > you. You want to iterate through the new associative array and echo each

> > state capital as an option to a select element?

>

> Actually, let's forget my last post.  I was just describing one of the

> things I did to try and modify the example.  I obviously modified it in

> the wrong way.

>

> On page 172 it shows the new array that they suggest using to improve and

> simplify the state capitals program.  My question is where do you put that

> array?  Do you work it into states.php or do you work it into

> capitals.php?  Also, what else in the program changes to allow this new,

> associative array to work?

>

> In the improved program, would the user still select a state of the U.S.

> from a pull-down selection menu?

> ----------------------------------------------------------------------

>

> Subject: xml to mysql using php

> From: "vidya" <vidya_kgg@y...>

> Date: Tue, 18 Dec 2001 14:50:39

> X-Message-Number: 7

>

> Hai

>

>   I am new to PHP. I am having XML file i need

> to insert the data from xml to mysql using php.

>

> <?xml version="1.0" encoding="UTF-8"?>

> <Data>

> <ResultCode>902</ResultCode>

> <Result>ProductID not found</Result>

> <ProductID>GR_DVL9700EK</ProductID>

> <Sort></Sort>

> <Category></Category>

> <Title></Title>

> <Stock>0</Stock>

> </Data>

>

>

>

> ----------------------------------------------------------------------

>

> Subject: Re: Question on Beginning PHP4 pg. 172

> From: "enapoleone" <john@e...>

> Date: Tue, 18 Dec 2001 10:12:37 -0500

> X-Message-Number: 8

>

> Adam,

>

> Well there are two ways to do this. But for the sake of this example and

the

> stage that you are in the book we will use the book.

>

> Put the associative array in states.php, dynamically create a select list

> using the index values(as I can remember--which are the states). Don't

worry

> about creating a complimentary array in capitals.php, of course we do not

> need this anymore. From capitals.php simply echo the value for the name of

> the select list in the form of a variable(this should be obvious

considering

> that they spent all of "getting data from the client" explaining it).

>

> There is the scenario that you can select more than one option from a

select

> list. That requires:

> 1.coding the select element using the multiple attribute

> 2.initializing the name for the select element as an array i.e. $x[] (I

> think this has to be scripted)

> If you desire multiple results and you do only one of these then I would

> guess that the user would only yield the first element in the list of

> multiple elements. Retrieving the data from this array is I guess obvious

> and redundant.

>

> ----- Original Message -----

> From: "Adam Simpson" <adam@g...>

> To: "beginning php" <beginning_php@p...>

> Sent: Tuesday, December 18, 2001 10:52 AM

> Subject: [beginning_php] Re: Question on Beginning PHP4 pg. 172

>

>

> > > Hmmm. I don't know if I quite follow you here. Let me see if I

> understand

> > > you. You want to iterate through the new associative array and echo

each

> > > state capital as an option to a select element?

> >

> > Actually, let's forget my last post.  I was just describing one of the

> > things I did to try and modify the example.  I obviously modified it in

> > the wrong way.

> >

> > On page 172 it shows the new array that they suggest using to improve

and

> > simplify the state capitals program.  My question is where do you put

that

> > array?  Do you work it into states.php or do you work it into

> > capitals.php?  Also, what else in the program changes to allow this new,

> > associative array to work?

> >

> > In the improved program, would the user still select a state of the U.S.

> > from a pull-down selection menu?




> $subst('Email.Unsub').

> >

>

>

> ----------------------------------------------------------------------

>

> Subject: RE: question on page131

> From: "Nikolai Devereaux" <yomama@u...>

> Date: Tue, 18 Dec 2001 11:24:08 -0800

> X-Message-Number: 9

>

>

> No, you're not.  Chances are, you configured PHP to report all NOTICES,

> errors, and warnings.  If you write code that uses a variable that hasn't

> been defined yet, you'll get a "notice" about it.

>

> Just change the line in PHP.ini that does your error reporting.

>

> -----Original Message-----

> From: Aung [mailto:aunglawt@m...]

> Sent: Tuesday, December 18, 2001 2:00 AM

> To: beginning php

> Subject: [beginning_php] question on page131

>

>

> As a beginner, I am working with the book beginning PHP4.

> I am stuck at Page No. 131 (holiday.php). I copy the source code from the

> download. But when

> ever I unchecked the radio buttons, the following error message appears.

>

> It says:

> Warning: Undefined variable: Grade in C:\Inetpub\wwwroot\php\holiday.php

on

> line 14

>

> Warning: Undefined variable: Grade in C:\Inetpub\wwwroot\php\holiday.php

on

> line 39

> You've not entered a value for hotel grade, go back and do it again

>

> I try on both IE and NS browser. Am I doing something wrong?

>

> Excuse my english..




> $subst('Email.Unsub').

>

>

> ----------------------------------------------------------------------

>

> Subject: display form function

> From: Jeff Jones <geffjones@y...>

> Date: Tue, 18 Dec 2001 14:50:01 -0500

> X-Message-Number: 10

>

> Hello,

>

> I am working on the emptyfields example (pg 241) and am having trouble

with

> the DisplayForm function listed here. If I pull up my phpinfo or look it

up

> in the function index I do not see it listed. I therefore assume it is a

> created function, but I do not know where to start to get the page to

> redisplay or for the form to continue processing.

>

> Thank You

> Jeffery Jones

>

>

>

> _________________________________________________________

>

> Do You Yahoo!?

>

> Get your free @yahoo.com address at http://mail.yahoo.com

>

>

>

>

> ----------------------------------------------------------------------

>

> Subject: RE: question on page131

> From: slippy_chicken@h...

> Date: Tue, 18 Dec 2001 19:57:27

> X-Message-Number: 11

>

> Well yeah, that would be the most technical approach to fixing it. If you

> don't know how to change the line in the PHP config file, then whenever

> you use a variable, declare it first, using "var". Not sure if that'll fix

> it, though I think it should.

>

> >

> > No, you're not.  Chances are, you configured PHP to report all NOTICES,

> > errors, and warnings.  If you write code that uses a variable that

hasn't

> > been defined yet, you'll get a "notice" about it.

> >

> > Just change the line in PHP.ini that does your error reporting.

> >

> > -----Original Message-----

> > From: Aung [mailto:aunglawt@m...]

> > Sent: Tuesday, December 18, 2001 2:00 AM

> > To: beginning php

> > Subject: [beginning_php] question on page131

> >

> >

> > As a beginner, I am working with the book beginning PHP4.

> > I am stuck at Page No. 131 (holiday.php). I copy the source code from

the

> > download. But when

> > ever I unchecked the radio buttons, the following error message appears.

> >

> > It says:

> > Warning: Undefined variable: Grade in C:\Inetpub\wwwroot\php\holiday.php

> on

> > line 14

> >

> > Warning: Undefined variable: Grade in C:\Inetpub\wwwroot\php\holiday.php

> on

> > line 39

> > You've not entered a value for hotel grade, go back and do it again

> >

> > I try on both IE and NS browser. Am I doing something wrong?

> >

> > Excuse my english..




> > $subst('Email.Unsub').

> >

>

> ----------------------------------------------------------------------

>

> Subject: RE: question on page131

> From: "Nikolai Devereaux" <yomama@u...>

> Date: Tue, 18 Dec 2001 11:56:31 -0800

> X-Message-Number: 12

>

>

> The problem with that is that people expect to use PHP as a SCRIPTING

> language -- one where you can pull a variable name out of anywhere and

start

> using it.  Much of the source code in all PHP books and tutorials expect

> your setup to have all notices ignored, and you're really setting yourself

> up for a fall if you try to change hundreds of lines of code instead of

one

> line in an ini file.

>

>

>

> -----Original Message-----

> From: slippy_chicken@h... [mailto:slippy_chicken@h...]

> Sent: Tuesday, December 18, 2001 7:57 PM

> To: beginning php

> Subject: [beginning_php] RE: question on page131

>

>

> Well yeah, that would be the most technical approach to fixing it. If you

> don't know how to change the line in the PHP config file, then whenever

> you use a variable, declare it first, using "var". Not sure if that'll fix

> it, though I think it should.

>

> >

> > No, you're not.  Chances are, you configured PHP to report all NOTICES,

> > errors, and warnings.  If you write code that uses a variable that

hasn't

> > been defined yet, you'll get a "notice" about it.

> >

> > Just change the line in PHP.ini that does your error reporting.

> >

> > -----Original Message-----

> > From: Aung [mailto:aunglawt@m...]

> > Sent: Tuesday, December 18, 2001 2:00 AM

> > To: beginning php

> > Subject: [beginning_php] question on page131

> >

> >

> > As a beginner, I am working with the book beginning PHP4.

> > I am stuck at Page No. 131 (holiday.php). I copy the source code from

the

> > download. But when

> > ever I unchecked the radio buttons, the following error message appears.

> >

> > It says:

> > Warning: Undefined variable: Grade in C:\Inetpub\wwwroot\php\holiday.php

> on

> > line 14

> >

> > Warning: Undefined variable: Grade in C:\Inetpub\wwwroot\php\holiday.php

> on

> > line 39

> > You've not entered a value for hotel grade, go back and do it again

> >

> > I try on both IE and NS browser. Am I doing something wrong?

> >

> > Excuse my english..




> > $subst('Email.Unsub').

> >

>




> $subst('Email.Unsub').

>

>

>

>

> ---

>

> END OF DIGEST

>




$subst('Email.Unsub').




  Return to Index