Re: [PHP] Novice question
> 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
On Sun, 30 Oct 2011 17:24:07 - "John Allsopp" 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
On 2011-10-30, at 2:45 PM, Marc Guay 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
> 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
Your question is NOT Novice and I really want to know the answer like you. On 10/30/11, John Allsopp 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
[PHP] Novice question
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
Re: [PHP] Novice Question - Viewing Errors
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 - Viewing Errors
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
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
[PHP] Novice Question - Viewing Errors
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
Re: [PHP] Novice Question
> 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
<> 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
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
[PHP] Novice Question
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
Re: [PHP] novice question
JD, This is how you would do it: - or you could do it directly like this - - or my personal preference - === 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
Sumthin like this... * * 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;) === 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
[PHP] novice question
Hi Id reelly like to know the syntax for returning results from a called function to the program that called it;) === 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] Novice question
Hi, thanks for reading this, Im just going to say it cos i dont want to waste your time. Im looking for a really big favour here(cos I think it may take time to spot this, although it might only take five seconds to spot, but I dunno,the problem area of code is only four lines long), so dont spend time reading this unless you got half an hour spare or are looking a good samaritan award or something. Still reading this? Excellent, Iam saved. I wrote code which takes a input string, breaks it up and puts the bits into an array called $real. THIS WORKS. But I may have lots of input strings so I slapped a for loop around the code to do the same thing for all the inputs and THAT WORKS ASWELL! Then i wanted to save the different bits of each input string in its own array, so I created an array of arrays and at the end of each cycle of the big loop, I take out all the element in $real and put them into the array of arrays, called $poly[][]. THIS DOESNT WORK. I've spent a week trying to fix this and get that horrible feeling that all the work is going down the drain, cos if I dont get this working, I am screwed. I'd be sincerely grateful if someone could help me with this /*===*/ I put these type of comments around the problem area of the code, which is about four lines long near the bottom /*===*/ Regards Bren "; $real[0]=0; $z=array_pop($real); $array[0] = 0; $z = array_pop($array); /*$real[0] = 0; $z = array_pop($real);*/ $test[0]=0; $z = array_pop($test); /*big loop=*/ for($ws=0;$ws".*/ /*echo"shit"; print_r($c);*/ for($r=0;$r<=count($c);$r++) { /* echo"peaches"; echo"";*/ $m=$c[$r]; echo"M EQUALS".""; echo"$m"; echo""; $count=0; for($j=0;$j"; /*$count=0;*/ if($m[$j]=="-" ) { $count++; } } if((($m[0]=="-")AND($count<2))OR($count<1)) { echo"dumbass"; echo""; /*if(count($real)<=4)*/ { array_push($real,$c[$r]); echo""; } } elseif(($m[0]=="-")AND($count>1)) { echo"bla"; echo""; $ss = explode("-",$m); for($cnt=0;$cnt"; $ss[$cnt] = "-".$ss[$cnt]; for($waa=0;$waa"; $ss = explode("-",$m); for($na=1;$na"; } } /*echo"$count"; echo"real"; echo""; print_r($real); */ } /* for($rt=0;$rt0) { print_r($real); echo""; $poly[$ws][$rt]=array_pop($real); $rt++; echo"pink elephants"; /**/ } } /*end of big loop*/ echo"real"; echo""; print_r($real); echo""."POLY EQUALS"; for($ty=0;$ty<4/*count($poly[$ws][$rt])*/;$ty++) { echo""."print loop"; echo $poly[0][$ty]; echo""; } echo""; ?> _ Join the worlds 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] novice question -- array_push($real[$i][$j],$s[$j]);????????
Hi, thanks for reading this, Iam trying to push elements into a two dimentional array, but I cant find the proper syntax, I'd be grateful if someone could email me the proper method. Iam using the normal method, which worked fine for a one dimentional array, but when I use it for a two dimentional array, it doesnt seem to recognise that is an array, even though I initialized the array with $real[0][0] = 0;. Thanks a million for your time, Bren _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Novice Question
> -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
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: > > > > > > > >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 > > > > > > > > > > > > > > > > > > > >npage.php > > > > > > > > > > > > > > > > >for($i=1 ;$i<= $NoPols ; $i++) > >{ > >?> > > > >enter polynomial here: > > > > > > >} > >?> > > > > > > > > > > > > > > > >_ > >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
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: > > > > > > > >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 > > > > > > > > > > > > > > > > > > > >npage.php > > > > > > > > > > > > > > > > >for($i=1 ;$i<= $NoPols ; $i++) > >{ > >?> > > > >enter polynomial here: > > > > > > >} > >?> > > > > > > > > > > > > > > > >_ > >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
yeah, it definitely works with text fields too. You can also do something like: 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: > > > > > > > > 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 > > > > > > > > > > > > > > > > > > > >npage.php > > > > > > > > > > > > > > > > >for($i=1 ;$i<= $NoPols ; $i++) > >{ > >?> > > > >enter polynomial here: > > > > > > >} > >?> > > > > > > > > > > > > > > > >_ > >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
name each field with an array name. I know the following works with checkboxes; try it with text fields: 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 > > > > > > > > > >npage.php > > > > > > > >for($i=1 ;$i<= $NoPols ; $i++) >{ >?> > >enter polynomial here: > > >} >?> > > > > > > > >_ >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
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 npage.php enter polynomial here: _ 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
[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 npage.php enter polynomial here: _ 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
RE: [PHP] Novice question
$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;$cnthttp://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
[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;$cnthttp://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Novice question - please help
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! > > > > > > > > > $x = 0; > $ay=array(); > $g=array(); > $c = explode (' ', $a); > > >for($q=0;$q<=count($c);$q++) > { > echo""; > echo"$c[$q]"; > echo""; > echo""; > } > > > $c=array_reverse($c); > > > for($w = 0;$w > { > echo $w; > $e=array_pop($c); > if(($e == ' ')||($e == NULL)) > { > > echo"hi space"; > array_push($ay,$e); > echo""; > } > else > { > echo"hi no space"; > array_push($g,$e); > > } > } > > > > echo(count($g)); > > > > for($x=0;$x<=(count($g));$x++) > { > echo""; > echo"$g[$x]"; > echo""; > } > > ?> > > > > > > > > == > start page code > == > > > > > > npage.php > > > > > > > > enter polynomial here: > > > > > > > > > > > > _ > 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
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 '); } /* I know it's weird, but use sizeof() for arrays, and strlen() for strings */ echo('$arr has ' . sizeof($arr) . ' elements'); echo('$str has ' . strlen($str) . ' characters'); ?> >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]
RE: [PHP] Novice question - Please Help
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]
[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 worlds 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]