php-windows Digest 17 May 2002 15:02:17 -0000 Issue 1148
Topics (messages 13810 through 13831):
Beta Test Needed
13810 by: Demi Vitalis
13811 by: Svensson, B.A.T. (HKG)
13830 by: Hugh Bothwell
Newline in file using fputs
13812 by: Henry Grech-Cini
13813 by: Ross Fleming
13814 by: Svensson, B.A.T. (HKG)
13815 by: Henry Grech-Cini
13816 by: Svensson, B.A.T. (HKG)
13817 by: Henry Grech-Cini
13818 by: Henry Grech-Cini
13819 by: Scott Carr
13820 by: Ross Fleming
13829 by: Scott Hurring
$PHP_SELF generating an error
13821 by: R.S. Herhuth
login authentification ?????
13822 by: toby z
Re: ASP and PHP
13823 by: Scott Hurring
13828 by: Shrock, Court
searching the text in uploazded Word docs
13824 by: R.S. Herhuth
13825 by: Scott Hurring
Re: automation
13826 by: Scott Hurring
Re: Return portion of a string
13827 by: Scott Hurring
Displaying checkbox values selected
13831 by: C Sims
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
I have just launched a new online entertainment portal written entirely in
php. I need some beta testers please to go through and see if they
experience any problems.
http://www.dancepass.net
Please note, the search will not return any results... I will not have that
done until tommorrow.
The technology features extensive server side caching, transparent mirroring
(tcpip load balancing based on a persons geographical location), database &
cpu load balancing, and much much more.
Also, I am able to launch new entertainment portals or any type of streaming
media web sites in 10 minutes or less with the technology I have built. See
http://www.siterunner.net and http://www.intravative.com for more details.
It has been in the works for a year now and developed exclusivley by me. A
little over 1.2 million lines of code for the whole thing to be 100%
automated. Everything from content encoding all the way to content
scheduling and roll outs. Basically if you would need to do something for
your streaming media web site, SiteRunner will do it for you and you dont
have to know how to program or do anything. It even translates your content
into multiple languages for you if you want to run your web site in
different countries. Really quite cool. My best application work thus far.
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Demi Vitalis [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 16, 2002 12:18 PM
> To: Php-Windows@Lists. Php. Net
> Subject: [PHP-WIN] Beta Test Needed
>
>
> I have just launched a new online entertainment portal written entirely
> in php. I need some beta testers please to go through and see if they
> experience any problems.
Kind of shine trough excuse to spam this list with unsolicited commercial e-mail....
--- End Message ---
--- Begin Message ---
> It has been in the works for a year now and developed exclusivley by me. A
> little over 1.2 million lines of code for the whole thing to be 100%
... so you're telling me you average 5000 lines of new code per
workday? I'd be interested to know how you manage this.
> have to know how to program or do anything. It even translates your
content
> into multiple languages for you if you want to run your web site in
> different countries. Really quite cool. My best application work thus far.
(grin) I _hope_ you mean it allows you to enter alternative content for
each language... because if you've rigged it to pass text through
an automatic translator, your clients may find the results lacking.
--- End Message ---
--- Begin Message ---
Dear All,
Firstly, I am a newbie to php so please be gentle.
I'm having problems with carriage returns placed in a file on a Linux based
server. When this file is download to a WindowsXP machine the carriage
returns are quite frankly useless. I just get "[]" (where "[]" represents an
undisplayable character. No actual carriage returns or newlines!
I generate the file using the following code (fragment only):
while($row=mysql_fetch_array($mysql_result))
{
$f_title=$row["title"];
$f_first_name=$row["first_name"];
$f_surname=$row["surname"];
$f_email=$row["email"];
fputs($file_op,"$f_title, $f_first_name, $f_surname, $f_email\n");
}
I then use the following link to a download_it.php script as described in
Tansley as follows:
$parameters="file_name=".urlencode($file_name)."&file_size=$file_size";
echo "<A HREF=\"downloadit.php?$parameters\">download it</A>";
The download_it.php file looks as follows:
<?php
#downloadit.php
$file_name=urldecode($file_name);
header("Content-type: Application/octet-stream");
header("Content-Disposition: attachment;filename=download/download.txt");
header("Content-Description: PHP Download");
header("Content-Length: $file_size");
readfile($file_name);
?>
Appart from the fact that the Content-Disposition appears not to be working
under IE6 since the file name is not correct.
The downloaded file does not contain Windows type carriage returns of
newlines! However it does contains the data thank goodness.
What is the fix?
Henry Grech-Cini
--- End Message ---
--- Begin Message ---
Congratulations on discovering the difference between windows and linux
carriage returns. :) There are 2 types of new-line character, \r (carriage
return, ie move the cursor back the the left hand side of the screen) and \n
(new line, strictly interpreted as "move cursor down one line, but not
along"). Linux quite happily accepts \n as, "new line and return cursor to
left home" however windows needs both, \n\r (or vice versa, I'm not sure
which). Linux fortunately will accept \n\r as a single return, so feel free to
always put \n\r
R
Henry Grech-Cini wrote:
> Dear All,
>
> Firstly, I am a newbie to php so please be gentle.
>
> I'm having problems with carriage returns placed in a file on a Linux based
> server. When this file is download to a WindowsXP machine the carriage
> returns are quite frankly useless. I just get "[]" (where "[]" represents an
> undisplayable character. No actual carriage returns or newlines!
>
> I generate the file using the following code (fragment only):
>
> while($row=mysql_fetch_array($mysql_result))
> {
> $f_title=$row["title"];
> $f_first_name=$row["first_name"];
> $f_surname=$row["surname"];
> $f_email=$row["email"];
> fputs($file_op,"$f_title, $f_first_name, $f_surname, $f_email\n");
> }
>
> I then use the following link to a download_it.php script as described in
> Tansley as follows:
>
> $parameters="file_name=".urlencode($file_name)."&file_size=$file_size";
> echo "<A HREF=\"downloadit.php?$parameters\">download it</A>";
>
> The download_it.php file looks as follows:
> <?php
> #downloadit.php
> $file_name=urldecode($file_name);
> header("Content-type: Application/octet-stream");
> header("Content-Disposition: attachment;filename=download/download.txt");
> header("Content-Description: PHP Download");
> header("Content-Length: $file_size");
> readfile($file_name);
> ?>
>
> Appart from the fact that the Content-Disposition appears not to be working
> under IE6 since the file name is not correct.
>
> The downloaded file does not contain Windows type carriage returns of
> newlines! However it does contains the data thank goodness.
>
> What is the fix?
>
> Henry Grech-Cini
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
> The downloaded file does not contain Windows type carriage returns of
> newlines! However it does contains the data thank goodness.
>
> What is the fix?
The problem you encounter is that one system is using soft line breaks
weather the other is using hard (never remember which one who did what
- just check with an hex editor to find out your self) and you need
to convert the breaks in order to display the properly on each system.
If you don't want to write the convert your self (fairly easy), there are
a number of utilities that convert in LF/CR text files between Unix and PC
formatted text files.
//ANders
--- End Message ---
--- Begin Message ---
Thankyou Ross, (may I call you Ross?) :-)
Worked a treat. The correct order is \r\n (\n\r just produces 2
undisplayable characters [][]).
I had tried \n\r but hadn't considered using \r\n.
Thankyou Thankyou Thankyou
Henry
"Ross Fleming" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Congratulations on discovering the difference between windows and linux
> carriage returns. :) There are 2 types of new-line character, \r
(carriage
> return, ie move the cursor back the the left hand side of the screen) and
\n
> (new line, strictly interpreted as "move cursor down one line, but not
> along"). Linux quite happily accepts \n as, "new line and return cursor
to
> left home" however windows needs both, \n\r (or vice versa, I'm not sure
> which). Linux fortunately will accept \n\r as a single return, so feel
free to
> always put \n\r
>
> R
>
> Henry Grech-Cini wrote:
>
> > Dear All,
> >
> > Firstly, I am a newbie to php so please be gentle.
> >
> > I'm having problems with carriage returns placed in a file on a Linux
based
> > server. When this file is download to a WindowsXP machine the carriage
> > returns are quite frankly useless. I just get "[]" (where "[]"
represents an
> > undisplayable character. No actual carriage returns or newlines!
> >
> > I generate the file using the following code (fragment only):
> >
> > while($row=mysql_fetch_array($mysql_result))
> > {
> > $f_title=$row["title"];
> > $f_first_name=$row["first_name"];
> > $f_surname=$row["surname"];
> > $f_email=$row["email"];
> > fputs($file_op,"$f_title, $f_first_name, $f_surname, $f_email\n");
> > }
> >
> > I then use the following link to a download_it.php script as described
in
> > Tansley as follows:
> >
> > $parameters="file_name=".urlencode($file_name)."&file_size=$file_size";
> > echo "<A HREF=\"downloadit.php?$parameters\">download it</A>";
> >
> > The download_it.php file looks as follows:
> > <?php
> > #downloadit.php
> > $file_name=urldecode($file_name);
> > header("Content-type: Application/octet-stream");
> > header("Content-Disposition:
attachment;filename=download/download.txt");
> > header("Content-Description: PHP Download");
> > header("Content-Length: $file_size");
> > readfile($file_name);
> > ?>
> >
> > Appart from the fact that the Content-Disposition appears not to be
working
> > under IE6 since the file name is not correct.
> >
> > The downloaded file does not contain Windows type carriage returns of
> > newlines! However it does contains the data thank goodness.
> >
> > What is the fix?
> >
> > Henry Grech-Cini
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
> Congratulations on discovering the difference between windows and linux
> carriage returns. :) There are 2 types of new-line character, \r (carriage
> return, ie move the cursor back the the left hand side of the screen) and \n
> (new line, strictly interpreted as "move cursor down one line, but not
> along"). Linux quite happily accepts \n as, "new line and return cursor to
> left home" however windows needs both, \n\r (or vice versa, I'm not sure
> which). Linux fortunately will accept \n\r as a single return, so feel free to
> always put \n\r
A proper language should interpret \n into the correct CR (new line) code at the
target platform. hence: don't fiddle around with \r or \f and that shit. Just do
a TrimRight() and add on a "\n" (new line) at the end - should be enough...
By the way. Windows uses 0x0D0A as CR, eg char(13) and char(10), in that order.
--- End Message ---
--- Begin Message ---
Dear All (and B.A.T.Svensson in particular)
I agree. It should not be necessary with a proper language. Could it be that
I need to use a different header as opposed to:
header("Content-type: Application/octet-stream");
In anycase doing TrimRight() and adding on a "\n" did not work!
Henry
"B.A.T. Svensson" <[EMAIL PROTECTED]> wrote in message
000601c1fce1$3e9fb660$[EMAIL PROTECTED]">news:000601c1fce1$3e9fb660$[EMAIL PROTECTED]...
> > Congratulations on discovering the difference between windows and linux
> > carriage returns. :) There are 2 types of new-line character, \r
(carriage
> > return, ie move the cursor back the the left hand side of the screen)
and \n
> > (new line, strictly interpreted as "move cursor down one line, but not
> > along"). Linux quite happily accepts \n as, "new line and return cursor
to
> > left home" however windows needs both, \n\r (or vice versa, I'm not sure
> > which). Linux fortunately will accept \n\r as a single return, so feel
free to
> > always put \n\r
>
> A proper language should interpret \n into the correct CR (new line) code
at the
> target platform. hence: don't fiddle around with \r or \f and that shit.
Just do
> a TrimRight() and add on a "\n" (new line) at the end - should be
enough...
>
> By the way. Windows uses 0x0D0A as CR, eg char(13) and char(10), in that
order.
--- End Message ---
--- Begin Message ---
B.A.T.Svensson wrote (possibly not visible as a post yet)
> Are you trying to get line breaks on a web pages with CR/LF?
> (IF so: it not possible, use the HTML tag "<br>" to induce a line break.)
No I'm not trying to do that, I'm trying to generate a CSV file from a
collection of tabels within a MySQL database. This .csv file is then
downloaded to a windows machine.
Any suggestions?
Henry
"Henry Grech-Cini" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Dear All (and B.A.T.Svensson in particular)
>
> I agree. It should not be necessary with a proper language. Could it be
that
> I need to use a different header as opposed to:
>
> header("Content-type: Application/octet-stream");
>
> In anycase doing TrimRight() and adding on a "\n" did not work!
>
> Henry
>
>
> "B.A.T. Svensson" <[EMAIL PROTECTED]> wrote in message
> 000601c1fce1$3e9fb660$[EMAIL PROTECTED]">news:000601c1fce1$3e9fb660$[EMAIL PROTECTED]...
> > > Congratulations on discovering the difference between windows and
linux
> > > carriage returns. :) There are 2 types of new-line character, \r
> (carriage
> > > return, ie move the cursor back the the left hand side of the screen)
> and \n
> > > (new line, strictly interpreted as "move cursor down one line, but not
> > > along"). Linux quite happily accepts \n as, "new line and return
cursor
> to
> > > left home" however windows needs both, \n\r (or vice versa, I'm not
sure
> > > which). Linux fortunately will accept \n\r as a single return, so
feel
> free to
> > > always put \n\r
> >
> > A proper language should interpret \n into the correct CR (new line)
code
> at the
> > target platform. hence: don't fiddle around with \r or \f and that shit.
> Just do
> > a TrimRight() and add on a "\n" (new line) at the end - should be
> enough...
> >
> > By the way. Windows uses 0x0D0A as CR, eg char(13) and char(10), in
that
> order.
>
>
--- End Message ---
--- Begin Message ---
Try passing the file through preg_replace. Replace all \n with \r\n.
--
Scott Carr
OpenOffice.org
Whiteboard-Doc Maintainer
http://whiteboard.openoffice.org/doc/
Quoting Henry Grech-Cini <[EMAIL PROTECTED]>:
> Dear All,
>
> Firstly, I am a newbie to php so please be gentle.
>
> I'm having problems with carriage returns placed in a file on a Linux based
> server. When this file is download to a WindowsXP machine the carriage
> returns are quite frankly useless. I just get "[]" (where "[]" represents
> an
> undisplayable character. No actual carriage returns or newlines!
>
> I generate the file using the following code (fragment only):
>
> while($row=mysql_fetch_array($mysql_result))
> {
> $f_title=$row["title"];
> $f_first_name=$row["first_name"];
> $f_surname=$row["surname"];
> $f_email=$row["email"];
> fputs($file_op,"$f_title, $f_first_name, $f_surname, $f_email\n");
> }
>
> I then use the following link to a download_it.php script as described in
> Tansley as follows:
>
> $parameters="file_name=".urlencode($file_name)."&file_size=$file_size";
> echo "<A HREF=\"downloadit.php?$parameters\">download it</A>";
>
> The download_it.php file looks as follows:
> <?php
> #downloadit.php
> $file_name=urldecode($file_name);
> header("Content-type: Application/octet-stream");
> header("Content-Disposition: attachment;filename=download/download.txt");
> header("Content-Description: PHP Download");
> header("Content-Length: $file_size");
> readfile($file_name);
> ?>
>
> Appart from the fact that the Content-Disposition appears not to be working
> under IE6 since the file name is not correct.
>
> The downloaded file does not contain Windows type carriage returns of
> newlines! However it does contains the data thank goodness.
>
> What is the fix?
>
> Henry Grech-Cini
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
--- End Message ---
--- Begin Message ---
Just to clarify, is the problem getting explorer to save the name properly?...
or is it still the carriage returns?
Isn't it amazing how typewriters are cause problems in todays programming
exercises?... :)
and yes, u can call me Ross :)
R
Henry Grech-Cini wrote:
> B.A.T.Svensson wrote (possibly not visible as a post yet)
>
> > Are you trying to get line breaks on a web pages with CR/LF?
> > (IF so: it not possible, use the HTML tag "<br>" to induce a line break.)
>
> No I'm not trying to do that, I'm trying to generate a CSV file from a
> collection of tabels within a MySQL database. This .csv file is then
> downloaded to a windows machine.
>
> Any suggestions?
>
> Henry
>
--- End Message ---
--- Begin Message ---
Or just use a real text-editor that will properly handle
files with "\n" and "\r\n". Anything more advanced than
MS Notepad should properly grok what's going on.
Unless you're going to be exclusively on Win32, those
little bastard "\r"'s can really mess things up...
I've had entire scripts refuse to run because i used
a text editor that felt like throwing in "\r" after
every line.
(Open up a "windows" file in "vi" to see the mess)
---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515
--- End Message ---
--- Begin Message ---
I am using the $PHP_SELF variable on a form page and while the page
works fine I'm getting an error:
Undefined variable PHP_SELF in...
This is very odd because it parses the link correctly and it works fine.
Ron
--- End Message ---
--- Begin Message ---
guys ... im stuck as usual .....
im making a login-passward page to allow login to my
site ......
now i have read a bit about SSL ... client/server
authentication ... n the works ....
now guyz ....
help me pleez .....
i dont know how to do it ......
i mean how can i authentify a user against his id and
password stored in the database ....
and im tryin to do this with xml ... which again is a
terrable problem as i have just started on it aswell
.....
guyz pleez .... do tell me somethin ......
i'd be in your eternal debt ......
stuck bad ..... toby .....
__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
--- End Message ---
--- Begin Message ---
Personally, there are 3 biggies for me
1) Free, open-source
2) works on linux and windows
3) it's NOT anything like VB :)
If you're looking for a technical in-depth review, try google.com
---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515
> -----Original Message-----
> From: "Spychala, Wojciech" [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 15, 2002 9:39 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] ASP and PHP
>
>
> is there somebody who can write few points why PHP is better
> than asp and
> why is worse?
>
> Thanks very much
>
> Bitter
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Sure....
ASP can't do associative arrays
ASP can only do numerical multi-dimension arrays
ASP can't do serious string manipulation
ASP carries way too much around in each function call--global scope all the
time for all variables
ASP cannot short-circuit a boolean expression
ASP database connection is very cryptic (because of COM) and lengthy to
perform the simplist of queries
ASP confuses functions and data structures--arrays and functions
ASP only recognizes strings as double-quote deliminited
ASP does not have mult-line comments
ASP doesn't understand external http or ftp resources
PHP can do COM just like ASP
PHP does associative, multi-dimension arrays without having to declare them
as such--$my['one']['two']['three'] = 'hello world'--just created a
3-dimensional
associative array
PHP's structure is WAY more simplistic
PHP can short circuit boolean expressions
PHP has very straightforward type casting and conversion mechanisms
PHP has output buffering and output filtering built in
PHP has VERY simple user error-handling
mechanism--error_handler('yourFunctionName')
PHP can do variable variables--$var = 'hello'; $hello = 'world'; echo
$$var;--just ourput 'world';
PHP can do variable functions--function foo() {echo 'hello';} $var = 'foo';
$var();--just printed 'hello'
PHP is so much faster! (benchmarks that I've seen on linux/apache ->
win/iis)
PHP can natively open and write to sockets
PHP can open ftp and http resources
PHP has a very complete set of regular expressions that are tied nicely to
their string and array functions
PHP has an enormous amount of built in features and functions that ASP does
not
PHP can send email without any additional downloads and cost
The list can go on and on....I have yet (4 years) to find something that ASP
can do that PHP can't....It took a day of coding ASP before I found tons of
things that ASP couldn't do that PHP could. The PHP developers are
absolutely incredible!!!! :-)
I am well-aware that there are 3rd party components to ASP that offer a good
deal of functionality, but usually on a per server or per cpu cost. This,
of course, is in addition to the cost of the software and all appropriate
licenses.
Microsoft has done a great job of improving ASP in ASP.Net, however, when
you start out with crap, it is not rocket science to make it a little
tastier and a little fresher. Also, READ the fine print on Microsoft's new
licenses before you go ANY further down that road.
> -----Original Message-----
> From: "Spychala, Wojciech" [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 15, 2002 6:39 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] ASP and PHP
>
>
> is there somebody who can write few points why PHP is better
> than asp and
> why is worse?
>
> Thanks very much
>
> Bitter
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Is there a way to include the text contained in Word Docs in a php based
search?
Ron
--- End Message ---
--- Begin Message ---
I've never used COM+Word, but i assume you can read the
contents of a Word file using COM, then search for
specific words. If you're on a windows platform, that is
-- becuase COM is windows-only
do some google.com searches for COM, PHP, Word.
---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515
> -----Original Message-----
> From: R.S. Herhuth [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 16, 2002 2:36 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] searching the text in uploazded Word docs
>
>
>
> Is there a way to include the text contained in Word Docs in
> a php based
> search?
>
> Ron
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Cronning a script works great as well
(I do this at home on my linux server)
---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515
> -----Original Message-----
> From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 16, 2002 6:03 AM
> To: Tim Blackwell; [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] automation
>
>
> > i need to automate a php script i'm writing. php doesn't
> look like it's the
> > best for this.
> >
> > is there a way to automate a php script?
>
> You can use AT.exe or the scheduler.
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
...Or you could preg_match on the string.
$data = <a href="javascript:void(EXTERNALLINK('102'))">
preg_match('/EXTERNALLINK\(\'(\d+)\'\)/', $data, $matches);
var_dump($matches);
---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515
> -----Original Message-----
> From: R.S. Herhuth [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 15, 2002 10:20 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Return portion of a string
>
>
>
> I have an instance where I have an article ($article) that may or may
> not contain:
>
> <a href="javascript:void(EXTERNALLINK('102'))">
>
> There might be many occurrances of this substring in exactly the same
> format but the id's will be unique with each occurance.
>
> Can someone please show me how to extract the id's (in this case the
> 102) of the above string into an array? I have been through the
> documentation on substrings and regular expressions but I'm just not
> getting it.
>
> Thanks,
> Ron
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hi all,
would appreciate any help with this (newbie) question. All im trying to do
is to echo on screen the checkbox values selected by the user. Problem is
when submit is pressed, the selected artists dont appear, it just goes back
to the original screen (with empty checkboxes). Below is the code which ive
copied from another site which supposedly should work. Thanks in advance for
help.
in file jukebox.php3
<?
// check for $submit
if (!isset($submit))
{
// and display form
?>
<form action="jukebox.php3" method="post">
<input type="checkbox" name="artist[]" value="Bon Jovi">Bon Jovi
<input type="checkbox" name="artist[]" value="N'Sync">N'Sync
<input type="checkbox" name="artist[]" value="Boyzone">Boyzone
<input type="checkbox" name="artist[]" value="Britney Spears">Britney Spears
<br>
<input type="submit" name="submit" value="Select">
</form>
<?
}
// or display the selected artists
else
{
?>
<b>And here are your selections:</b>
<br>
<?
// use a "for" loop to read and display array elements
for($count = 0; $count < sizeof($artist); $count++)
{
print "<i>$artist[$count]</i><br>";
}
}
?>
--- End Message ---