Re: [PHP] Novice question

2011-10-31 Thread John Allsopp
 cURL is the best one in my experience, but you have to manage security
 yourself. Meaning: Remember to escape/encode data.

 http://php.net/manual/en/book.curl.php

Thanks everyone, appreciated, I'll investigate ..

Cheers
J

 --
 01723 376477

 Cost-free marketing: http://www.flowmarketing.co.uk/

 Affordable marketing guidance for small businesses:
 http://www.amilliontweaks.co.uk/

 Effective marketing services for SMEs: coming soon at
 http://www.surgemarketing.co.uk

 Professional Internet marketing consultancy:
 http://www.johnallsopp.co.uk


 --
 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




-- 
01723 376477

Cost-free marketing: http://www.flowmarketing.co.uk/

Affordable marketing guidance for small businesses:
http://www.amilliontweaks.co.uk/

Effective marketing services for SMEs: coming soon at
http://www.surgemarketing.co.uk

Professional Internet marketing consultancy: http://www.johnallsopp.co.uk


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



Re: [PHP] Novice question

2011-10-30 Thread Negin Nickparsa
Your question is NOT Novice and I really want to know the answer like you.

On 10/30/11, John Allsopp j...@johnallsopp.co.uk wrote:
 Hi

 I'm afraid I've fallen a little out of touch with PHP dev, so a stupid
 question for you.

 I want to write a script that requests a URL and then reads that website
 .. I'm interested to map web structures. My web host is saying I'll need
 URL file access enabled but that it's a) a security risk and b)
 deprecated.

 So .. what's the good / proper / acceptable / secure way of reading in
 URLs in PHP or .. isn't there one?

 Cheers
 J

 --
 01723 376477

 Cost-free marketing: http://www.flowmarketing.co.uk/

 Affordable marketing guidance for small businesses:
 http://www.amilliontweaks.co.uk/

 Effective marketing services for SMEs: coming soon at
 http://www.surgemarketing.co.uk

 Professional Internet marketing consultancy: http://www.johnallsopp.co.uk


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



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



Re: [PHP] Novice question

2011-10-30 Thread Marc Guay
 I want to write a script that requests a URL and then reads that website
 .. I'm interested to map web structures. My web host is saying I'll need
 URL file access enabled but that it's a) a security risk and b)
 deprecated.


simplehtmldom is pretty great for this, if I understand your needs
correctly... also not sure about it's server setting requirements, but
worth a look..


http://simplehtmldom.sourceforge.net/

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



Re: [PHP] Novice question

2011-10-30 Thread Bastien

On 2011-10-30, at 2:45 PM, Marc Guay marc.g...@gmail.com wrote:

 I want to write a script that requests a URL and then reads that website
 .. I'm interested to map web structures. My web host is saying I'll need
 URL file access enabled but that it's a) a security risk and b)
 deprecated.
 
 
 simplehtmldom is pretty great for this, if I understand your needs
 correctly... also not sure about it's server setting requirements, but
 worth a look..
 
 
 http://simplehtmldom.sourceforge.net/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Another option is cURL www.php.net/curl

Bastien Koert
905-904-0334


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



Re: [PHP] Novice question

2011-10-30 Thread Rico Secada
On Sun, 30 Oct 2011 17:24:07 -
John Allsopp j...@johnallsopp.co.uk wrote:

 Hi
 
 I'm afraid I've fallen a little out of touch with PHP dev, so a stupid
 question for you.
 
 I want to write a script that requests a URL and then reads that
 website .. I'm interested to map web structures. My web host is
 saying I'll need URL file access enabled but that it's a) a security
 risk and b) deprecated.
 
 So .. what's the good / proper / acceptable / secure way of reading in
 URLs in PHP or .. isn't there one?

cURL is the best one in my experience, but you have to manage security
yourself. Meaning: Remember to escape/encode data.

http://php.net/manual/en/book.curl.php

 Cheers
 J
 
 -- 
 01723 376477
 
 Cost-free marketing: http://www.flowmarketing.co.uk/
 
 Affordable marketing guidance for small businesses:
 http://www.amilliontweaks.co.uk/
 
 Effective marketing services for SMEs: coming soon at
 http://www.surgemarketing.co.uk
 
 Professional Internet marketing consultancy:
 http://www.johnallsopp.co.uk
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



Re: [PHP] Novice Question - Viewing Errors

2007-06-19 Thread Daniel Brown

On 6/19/07, revDAVE [EMAIL PROTECTED] wrote:

I am just beginning to learn about PHP.

It seems as though if I make a code error... The PHP page will simply come
up blank. ( Not too helpful for error checking) -  I would like to see some
kind of report on the page as to what went wrong.

 I have tried adding various lines of code to my page - from the link below
-  however I still get a blank page when errors occur...

display_errors(1);
error_reporting (E_ALL);
Etc

 I have read that possibly the errors are being sent to kind of error log -
rather than the page?

Q: How can I get the error reporting show up on the page so I can see it?

- - - - -
From: PHP: Error Handling and Logging Functions - Manual
Location: http://www.php.net/manual/en/ref.errorfunc.php
- - - - -

XXXIII. Error Handling and Logging Functions




--
Thanks - RevDave
[EMAIL PROTECTED]
[db-lists]

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




   If it's a shared host, your administrator may have disabled it.
If it's your own box, check your php.ini settings for errors and
output.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Novice Question - Viewing Errors

2007-06-19 Thread Daniel Brown

On 6/19/07, Daniel Brown [EMAIL PROTECTED] wrote:

On 6/19/07, revDAVE [EMAIL PROTECTED] wrote:
 I am just beginning to learn about PHP.

 It seems as though if I make a code error... The PHP page will simply come
 up blank. ( Not too helpful for error checking) -  I would like to see some
 kind of report on the page as to what went wrong.

  I have tried adding various lines of code to my page - from the link below
 -  however I still get a blank page when errors occur...

 display_errors(1);
 error_reporting (E_ALL);
 Etc

  I have read that possibly the errors are being sent to kind of error log -
 rather than the page?

 Q: How can I get the error reporting show up on the page so I can see it?

 - - - - -
 From: PHP: Error Handling and Logging Functions - Manual
 Location: http://www.php.net/manual/en/ref.errorfunc.php
 - - - - -

 XXXIII. Error Handling and Logging Functions




 --
 Thanks - RevDave
 [EMAIL PROTECTED]
 [db-lists]

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



If it's a shared host, your administrator may have disabled it.
If it's your own box, check your php.ini settings for errors and
output.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107



   Also, to answer the question that you didn't ask check in the
same directory as the scripts for a file named `error_log`.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Novice Question - Viewing Errors

2007-06-19 Thread Jochem Maas
revDAVE wrote:
 I am just beginning to learn about PHP.
 
 It seems as though if I make a code error... The PHP page will simply come
 up blank. ( Not too helpful for error checking) -  I would like to see some
 kind of report on the page as to what went wrong.
 
  I have tried adding various lines of code to my page - from the link below
 -  however I still get a blank page when errors occur...

if you make an syntax error then your script will never be run,
in which case the error reporting settings will never be set by your script.

if your on a local/dev machine try changing the relevant ini settings in php.ini

alternatively if you have the ability to use a .htaccess file (apache webserver)
the you can add the following 2 lines to set the error_reporting:

php_value display_errors On
php_value error_reporting 2048

(I wrote than off the top of my head - please check the manual for exact
ini setting names and values)

alternatively you could may 'tail' the relevant error_log (most often this is
the apache error log)

you can check what the current ini setting for something is using this:

echo ini_get(error_reporting);

 
 display_errors(1);
 error_reporting (E_ALL);
 Etc
 
  I have read that possibly the errors are being sent to kind of error log -
 rather than the page?
 
 Q: How can I get the error reporting show up on the page so I can see it?
 
 - - - - -
 From: PHP: Error Handling and Logging Functions - Manual
 Location: http://www.php.net/manual/en/ref.errorfunc.php
 - - - - -
 
 XXXIII. Error Handling and Logging Functions
 
 
 
 
 --
 Thanks - RevDave
 [EMAIL PROTECTED]
 [db-lists]
 

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



Re: [PHP] Novice Question

2002-10-03 Thread Justin French

Run a small phpinfo() script on both servers... take note of the version
numbers being used, and take not of the config setting register_globals on
both... my guess is that register_glabals is set to OFF on your local
machine, being a newer install.

If it isn't that, it may be an issue with the mail()


Report back :)


Justin


on 03/10/02 11:17 PM, ThinkNetSolutions ([EMAIL PROTECTED]) wrote:

 Hello,
 I don't know if I'm in the right place to ask for help or not...
 
 First...I am not a hardcore coder...I'm a designer - so I'm still trying to
 learn the other side. :)
 I am being hosted on a Windows 2000 server. It supports PHP. I have a simple
 script (refer a friend) on a Linux server that works. The same script will
 not work on this Windows server.
 
 Question:
 Does PHP4 code have to be written differently for Windows servers? If so, is
 there a code resource describing the differences?
 (the only information I can find is on installation on Win servers)
 
 Thank you in advance for your help!
 
 Kim Strawn
 [EMAIL PROTECTED]
 
 
 www.ThinkNetSolutions.com
 
 


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




Re: [PHP] Novice Question

2002-10-03 Thread Liam . Gibbs

First...I am not a hardcore coder...I'm a designer - so I'm still trying
to learn the other side. :) I am being hosted on a Windows 2000 server. It
supports PHP. I have a simple script (refer a friend) on a Linux server that
works. The same script will not work on this Windows server.

What's an example error message that you're getting? As said, it may just be
a difference in versions.



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


Re: [PHP] Novice Question

2002-10-03 Thread 1LT John W. Holmes

 Question:
 Does PHP4 code have to be written differently for Windows servers? If so,
is
 there a code resource describing the differences?
 (the only information I can find is on installation on Win servers)

No, not really. There are a few functions that won't work on windows because
they access things that are in unix (crypt() for one, I think). But, any
basic code will run on any server with PHP.

Now, if you're using special modules, then they must be installed on each
server, obviously.

---John Holmes...


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




RE: [PHP] novice question

2002-02-28 Thread Cal Evans

Sumthin like this...

?PHP

$a=10;
$b=20;
echo add($a,$b)

function($one, $two){
  return $one + $two
} // function($one, $two)
?

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: me us [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 27, 2002 3:23 PM
To: [EMAIL PROTECTED]
Subject: [PHP] novice question


Hi
  Id reelly like to know the syntax for returning results from a
called function to the program that called it;)

?
program

add($a,$b);
echo$ab;
?


===
?

function add($a,$b)
{
$ab =$a+$b;
}
return??


?


Many many thanks

JD

_
Chat with friends online, try MSN Messenger: http://messenger.msn.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




Re: [PHP] novice question

2002-02-28 Thread Jason Cox

JD,

This is how you would do it:

?
$ab = add($a,$b);
echo$ab;
?
- or you could do it directly like this -
?
echo add($a,$b);
?
- or my personal preference -
?=add($a,$b)?
===
?
function add($a,$b)
{
$ab =$a+$b;
return $ab;
}
?

A quick read of the section on functions in the online manual would be a
great resource.  In fact, I recommend checking the manual before posting to
this list.  It's a great tool and contains user comments.  Chances are that
if you have a problem, someone else has already run into it and posted the
solution in the manual.  Here's a link:
http://www.php.net/manual/en/functions.php

Regards,
Jason Cox
- Original Message -
From: me us [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, February 27, 2002 2:23 PM
Subject: [PHP] novice question


 Hi
   Id reelly like to know the syntax for returning results from
a
 called function to the program that called it;)

 ?
 program

 add($a,$b);
 echo$ab;
 ?


 ===
 ?

 function add($a,$b)
 {
 $ab =$a+$b;
 }
 return??


 ?


 Many many thanks

 JD

 _
 Chat with friends online, try MSN Messenger: http://messenger.msn.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




RE: [PHP] Novice Question

2002-02-19 Thread Ford, Mike [LSS]

 -Original Message-
 From: Martin Towell [mailto:[EMAIL PROTECTED]]
 Sent: 18 February 2002 22:44
 To: 'JSheble'; [EMAIL PROTECTED]
 
 window.document.frmName.elements[poly[]].value  !!!

This should also work (well, it has for me in the past!):

window.document.frmName[poly[]].value

since in JavaScript the syntax a.b is, by definition, exactly equivalent to a[b].

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




RE: [PHP] Novice Question

2002-02-18 Thread Rick Emery

Do you wish to create multiple forms or multiple input fields on a single
form?

-Original Message-
From: brendan conroy [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 2:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Novice Question


Hi thanks for reading this.

This problem is difficult to get across, this is what happens:

A) On a html page I ask users how many inputs they wish to enter, say 3. The

3 is stored as a variable called $NoPols.

B) Then in the code below, a loop creates $NoPols (3) forms to take the 
users inputs.

The problem is that the same name($Yourpol) is used in each of the created 
forms, and i dont know how to get around this problem.

I would like to know if it is possible to create a page which has a number 
of forms, the number of which is decided by the user(on a start page), so 
the user can submit as many inputs as they want from one page.


Sorry if I've wasted your time,

I'd be very grateful for any assisstance with this problem,

thanks a million,




Brendan







html
head
titlenpage.php/title

/head

body bgcolor=#FF text=#00

p
?php $NoPols; ?
?php
for($i=1 ;$i= $NoPols ; $i++)
{
?
form action=ppage.php method=post
enter polynomial ? echo $i;? here:input type=text name=Yourpol
br
/br
?
}
?
input type=submit name=submit value=Submit Pols!



/body
/html

_
Send and receive Hotmail on your mobile device: http://mobile.msn.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




RE: [PHP] Novice Question

2002-02-18 Thread Rick Emery

name each field with an array name.  I know the following works with
checkboxes; try it with text fields:

input type=text name=poly[] value=
input type=text name=poly[] value=
input type=text name=poly[] value=
input type=text name=poly[] value=


then, in your php script called from the form, you'll access the polynomials
using poly[0], poly[1], poly[2], poly[3], etc.
You know how many fields were created, because you created them; so you
could pass the number of created fields in a HIDDEN value ($NoPols) from the
form.  As you examine each field, you'll determine if it's empty or not.

for( $idx=0; $idx$NoPols; $idx++ )
{
if( strcmp( , $poly[$idx] )
{
... do something with field ...
}
}

-Original Message-
From: brendan conroy [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 3:27 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Novice Question


I wish to create multiple input fields on a single form, I think(sorry 
..could you advise?)

I'd like a page that has multiple input fields, but I dont know how to 
access the individual inputs.

Say the user wanted to enter three inputs(polynommials in this case)
so they get a page with three input boxes,

Enter polynommial here:

Enter polynommial here:

Enter polynommial here:


How would I dynammicaly create the input boxes and name the inputs. Thanks 
for your time on this, I sorry I didnt explain this clearer in the first 
place,


Thanks,


Bren



From: Rick Emery [EMAIL PROTECTED]
To: 'brendan conroy' [EMAIL PROTECTED], 
[EMAIL PROTECTED]
Subject: RE: [PHP] Novice Question
Date: Mon, 18 Feb 2002 14:54:09 -0600

Do you wish to create multiple forms or multiple input fields on a single
form?

-Original Message-
From: brendan conroy [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 2:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Novice Question


Hi thanks for reading this.

This problem is difficult to get across, this is what happens:

A) On a html page I ask users how many inputs they wish to enter, say 3. 
The

3 is stored as a variable called $NoPols.

B) Then in the code below, a loop creates $NoPols (3) forms to take the
users inputs.

The problem is that the same name($Yourpol) is used in each of the created
forms, and i dont know how to get around this problem.

I would like to know if it is possible to create a page which has a number
of forms, the number of which is decided by the user(on a start page), so
the user can submit as many inputs as they want from one page.


Sorry if I've wasted your time,

I'd be very grateful for any assisstance with this problem,

thanks a million,




Brendan







html
head
titlenpage.php/title

/head

body bgcolor=#FF text=#00

p
?php $NoPols; ?
?php
for($i=1 ;$i= $NoPols ; $i++)
{
?
form action=ppage.php method=post
enter polynomial ? echo $i;? here:input type=text name=Yourpol
br
/br
?
}
?
input type=submit name=submit value=Submit Pols!



/body
/html

_
Send and receive Hotmail on your mobile device: http://mobile.msn.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



_
Join the world's largest e-mail service with MSN Hotmail. 
http://www.hotmail.com

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




Re: [PHP] Novice Question

2002-02-18 Thread Corey Eiseman

yeah, it definitely works with text fields too. You can also do something
like:

input type=text name=poly[?=$i;?]

where $i will then be the key of the resulting array $poly. it doesn't seem
necessary in this case, since the numbers will probably be consecutive, but
if you wanted an associative array for some reason this can be useful.


Corey Eiseman
Infinite Orange Incorporated
http://infiniteorange.com/






Rick Emery [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 name each field with an array name.  I know the following works with
 checkboxes; try it with text fields:

 input type=text name=poly[] value=
 input type=text name=poly[] value=
 input type=text name=poly[] value=
 input type=text name=poly[] value=


 then, in your php script called from the form, you'll access the
polynomials
 using poly[0], poly[1], poly[2], poly[3], etc.
 You know how many fields were created, because you created them; so you
 could pass the number of created fields in a HIDDEN value ($NoPols) from
the
 form.  As you examine each field, you'll determine if it's empty or not.

 for( $idx=0; $idx$NoPols; $idx++ )
 {
 if( strcmp( , $poly[$idx] )
 {
 ... do something with field ...
 }
 }

 -Original Message-
 From: brendan conroy [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 18, 2002 3:27 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] Novice Question


 I wish to create multiple input fields on a single form, I think(sorry
 ..could you advise?)

 I'd like a page that has multiple input fields, but I dont know how to
 access the individual inputs.

 Say the user wanted to enter three inputs(polynommials in this case)
 so they get a page with three input boxes,

 Enter polynommial here:

 Enter polynommial here:

 Enter polynommial here:


 How would I dynammicaly create the input boxes and name the inputs. Thanks
 for your time on this, I sorry I didnt explain this clearer in the first
 place,


 Thanks,


 Bren



 From: Rick Emery [EMAIL PROTECTED]
 To: 'brendan conroy' [EMAIL PROTECTED],
 [EMAIL PROTECTED]
 Subject: RE: [PHP] Novice Question
 Date: Mon, 18 Feb 2002 14:54:09 -0600
 
 Do you wish to create multiple forms or multiple input fields on a single
 form?
 
 -Original Message-
 From: brendan conroy [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 18, 2002 2:48 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Novice Question
 
 
 Hi thanks for reading this.
 
 This problem is difficult to get across, this is what happens:
 
 A) On a html page I ask users how many inputs they wish to enter, say 3.
 The
 
 3 is stored as a variable called $NoPols.
 
 B) Then in the code below, a loop creates $NoPols (3) forms to take the
 users inputs.
 
 The problem is that the same name($Yourpol) is used in each of the
created
 forms, and i dont know how to get around this problem.
 
 I would like to know if it is possible to create a page which has a
number
 of forms, the number of which is decided by the user(on a start page), so
 the user can submit as many inputs as they want from one page.
 
 
 Sorry if I've wasted your time,
 
 I'd be very grateful for any assisstance with this problem,
 
 thanks a million,
 
 
 
 
 Brendan
 
 
 
 
 
 
 
 html
 head
 titlenpage.php/title
 
 /head
 
 body bgcolor=#FF text=#00
 
 p
 ?php $NoPols; ?
 ?php
 for($i=1 ;$i= $NoPols ; $i++)
 {
 ?
 form action=ppage.php method=post
 enter polynomial ? echo $i;? here:input type=text name=Yourpol
 br
 /br
 ?
 }
 ?
 input type=submit name=submit value=Submit Pols!
 
 
 
 /body
 /html
 
 _
 Send and receive Hotmail on your mobile device: http://mobile.msn.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
 


 _
 Join the world's largest e-mail service with MSN Hotmail.
 http://www.hotmail.com



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




RE: [PHP] Novice Question

2002-02-18 Thread JSheble

with this type of naming convention, how would you write a javascript 
function to access these form elements for client side 
validation?  JavaScript vomits when accessing 
window.document.frmName.poly[].value???

At 03:35 PM 2/18/2002 -0600, Rick Emery wrote:
name each field with an array name.  I know the following works with
checkboxes; try it with text fields:

input type=text name=poly[] value=
input type=text name=poly[] value=
input type=text name=poly[] value=
input type=text name=poly[] value=


then, in your php script called from the form, you'll access the polynomials
using poly[0], poly[1], poly[2], poly[3], etc.
You know how many fields were created, because you created them; so you
could pass the number of created fields in a HIDDEN value ($NoPols) from the
form.  As you examine each field, you'll determine if it's empty or not.

for( $idx=0; $idx$NoPols; $idx++ )
{
 if( strcmp( , $poly[$idx] )
 {
 ... do something with field ...
 }
}

-Original Message-
From: brendan conroy [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 3:27 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Novice Question


I wish to create multiple input fields on a single form, I think(sorry
..could you advise?)

I'd like a page that has multiple input fields, but I dont know how to
access the individual inputs.

Say the user wanted to enter three inputs(polynommials in this case)
so they get a page with three input boxes,

Enter polynommial here:

Enter polynommial here:

Enter polynommial here:


How would I dynammicaly create the input boxes and name the inputs. Thanks
for your time on this, I sorry I didnt explain this clearer in the first
place,


Thanks,


Bren



 From: Rick Emery [EMAIL PROTECTED]
 To: 'brendan conroy' [EMAIL PROTECTED],
 [EMAIL PROTECTED]
 Subject: RE: [PHP] Novice Question
 Date: Mon, 18 Feb 2002 14:54:09 -0600
 
 Do you wish to create multiple forms or multiple input fields on a single
 form?
 
 -Original Message-
 From: brendan conroy [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 18, 2002 2:48 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Novice Question
 
 
 Hi thanks for reading this.
 
 This problem is difficult to get across, this is what happens:
 
 A) On a html page I ask users how many inputs they wish to enter, say 3.
 The
 
 3 is stored as a variable called $NoPols.
 
 B) Then in the code below, a loop creates $NoPols (3) forms to take the
 users inputs.
 
 The problem is that the same name($Yourpol) is used in each of the created
 forms, and i dont know how to get around this problem.
 
 I would like to know if it is possible to create a page which has a number
 of forms, the number of which is decided by the user(on a start page), so
 the user can submit as many inputs as they want from one page.
 
 
 Sorry if I've wasted your time,
 
 I'd be very grateful for any assisstance with this problem,
 
 thanks a million,
 
 
 
 
 Brendan
 
 
 
 
 
 
 
 html
 head
 titlenpage.php/title
 
 /head
 
 body bgcolor=#FF text=#00
 
 p
 ?php $NoPols; ?
 ?php
 for($i=1 ;$i= $NoPols ; $i++)
 {
 ?
 form action=ppage.php method=post
 enter polynomial ? echo $i;? here:input type=text name=Yourpol
 br
 /br
 ?
 }
 ?
 input type=submit name=submit value=Submit Pols!
 
 
 
 /body
 /html
 
 _
 Send and receive Hotmail on your mobile device: http://mobile.msn.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
 


_
Join the world's largest e-mail service with MSN Hotmail.
http://www.hotmail.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




RE: [PHP] Novice Question

2002-02-18 Thread Martin Towell

window.document.frmName.elements[poly[]].value  !!!


-Original Message-
From: JSheble [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 19, 2002 9:41 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Novice Question


with this type of naming convention, how would you write a javascript 
function to access these form elements for client side 
validation?  JavaScript vomits when accessing 
window.document.frmName.poly[].value???

At 03:35 PM 2/18/2002 -0600, Rick Emery wrote:
name each field with an array name.  I know the following works with
checkboxes; try it with text fields:

input type=text name=poly[] value=
input type=text name=poly[] value=
input type=text name=poly[] value=
input type=text name=poly[] value=


then, in your php script called from the form, you'll access the
polynomials
using poly[0], poly[1], poly[2], poly[3], etc.
You know how many fields were created, because you created them; so you
could pass the number of created fields in a HIDDEN value ($NoPols) from
the
form.  As you examine each field, you'll determine if it's empty or not.

for( $idx=0; $idx$NoPols; $idx++ )
{
 if( strcmp( , $poly[$idx] )
 {
 ... do something with field ...
 }
}

-Original Message-
From: brendan conroy [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 3:27 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Novice Question


I wish to create multiple input fields on a single form, I think(sorry
..could you advise?)

I'd like a page that has multiple input fields, but I dont know how to
access the individual inputs.

Say the user wanted to enter three inputs(polynommials in this case)
so they get a page with three input boxes,

Enter polynommial here:

Enter polynommial here:

Enter polynommial here:


How would I dynammicaly create the input boxes and name the inputs. Thanks
for your time on this, I sorry I didnt explain this clearer in the first
place,


Thanks,


Bren



 From: Rick Emery [EMAIL PROTECTED]
 To: 'brendan conroy' [EMAIL PROTECTED],
 [EMAIL PROTECTED]
 Subject: RE: [PHP] Novice Question
 Date: Mon, 18 Feb 2002 14:54:09 -0600
 
 Do you wish to create multiple forms or multiple input fields on a single
 form?
 
 -Original Message-
 From: brendan conroy [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 18, 2002 2:48 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Novice Question
 
 
 Hi thanks for reading this.
 
 This problem is difficult to get across, this is what happens:
 
 A) On a html page I ask users how many inputs they wish to enter, say 3.
 The
 
 3 is stored as a variable called $NoPols.
 
 B) Then in the code below, a loop creates $NoPols (3) forms to take the
 users inputs.
 
 The problem is that the same name($Yourpol) is used in each of the
created
 forms, and i dont know how to get around this problem.
 
 I would like to know if it is possible to create a page which has a
number
 of forms, the number of which is decided by the user(on a start page), so
 the user can submit as many inputs as they want from one page.
 
 
 Sorry if I've wasted your time,
 
 I'd be very grateful for any assisstance with this problem,
 
 thanks a million,
 
 
 
 
 Brendan
 
 
 
 
 
 
 
 html
 head
 titlenpage.php/title
 
 /head
 
 body bgcolor=#FF text=#00
 
 p
 ?php $NoPols; ?
 ?php
 for($i=1 ;$i= $NoPols ; $i++)
 {
 ?
 form action=ppage.php method=post
 enter polynomial ? echo $i;? here:input type=text name=Yourpol
 br
 /br
 ?
 }
 ?
 input type=submit name=submit value=Submit Pols!
 
 
 
 /body
 /html
 
 _
 Send and receive Hotmail on your mobile device: http://mobile.msn.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
 


_
Join the world's largest e-mail service with MSN Hotmail.
http://www.hotmail.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



RE: [PHP] Novice question

2002-02-15 Thread Rick Emery

$element[0] = -.$element[0];
$element[1] = -.$element[1];
$element[2] = -.$element[2];
$element[3] = -.$element[3];

-Original Message-
From: brendan conroy [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 3:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Novice question


Hi,thanks for reading this!
This problem has got me beat! I cant figure out how to insert a minus sign 
into each element in an array of strings.
I keep getting the error that the first element in array_push has to be an 
array, no matter what method I've tried, and I cant think of any more!
Im trying to isolate terms in polynommials, which Ive stored in an array m[]

like this:


$m[0]=-3x_1^6/7-4x_2^3/5;
$m[1]=-4x_3^2/3-7x_4/7;


/*Each element in m has two terms, and I want to isolate these by exploding 
on the minus sign, thus giving me four elements, which then need to have a 
minus inserted into them.


I take one of the four elements in $ss, and for each character I push it 
into a temporary storage array $test, then I reverse $test so the term is in

the correct order, and then I insert the minus sign at the start. But 
funnily enough, there seems to be a flaw in my logic or code. What Ive 
written so far is*/

$ss=explode(-,$m);

for($cnt=1;$cntcount($ss);$cnt++)
{
for($waa=0;$waa$cnt;$c++)
{
array_push($test,$ss[$waa])
}
array_reverse($test);
array_push($test,-);
array_push($real,$test);


I would be extremely grateful for anyones assistance, thanks a million,


Regards



Bren






_
Send and receive Hotmail on your mobile device: http://mobile.msn.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




Re: [PHP] Novice question - please help

2002-02-11 Thread Adrian Murphy

use str_replace() instead of ereg_replace() ...in the same way described
- Original Message -
From: brendan conroy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 11, 2002 9:15 PM
Subject: [PHP] Novice question - please help


 Hi,
THANK YOU for reading this.I would really appreciate it if someone
could
 please email me if they know any easy way or an existing function for
 removing an unknown ammount of space characters from an array.

 Iam having an awful lot of trouble trying to remove multiple space
 characters from an array,

   ie.   x   +   y
 123456789

 where there are three or more spaces in a row(rep'd above by 234  678),
 basically weird user input.

 I have written code already, but I cant see where Ive gone wrong, here it
is
 if you care to look at it, and have a good chuckle, told you I was a
novice!
 I included the start page that allows you to see what the code does, in
you
 want to look at it.
 Thank you for your time, I'd really appreciate any replies!


 HTML
 BODY


 ?


 $x = 0;
 $ay=array();
 $g=array();
 $c = explode (' ', $a);


for($q=0;$q=count($c);$q++)
 {
 echofont color=green;
 echo$c[$q];
 echoHR;
 echo/font;
 }


 $c=array_reverse($c);


 for($w = 0;$wcount($c);$w++)

 {
 echo $w;
 $e=array_pop($c);
 if(($e == ' ')||($e == NULL))
 {

 echohi space;
 array_push($ay,$e);
 echoHR;
 }
 else
 {
 echohi no space;
 array_push($g,$e);

 }
 }



 echo(count($g));



 for($x=0;$x=(count($g));$x++)
 {
 echoBR;
 echo$g[$x];
 echoHR;
 }

 ?

 /BODY
 /HTML




 ==
 start page code
 ==



 html
 head
 titlenpage.php/title

 /head

 body bgcolor=#FF text=#00


 form action=newplan2.php method=post
 enter polynomial ? echo $i;? here:input type=text name=a

 input type=submit name=submit value=Submit Pols!



 /body
 /html




 _
 Chat with friends online, try MSN Messenger: http://messenger.msn.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




RE: [PHP] Novice question - Please Help

2002-01-30 Thread Jerry Verhoef (UGBI)

Take a look at split, explode

 -Original Message-
 From: brendan conroy [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 30, 2002 1:10 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Novice question - Please Help
 
 
 Hi,
thanks for reading this. Ive looked at every php site and 
 cant find an 
 answer, youre my last hope!(ok so its not that serious, but 
 pretty close!).
 Could someone please email me and tell me how to split a string into 
 different arrays and save what they were split on?
 Also I cant get the sizeof function to work no matter what 
 syntax i use, i 
 think ive tried them all, do you have to include a library or 
 something in 
 your program to make it work?
 
 Thanks a million, this isint a frivilous question, I looked 
 everywhere 
 before i came here, thanks,
 
 
 
 Bren
 
 _
 Join the world's largest e-mail service with MSN Hotmail. 
 http://www.hotmail.com
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 


The information contained in this email is confidential and
may be legally privileged. It is intended solely for the 
addressee. Access to this email by anyone else is 
unauthorized. If you are not the intended recipient, any 
form of disclosure, production, distribution or any action 
taken or refrained from in reliance on it, is prohibited and 
may be unlawful. Please notify the sender immediately.

The content of the email is not legally binding unless 
confirmed by letter bearing two authorized signatures.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Novice question - Please Help

2002-01-30 Thread David Otton

On Wed, 30 Jan 2002 12:10:14 +, you wrote:

Could someone please email me and tell me how to split a string into 
different arrays

?
/* this is our start string */
$str = this:is:a:test:string;

/* split accepts a regular expression and a string, and
returns an array */
/* we could also use preg_split() or explode() */
$arr = split(':', $str);

/* for each element of $arr */
for ($i = 0; $i  sizeof($arr); $i++) {
/* display element */
echo($arr[$i]);
echo('br');
}

/* I know it's weird, but use sizeof() for arrays, and
strlen() for strings */

echo('$arr has ' . sizeof($arr) . ' elementsbr');

echo('$str has ' . strlen($str) . ' charactersbr');

?

and save what they were split on?

Not sure what this means.

Also I cant get the sizeof function to work no matter what syntax i use, i 
think ive tried them all, do you have to include a library or something in 
your program to make it work?

If the above doesn't work, then maybe there's something wrong with
your install.

djo


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]