RE: [PHP] Re: File Upload Problem

2002-10-31 Thread David Robley
In article <01c2805a$8a2a11a0$4b0a0a0a@skink>, 
[EMAIL PROTECTED] says...
> 
> G'day David
> 
>  > > My problem is that files uploaded through a form are 
>  > > increasing in size.
> 
>  > Doesn't that look like the EOL characters are being 
>  > translated after the fashion of ftp ascii transfers?
> 
>  > Maybe have a look at the two versions in a 
>  > hex viewer and see if that is the case? 
> 
> Yes, I'd considered that.  That was what I'd gone looking for in config
> files etc.  I'd hoped to find a switch for ftp transfer mode.  Didn't
> find one though.
> 
> However, partly because of your email and partly because I noted that
> the file size increase was the same every time (27 bytes) I decided to
> load it into a hex editor.
> 
> What I found was that at the top of the file, the following had been
> added:
> 
> -8<-
> Content-Type: image/gif
> 
> -8<-
> 
> I also found that if I remove these two lines the image will display
> perfectly.
> 
> So, my next question is, why does my linux box add this to an uploaded
> image and my windows box not do so?  Can someone make a suggestion on
> where I should be looking?  Is the addition of this information a server
> (Apache) thing?  Or is it a php thing?
> 
> CYA, Dave

That's, er, odd?? Dunno whether you might find anything useful from 

http://www.google.com/search?q=upload+file+content+type+form+multipart+ima
ge+php&sourceid=opera&num=0&ie=utf-8&oe=utf-8

(unwrap that). As I understand it, upload by form has nothing to do with 
ftp - it's part of http - and I assume that it is intended to do an 
'exact' copy? Perhaps a code snippet, just in case anyone can pick 
something odd about it.

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: confirm subscribe to php-general@lists.php.net

2002-11-04 Thread David Robley
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> On 2 Nov 2002 03:26:36 -
> [EMAIL PROTECTED] wrote:
> 
> > Hi! This is the ezmlm program. I'm managing the
> > [EMAIL PROTECTED] mailing list.
> > 
> > I'm working for my owner, who can be reached
> > at [EMAIL PROTECTED]
> > 
> > To confirm that you would like
> > 
> >[EMAIL PROTECTED]
> > 
> > added to the php-general mailing list, please send
> > an empty reply to this address:
> > 
> >
>[EMAIL PROTECTED]
> > 
> > Usually, this happens when you just hit the "reply" button.
> > If this does not work, simply copy the address and paste it into
> > the "To:" field of a new message.
> > 
> > or click here:
> > 
>mailto:php-general-sc.1036207596.kehogdkeclpnffkcijba-bryanc2000=insightbb.com@;lists.php.net

Brian

Read the instructions above carefully, particularly the bit where it tells 
you what address to send to, and try again.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: Works in html, not when echoed in PHP

2002-11-13 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> Folks,
> 
> Can't see an answer anywhere in the archives, so here goes.
> 
> This works fine in plain html:
> 
>  onresize="window.location.reload(false)" topmargin="1" bottommargin="0"
> leftmargin="0" rightmargin="0">
> 
> When I put it in PHP thus:
> 
> echo " onresize=\"window.location.reload(false)\" topmargin=\"1\"
> bottommargin=\"0\" leftmargin=\"0\" rightmargin=\"0\">";
> 
> When the page loads, I get an "Error: 'menuObj' is null or not an object"
> 
> The onoff() function is what contains the menuObj, so I suspect the single
> quotes around the parameters mainmenu and on, but have tried everyway I can
> think of and can't get rid of the Error.
> 
> The function is thus:
> 
> function onoff (elemparent,elem,state) {
> if (loaded) {
> newstate = eval(elem+"_"+state);
> if (n4) {
> menuObj = eval (doc + elemparent + doc2 + elem);
>  }
> else if (ie || n6) {
> menuObj = eval (doc + elem + doc2);
>  }
> 
> I would be grateful for any tips.

Not a JS expert, but: have you tried comparing the 'View source' of your 
PHP script output with the expected code?

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: PHP's mail() function doesn't work on my server

2002-11-13 Thread David Robley
In article <004101c288f5$2fa6f0b0$0100a8c0@hub>, 
[EMAIL PROTECTED] says...
> I have sendmail installed and the path to it in the php.ini is correct, when i try a 
>file just containing the mail() function (no errors in that!) it starts sendmail but 
>nothing gets sent!
> 
> root 22508  0.0  0.2  3556 1520 pts/2S20:09   0:00 php test.php
> smmsp22509  0.0  0.2  3416 1440 pts/2S20:09   0:00 /usr/sbin/sendmail -t 
>-i
> 
> help!
> 

Test the return value from mail - if it is true then mail() has handed the 
message off to sendmail successfully and you need to check your sendmail 
logs to try and track the problem. Also check the mail address on your 
system that would receive error mails (not delivered, etc).

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




RE: [PHP] Why $ on variable names?

2002-11-13 Thread David Robley
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> In an earlier message, Larry Rosenman [mailto:ler@;lerctr.org] said ...
> 
> > How about:
> 
> > That's the way the language designers did it, and
> > there's LOTS of PRODUCTION code out there that uses it.
> 
> Because "that's the way it is"?  Well, that's good enough for me.  I'll
> never question anything else again & I trust you won't, either.
> 
> >  See also the precedence of PERL.
> 
> Huh?  What does the "precedence of PERL" mean?

If I may be permitted a moment of mindreading, I think he meant 
'precedent'. Its possible he is an American and has English as a second 
language :-)



Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: php/mysql not mutually connected

2002-11-13 Thread David Robley
In article <003001c28a86$cab1dce0$[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> I have php (as an apache module) and mysql up and running on Windows in the same 
>computer, but they seem to be unconnected.
> How do I configure php.ini, my.ini, etc for a php script to find and query a 
>database in the mysql server?
> Thanks for any help
> 
> Alberto Brea
> 
Your installation probably has mysql support enabled - use phpinfo() to 
check.

Then see http://www.php.net/manual/en/ref.mysql.php for all the mysql 
functions which will do what you want.

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: Thumbnail pages - alot of them

2002-06-07 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> I have a mysql database table of about 7000 images (they are not
> actually in the db, just references), as yet uncategorized.  I need to
> put them online and allow my client to browse 12-18 thumbnails per page.
> 
> what would be the most efficient method to code that with PHP?  any help
> is appreciated!
> 
> Thanks,
> 
> Rory
> 
> 
Look into mysql's LIMIT which permits you to define the number of records 
returned from a query

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: Date functions & Unic Epoch

2002-06-09 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Hi!
> 
> Say, has anybody re-written the date funtions so they work with any date and
> not be crippled by the unix timestamp range limit?
> 
> I am looking for a function which will do the equivalent of
>date("w",mktime(0,0,0,8,30,1934))
> but that will actually *work*.
> 
> Does anybody know a way to return which day of the week (0-7) it is for
> dates outside the unix timestamp range?
> 
> I wish this stuff would be build into PHP.

You might look at the Calendar functions for this - you may need to 
recompile your php to include them.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: apache/oracle/php

2002-06-11 Thread David Robley

In article <00cb01c2112c$a1530140$[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Hi to all,
> 
> Is there anyone who could give me some reasons why does my php script with
> oracle function does'nt work if i run apache as nobody/nobody?
> 
> My script only work if i run apache as oracle/dba.

Does oracle not require you to pass appropriate user/pass when you accces 
it?

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: Email with PHP.

2002-06-11 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Well I have install the second version from the end :) .. in a slack box
> with the latest apache server..
> 
> I tried to use the mail() function and it says that:
> 
>  Warning: mail() is not supported in this PHP build in . . . . .
> 
> Well I notice that I haven't got sendmail installed, and so I installed it.
> 
> I also configures the php.ini file to use sendmail.
> 
> DO I NEED 2:
> 
> 1. reinstall php with any special flag to use mail() function ??
> 2. or do I need to do anything else.??
> 
> 
> Thanks in advance..

If you didn't have sendmail or equivalent installed when you compiled php, 
you'll have to reconfigure and recompile php after the mail package is 
installed. The configure process goes looking for sendmail and if it 
doesn't find it, no mail functionality is included.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




Re: [PHP] GOTO command. Doest it exist?

2002-06-11 Thread David Robley

In article <001901c21190$c2ffc4e0$017f@localhost>, 
[EMAIL PROTECTED] says...
> Many will tell you that the goto command is extinct.  It isn't, it's just
> evolved into the function command.  What you do now is create a function:
> 
> function some_name($variable,$other_variable,...)
> {
> some code here;
> }
> 
> then, call it using :
> 
> call_user_func('some_name',$variable,$other_variable,...)
> 
> It's just like goto, it goes to a specified code block and then returns to
> the line below the call, but takes more typing.
> Hope this helps.
> Hugh

What you have described is more like a gosub.

Goto jumps execution to the specified point in the code and continues from 
there. It does not automatically return to the line after the goto call.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: POST/GET var problem

2002-06-12 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> take the following html code
> 
> 
> 
> 
> 
> Now when that is created by a php script the value that is passed back is 
> the following.
> 
> myimg.x="Click loc X"&myimg.y="Click loc y"
> 
> I could leave the name attribute off and I get an x/y value set that I can 
> use for some math functions I have.  The problem is that I have more than 
> one image that could be clicked on and depending on which you click on 
> determines what math to do.
> 
> $HTTP_POST_VARS['myimg.x'] seems to be an object as I can't do the following
> $x=$HTTP_POST_VARS['myimg.x'];
> 
> Anyone know how I can get this value into a variable I can use?

PHP will replace the dot with an underscore as dot is normally 
concatention operator.

Use 

$x=$HTTP_POST_VARS['myimg_x'];

or just test if _x or _y are set to see which image was used.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: converting C to PHP

2002-06-12 Thread David Robley

In article <6416776FCC55D511BC4E0090274EFEF508A46F@EXCHANGE>, 
[EMAIL PROTECTED] says...
> I'm converting some C functions to PHP and have come across this:
> 
> int skipf(..., char *format)
> {
>   /* ... */
>   cp = format;
>   char *cp, *cp2;
>   multiplier = strtol(cp, &cp2, 10);
>   /* ... */
> }
> 
> 
> How can I implement this line in PHP ?
>   multiplier = strtol(cp, &cp2, 10);
> 
> 
> Oh, and an example of format is "12L20W2P"

Non C programmer volunteers suggsetion. I looked at strtol in the C docs 
and I don't quite understand exactly what it does. But I wonder if intval 
would be a starting point to try and get the result I think you want?

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




Re: [PHP] netscape wont show form result

2002-06-13 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> I know what you are both saying and it was a poor explanation from me as to what
> happened. let me explain it further because although the code is working now i
> would like to know what happened.
> We know the code should work the same regardless of browser since the server is
> interpreting the code not the browser, however;
> 1. the tables were all properly formatted. The script called for different includes
> depending on the situation - these were all complete individual tables (remember ns
> would display correctly, but only if the script excecuted to the end, ie corect
> input from the user)
> 2. the memory cache on ns was set to 5MG and the disk cache to over7MG - ample for
> this situation. I currently have the memory cache set to 1MG and it still works.
> 3. the only change i made between the first and second messages yesterday was to
> remove the 'exit' line, which i had placed in the script at a point after user
> input errors had been detected and before the email was sent.
> 4.ns threw up blank pages whenever i deliberately made an error on the form
> 5.once this line was removed ns worked as expected. ie worked as expected both
> before and after the amendment
> 
> Any thoughts???
> Steve
> Stuart Dallas wrote:
> 
> > On Wednesday, June 12, 2002 at 5:48:02 AM, you wrote:
> >
> > > An 'exit' directive had secretly sneaked into the script! which caused ns to
> > > abort the rest of the script (as it should) while ie blissfully ignored
> > > it(??). Anyway it all works now. Thanks again.
> >
> > Just thought I'd point out an error in your explanation. PHP is executed by the
> > server, not by the browser. Therefore, IE cannot have "blissfully ignored" an
> > exit directive since it never saw one. I think you've solved your problem by
> > coincidence rather than logic - a very bad way to write code.

As I am sure has been pointed out previously on this list, Netscape 
handled poorly formatted tables differently from IE. If the exit() caused 
a malformed table to be sent to Netscape, NS would not render the table, 
whereas IE will make an attempt to render based on the information 
received.

You can demonstrate this by replacing the exit() and do a view source in 
both browsers. You will find the source is the same, but is rendered 
differently.

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: UPDATE mysql

2002-06-23 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> I can't get UPDATE to work properly when querying MySQL.
> 
> $query = "UPDATE $table SET field1='$var1' WHERE id='$id'";
> 
> I want to update one field of one row in a table.  Is this syntax
> correct?
> 
if id is an int type, no. You only need to quote values being passed to 
[var]char or text type fields.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: MySQL Problem with PHP

2002-06-26 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> I am using PHP and MySQL on a 2k dev box to be uploaded to a linux box
> 
> I have a piece of SQL
> 
> INSERT INTO `contracts` (`key`, `content`) VALUES (1,'blah blah blah
> character 39 is a single speach mark '+CHAR(39)+' blah blah blah')
> 
> Instead of inserting: 'blah blah blah character 39 is a single speach mark '
> blah blah blah
> It inserts 0
> All variations work fine when there is no single speachies
> 
> help?

Look into addslashes and the various magic_quotes settings in you r 
php.ini.


-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: Weird error!!

2002-06-26 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Bad file descriptor
> 
> is generally when there is a fault with the disk...
> 
> try on some other server...
> 
> 

Bad file descriptor might well mean that a file that doesn't exist has 
been requested; this is more likely the problem

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: Testing PHP on a local machine

2002-06-26 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Thanks for pointing me in the right direction
> 
> However, just have a few other questions:-
> 
> Do i need to install apache if i use the windows self extracting version?

I assume you are talking about php self extracting? If so, you will also 
need some sort of web server to be able ot develop php web based stuff.

> Can all this be also done on a laptop?
Works on mine.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: Help and advice sought - search/replace

2002-07-02 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Just looking for a pointer or functions I can use to do this...
> 
> I have a spreadsheet with a couple thousand entries that I'll be using for
> populating a MySQL database. The spreadsheet has names listed in "last,
> first" - the database I'll be populating has separate fields for first and
> last names.
> 
> I exported the names column from the spreadsheet in tab-delimited format and
> I figured I could come up with a quick PHP script that would open the text
> file, find each instance of ", ", take all that's before that delimiter and
> move it after all that's after that delimiter, inserting a tab in between.
> So "last, first" would become "first[tab]last".
> 
> So far, I've gotten:
>$filename = "NAMES.txt"; //name the file...
>   $fp = fopen($filename,"r+"); //open it...
>   echo "Reading $filename...";
> 
>   $contents = fread($filename, filesize($filename)); //read it...
> 
>   $names = explode("\n", $contents);
> 
>   foreach($names as $name);
>   echo "$name";
> 
>   fclose($filename);
> ?>
> 
> Obviously, I've written in some stuff just so I can see what I'm doing, the
> echo in the foreach for example. But I'm stuck on what to use to actually
> separate and rewrite each $name. I'm assuming I'll have to create a while()
> or for() loop and use a regular expression for this? I'm not sure where to
> look. Any help would be great - just so I won't have to go in and manually
> separate first and last names. Thanks!
> 
> Jason Soza


Off the top of my head (pseudocode):

Read the file into an array with file()
 foreach element
  explode on tab
  select name field
  explode on comma
  extract last, first fields and write to...
done

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




Re: [PHP] HTTP_USER_AGENT?

2002-07-11 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Thanks that worked just fine.  But now I am irritated as hell.  Obviously there
> is no backwards compatibility with new releases.  Does this mean if I install a
> new version of PHP then all books published before that date are worthless?
> Seems so.
> 
> For example in a book discussing PHP 3 it says:
> 
>  phpinfo();
> ?>
> 
> This works just fine.  In a book that discusses PHP 4 it says:
> 
>  php_info()
> ?>
> 
> This gives "Fatal error: Call to undefined function: php_info() in
> c:\inetpub\wwwroot\php\phpinfo.php on line 2."
> 
> So it's not just backwards compatibility it is careless planning.  This is not
> good.  I will have to search hi and lo to determine if a failure is due to
> incorrect syntax because of version and not just careless typing on my part.

Have you considered the possibility that, in this case, the book might 
have a misprint? Your definitive source should always be the latest php 
documentation.

> I remember when FORTRAN was being developed we were assurred that all previous
> commands from older versions would continue operative in the new.  FORTRAN 77
> to FORTRAN 90.  I think the developers of PHP ought to consider why the
> developers of FORTRAN thought that might be a good thing to do.  It is still
> used to this day.  Write a FORTRAN 77 prog and it will compile and run on a
> FORTRAN 90 compiler out of the box.  Thanks again.


-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: compiling with mysql

2002-07-14 Thread David Robley

In article , [EMAIL PROTECTED] says...
> 
> Another PHP compilation question ...
> 
> I've just compiled PHP 4.2.1 --with-mysql. I added no path to mysql, and
> it worked fine as it always does. However, I'm keen to add mod_python as a
> DSO to Apache as well, and noticed in PHP's INSTALL notes that I'll
> probably need to recompile PHP with a path to mysql:
> 
>   --with-mysql=/somewhere/or/other/
> 
> 1. Is this always the case?
> 
> 2. Where would the path be likely to be on RedHat 7.2 with MySQL rpms?

I'm not a Redhat user, but I think you will have to have installed a 
source rpm for mysql. You can probably check if you have the include files 
installed by doing locate mysql.h to give you the mysql include directory, 
possibly something like /var/mysql/include or /usr/local/mysql/include. 
Stripping the /include should give you the 'parent' directory under which 
both the include files and lib files can be found.

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: Question 1

2002-07-14 Thread David Robley

In article , [EMAIL PROTECTED] says...
> 
> I am looking at importing data from rdtool into a mysql backend
> And not sure how to go about it...
> 
> I was wondering if anyone has tried this or know of some information
> that may help.
> 
> Or even a theroy on how the best way would be to do this...
> 
> Thanks in advance..

Does rdtool allow you to export in commma/tab/whatever delimited format? 
Then just use mysql's LOAD DATA INFILE

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




RE: [PHP] Re: Question 1

2002-07-14 Thread David Robley

On 15 Jul 2002 at 14:27, Chris Kay wrote:

> 
> I wish it was that eazy :)
> 
> 
> --- Chris Kay Technical Support - Techex Communications Website:
> www.techex.com.au   Email: [EMAIL PROTECTED] Telephone: 1300 88 111
> 2 - Fax: (02) 9970 5788 Address: Suite 13, 5 Vuko Place, Warriewood, NSW
> 2102 Platinum Channel Partner of the Year - Request DSL - Broadband for
> Business
> 
> ---
> 
> 
> 
> 
> -Original Message-
> From: David Robley [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, July 15, 2002 2:27 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Question 1
> 
> 
> In article  fs.techex.net.au>, [EMAIL PROTECTED] says...
> > 
> > I am looking at importing data from rdtool into a mysql backend And not
> > sure how to go about it...
> > 
> > I was wondering if anyone has tried this or know of some information
> > that may help.
> > 
> > Or even a theroy on how the best way would be to do this...
> > 
> > Thanks in advance..
> 
> Does rdtool allow you to export in commma/tab/whatever delimited format?
> 
> Then just use mysql's LOAD DATA INFILE
> 

OK - I can then assume that rdtool is the Ruby Documentation tool? At 
least that's what google chucks up. It appears that it produces 
documentation in a number of formats. Perhaps if you could be a bit more 
specific about exactly what you want to achieve? For example, how is 
your data currently formatted? is it just in text files? what sort of 
table structure do you want to put it in?

-- 
David Robley
Temporary Kiwi!
Quod subigo farinam

"This is mutiny!" said Tom bountifully.



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




RE: [PHP] Re: Question 1

2002-07-14 Thread David Robley

On 15 Jul 2002 at 14:50, Chris Kay wrote:

> 
> The data is stored in a text file that is created by mrtg/rrdtool
> The file size always stays the same and never grows even though the data
> does.
> 
> I wish to pull the data into a mysql database, I don't have fields yet as
> I am not sure how to do it,...
> 
> 
> -Original Message-
> From: David Robley [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, July 15, 2002 2:49 PM
> To: Chris Kay; [EMAIL PROTECTED]
> Subject: RE: [PHP] Re: Question 1
> 
> 
> On 15 Jul 2002 at 14:27, Chris Kay wrote:
> 
> > 
> > I wish it was that eazy :)
> > 
> -------- >
> --- > > > > > -Original Message- > From: David Robley
> [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 15, 2002 2:27 PM >
> To: [EMAIL PROTECTED] > Subject: [PHP] Re: Question 1 > > > In
> article 
> fs.techex.net.au>, [EMAIL PROTECTED] says... > > > > I am looking at
> importing data from rdtool into a mysql backend And > > not sure how to go
> about it... > > > > I was wondering if anyone has tried this or know of
> some information
> 
> > > that may help.
> > > 
> > > Or even a theroy on how the best way would be to do this...
> > > 
> > > Thanks in advance..
> > 
> > Does rdtool allow you to export in commma/tab/whatever delimited 
> > format?
> > 
> > Then just use mysql's LOAD DATA INFILE
> > 
> 
> OK - I can then assume that rdtool is the Ruby Documentation tool? At
> least that's what google chucks up. It appears that it produces
> documentation in a number of formats. Perhaps if you could be a bit more
> specific about exactly what you want to achieve? For example, how is your
> data currently formatted? is it just in text files? what sort of table
> structure do you want to put it in?

First, may I suggest you keep the discussion on-list, as there may be others there 
better 
equipped to help you.

My first suggestion, now that you say you are using rrdtool not rdtool:-) would be to 
open 
the file in which your data is stored and try and work out the structure in which it 
is 
stored. Then, decide which of that data you need for your purpose, and work from there.

-- 
David Robley
Temporary Kiwi!
Quod subigo farinam

"My stereo's half-fixed," said Tom monotonously.



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




Re: [PHP] Someone Help please

2002-07-17 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Chris:
> 
> Geez, this is your third thread on this today...  Lame.
> 
> --Dan
> 
> 

There is none deafer than (s)he who won't listen :-)

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




Re: [PHP] ErrorDocument 404 & Form

2002-07-17 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> 
> Tom a écrit : 
> 
>  > Actaully, neither Apache or PHP is at fault. The ErrorDocument (either in
>  > httpd.conf or an .htaccess file) follows absolute paths, so you are calling
>  > your engine.php out of the root directory of the machine. So the question
>  > is, do you have engine.php in the / folder? If not you can put it there or
>  > just adjust your ErrorDocument command to point to the path of the file.
> 
> No, you didn't understand. I'll make a simpler example. Let's say I did
> use :
> 
> ErrorDocument 404 /phpinfo.php
> 
> /phpinfo.php exists, it just does phpinfo();
> 
> If I call http://localhost/dontexist?plop=foobar I will see the phpinfo,
> and I will see variables like :
> 
> REDIRECT_ERROR_NOTES: File does not exist: /var/www/dontexist 
> REDIRECT_QUERY_STRING: plop=foobar 
> REDIRECT_REQUEST_METHOD: GET 
> REDIRECT_STATUS: 404 
> etc
> 
> but $plop won't be set, and there is no way to get the variables
> back. In POST method I won't even see the REDIRECT_QUERY_STRING at
> all. So should this work, if not why, and is there a way to fix it ?

I seem to remember some discussion about this ages ago - there was some 
difference between how ErrorDocument works in httpd.conf and .htaccess - 
you might try the latter and see if there is a different result.

Then again, I might not be remembering correctly, so ...

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: snmp / php / linux /error

2002-07-18 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Iam trying to use my php file in a Linux machine.
> 
> #!/usr/local/bin/snmp_guard.php -q
> 
>  $bat = snmpget("192.168.10.8", "pub_likt", ".1.3.6.1.4.1.2606.1.2.12.0");
> $sum = snmpget("192.168.10.8", "pub_likt", ".1.3.6.1.4.1.2606.1.2.13.0");
> $drift = snmpget("192.168.10.8", "pub_likt", ".1.3.6.1.4.1.2606.1.2.10.0");
> $verk = snmpget("192.168.10.8", "pub_likt", ".1.3.6.1.4.1.2606.1.2.11.0");
> echo $bat;
> ?>
> 
> Then I start it with php snmp_guard.php
> 
> All I get is
> 
> Call to undefeind funcion snmpget()
> 
> WHY??

That error is usually an indication that the particular resource hasn't 
been included when php was compiled.

Use phpinfo() to see what capabilities your installation has.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: Searching...

2002-07-18 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> in ym search page, i construct a sql query from user input to search my
> database, and i run this query to get totalresults. Then run another query
> with a LIMIT 0, 30 ending for each page. So I'm running 2 mySQL queries per
> page. My question is, is this inefficient? is there any better way i dont
> know of? or does the 2 queries not mka emuch of a difference
> 

You might consider running the first query just to get a COUNT(), rather 
than extracting all the resulting rows and using mysql_numrows to 
determine how many were returned

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




Re: [PHP] Re: Searching...

2002-07-19 Thread David Robley

In article <[EMAIL PROTECTED]>, php-
[EMAIL PROTECTED] says...
> On Friday 19 July 2002 14:08, David Robley wrote:
> 
> > You might consider running the first query just to get a COUNT(), rather
> > than extracting all the resulting rows and using mysql_numrows to
> > determine how many were returned
> 
> Am I missing something? If you do a COUNT() in the query then, in general, 
> it'll only return 1 row. You then use this row to determine the result of the 
> COUNT(). IE using mysql_numrows() on this result is inappropriate.
> 
> 
Nope. The OP sounded like he was pulling the entire query and doing a 
mysql_num_rows on it, then running the query again. Of course, I may have 
misunderstood what he was saying...

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




RE: [PHP] email

2002-07-21 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> 
> >try doing a echo eg
> >
> >$mail = mail( $to, $subj, $Message );
> >echo $to;
> >echo "";
> >echo $subj;
> >echo "";
> >echo $Message;
> >echo "";
> >echo $mail;
> >
> >and see if that is setting the variables...if $mail = 1 then on php's side mail is 
>sent if it's 0 then u have an error
> 
> How can I see what the error is?
> 

Check the logs for your MTA (sendmail, qmail whatever) for errors

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: can pdf forms be used to submit data into a db?

2003-08-28 Thread David Robley
In article , [EMAIL PROTECTED] 
says...
> hi guys and gals, aloha from hawaii,
> 
> Not sure if this is the right place to ask, but i just need to know if it
> is technically possible to have a pdf form be filled out online and then
> once the user hits submit, php takes the data and puts it into a db or some
> sort of db technology and if the need arises to pull up that record once
> more, php fetches the data from the db and dynamically fills out the pdf
> form and presents it to the end user...can do?  or anyone know who i can
> talk to about this...
> 
> thanks and mahalo from hawaii
> 
> 
> if anyone can help me or point me in the right direction, i MAY be inclined
> to send some macadamia nuts to the continental US
> 

I think the FDF (Forms Data Format) functions may be just what you need. 

Cheers
-- 
Quod subigo farinam

$email =~ s/oz$/au/o;
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: Lack of info

2003-09-01 Thread David Robley
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> IM not ranting, IM pointing out that I have looked on the website and the
> FAQ is a joke and help from other sources is either buy something or as the
> case of IRC, no channel of that description was turned up in the search.



Somewhere in there I think you may have asked a question but it was well 
hidden. Perhaps if you were to simply ask your question, someone might 
help you.

Oh, and there is a #php on irc.freenode.net (at least)

-- 
Quod subigo farinam

$email =~ s/oz$/au/o;
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: how to include() N lines?

2003-09-04 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> hello!
> 
> i need to include() only a given amount of lines (the first 10 for example)
> instead of a whole file.
> 
> does someone know how this has to be done?
> 
> 
> thanks a lot for your effort,
> best regards

include and friends only load a complete file. You might try fopen/fread 
and count the number of lines loaded.

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



Re: [PHP] Re: URGENT: how to make a global "server temporarily down" page?

2003-09-05 Thread David Robley
In article <[EMAIL PROTECTED]>, davidtg-
[EMAIL PROTECTED] says...
> Bogdan --
> 
> ...and then Bogdan Stancescu said...
> % 
> % Typing "Apache custom 404" and clicking on "I feel lucky" would get you 
> % to this information:
> 
> Ah!  That's a good point; just make everything on the site a 404.  It
> means I'll have to muck about in my httpd.conf instead of just in the doc
> root dir, but that's still pretty straightforward.

Well, no - I am sure you can do it with an entry in .htaccess in the 
server root.


-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



Re: [PHP] Passing query parameter which has value "###"

2003-09-08 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Not at all. I tried it.
> When I see the properties of that page it is showing me
> http://172.16.1.193/main.php?name=murugesh&id=#&[EMAIL PROTECTED]
> 
> but the actual value for id is ###
> 
> -Murugesan
> 
> - Original Message -
> From: "Angelo Zanetti" <[EMAIL PROTECTED]>
> To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>; "murugesan"
> <[EMAIL PROTECTED]>
> Sent: Monday, September 08, 2003 5:06 PM
> Subject: RE: [PHP] Passing query parameter which has value "###"
> 
> 
> > try this
> >
> >
> > main.php?name=" . $name . "&id=" . $id . "&id1=" . $id1 . "
> >
> >
> > HTH
> > -Original Message-
> > From: murugesan [mailto:[EMAIL PROTECTED]
> > Sent: Monday, September 08, 2003 1:05 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Passing query parameter which has value "###"
> >
> >
> > I passed value
> > main.php?name=$name&id=$id&id1=$id1  to next page
> > where $id has value "###"
> > In the next page I was not able to get the $id and $id1 values
> > and I am able to get the two values $id1 and $name when I used
> > main.php?name=$name&id1=$id1
> > What might be the problem?
> >

You might want to use something like urlencode - the # is usually used as 
the symbol for a jump to anchor point in the target page.

-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: php generate thumbnails

2003-09-15 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Sir, I read in a thread that you mailed some code to generate thumbnails
> Might I also have a copy ?
> It's been driving me crazy, all week.
> Thanks 
> Cheers
> Russell

Russell - you might try this google link if you don't get a more useful 
response:

http://www.google.com/search?q=generate+thumbnails+php&sourceid=opera&num=
25&ie=utf-8&oe=utf-8

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: Verifying E-mail Addresses

2003-09-15 Thread David Robley
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> I'm having a problem with e-mail addresses entered by users that are
> invalid (i.e. $email == "some person at somewhere.com").  Is there a
> function I could call like:
> 
>  
>   if (email_is_valid($email))
>{ mail_out_newsletter($email); }
>   else
>{ yelp_and_whine(); }
> 
> ?>
> 
> Thanks in advance,

Haven't seen this question for a few days now :-) The mailing list 
archives are a valuable resource at 

http://marc.theaimsgroup.com/?l=php-general

In particular, for your question, try (allowing for line wrap)

http://marc.theaimsgroup.com/?l=php-
general&w=2&r=1&s=email+address+validation&q=b

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



Re: [PHP] Control Structure problem

2003-09-17 Thread David Robley
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> yeah, i really like using cases they work well and especially if you want to
> do something different for different values, i forgot about that, its a good
> way to do it,
> 
> does php have case else? cuz that is a really handy thing in VB that people
> often forget...

You mean 'default'

   switch ($var)  {
 case 'TEST-1': case 'TEST-2': case 'TEST-2':
   do_something();
   break;  // to stop falling through to next option

default:  // any other case not above
  do_other_thing();
  break;  //Not really needed as is last statement but good practice 
   }

And default can appear anywhere in the statement, not just as last item.

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: template problems

2003-09-18 Thread David Robley
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> hi,
> 
> I've got this problem when using templates on my localhost. The code works
> on my web server which i rent so the code is fine. I have ran php code for
> mysql functions and other for testing purposes.
> 
> Below is the code i used in index.php.
> 
> INDEX.PHP
> 
>  
> switch ($page)
> 
> { 
> default : include "error.txt"; 
> break; 
> case "screenshots" : include "news.txt"; 
> break; 
> 
> } 
> 
> 
> 
> 
> ?> 
> 
> 
> When i type say www.myrentedwebsite.com/index.php?page=main it will display the page 
> main.txt 
> 
> When i try this on my localhost it displays the error.txt file instead. It doesn't 
> recognize the index.php?>?PAGE=MAIN i think !. 
> 
> Could anybody help me with this problem because i wanted the localhost for testing 
> purposes. 

Is it possible that localhost has register_globals set off? In which case 
you need 

switch($_GET{'page}) {

-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: MySQL timestamp to desired date function

2003-09-18 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Hi all,
> 
> I have a a timestamp in a DB (14 digits) that I want to display like I
> want in my pages. I tried to use strtotime, mktime and date functions
> with no success... it always return the current timestamp instead of the
> one I have stored. This is what I've done so far:
> 
>   for ($x = 0; $x < $num_rows; $x++)
>   {
>   $row = mysql_fetch_array($result);
>   $date1 = strtotime($row[lugar_lastinsert]);
>   $date2 = date("d \de m \de Y \a \l\a\s H:i:s",
> mktime($date1));
>   echo "";
>   echo "";
>   echo $row[lugar_name]." - ".$row[lugar_specific];
>   echo "";
>   echo "";
>   echo $date2;
>   echo "";
>   echo "";
>   }
> 
> How can I do this and make it work?
> 
> Thanks in advanced,
> 
> Cesar Aracena
> www.icaam.com.ar
> 
Have you considered using MySQL's DATE_FORMAT function?

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: program_root in phpdoc

2003-09-18 Thread David Robley
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Hi there any phpdoc heads out there know how to set the program_root to
> show the exact path to the files, there is no setting for this in the
> config files, let me know cheers.
> 
Not sure if this is what you mean - from php.ini:

; The root of the PHP pages, used only if nonempty.
doc_root =

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: PHP and SAP

2003-09-18 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> Hi,
> 
> I had a request if it is possible to access SAP data from PHP.
> 
> If it is, where can I get more info?
> 
> Thanks
> 
> Nico
> 
This google search _may_ be what you are looking for - if SAP is a 
database

http://www.google.com/search?q=sap+site:www.php.net&l=en

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: breaking a string into chunks

2003-09-19 Thread David Robley
In article <[EMAIL PROTECTED]>, davidtg-
[EMAIL PROTECTED] says...
> Hi, all --
> 
> Now it's my turn to ask a simple question, or one that sure sounds like
> it should be...
> 
> I have a 14-char date string like "20030917181909" and I need to break it
> into its component parts for a more readable "2003-09-17 18:19:09" view.
> How can I do that?  Do I really need to call substr half a dozen times?(!?)
> 
> I tried unpack() but all I ended up getting was an array with one entry
> (sometimes with a very strange-looking key).
> 
> 
> TIA & HAND
> 
> :-D

If you are getting that string from a database, and the database is mysql, 
you could let the db do the work. See DATEFORMAT() in mysql.

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: SQL statement

2003-09-23 Thread David Robley
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Hello,
> 
> Im having a bit of trouble with the DATE_FORMAT function in mysql.  
> 
> $query = ('SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') FROM 
> custlogon');
> 
> I know its failing because php doesnt like the quotation before the format 
> parameters.  Ive tried to fix this without any luck.  Any Ideas ?
> 
> DATE_FORMAT ( timestamp, ' %d%m%y ')
> 
> Thanks in advance,
> -Dan

Try
$query = "SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') FROM 
custlogon";

-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: Accepting data from URL Parameters

2003-09-24 Thread David Robley
In article , [EMAIL PROTECTED] says...
> I appologize for what may be a newbie-like request, but I have not been
> able to find this information in the PHP documentation.
> 
> If I were to have a link on an HTML page such as the following:
> 
> http://www.foo.com/myscripts/myscript.php?Value1=value&Value2=value
> 
> How can I retrieve those values in the script?  Should I construct the
> link differently?  Is there a completely different method I'm missing
> altogether?
> 
> Thanks so much in advance for any help you could provide!
> 
> Jared

Each of those values will be available as $_GET{'Value1'} $_GET{'Value2'} 
etcetera. Note that the variable names are case sensitive.

-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: Limits and php...

2003-10-09 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> Hi,
> 
> I have been trying to understand how to write a simple code that will 
> let me limit the number of  files view to 10 records, but I need to 
> under how php can look at a number of records and then caculates how 
> many pages it needs to show all records. Is there some sample code that 
> shows how to calculate and how to show limits  0,5 5,10 so on and so on

If you mean the number of records from a database, rather than files which 
you first mention, all you need to do is use COUNT(*) to determine the 
number of records found, then use some simple arithmetic and possibly 
the modulus operator to determine how many pages would be needed to 
display the records x at a time. For example, you have 57 records and you 
want to display 10 at a time. You will need at least 57/10 pages, plus one 
if 57 modulus 10 != 0.

And the modulus operator in php is %

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: limit to elements in an array?

2003-10-24 Thread David Robley
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Is there an upper limit to the number of elements that can be in an
> array? If so, what is that limit?

That rather depends on available memory. How big is each array element?


-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: mysql_field_type() ...

2003-11-07 Thread David Robley
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> ...will say if a field is of type "ENUM", but not its possible values 
> (including default). Does anyone know how I can fetch possible values 
> of a field type of ENUM?
> 
> Thanks.
> 
> ...Rene
> 
Try this little function which I use as an include file; there are 
possibly other and/or better ways to do it. Watch out for linewrap :-0



-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



Re: [PHP] [Stats] PHP Net List: October 2003

2003-11-07 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> Probably because nobody wants to risk offending John--or (more likely) 
> because no one will admit knowing who the "other" John Holmes is ;-)
> 
> Cheers,
> 
> 
> Marco
> 
> --
> 
> php|architect - The Magazine for PHP Professionals
> Try us free at http://www.phparch.com!
> 
> Complete searchable PHP mailing list archives at 
> http://www.phparch.com/mailinglists
> 
> Roger Spears wrote:
> > That is funny stuff..I often wonder why no one ever cracks jokes or 
> > makes a connection...
> > 
> > John W. Holmes wrote:
> > 
> >> John Nichel wrote:
> >>
> >>> Hey, I beat John Holmes  
> >>
> >>
> >>
> >> You mean you're bigger than 14 inc... err, nevermind, you're talking 
> >> about something else...
> >>
> > 
> > 
> 

But the other one is dead

-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



Re: [PHP] Important notice

2003-12-01 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> Chris W. Parker wrote:
> > [EMAIL PROTECTED] 
> > on Wednesday, November 26, 2003 9:30 PM said:
> > 
> >>If you feel this transaction was made
> >>by our mistake, please press "No".
> > 
> > I keep clicking "No" but nothing is happening. PLEASE HELP! Maybe it's a
> > bug with PHP??
> > 
> > Chris.
> 
> My keyboard doesn't have a 'No' key.

It should be right under the 'Any' key :-)

-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: forms and mysql

2003-12-02 Thread David Robley
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Hi i am very new to PHP so need some help !
> 
> i have a form which allows the user to put in 2 team names and then displays
> them, at the moment it displays them side by side but i need to insert V
> (versus) in the middle--how can i do that.
> I am guessing it goes in the lines of the code below somewhere, This code
> originally displayed someones input for --first name,last name and address
> so i have adapted it. Is there anyway to have the 'address' field display a
> set value as in a V , at the moment i have removed that part but the table
> field is still there, i have just hidden the form input.
> 
> 
>   $result = mysql_query("SELECT * FROM teams",$db);
> 
> while ($myrow = mysql_fetch_array($result)) {
> 
>   printf("%s %s \n", $PHP_SELF, $myrow["id"],
> $myrow["teama"],$myrow["teamb"]);

I'm sure that printf and friends must be most confusing to those who don't 
come from a C background :-)

I think something like this might work, and be a bit more comprehensible 
to a neophyte.

$result = mysql_query("SELECT * FROM teams",$db);
while ($myrow = mysql_fetch_array($result)) {
  extract($myrow); // allows you to access fields as $id, $teama etc
//  printf("%s %s \n", $PHP_SELF, $myrow["id"],
// $myrow["teama"],$myrow["teamb"]);
echo '' . "\n";
echo "$teama V $teamb\n";
}

-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: preserving blank space padding when using fgetcsv

2003-12-04 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> Hello,
> 
> I've been researching this for most of the day and am unable to find an 
> answer.
> 
> I'm using fgetcsv to read a comma delimited file (Microsoft Excel CSV).  
> I'm trying to create a PHP application which will read a csv file line 
> by line, remove the commas and preserve the padding that is in each 
> column.  That means if a column is a fixed length of 15 characters and 
> the actual text in that column is only 5 characters long, the 
> application will preserve the extra 10 blank spaces.
> 
> I'm able to open and read the csv using fgetcsv:
> $handle = fopen ($filename, "r");
> while ($mpt_line = fgetcsv ($handle, filesize ($filename), ","))
> {
> Then I check each member of that array to make sure it is the proper 
> length for that column:
> if (strlen($mpt_line[0])<4)
>  {
>  str_pad($mpt_line[0], 4, " ", STR_PAD_RIGHT);
>  }
> When all of the length checks are finished I remove the commas and then 
> print out the finished product:
> }
> $no_commas = str_replace(",", "", $mpt_line);
> print "aa/".$no_commas[0]."/aa";
> 
> For output all I get is the actual text and no blank space padding.  
> Meaning that if the field contains two characters of data it should 
> still appear 4 characters in length.  I was hoping to achieve aa/hi  /aa 
> instead all I get is aa/hi/aa. 

If you want to see multiple white space in the browser, you'll need to 
surround the text with  tags. Browsers tend to ignore white space 
(multiple spaces, tabs, EOL etc).

If you do a view source of your current output  you will see the spaces.

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: problem with INSERT query

2003-12-09 Thread David Robley
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> 
> 
> Hi all, 
>  I am trying to do a simple INSERT data into the database using the following 
> php script but the problem here is that whenever I click "submit", the script 
> only insert a "NULL" value into the columns into the datadase instead the 
> value I enter in the forms fieldSELECT query was successful but not 
> INSERT..
> 
> A snip of the code are as follow:
> 
>  //declare error variable
> $err = "";
> 
> //set error variable
> $err .= check_tutor_name();
> $err .= check_tutor_contact();
> $err .= check_tutor_email();
> $err .= check_tutor_profile();
> 
> //define connection string
> $dsn = "mysql://root:[EMAIL PROTECTED]/table1";
> 
> //connect to DB
> $db = DB::connect ($dsn);
> //check for any DB connection errors
>if (DB::isError ($db))
>die ($db->getMessage());
> 
> $tutor_name = $db->quote($POST["tutor_name"]);
> $tutor_contact = $db->quote($POST["tutor_contact"]);
> $tutor_email = $db->quote($POST["tutor_email"]);
> $tutor_profile = $db->quote($POST["tutor_profile"]);

I think your problem might be in the above lines; the superglobal variable 
is $_POST{'whatever'} - note the underscore in the name.
> 
> 
> So, what could be the problem with the code I have wriiten???
> Any help are appreciated.
> 
> 
> Irin.
> 

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: Reading email from sendmail

2003-12-09 Thread David Robley
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Good afternoon, all!!
> 
>   Is there a function or series of functions in PHP that will allow a PHP
> package to read email from a sendmail account, look for a specific
> information in the subject line, then be able to resend that email to a
> group of users?? I know mail can be used to send email but reading from
> sendmail???...
> 
> Any information is greatly appreciated and profoundly useful.
> 
> Robin 'Sparky' Kopetzky
> Black Mesa Computers/Internet Service
> Grants, NM 87020

If the 'sendmail account' can be a dedicated address, you can use 
sendmail's alias to direct any emails to a php script which does what you 
need.

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: treu type fonts

2003-12-11 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> G'day all
> I was wandering I have php installed with GD with freetype fonts compiled in
> I ran this php script
>header("Content-type: image/gif");
>   $im = imagecreate(400,30);
>   $white = imagecolorallocate($im, 255,255,255);
>   $black = imagecolorallocate($im, 0,0,0);
>   // Replace path by your own font path
>   imagettftext($im, 20, 0, 10, 20, $black, "./arial", "Testing... Omega:
> Ω");
>   imagegif($im);
>   imagedestroy($im);
> ?>
> 
> and nothing gets displayed on the screen.
> Also if i right click in the top right hand corner and click properties the
> type is gif image.
> Can any one tell me what I should double check and what to look for.
> As I am getting no errors messages, I guess that means that free type fonts
> support is installed correctly? or please correct me if im wrong.
> 
> Thanks
> CJ

That looks remarkably like an example from the docs; as a first debugging 
process try removing the header() and see what error messages you may get.

My guess is that your fontfile string is wrong - I would expect, unless 
you have renamed the file, that it would be ./arial.ttf. You might also 
find that you need a full path to the font file.

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: need help getting one variable

2003-12-23 Thread David Robley
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> hello all i need help to enter one variable in a cookie and then retreive it back 
> later, i know this probably sounds dumb to most but this is really the first time 
> ive tried working with cookies so please bear with me, thanks for any help.
> 

http://www.php.net/setcookie is a good starting point.

-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: Error/ Warning messages in log files (OS 121) and (OS 64)

2004-01-07 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> (Relisted as no response from over Xmas period)
> 
> Hi,
> 
> I am having a real problem with error messages posted in the error.log file
> 
> in the Apache directory. I have been doing lots of searches to find a
> 
> solution and it seems obvious that many people are see this issue but I can
> 
> find no resolution or explanation for the entries (see below).
> 
> PHP Bug #25570 seemed to be a solution but the version of php I am using is
> 
> 4.3.2 which is claimed to not exhibit the bug described in 25570.
> 
> The system is running on a Win2K box, and we are using php, sql and Apache.
> 
> 
> Anyone out there have an idea of how to fix this issue?
> 
> Thanks
> 
> Trevor
> 
> 
> 
> 
> 
> Some system info:
> 
> System Windows NT UKRBCSR01 5.0 build 2195
> 
> Build Date May 28 2003 15:06:05
> 
> Server API Apache 2.0 Handler
> 
> Apache/2.0.47 (Win32) PHP/4.3.2
> 
> This is the more worring of the issues:
> 
> 21:18:49 2003 [notice] Parent: child process exited with status
> 
> 4294967295 -- Restarting.
> 
> 
> 
> But I am assuming that some or all of these are related.
> 
> 21:19:44 2003 [warn] (OS 121)The semaphore timeout period has expired. :
> 
> winnt_accept: Asynchronous AcceptEx failed.
> 
> 00:50:58 2003 [warn] (OS 64)The specified network name is no longer
> 
> available. : winnt_accept: Asynchronous AcceptEx failed.

One or more of the results from 

http://www.google.com/search?q=Asynchronous+AcceptEx+failed

may provide some insight into the problem?

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: Help parsing text file?

2004-01-08 Thread David Robley
In article 
<[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> I'm very new to PHP.
> I want to display /var/log/lastlog with php on a webpage, but I need
> some help. How do I do that?
> Looking at the docs it looks like file() would work, but I couldn't get
> it to display the file.
> Carlton.
>  
>  
> 
lastlog isn't actually a text file. You'ld need to use the lastlog program 
to parse it for you and then output the result.

Having said that, I wonder if you are really looking for the output of 
last (driven from wtmp) which will give you a complete login history, 
rather than the info available from lastlog?

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: Function Problem (Long-ish)

2004-01-13 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Hi List,
> 
> I have a self-made function that uses a MySql statement something like this:
> 
> Function MyFunc(){
>  sql = mysql_query("select * from table where somefield=\"somevar\""){
>   while(blah blah){
>   $var ="blah blah";
>}
>   }
>  return $blah;
> }
> 
> This works ok but if I add a bit to the sql then I get a Warning:
> mysql_fetch_array(): supplied argument is not a valid MySQL result resource
> in error, so if I add:
> 
> Function MyFunc(){
>  sql = mysql_query("select *, count(id) as cnt from table where
> somefield=\"somevar\""){
>   while(blah blah){
>   $var ="blah blah";
>}
>   }
>  return $blah;
> }
> 
> I get the error.
> 
> But this works:
> 
> Function MyFunc(){
>  sql = mysql_query("select count(id) as cnt, sum(numfield) as total from
> table where somefield=\"somevar\""){
>   while(blah blah){
>   $var ="blah blah";
>}
>   }
>  return $blah;
> }
> 
> My Question is Why ?
> 
> Any help is a appreciated and I thank you fully in advance.

Bit hard without seeing your actual code; however if you were to use 
mysql_error() after your call to the database it would probably return you 
a useful error message.

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: class limitations brought by PEAR

2004-01-14 Thread David Robley
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> I don't want to rely on PEAR, mainly because I don't know it too well to 
> use it fully. But most PHP installs come with base PEAR classes, so does 
> that take away my ability to name classes that PEAR already made? (ie. 
> class DB).
> 
> Glenn
> 
If the base PEAR install is not in your include_path, then it shouldn't be 
a problem.

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: Adding Text to .txt file

2004-01-20 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> And this function was differs from fopen("myFile.txt", "a");
> 
That would possibly be fwrite() after you do an fopen as above

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: Sorry the attachement was not received!! I put the codes here.

2004-01-20 Thread David Robley
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Just before a minute I sent a message with an attachement.. but the attachement was 
> canceled by the list!!
> 
> Any way.. these are the codes of the pages :
> 
> 
> Login.php :
> 
>  
> $link = mysql_connect("localhost", "Database username", "Database password")
> or die("Could
> not connect: " . mysql_error());
> mysql_select_db("Database name", $link);
> 
> $UserName = $_GET['UserName'];
> $Password = $_GET['Password'];
> $Serial = $_GET['Serial'];
> 
> $UserName = mysql_escape_string($UserName);
> $Password = mysql_escape_string($Password);
> $Serial = mysql_escape_string($Serial);
> 
> $user = escape_function($user);
> $query1 = "select Serial from accounts where UserName='$UserName' and 
> Password='$Password'";
> $query2 = "SELECT Random FROM accounts";
> $Random = 'Random'

Any chance that a missing ; here might be part of your problem?

-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



Re: [PHP] How to get information from

2001-02-21 Thread David Robley

On Thu, 22 Feb 2001 04:20, Zenith wrote:
> Hello everbody, if a have HTML document lik this:
> 
> 
> 
> 
>
> How can know whether the user is pressed on the "action1" or "action2"
> image button??

http://au.php.net:81/FAQ.php#7.13 covers the topic nicely.

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Why Arrays in Forms? ( Was "Accessing variables from a form" )

2001-02-21 Thread David Robley

On Thu, 22 Feb 2001 08:24, Brian White wrote:
> That's the point - why do I have to have 'name="myArray[]"'. Why
> do I have to specify the '[]'s at all?
>
> Brian
>
> At 13:44 21/02/2001 -0800, jason cox wrote:
> >You don't have to specify them as "PHP arrays".  You
> >can do something like:
> >
> >
> >
> >
> >
> >
> >PHP will create the array for you.
> >
> >Jason
>
> -
> Brian White
> Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy
> Phone: +612-93197901
> Web:   http://www.steptwo.com.au/
> Email: [EMAIL PROTECTED]

Because otherwise you have one variable name, and it will contain the 
last value which was assigned to it.

I don't know any languages where you can do:

$value = 'A'
$value = 'B'
$value = 'C'

print $value 

and get a result other than C 


-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] array headaches

2001-02-21 Thread David Robley

On Thu, 22 Feb 2001 02:11, Matt Williams wrote:
> I have done it this way...
>
>   $menu = array();
>   $count = $db->num_rows();
>   for($i = 0; $db->next_record(); $i++)
>   {
>   $menu[$i]["name"] = $db->f("name");
>   $menu[$i]["url"] = $db->f("topic_id");
>   }
>
> OK, so is there a better way of acheiving the same end result?
> and this is what I've got to print the results
>
>   while ( list($name, $subarray) = each($menu) )
>
>
>   echo " href=\"".$subarray["url"]."\">".$subarray["name"]."\n";
>
>   }
>
> is there any better way of doing this??
>
> thanks
>
> M@

Why do you need to put the values in an array, then read through the 
array to print the values? Why not just print each record as you get it 
from the DB?

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Adding new data at beginning.

2001-02-22 Thread David Robley

On Fri, 23 Feb 2001 08:34, Jan Grafström wrote:
> Hi!
> I am trying to put in a new data at the beginning of a file.
> I have started like this;
>
> 
>
> $yourfile = "test.xml";  ( this is the file.)
> $fp = fopen ($yourfile, r);
> $message  = array(1 => '', '', '', '', '', '',
> '');
> Here I need some code to get the output look like
> this""
>
> print_r($message);
> fwrite ($fp, $message);
> fclose ($fp);
>
> I am thankful for any help.
>
> Regards
> Jan

You need to do something like:
open file for read
while(condition not met)
  read file line by line into array
endwhile
add your element(s) to the array
read the rest of the file into the array
close file
open file for write [which will truncate the file]
write the array to file
close file

You could perhaps enhance this by writing to say a temp file and once you 
are satisfied the write is complete, rename the temp file to the original.

The 'while condition not met' is the test you use to determine when you 
get to the part of the file where you want to add your bits.

Cheers
-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Obtaining a value from dynamic list box

2001-02-22 Thread David Robley

On Fri, 23 Feb 2001 05:21, Claudia wrote:
> When selecting a value from a dynamically generated list box, the
> subsequent value passed to the table truncates when
> there is a blank in the string
>
> Here is the table structures (Mysql database)
>
> First table has variable course_name (varchar -- length 50)
> This database will be used to generate the dynamic list box for the
> course_name field.
> Second table has variable issue_course_name (varchar -- length50) and
> is the variable that stores the result of the selected
> course name in the dynamic list box.
>
> Here is the code that is currently truncating all characters after the
> space:
>
> td height="41" bgcolor="#FF">  ';
>
>  $result = mysql_query("select course_name from coursebuild
>   where course_status = \"in_test\"
>   order by course_name asc");
>
>  echo "";
>  echo " Select Course \n";
>
>  if ($myrow = mysql_fetch_array($result))
>   {
>  do
>  {
>  echo " value=$myrow[course_name]>$myrow[course_name]\n";
>  }
>  while ($myrow = mysql_fetch_array($result));
>  echo "";
>
> Insert statement
>
> $query = "insert into testissues ( issue_course_name)
> values ( '$issue_course_name') ";
>   $mysql_result = mysql_query($query, $mysql_link);

IIRC the relevant standards require that values in tags be enclosed in 
quotes if they [are likely to] contain spaces. So at minimum your OPTION 
tags should look like:
echo "$myrow[course_name]\n";

Having said that, you could handle this better if you have an 
autoincrement field like course_id that uniquely defines each course_name 
record - then you could use the course_id as the VALUE in the option tag; 
you may have to do a lookup at the INSERT stage to get the value of 
course_name.


-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

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

2001-02-22 Thread David Robley

On Fri, 23 Feb 2001 14:46, Peter Houchin wrote:

> > if i have a form with a select box in it how an i get the values to
> echo a php value ...
 
> ie
> 
>  
> ACT 
> VIC 
>  
> 
> can i change it to say
>  
> ACT 
> VIC 
>  
> 
> so that when the page loads it shows which ever option is in the Data
> base?
 
> Peter Houchin
> Sun Rentals
> [EMAIL PROTECTED]
> 

I think you are asking how to show the selected value?

Something like

ACT

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] mail prob

2001-02-22 Thread David Robley

On Fri, 23 Feb 2001 16:32, W.D. wrote:
> so there is no way to pull this variable from an email form field?
>
> > From: "W.D." <[EMAIL PROTECTED]>
> >
> > > I'm using a remote host, and when I call mail() with all the var's
>
> pulling
>
> > > values from form fields, it still shows as nobody in from header.
> > > Is
>
> this
>
> > a
> >
> > > server situation? Theyre using php4 support and they claim its that
> > > I'm
> >
> > not
> >
> > > using appropriate variables in the function.
> >
> > You have to set the From header manually:
> >
> >
> >  > $to = "[EMAIL PROTECTED]";
> > $from = "[EMAIL PROTECTED]";
> > $subject = "Blah";
> > $body = "Lorem ipsum dolor sit amet.";
> >
> > mail($to, $subject, $body, "From: $from");
> > ?>
> >
> >
> > http://www.php.net/manual/en/function.mail.php
> >
> >
> > Regards
> >
> > Simon Garner

Well, you can use a variable from _anywhere_ Simon's example uses a 
variable set locally just so you can see exactly what is going on.

But if you had a form element called, say, reply_address in which the 
user types an email address, you could pass that as the fourth argument 
to mail().

Of course, in this case you have no control over the accuracy or validity 
of the address entered. But that's a whole different question - search 
the archives for info on validating email addresses. And somebody has 
published a class somewhere?

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] mail prob

2001-02-22 Thread David Robley

On Fri, 23 Feb 2001 16:52, W.D. wrote:
> 
> First Name: 
> Last Name: 
> E-mail Address: 
> Ask a
> Question
>  
> 
> 
>
>
>  $from = $FirstName ." ". $LastName;
> $subject = $Email;
> $message = $Info;
> mail("[EMAIL PROTECTED], [EMAIL PROTECTED], $subject, $message,
> $from); ?>
>

You seem to have gotten a little confuzzed here! $from should contain the 
email address which you are collecting as $Email and presumably $Info is 
the message body and I'm not quite sure what you want in the subject, but 
all you have available is first and last names!

And then, you need a check to see what action should be taken when you 
call this script - at the moment every time you open the script you send, 
or try to send, an empty mail. Perhaps assigning a name and value to your 
submit button and testing for that?

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Can't connect php to mysql on linux

2001-02-25 Thread David Robley

On Sat, 24 Feb 2001 16:10, George  Alexander wrote:
> Hi,
>
> I working on Redhat Linux 6.1 and I've installed
> MySQL-3.23.33-1.i386.rpm and MySQL-client-3.23.33-1.i386.rpm. MySql is
> working fine. I've even created a database also using MySqlAdmin.
> Regarding Php I've installed php-3.0.18-1.6.x.i386.rpm and as for
> Apache : apache-1.3.14-2.6.2.i386.rpm. I've even installed
> php-mysql-3.0.16-1.i386.rpm and mod-php3-3.0.12-2.i386.rpm.
>
> My problem is I can't connect PHP to Mysql Db using the
> mysyql_connect("localhost","root","mypassword") command.
>
> Please help me asap.
> Regards,
> George

Use mysql_error() after your unsuccessful call to mysql_connect to return 
a mysql error string

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] php.ini

2001-02-25 Thread David Robley

On Sun, 25 Feb 2001 18:21, Brandon Feldhahn wrote:
> what do i put in the "Sendmail_from" section of php.ini?

Did you check the documentation, or the sample ini file? According to the 
docs,

sendmail_from string

Which "From:" mail address should be used in mail sent from PHP under 
Windows.

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] switch statement

2001-02-25 Thread David Robley

On Mon, 26 Feb 2001 12:33, Peter Houchin wrote:

> > Does any one know where there are some tutorials for the switch
> statement?
 
> Peter Houchin
> Sun Rentals
> [EMAIL PROTECTED]
>
 
Have a quick look at 
http://www.php.net/manual/en/control-structures.switch.php
which has some user notes which are possibly useful over and above the 
actual documentation.

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] switch statement

2001-02-25 Thread David Robley

On Mon, 26 Feb 2001 13:20, Peter Houchin wrote:
> I'm playing aruond with the switch statement trying to get one to work
> for $submit
> I have 2 forms on the one page (only one displays at a time) 1 is for
> creating a new record in my data base the other is for
> updating/changing values from the first form should there be any. So i
> want it to switch between the 2 cases

OK. Suppose the possible values for $submit are 'insert' and 'update'. [I 
assume those are values _you_ can assign to a submit button]

Then

switch($submit) {

case 'insert':
  // Your insert stuff here
  break; //So it doesn't fall through to the next case

case 'update:
  // Your update stuff here
  break;

case default:
  // The page has somehow been called without a value (or an
  // inappropriate value) for submit
  // Error handling or whatever here

}

Does that make it clearer? or muddier :-)

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] include file

2001-02-25 Thread David Robley

On Mon, 26 Feb 2001 13:29, JW wrote:
> I have created a config.php3 to store the connection of the database
> and some constant variable. Then, I created the other file
> functions.php3 and inculde config.php3 into this file for
> function.phps3 should use some variables inside the file config.php3.
> However, I don't know why all the variable cannot display in the
> function.php3.
>
> would anyone please to tell me what is the reason and how I can solve
> it?

You may need to declare the variables global within the function, or pass 
them as arguments to the function.

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] PHP4 directives in httpd.conf not working

2001-02-25 Thread David Robley

On Mon, 26 Feb 2001 15:30, Brian White wrote:
> I have php4 running under Apache. Under that apache I have several
> s. I want to set to some of the PHP.INI values under
> one of those hosts. So far I have tried the following values in
> my httpd.conf file:
>
> 1) include_path   "/my/phpinc/path"
> 2) php_include_path   "/my/phpinc/path"
> 3) php3_include_path  "/my/phpinc/path"
> 4) php4_include_path  "/my/phpinc/path"
>
> None of them have worked - I can't even restart Apache with them in
> place. "/my/phpinc/path" definitely exists.
>
> What am I doing wrong?
>
> Regs
>
> Brian White

PHP4 uses different Apache configuration directives (see 
http://au.php.net:81/manual/en/configuration.php ) I think the one you 
want is probably php_value so

php_value include_path "/my/phpinc/path"

might work.

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] installation problem

2001-02-26 Thread David Robley

On Mon, 26 Feb 2001 20:52, [EMAIL PROTECTED] wrote:
> I'm a beginner but...I can't install php-4.o.4pl1 on my linux
> mandrake..why?
> When I run configure ,the program checks all the files...
> there are some missing..but it never return an error
> it return a warning 'you will need bison if you want to regenerate the
> php parsers'
> and after other check..it stops with this error'cannot find output for
> lex;giving up'
>
> what can i do?
> thanks
> Daniele

You are missing some of the files you need to compile - you may need to 
seek assistance from someone familiar with Mandrake to determine how to 
add the necessary stuff. I can tell you how with slackware

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] archive location

2001-02-26 Thread David Robley

On Tue, 27 Feb 2001 05:33, Jerry Lake wrote:
> What is the newsgroup archive location ?
> marc.themaesgroup.something ?
>
> Jerry Lake- [EMAIL PROTECTED]
> Web Designer
> Europa Communications - http://www.europa.com
> Pacifier Online   - http://www.pacifier.com

nearly - marc.theaimsgroup.com or check /support.php at your local PHP 
mirror for direct links to all the mail list archives.

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Walking Through Mail Headers

2001-02-26 Thread David Robley

On Tue, 27 Feb 2001 06:28, Jason wrote:
> Hi,
>
> I need a way to walk through mail headers and search for a specific
> string in the subject. If the message contains the string, it will be
> forwarded to a different account, otherwise it will trigger an
> autoresponse with a certain message to the sender. Does anyone have any
> infomation on doing this, or can point me where to start. I think the
> thing I'm caught up on is how I walk through the mail headers in the
> mail file (We are on FreeBSD). Thanks.
>
> Jason

Procmail should be able to do this for you?

But how are you actually dealing with the incoming mails? Are they being 
sent to the php script as they arrive from an alias or procmail, or are 
you attempting to parse the contents of the mail spool file for a 
particular user?

If it's the former, all you need to do is parse each line until you find 
the one beginning with Subject and do the necessary.

If the latter, you'll need to check the relevant RFCs to determine how 
messages are separated in the spool, and how the body of the message is 
separated from the headers - I'm fairly sure that's two newlines. RFC1822 
from memory?

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] PERL to PHP

2001-02-26 Thread David Robley

On Tue, 27 Feb 2001 01:28, Clayton Dukes wrote:

> > Hi :-)
> Can someone tell me how to do the equivalant of this Perl script in
> PHP?
>
> ###
> ### This function prints all lines between the dashes read in a text
> file ###
> ### The file looks like this:
>
> # -
> # Somedata:   something
> # Someother:  something else
> # --
> #
> # Several paragraphs
> # Several paragraphs
> # Several paragraphs
> # --END--
> #
>
>
>
> #!/usr/bin/perl -w
> @rray = ;
>
>
> $inside = 0;
> foreach $line (@rray) {
>   if ($line =~ /-/ig) {
> $inside = 1;
>   } elsif ($line =~ /-/gi) {
> $inside = 0;
>   }
>
>   if ($inside == 1) {
>   print $line;
> }
> }
>
>
> TIA!

Seems like your solution boils down to this:

Set toggle = 0
open file for read
while not EOF
Read file line by line
  if(line has dashes)
toggle = not(toggle)  // flip the toggle
  endif

  if (toggle)
print line
  endif
endwhile
close file

The code is left as an exercise for the student :-)

Cheers
-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Weird Problem

2001-02-26 Thread David Robley

On Tue, 27 Feb 2001 05:53, Steve Segarra wrote:
> Hi everyone,
>   First, let me explain I am a very knowledgable php developer.  I'm not
> someone trying to write their first script.  I have been working on a
> very large and complex problem for some time now when it suddenly
> stopped working.  I did not change anything in any configurations or
> edit any code that would have affected how my database functionality
> class would function.  But, all of my connections started to bomb out.
>
> Follows are the entire contents of a file simp.php (minus the line
> numbers):
>
> 1   2
> 3  $db = mysql_connect("localhost", "web", "pw") || print "error
> connecting   ".mysql_error()." ".mysql_errno();
> 4  mysql_select_db("surveys");
> 5
> 6  $result = mysql_query("select * from attract") || print "error
> querying   ".mysql_error()." ".mysql_errno();
> 7
> 8  $i = 0;
> 9  while ($row = mysql_fetch_array(mysql_query("select * from
> attract"))){ // && ($i++ < 5)){
> 10   echo $row[0]." ".$row[1]."";
> 11 }
> 12 ?>
>
>
> Please note that the user web@localhost identified by pw has
> permissions to select from the table attract.
>
> Here is what I have identified so far:
>
> A - If I use $result in mysql_fetch_array() line 9, I get the error:
> Warning: Supplied argument is not a valid MySQL result resource
> in simp.php3 on line 9
>
> But if I use the statement mysql_query("select * from attract")
> in its
> place, the loop (although infinite) will produce expected results, ie
> print out the first and second columns of the first row of the table
> infinitely.  So basically, I would conclude the life of the variable
> result is terminiating before I can use it.  Why, I don't have a clue.
>
> B - Being tired of an infinite loop in my investigation, I added line 8
> and I placed the statement && ($i++ < 5) inside the while loop
> condition.  Now, only the  and spaces from line 10 will print, not
> the actual values of the $row array.  The output is
> , with no values from the table attract.
>
> This is where I stand now, completely flabberghasted and nearly insane.
> Can anyone shed any light on this before I have to commit to bringing
> down the webserver while I reinstall php4.  (oh, btw I am running
> Apache/1.3.14 (Unix) PHP/4.0.4pl1 on Red Hat 6.2 (I hate redhat, but
> the bossman says its better supported than slakware.  bah.))
>
> Thank you all for your help.
> steve

Is it possible that the || construct doesn't work in the way you are 
using it and thus you aren't seeing mysql_error? The most common examples 
I have seen use the actual string 'or'. Try with a query that you _know_ 
will trip an error.

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] redirect pages

2001-02-26 Thread David Robley

On Tue, 27 Feb 2001 14:58, Peter Houchin wrote:

> > can some one offer a suggestion please ... i have a  
> 
> if ($update) {
> $result=foo;
> }
> 
> in that if statement i want to redirect them to another page after it
> has processed the result ..
 
> i tried having using
> 
> if ($update) {
> $result=foo;
> echo "";
> }
> 
> but to no avail ..
> 
> any suggestions ?
> 
> Peter Houchin

if ($update) { 
 $result=foo; 
 header("page.php"); 
 } 

and make _absolutely_ sure that your script doesn't even have a white 
space _anywhere_ before issuing the header.

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] redirect pages

2001-02-26 Thread David Robley

On Tue, 27 Feb 2001 15:15, David Robley wrote:
> On Tue, 27 Feb 2001 14:58, Peter Houchin wrote:
> > > can some one offer a suggestion please ... i have a
> >
> > if ($update) {
> > $result=foo;
> > }
> >
> > in that if statement i want to redirect them to another page after it
> > has processed the result ..
> > i tried having using
> >
> > if ($update) {
> > $result=foo;
> > echo "";
> > }
> >
> > but to no avail ..
> >
> > any suggestions ?
> >
> > Peter Houchin
>
> if ($update) {
>  $result=foo;
>  header("page.php");

I mean, of course
  header("Location: page.php");

Must teach fingers to wait for brain to engage :-)

>  }
>
> and make _absolutely_ sure that your script doesn't even have a white
> space _anywhere_ before issuing the header.

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Change the Input to st different..

2001-03-04 Thread David Robley

On Mon,  5 Mar 2001 08:59, Erdinc Guler wrote:
> hi..
> my problem is to change some characters from input data coming from a
> form to something..i mean like :
> inputoutput
> ---
> i-->  y
> fire -->  fyre
>
> Is it possible??
>
> erdinc..

Have a look in the String Functions section of the manual. In particular, 
substr_replace, str_replace or strtr. Also the Regular Expressions 
section if you want more complex replacement capabilities.

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] mail problem

2001-03-04 Thread David Robley

On Mon,  5 Mar 2001 14:17, Peter Houchin wrote:

> > Hiya,
> am near completeion of a site only i can't get any mail to send to
> multiple recipients at all .. either in the  "To:" section or having on
> email in "To" and one email address in "CC" section.. and i need to be
> able to do this ... can any one offer any suggestions ...( I'd prefer
> to have one in the "To" section and one in the "CC" section 
 I'm am
> using sendmail on solaris 2.6 to send the actual emails 
> <-- Start of snip--->
> $address .= $email  ;
> $subject = "VFSA-eRentals Calculation Results";
> $body="blah blah\n";
> $headers .= "CC: [EMAIL PROTECTED] "; 
> mail("$address", "$subject", "$body", "$headers \nContent-Type:
> text/plain; charset=iso-8859-1\nContent-Transfer-Encoding: 64bit"  );
> <--- end of snip--->
> 
> 
> any help would be greatful :)
> Peter Houchin
> Sun Rentals
> [EMAIL PROTECTED]
> 
Two things that may or may not be part of your problem; 

first, if there is already something in $headers then appending the cc to 
it may give you an invalid string; and

second, you might try Cc: instead of CC:

Cheers
-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] dealing with no record

2001-03-04 Thread David Robley

On Tue,  6 Mar 2001 06:36, [EMAIL PROTECTED] wrote:

> > People
> If I run a sniplet like this:
>
> **
> $query="select name from foo";
> $result= mysql_query($query);
> while($row = mysql_fetch_row($result))
>  stuff...to display record found
> ...
> ***
> what am I suppose to do if I also want the code to be able to deal with
> the case that no record found  and redirect user to other page? Jack

$query="select name from foo";
$result= mysql_query($query);
if(mysql_num_rows($result) ==0)) {
  redirect
 }
else...


-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] comparing values

2001-03-05 Thread David Robley

On Mon,  5 Mar 2001 18:27, Paul wrote:
> below is the code I am using, $sourcefile is a url var
> for example http://url/?sourcefile=/this/path/to/whatever.php
>
> $filelist = array("",
> "db_auth.conf",
> "config.php",
> "master.functions.inc"
> );/* these are the files I want to protect from
> this script */
>
> function check_hackers($sourcefile, $filelist) {
> $checkfile = explode("/", $sourcefile);/* seperate the
> sourcefile var */
> $disallowed = $checkfile[count($checkfile) -1];/* use only
> the last  part (filename.ext) */
> $filecount = count($filelist);/* count how many files in
> array */
> while ($tempcount < $filecount) {
> $tempfile = $filelist[$tempcount];
> if ($tempfile == $disallowed) {
> $sourcefile = "source.inc";/* this is not
> returned to the global space  why not ??? */
> echo $disallowed;/* this will echo
> the correct thing (config.php) */
> echo $tempfile;/* this will
> echo the correct thing (config.php) */
> return $sourcefile;/* this doesn't work
> either  what the ??? */
> }
> $tempcount++;
> }
> }
>
> check_hackers($sourcefile, $filelist);
>
> Can somebody tell me why this is not return $sourcefile = "source.inc"
>  what am I doing wrong.
> Can you please reply to [EMAIL PROTECTED]  PLEASE PLEASE PLEASE

Um, you aren't assigning the result of the function to anything?

$what_you_want_to_see = check_hackers($sourcefile, $filelist);
echo $what_you_want_to_see;

Cheers
-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] config question

2001-03-05 Thread David Robley

On Tue,  6 Mar 2001 11:30, [EMAIL PROTECTED] wrote:
> My server admin is being stupid... magic_quotes_gpc have been turned
> off unexpectadly so phpMyAdmin aint working, as well as half my
> scripts. He says nothing has been changed so it must be my fault, is
> there a command in php to displays the PHP config options so i can show
> this mofo that they are off
>
> - Peter

phpinfo() 

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] removing characters

2001-03-05 Thread David Robley

On Tue,  6 Mar 2001 15:50, [EMAIL PROTECTED] wrote:
> A problem of inexperience...
>
> I am trying to store an array in mysql. I obtain the array like so--
>
> $partcount = count($Area);
>  reset($Area);
>  for ($i = 0; $i < $partcount; $i++){
>$key = key($Area);
>$val = $Area[$key];
> $string1 .= $val . "\') or (Area=\'";
>next($Area);
>  }
>
> This results, with a bit of coaxing, in an array like this one --
>
> +-+
>
> | Area|
>
> +-+
>
> | (Area='1') or (Area='2') or (Area='3') or (Area='') |
>
> +-+
>
> Everything is falling into place, *except*  these last thirteen
> characters --
>
>  or (Area='')
>
> And that's what I'd like to eradicate.
>
> Tips, suggestions, especially outright code greatly appreciate.
>
> Thanks,
> Robert
> p.s.-- I have ordered the Friedl book on Regular Expressions. Hoping it
> will enlighten me for the future

My suggestion would be to not create the empty reference in the firast 
place :-)

Before starting your loop (but after checking there is something to work 
with) use the first element of the arra to create the (Area='1') then you 
can loop through the rest of the array, starting with $i = 1 and create  

  or (Area='$val')

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] MIME and headers

2001-03-06 Thread David Robley

On Wed,  7 Mar 2001 10:46, Peter Houchin wrote:

> > Can some one please tell me what the relationship between mime and
> email headers is I have not been able to find a straight answer off
> the net ..so if any one knows of a good site can you please give me the
> url so i can look at it .. thanks
 Peter Houchin
> Sun Rentals
> [EMAIL PROTECTED]
> 

You might want to dig into the RFCs to get the real lowdown here. RFC822 
is the original for email (Updated by RFC1123, RFC1138, RFC1148, RFC1327, 
RFC2156), and 1344 and 1522 might be starting points for MIME.

This URL is an index of all the RFCs (big document ~400Kb) 
http://mirror.aarnet.edu.au/pub/rfc/rfc-index.txt

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] MySQL help URGENT

2001-03-06 Thread David Robley

On Thu,  8 Mar 2001 02:38, Deependra B. Tandukar wrote:
> Greetings!
>
> I am trying to compile MySQL. what I did are:
> tar -xvzf mysql-3.23.33.tar.gz
> cd mysql-3.23.33
> ./configure --prefix=/usr/local/mysql
> then it startx to work and inerrupt and says
> testing gcc working: no
> configure: error: installation or configure problem: c compiler can not
> create executables
>
> what should I do?

The mysql list would be a good place for mysql problems, no? But you a) 
may not have access to the c compiler or b) may not have permission to 
create files in the particular directory or

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Installation on RH6.2: help!

2001-03-06 Thread David Robley

On Wed,  7 Mar 2001 17:54, Les Neste wrote:
> Hi all,
>
> I'm in the process of my first installation of PHP and running into a
> problem.  Any experts, feel free to chime in with your knowledge.
>
> After I unzip it, I run the configure script.  Here's the command line
> I use and the error I get:
>
> ./configure --with-mysql=/var/lib/mysql --with-apxs
> ... lots of output ...
> Checking for MySQL support: yes
> configure: error: Cannot find header files under /var/lib/mysql
>
> I've tried lots of different directories, none of which seem to work.
> Which header files is it looking for?
>
> BTW, I'm attempting to install php 4.0.4 pl1, as an apache module
> (rather than statically linked with apache).  I've already installed
> MySQL 3.22 and it appears to have been successfully installed.
>
> Any help much appreciated.
>
> ...
>. Les Neste  678-778-0382  http://www.lesneste.com

IANARH expert but: it'll be looking for /var/lib/mysql/include/*.h and I 
belive that if you have installed mysql from an rpm that you don't get 
that stuff by default - there is another RPM with mysql source and 
library stuff in it.

If you don't need any other mysql related stuff you could try using the 
php builtin mysql support by using just --with-mysql and not specifying a 
path.

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] populate select box with contents of a file?

2001-03-07 Thread David Robley

On Thu,  8 Mar 2001 11:10, Jerry Lake wrote:
> I would like to be able to populate
> the options of a select box with the
> contents of my images directory online
> so I can select the image I want to
> go with the form I am filling out.
> what functions do I need to look into
> to figure this one out?

The directory functions - there are some simple samples in readdir() - 
and is_file and is_dir may be useful

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] mysql_fetch_array()

2001-03-07 Thread David Robley

On Thu,  8 Mar 2001 14:03, Deependra B. Tandukar wrote:
> Greetings!
>
> I am using PHP and MySQL in RedHat 6.0.
> I have used mysql_fetch_array() to display the datas in web page but
> all the columns are printed twice. What can be the wrong with my code:
>  $connection=mysql_connection(...);
> $db=mysql_select_db(.);
> $sql="select * from my db";
> $sql_result=$mysql_query($sql,$connection);
> print "";
> while ($row=mysql_fetch_array($sql_result))
> {
> print "";
> foreach ($row as $field)
> print "$field";
> print "";
> print "Get it";
> print "";
> print "";
> }
> print "";
> ?>
>
> But it works fine with mysql_fetch_row() however it does not pass the
> pass the variable ID.
>
> Looking forward to hearing from you.
>
> Warm regards,

First up, shouldn't you have {} to delineate what is actually the foreach 
procedure(s)?

I would suggest using extract within your While loop to make the table 
fields available as variables.

while ($row=mysql_fetch_array($sql_result))
  {
  extract($row);
  echo "";
  echo "$field"; \\ or whatever the field is called
  echo "";
  echo "Get it";
  echo "";
  echo "";
  }


-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] News Server (news.php.net)

2001-03-07 Thread David Robley
On Thu,  8 Mar 2001 15:43, Yasuo Ohgaki wrote:
> FYI
> For those who do not know about news server.
> (I didn't know there is a news server for mailing lists.)
>
> news://news.php.net
>
> I think it is better to be mentioned in www.php.net support or any
> other appropriate places.
>
> Yasuo Ohgaki

It _is_ mentioned on the support page, just below the mailing list 
information - at least on the new site and I'm sure it was there before.

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] test - can someone please reply?

2001-03-07 Thread David Robley

On Thu,  8 Mar 2001 16:32, [EMAIL PROTECTED] wrote:
> this is a test for echo.
this is a test for echo. .ohce rof tset a si siht
-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] test - can someone please reply?

2001-03-07 Thread David Robley

On Thu,  8 Mar 2001 16:32, [EMAIL PROTECTED] wrote:
> this is a test for echo.

Heh. If you read this, Matt, your email address is wrong :-( His 
address responded with

Hi. This is the qmail-send program at usaexpress.net.
I'm afraid I wasn't able to deliver your message to the following 
addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

<[EMAIL PROTECTED]>:
Sorry, no mailbox here by that name. (#5.1.1)

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Qmail problem

2001-03-08 Thread David Robley

On Fri,  9 Mar 2001 03:43, pete collins wrote:
> I keep getting:
> qmail-inject: fatal: read error
>
> I've tried everything.
>
> Sendmail is symlinked to /var/qmail/bin/sendmail wrapper
>
> $ ls -l /usr/lib/sendmail
> lrwxrwxrwx   1 root root   28 Aug 25  2000
> /usr/lib/sendmail -> ../../var/qmail/bin/sendmail
>
> $ ls -l /usr/sbin/sendmail
> lrwxrwxrwx   1 root root   28 Aug 25  2000
> /usr/sbin/sendmail -> ../../var/qmail/bin/sendmail
>
>
> I have tried every permutation for my sendmail_path in php.ini
>
> I tested the php code i'm using from my FreeBSD box which uses sendmail
> and it all works fine.
>
> I can use qmail fine from perl.
>
> Does anyone have any ideas? This is down right silly. ;-)
>
> Thanks
>
> --pete

For me, on Slackware, this works:

~$ ls -l /usr/sbin/sendmail
lrwxrwxrwx   1 root root   23 Aug 28  2000 /usr/sbin/sendmail 
-> /var/qmail/bin/sendmail*
~$ ls -l /usr/lib/sendmail
lrwxrwxrwx   1 root root   18 Jul 12  2000 /usr/lib/sendmail 
-> /usr/sbin/sendmail*

sendmail_path   =   /usr/sbin/sendmail -t -i;for unix only, 
may supply arguments as well (default is sendmail -t) 

Cheers  
-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] Mailing List

2001-03-11 Thread David Robley

On Mon, 12 Mar 2001 11:54, Thomas Anderson wrote:
> Ok, I've tried time and time again to unsubscribe from php.net's
> mailing list unisubscribe instructions but it doesn't work. So how do I
> get off the list?
>
>
The following is at the bottom of each message from the list:

To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
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] RegExp help..

2001-03-11 Thread David Robley

On Mon, 12 Mar 2001 12:10, John Vanderbeck wrote:
> I really wish I could figure these darn things out :)  I have a task I
> need to do, and i'm certain I could do this easily with a regexp..
>
> I have a file name in the format MMDDYY-*.txt...I need to parse it to
> determine if the month and year matches a specified month and year. 
> Day is irrelevant
>
> Can any of your regexp wizards help me?

A non-regexp solution that comes to mind is to use substr() to extract 
the bits you want from the filename, assuming the filenames to be always 
as your example. So:

$month = substr($filename,0,2);
$year = substr($filename,4,2);

Then you have the string values for month and year in the respective 
variables.

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

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




<    1   2   3   4   5   6   7   8   9   10   >